:root {
  --bg: #f3fbff;
  --card: #ffffff;
  --text: #143a52;
  --pink: #ff4da6;
  --blue: #3b82f6;
  --yellow: #ffd84d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #d9f3ff 0%, var(--bg) 100%);
  background-size: 100% 160%;
  animation: skyShift 8s ease-in-out infinite alternate;
  color: var(--text);
}

.topbar {
  text-align: center;
  padding: 1.25rem 1rem;
  background: #ffffffd9;
  border-bottom: 4px solid #a5dbff;
}

.topbar h1 {
  margin: 0;
  font-size: 2.2rem;
}

.topbar p {
  margin: 0.35rem 0 0;
  font-weight: 700;
}

.container {
  max-width: 900px;
  margin: 1rem auto 2rem;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 3px solid #cfefff;
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 6px 0 #c7eaff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0 #c7eaff;
}

.card h2 {
  margin-top: 0;
}

.bot {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.bot-face {
  font-size: 2rem;
  animation: botBounce 1.8s ease-in-out infinite;
}

.bot-message {
  margin: 0;
  min-height: 2.7rem;
  background: #f8fdff;
  border: 2px solid #bde6ff;
  border-radius: 12px;
  padding: 0.6rem;
  font-weight: 700;
  color: #225f84;
}

.bot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.game {
  grid-column: 1 / -1;
}

.mini {
  grid-column: 1 / -1;
}

.media {
  grid-column: 1 / -1;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.8rem;
}

.kid-video {
  width: 100%;
  border-radius: 12px;
  border: 2px solid #bde6ff;
  background: #dff3ff;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.8rem;
}

.mini-card {
  background: #f8fdff;
  border: 2px solid #bde6ff;
  border-radius: 12px;
  padding: 0.75rem;
}

.mini-card h3 {
  margin: 0 0 0.45rem;
}

.mini-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}

.mini-input {
  min-width: 90px;
  border: 2px solid #bde6ff;
  border-radius: 10px;
  padding: 0.42rem 0.55rem;
  font-size: 0.98rem;
  color: var(--text);
}

.mini-text {
  margin: 0.45rem 0;
  font-weight: 700;
}

.color-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.color-dot {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 3px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 0 #c8e6ff;
}

.color-dot.red { background: #ff4d4d; }
.color-dot.blue { background: #3b82f6; }
.color-dot.green { background: #22c55e; }
.color-dot.yellow { background: #facc15; }

.tap-area {
  position: relative;
  height: 150px;
  border: 3px dashed #bde6ff;
  border-radius: 12px;
  background: #f4fbff;
  overflow: hidden;
}

.tap-btn {
  position: absolute;
  left: 10px;
  top: 10px;
  border: none;
  border-radius: 10px;
  background: #ff4da6;
  color: #fff;
  padding: 0.45rem 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

ul {
  padding-left: 1.2rem;
}

.star {
  font-size: 2.4rem;
  border: none;
  background: var(--yellow);
  border-radius: 12px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  position: absolute;
  left: 1rem;
  top: 1rem;
  transition: left 0.18s ease, top 0.18s ease, transform 0.1s ease;
}

.star:active {
  transform: scale(0.94);
}

.small {
  margin-top: 0.75rem;
  border: none;
  border-radius: 10px;
  background: var(--blue);
  color: white;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.1s ease;
}

.small:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.bot-actions .small {
  margin-top: 0;
}

.small.pink {
  background: var(--pink);
}

.mode-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.stats-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.badge {
  margin: 0;
  background: #ebf8ff;
  border: 2px solid #bde6ff;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-weight: 700;
}

.game-area {
  margin-top: 0.7rem;
  height: 170px;
  border: 3px dashed #bde6ff;
  border-radius: 14px;
  background: #f8fdff;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 0 rgba(255, 216, 77, 0.5);
}

.game-area.cool {
  animation: glowPulse 1s ease-in-out infinite;
}

.message {
  min-height: 1.3rem;
  font-weight: 700;
  color: #225f84;
}

.footer {
  text-align: center;
  padding: 1rem;
  font-weight: 700;
  color: #1e4f70;
}

.party-mode {
  background: linear-gradient(180deg, #f4d3ff 0%, #d7f5ff 45%, #fff4c9 100%);
  background-size: 100% 220%;
}

.party-mode .topbar {
  border-bottom-color: #f4a9ff;
}

.party-mode .game-area {
  border-color: #ffc9ef;
  background: #fff6fe;
}

.sparkle {
  position: absolute;
  font-size: 1.15rem;
  pointer-events: none;
  animation: sparklePop 650ms ease-out forwards;
}

@keyframes sparklePop {
  0% {
    transform: translateY(0) scale(0.8);
    opacity: 0.95;
  }
  100% {
    transform: translateY(-28px) scale(1.25);
    opacity: 0;
  }
}

@keyframes glowPulse {
  0% {
    box-shadow: inset 0 0 0 0 rgba(255, 216, 77, 0.4);
  }
  50% {
    box-shadow: inset 0 0 0 7px rgba(255, 216, 77, 0.22);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(255, 216, 77, 0.4);
  }
}

@keyframes skyShift {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 0% 100%;
  }
}

@keyframes botBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}
