﻿:root {
  --sky: #fff7df;
  --mint: #c7f3d2;
  --melon: #ff8f6b;
  --berry: #154e7a;
  --sun: #ffd54f;
  --leaf: #2d8f5b;
  --paper: rgba(255, 255, 255, 0.84);
  --shadow: 0 18px 50px rgba(21, 78, 122, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Fredoka", sans-serif;
  color: var(--berry);
  background:
    radial-gradient(circle at top left, rgba(255, 213, 79, 0.68), transparent 28%),
    radial-gradient(circle at right 12% top 18%, rgba(199, 243, 210, 0.9), transparent 24%),
    linear-gradient(180deg, #fffcf1 0%, #fff3da 42%, #ffe8d4 100%);
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 26px;
}

.hero-copy h1 {
  margin: 0;
  font-family: "Baloo 2", cursive;
  font-size: clamp(3rem, 8vw, 5.8rem);
  line-height: 0.95;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.hero-text {
  max-width: 52ch;
  font-size: 1.15rem;
  line-height: 1.6;
}

.hero-card,
.panel,
.game-card,
.score-card,
.level-card,
.menu-card,
.leaderboard-card {
  background: var(--paper);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  padding: 28px;
  border-radius: 28px;
}

.hero-sticker {
  display: inline-grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin-bottom: 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, #fff 0%, #ffd9be 100%);
  font-family: "Baloo 2", cursive;
  font-size: 2.2rem;
  color: var(--melon);
  transform: rotate(-8deg);
}

.sparkle {
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--sun);
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
}

.sparkle-a {
  top: 18px;
  left: 28px;
}

.sparkle-b {
  bottom: 28px;
  left: 58px;
  background: var(--mint);
}

.panel {
  display: none;
  padding: 28px;
  border-radius: 30px;
}

.panel.active {
  display: block;
  animation: float-in 0.45s ease;
}

.panel-head h2,
.game-top h3,
.menu-card h3 {
  margin: 0;
  font-family: "Baloo 2", cursive;
}

.panel-head p,
.compact-head p {
  margin: 8px 0 0;
  font-size: 1rem;
}

.step-tag,
.badge,
.progress-pill,
.rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(21, 78, 122, 0.08);
  font-size: 0.9rem;
}

.age-form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
  margin-top: 24px;
}

.input-label {
  display: block;
  width: 100%;
  font-weight: 600;
}

input[type="number"],
input[type="text"] {
  flex: 1 1 220px;
  min-width: 220px;
  width: 100%;
  padding: 16px 18px;
  border: 2px solid rgba(21, 78, 122, 0.12);
  border-radius: 18px;
  font: inherit;
  font-size: 1.1rem;
  background: #fffef8;
  text-align: right;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.primary-btn,
.secondary-btn,
.chip,
.choice-btn,
.menu-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-btn,
.secondary-btn {
  padding: 16px 22px;
  border-radius: 18px;
  font-weight: 700;
}

.primary-btn {
  background: linear-gradient(135deg, var(--melon), #ffb16e);
  color: white;
  box-shadow: 0 12px 24px rgba(255, 143, 107, 0.32);
}

.secondary-btn {
  background: rgba(21, 78, 122, 0.08);
  color: var(--berry);
}

.chip {
  padding: 12px 16px;
  border-radius: 999px;
  margin-left: 10px;
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--berry);
}

.primary-btn:hover,
.secondary-btn:hover,
.chip:hover,
.choice-btn:hover,
.menu-card:hover {
  transform: translateY(-2px);
}

.dashboard {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  margin: 24px 0;
}

.score-card,
.level-card,
.leaderboard-card {
  border-radius: 24px;
  padding: 22px;
}

.score-label {
  margin: 0;
  opacity: 0.78;
}

.score-value {
  margin: 6px 0 18px;
  font-family: "Baloo 2", cursive;
  font-size: 3.1rem;
  line-height: 1;
}

.level-card {
  display: grid;
  align-content: center;
  background: linear-gradient(135deg, rgba(199, 243, 210, 0.92), rgba(255, 255, 255, 0.72));
}

.leaderboard-card {
  margin-top: 22px;
}

.leaderboard-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 76px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.leaderboard-name {
  font-weight: 700;
  word-break: break-word;
}

.leaderboard-age,
.leaderboard-score {
  opacity: 0.84;
}

.empty-board {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.menu-grid,
.games-grid {
  display: grid;
  gap: 18px;
}

.menu-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.games-grid {
  grid-template-columns: 1fr;
}

.menu-card,
.game-card {
  padding: 22px;
  border-radius: 26px;
  text-align: right;
}

.menu-card.hidden {
  display: none;
}

.menu-card p {
  margin-bottom: 0;
}

.play-header {
  display: none;
  margin-bottom: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.play-header.active {
  display: flex;
}

.game-screen {
  display: none;
}

.game-screen.active {
  display: block;
}

.game-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.prompt-box,
.image-clue {
  min-height: 94px;
  margin: 18px 0 16px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--berry);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.image-clue {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 10px;
}

.image-emoji {
  font-size: 4rem;
  line-height: 1;
}

.choice-row,
.choice-col {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.choice-col {
  flex-direction: column;
}

.choice-btn {
  flex: 1 1 92px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  background: white;
  color: var(--berry);
  font-size: 1.05rem;
  font-weight: 600;
  box-shadow: inset 0 0 0 2px rgba(21, 78, 122, 0.08);
}

.choice-btn.correct {
  background: var(--mint);
  box-shadow: inset 0 0 0 2px rgba(45, 143, 91, 0.16);
}

.choice-btn.wrong {
  background: #ffd6cb;
  box-shadow: inset 0 0 0 2px rgba(222, 90, 55, 0.14);
}

.prompt-word {
  color: #cf2f28;
  font-size: 2.2rem;
  font-weight: 800;
}

.math-expression {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

 .builder-answer {
  min-height: 70px;
  margin: 0 0 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--berry);
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
    padding: 20px 0 36px;
  }

  .hero,
  .dashboard,
  .menu-grid,
  .leaderboard-row {
    grid-template-columns: 1fr;
  }

  .panel,
  .hero-card,
  .menu-card,
  .game-card,
  .score-card,
  .level-card,
  .leaderboard-card {
    padding: 18px;
  }

  .play-header.active {
    flex-direction: column;
    align-items: stretch;
  }

  .game-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-copy h1 {
    font-size: clamp(3rem, 18vw, 4.6rem);
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: calc(100% - 16px);
    padding: 14px 0 28px;
  }

  .hero {
    gap: 16px;
    margin-bottom: 18px;
  }

  .hero-copy h1 {
    font-size: clamp(2.4rem, 16vw, 3.6rem);
  }

  .hero-text,
  .panel-head p,
  .compact-head p,
  .menu-card p,
  .game-card p {
    font-size: 0.98rem;
  }

  .hero-sticker {
    width: 74px;
    height: 74px;
    font-size: 1.8rem;
  }

  .age-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  input[type="number"],
  input[type="text"],
  .primary-btn,
  .secondary-btn,
  .choice-btn {
    width: 100%;
  }

  .age-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .chip {
    margin: 0;
    width: 100%;
    text-align: center;
  }

  .score-value {
    font-size: 2.5rem;
  }

  .prompt-box,
  .image-clue {
    min-height: 78px;
    padding: 14px;
    font-size: 1.35rem;
  }

  .prompt-word,
  .builder-answer {
    font-size: 1.6rem;
  }

  .image-emoji {
    font-size: 3rem;
  }

  .choice-row,
  .choice-col,
  .leaderboard-list,
  .menu-grid,
  .games-grid {
    gap: 10px;
  }

  .leaderboard-row {
    padding: 12px;
  }
}

@media (max-width: 420px) {
  .panel,
  .hero-card,
  .menu-card,
  .game-card,
  .score-card,
  .level-card,
  .leaderboard-card {
    border-radius: 20px;
    padding: 14px;
  }

  .eyebrow,
  .step-tag,
  .badge,
  .progress-pill,
  .rank-pill {
    font-size: 0.78rem;
    padding: 5px 10px;
  }

  .hero-copy h1 {
    font-size: 2.2rem;
  }

  .prompt-box,
  .image-clue {
    font-size: 1.15rem;
  }

  .prompt-word,
  .builder-answer {
    font-size: 1.35rem;
  }

  .choice-btn,
  .primary-btn,
  .secondary-btn {
    padding: 12px 14px;
    font-size: 0.98rem;
  }
}






