:root {
  --sky: #2f63ef;
  --sea: #1e44b5;
  --sun: #ffe36d;
  --gold: #ffb81f;
  --melon: #ff6a42;
  --leaf: #73c43d;
  --berry: #8b4fe8;
  --ink: #1e2f66;
  --card: rgba(255, 252, 242, 0.93);
  --shadow: 0 20px 48px rgba(18, 35, 96, 0.28);
}

body[data-theme="sunrise"] {
  --sky: #ffd8c7;
  --sea: #ff9b73;
  --sun: #ffe08a;
  --gold: #ffbf3f;
  --melon: #ff7b6b;
  --leaf: #f4b860;
  --berry: #ff6f91;
  --ink: #5b3951;
  --card: rgba(255, 252, 247, 0.92);
  --shadow: 0 18px 45px rgba(91, 57, 81, 0.16);
}

body[data-theme="garden"] {
  --sky: #d6f7e8;
  --sea: #5fc3a2;
  --sun: #ffe38a;
  --gold: #f3c94f;
  --melon: #ff8f6b;
  --leaf: #6fcb78;
  --berry: #ff6e7d;
  --ink: #234b46;
  --card: rgba(251, 255, 252, 0.92);
  --shadow: 0 18px 45px rgba(35, 75, 70, 0.14);
}

body[data-theme="ocean"] {
  --sky: #b8ebff;
  --sea: #2498c9;
  --sun: #8ee3ff;
  --gold: #4fd1ff;
  --melon: #2ea7d1;
  --leaf: #5fd0c1;
  --berry: #2b78b8;
  --ink: #173d66;
  --card: rgba(245, 253, 255, 0.92);
  --shadow: 0 18px 45px rgba(23, 61, 102, 0.18);
}

body[data-theme="rainbow"] {
  --sky: #ffe6f3;
  --sea: #63c7f2;
  --sun: #ffe279;
  --gold: #ffb84d;
  --melon: #ff7f7f;
  --leaf: #7ad97a;
  --berry: #d96cff;
  --ink: #4c3f7a;
  --card: rgba(255, 252, 255, 0.92);
  --shadow: 0 18px 45px rgba(76, 63, 122, 0.16);
}

body[data-theme="soft-night"] {
  --sky: #243c6a;
  --sea: #6ca9ff;
  --sun: #f2d27c;
  --gold: #8b7cff;
  --melon: #ff9fc3;
  --leaf: #79c8b9;
  --berry: #c59fff;
  --ink: #eef4ff;
  --card: rgba(26, 39, 69, 0.78);
  --shadow: 0 18px 45px rgba(11, 18, 36, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--sun) 82%, white 18%), transparent 24%),
    radial-gradient(circle at top right, color-mix(in srgb, var(--leaf) 52%, white 48%), transparent 24%),
    radial-gradient(circle at bottom right, color-mix(in srgb, var(--sky) 22%, white 78%), transparent 28%),
    linear-gradient(
      180deg,
      #fff9e8 0%,
      #eef7ff 55%,
      #f6ffef 100%
    );
  display: grid;
  place-items: center;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  z-index: 0;
  opacity: 0.45;
}

body::before {
  width: 260px;
  height: 260px;
  background: color-mix(in srgb, var(--sun) 48%, white 52%);
  top: 70px;
  left: -60px;
}

body::after {
  width: 180px;
  height: 180px;
  background: color-mix(in srgb, var(--sky) 20%, white 80%);
  right: -30px;
  bottom: 120px;
}

.sky-stickers {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sticker {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  filter: drop-shadow(0 10px 18px rgba(36, 64, 90, 0.1));
}

.sticker-star {
  font-size: 2rem;
  animation: twinkleFloat 8s ease-in-out infinite;
}

.sticker-cloud {
  font-size: 4rem;
  opacity: 0.82;
  animation: cloudDrift 16s ease-in-out infinite;
}

.sticker-dove {
  font-size: 2.5rem;
  animation: doveGlide 12s ease-in-out infinite;
}

.sticker-star-one {
  top: 12%;
  left: 8%;
  animation-delay: 0s;
}

.sticker-star-two {
  top: 68%;
  right: 10%;
  animation-delay: 1.4s;
}

.sticker-cloud-one {
  top: 10%;
  right: 14%;
  animation-delay: 0.8s;
}

.sticker-cloud-two {
  bottom: 8%;
  left: 6%;
  animation-delay: 2.2s;
}

.sticker-dove-one {
  top: 22%;
  right: 5%;
  animation-delay: 0.4s;
}

.sticker-dove-two {
  bottom: 18%;
  left: 14%;
  animation-delay: 2.8s;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  display: grid;
  gap: 20px;
}

.hero-card,
.game-card,
.reward-card {
  background:
    radial-gradient(circle at top right, rgba(255, 227, 109, 0.22), transparent 26%),
    radial-gradient(circle at bottom left, rgba(115, 196, 61, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 253, 246, 0.96) 0%, rgba(237, 246, 255, 0.95) 100%);
  border: 3px solid rgba(47, 99, 239, 0.16);
  border-radius: 30px;
  box-shadow: 0 24px 46px rgba(41, 76, 142, 0.14);
  backdrop-filter: blur(8px);
}

body[data-theme="soft-night"] .eyebrow,
body[data-theme="soft-night"] .round-tag,
body[data-theme="soft-night"] .score-label,
body[data-theme="soft-night"] .journey-label,
body[data-theme="soft-night"] .progress-track-head span,
body[data-theme="soft-night"] .panel-head p,
body[data-theme="soft-night"] .character-button span:last-child,
body[data-theme="soft-night"] .mode-button span,
body[data-theme="soft-night"] .theme-button span:last-child,
body[data-theme="soft-night"] .journey-note,
body[data-theme="soft-night"] .hint,
body[data-theme="soft-night"] .feedback,
body[data-theme="soft-night"] .leaderboard-empty,
body[data-theme="soft-night"] .leader-meta span,
body[data-theme="soft-night"] .leader-score span {
  color: rgba(235, 242, 255, 0.9);
}

body[data-theme="soft-night"] .hero-card,
body[data-theme="soft-night"] .game-card,
body[data-theme="soft-night"] .reward-card,
body[data-theme="soft-night"] .journey-box,
body[data-theme="soft-night"] .progress-track,
body[data-theme="soft-night"] .memory-box,
body[data-theme="soft-night"] .summary-box,
body[data-theme="soft-night"] .age-adventure-card,
body[data-theme="soft-night"] .answer-card {
  border-color: rgba(140, 172, 255, 0.18);
}

.hero-card {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.hero-card::before,
.game-card::before,
.reward-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent 34%),
    linear-gradient(315deg, rgba(255, 184, 31, 0.08), transparent 28%);
  pointer-events: none;
}

.eyebrow,
.round-tag {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--melon);
  font-size: 0.82rem;
}

.hero-card h1,
.hero-card h2,
.hero-card h3,
.hero-card .subtitle,
.hero-card .field-label,
.hero-card .name-note,
.hero-card .panel-head p,
.hero-card .hint,
.hero-card .journey-note,
.hero-card .leaderboard-empty,
.hero-card .leader-meta span,
.hero-card .leader-score span,
.game-card h2,
.game-card h3,
.game-card .hint,
.reward-card h2,
.reward-card h3,
.reward-card .hint {
  color: var(--ink);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Baloo 2", cursive;
  line-height: 1.05;
}

h1 {
  margin-top: 10px;
  font-size: clamp(2.2rem, 4vw, 4rem);
}

.title-icon,
.section-icon,
.card-icon,
.level-emoji,
.button-inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Baloo 2", "Nunito", sans-serif;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
}

.icon-svg {
  width: 24px;
  height: 24px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.title-icon {
  min-width: 56px;
  height: 56px;
  padding: 0 14px;
  margin-right: 8px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff2a6 0%, #ffbf1d 100%);
  box-shadow: 0 10px 22px rgba(255, 184, 31, 0.28);
  font-size: 1.35rem;
  color: var(--ink);
}

.section-icon {
  min-width: 50px;
  height: 44px;
  padding: 0 12px;
  margin-right: 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, #eff6ff 0%, #c6dbff 100%);
  box-shadow: 0 8px 18px rgba(30, 68, 181, 0.18);
  font-size: 1rem;
  color: var(--sea);
}

.card-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff3b0 0%, #ffc843 100%);
  box-shadow: 0 10px 18px rgba(255, 184, 31, 0.24);
  font-size: 1.55rem;
  color: var(--ink);
}

.button-inline-icon {
  margin-right: 8px;
}

h2 {
  margin-top: 10px;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.subtitle {
  margin: 14px 0 0;
  font-size: 1.08rem;
  max-width: 56ch;
}

.score-panel,
.summary-grid,
.level-grid,
.character-grid,
.timer-grid,
.age-path-grid {
  display: grid;
  gap: 12px;
}

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

.score-box,
.summary-box {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(236, 245, 255, 0.94) 100%);
  border-radius: 22px;
  padding: 18px;
  text-align: center;
  border: 2px solid rgba(47, 99, 239, 0.14);
  box-shadow: 0 14px 24px rgba(41, 76, 142, 0.1);
}

.score-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--sea);
}

.score-box strong,
.summary-box strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  color: var(--ink);
}

.game-card,
.reward-card {
  padding: 28px;
}

.question-wrap {
  margin-bottom: 22px;
}

.hint {
  margin: 12px 0 0;
  color: #5d7298;
  font-size: 1rem;
}

.field-label {
  display: inline-block;
  margin-bottom: 8px;
  font-weight: 800;
}

.name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.text-input {
  width: 100%;
  border: 2px solid rgba(47, 99, 239, 0.28);
  border-radius: 18px;
  padding: 15px 16px;
  font: inherit;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.text-input:focus {
  outline: 3px solid rgba(47, 99, 239, 0.28);
  border-color: rgba(47, 99, 239, 0.52);
}

.guest-button {
  white-space: nowrap;
  min-height: 56px;
  background: linear-gradient(180deg, #ffcf63 0%, #ff8d2f 100%);
  color: #fffdf8;
  box-shadow: 0 12px 24px rgba(255, 106, 66, 0.3);
}

.name-note {
  margin: 10px 0 0;
  color: #5d7298;
  font-size: 0.95rem;
  font-weight: 700;
}

.level-grid {
  margin-top: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.level-button,
.answer-button,
.ghost-button,
.character-button,
.mode-button {
  font: inherit;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.character-panel,
.timer-panel,
.age-path-panel {
  margin-top: 18px;
}

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

.age-path-button {
  border: none;
  border-radius: 24px;
  padding: 18px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(236, 245, 255, 0.96) 100%);
  box-shadow: 0 14px 24px rgba(41, 76, 142, 0.1);
  border: 2px solid rgba(47, 99, 239, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.age-path-button.selected {
  background: linear-gradient(180deg, rgba(210, 247, 205, 0.98) 0%, rgba(232, 250, 214, 0.98) 100%);
  outline: 3px solid rgba(115, 196, 61, 0.24);
}

.age-path-button strong,
.age-path-button span {
  display: block;
}

.age-path-button span:last-child {
  margin-top: 8px;
  color: #5d7298;
  font-size: 0.95rem;
  font-weight: 700;
}

.age-path-badge {
  display: inline-flex !important;
  width: fit-content;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--melon), var(--gold));
  color: white !important;
  font-size: 0.85rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.age-adventure-card {
  position: relative;
  overflow: hidden;
  margin-top: 14px;
  border-radius: 24px;
  padding: 18px 18px 18px 86px;
  background: linear-gradient(135deg, rgba(255, 244, 194, 0.9) 0%, rgba(255, 255, 255, 0.95) 42%, rgba(222, 241, 255, 0.92) 100%);
  border: 2px solid rgba(47, 99, 239, 0.12);
}

.age-adventure-card strong,
.age-adventure-card span {
  display: block;
}

.age-adventure-card span:last-child {
  margin-top: 8px;
  color: #5d7298;
  font-weight: 700;
}

.age-adventure-icons {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 6px;
}

.age-spark {
  font-size: 1.35rem;
  animation: floatSpark 2.8s ease-in-out infinite;
}

.spark-two {
  animation-delay: 0.6s;
}

.spark-three {
  animation-delay: 1.2s;
}

#appShell.little-theme .hero-card {
  box-shadow: 0 22px 40px rgba(255, 183, 3, 0.14);
}

#appShell.older-theme .hero-card {
  box-shadow: 0 24px 44px rgba(30, 68, 181, 0.24);
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.96) 0%, rgba(238, 244, 255, 0.95) 100%);
}

#appShell.older-theme .age-adventure-card {
  background: linear-gradient(135deg, #eef4ff 0%, #f4ffe6 100%);
}

.panel-head {
  margin-bottom: 12px;
}

.panel-head p {
  margin: 8px 0 0;
  color: #5d7298;
  font-weight: 700;
}

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

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

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

.level-button {
  border: none;
  border-radius: 22px;
  padding: 18px;
  font-weight: 800;
  text-align: left;
  color: #fffefb;
  background: linear-gradient(180deg, #ffcf63 0%, #ff8d2f 100%);
  box-shadow: 0 14px 24px rgba(255, 106, 66, 0.3);
  cursor: pointer;
}

.character-button,
.mode-button,
.theme-button {
  border: none;
  border-radius: 22px;
  padding: 18px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.character-button {
  background: linear-gradient(180deg, #ff8d5a 0%, #d94f33 100%);
  box-shadow: 0 14px 24px rgba(130, 27, 15, 0.3);
}

.mode-button {
  background: linear-gradient(180deg, #4d8cff 0%, #1e44b5 100%);
  box-shadow: 0 14px 24px rgba(20, 48, 133, 0.32);
}

.theme-button {
  background: linear-gradient(180deg, #9b66ff 0%, #6a3fd0 100%);
  box-shadow: 0 14px 24px rgba(71, 35, 132, 0.32);
}

.theme-swatch {
  display: inline-block;
  width: 64px;
  height: 28px;
  margin-bottom: 12px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 20px rgba(18, 35, 96, 0.18);
}

.sky-swatch {
  background: linear-gradient(90deg, #1e44b5 0%, #2f63ef 42%, #ffe36d 72%, #73c43d 100%);
}

.sunrise-swatch {
  background: linear-gradient(90deg, #ff6a42 0%, #ff9f1f 42%, #ffe36d 72%, #ff5b6e 100%);
}

.garden-swatch {
  background: linear-gradient(90deg, #2f8f36 0%, #73c43d 48%, #cfe96b 70%, #ffb81f 100%);
}

.ocean-swatch {
  background: linear-gradient(90deg, #163a9a 0%, #1e44b5 35%, #2f63ef 62%, #69c8ff 100%);
}

.rainbow-swatch {
  background: linear-gradient(90deg, #ff5b6e 0%, #ff8d2f 18%, #ffe36d 38%, #73c43d 58%, #2f63ef 78%, #8b4fe8 100%);
}

.soft-night-swatch {
  background: linear-gradient(90deg, #16234d 0%, #2847a3 34%, #6f56e8 68%, #d16dff 100%);
}

.character-button span,
.mode-button span,
.theme-button span,
.mode-button strong,
.character-button strong,
.theme-button strong {
  display: block;
}

.character-button span:last-child,
.mode-button span,
.theme-button span:last-child {
  margin-top: 8px;
  color: rgba(30, 47, 102, 0.76);
  font-size: 0.95rem;
  font-weight: 700;
}

.character-illustration {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 96px;
  margin-bottom: 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 2px rgba(255, 227, 109, 0.24);
  transform-origin: center bottom;
  animation: characterBob 3.4s ease-in-out infinite;
}

.character-face {
  font-size: 2rem;
  line-height: 1;
  animation: characterNod 3s ease-in-out infinite;
}

.character-scene {
  font-size: 1.1rem;
  line-height: 1;
  animation: sceneSparkle 2.8s ease-in-out infinite;
}

.david-illustration {
  background: linear-gradient(180deg, #ffe9b8 0%, #ffc44d 100%);
}

.esther-illustration {
  background: linear-gradient(180deg, #ffe0e0 0%, #ff8a8a 100%);
}

.moses-illustration {
  background: linear-gradient(180deg, #e5efff 0%, #96b8ff 100%);
}

.mary-illustration {
  background: linear-gradient(180deg, #f0e6ff 0%, #c39dff 100%);
}

.level-button span {
  display: block;
  margin-top: 6px;
  font-size: 0.92rem;
  color: rgba(30, 47, 102, 0.78);
  font-weight: 700;
}

.level-emoji {
  width: 52px;
  height: 52px;
  margin-bottom: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 1.55rem;
}

.level-name {
  color: var(--ink) !important;
  font-size: 1.05rem !important;
  margin-top: 0 !important;
}

.level-button.selected {
  background: linear-gradient(180deg, #74c73d 0%, #35882c 100%);
  outline: 3px solid rgba(255, 227, 109, 0.42);
}

.level-button.completed {
  background: linear-gradient(180deg, #4d8cff 0%, #1e44b5 100%);
  box-shadow: 0 14px 24px rgba(20, 48, 133, 0.3);
}

.level-button.locked {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.level-button:disabled {
  cursor: not-allowed;
}

.character-button.selected,
.mode-button.selected,
.theme-button.selected {
  outline: 3px solid rgba(115, 196, 61, 0.35);
  background: linear-gradient(180deg, #f5ffe9 0%, #d9f4bf 100%);
}

.character-button.selected .character-illustration {
  animation-duration: 1.8s;
  transform: translateY(-4px) scale(1.03);
}

.character-button.selected .character-face {
  animation-duration: 1.5s;
}

.character-button.selected .character-scene {
  animation-duration: 1.4s;
}

.answers {
  display: grid;
  gap: 12px;
}

.answer-card {
  margin-bottom: 20px;
  padding: 20px;
  border-radius: 28px;
  background: linear-gradient(180deg, #fff7d2 0%, #ffe392 50%, #fff8e3 100%);
  border: 3px solid rgba(255, 184, 31, 0.34);
  box-shadow: 0 18px 30px rgba(255, 184, 31, 0.22);
}

.answer-card-head {
  margin-bottom: 14px;
}

.answer-card-tag {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e07520;
}

.answer-card-note {
  margin: 8px 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: #59698f;
}

.journey-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.memory-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.journey-box,
.progress-track,
.memory-box {
  border-radius: 22px;
  background: linear-gradient(180deg, #fffef8 0%, #eef4ff 100%);
  border: 2px solid rgba(47, 99, 239, 0.14);
  padding: 16px 18px;
}

.journey-label,
.progress-track-head span {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sea);
}

.journey-box strong,
.memory-box strong {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
  font-family: "Baloo 2", cursive;
}

.journey-note {
  display: block;
  margin-top: 6px;
  color: #586a92;
  font-size: 0.95rem;
  font-weight: 700;
}

.progress-track {
  margin-bottom: 18px;
}

.music-panel {
  margin-bottom: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fffef8 0%, #eef4ff 100%);
  border: 2px solid rgba(47, 99, 239, 0.14);
  padding: 16px 18px;
}

.music-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.music-button {
  min-width: 150px;
}

.memory-answer-area {
  margin-bottom: 18px;
}

.memory-guide-box {
  background: linear-gradient(180deg, #ffe9cf 0%, #ffc979 100%);
}

.mini-game-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--leaf), var(--gold));
  color: white;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 10px 18px rgba(103, 197, 135, 0.22);
}

.memory-label {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sea);
}

.memory-assembled,
.memory-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 72px;
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
  border: 2px dashed rgba(47, 99, 239, 0.22);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.memory-assembled.drag-over,
.memory-choices.drag-over {
  border-color: rgba(103, 197, 135, 0.6);
  background: linear-gradient(180deg, #f7fff5 0%, #e5f9ec 100%);
  transform: scale(1.01);
}

.memory-slot {
  min-width: 118px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  border: 2px dashed rgba(47, 99, 239, 0.26);
  background: rgba(255, 255, 255, 0.88);
  padding: 6px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.memory-slot.filled {
  border-style: solid;
  background: rgba(255, 255, 255, 0.98);
}

.memory-slot.drag-over {
  border-color: rgba(103, 197, 135, 0.75);
  background: linear-gradient(180deg, #f7fff5 0%, #e5f9ec 100%);
  transform: scale(1.03);
}

.memory-slot-placeholder {
  color: #6b7ea7;
  font-size: 0.9rem;
  font-weight: 800;
}

.memory-chip {
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 800;
  color: var(--ink);
  background: linear-gradient(180deg, #fff0af 0%, #ffca4a 100%);
  box-shadow: 0 8px 16px rgba(255, 184, 31, 0.2);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.memory-chip[draggable="true"] {
  cursor: grab;
}

.memory-chip.dragging {
  opacity: 0.35;
  transform: scale(0.96);
}

.memory-chip:hover,
.memory-chip:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 18px rgba(36, 64, 90, 0.14);
  outline: 3px solid rgba(47, 99, 239, 0.3);
}

.memory-chip.used {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.memory-chip.placed {
  background: linear-gradient(180deg, #effff1 0%, #c9f5d3 100%);
}

.memory-chip.option-selected {
  background: linear-gradient(180deg, #eef4ff 0%, #cfddff 100%);
  box-shadow: 0 10px 18px rgba(30, 68, 181, 0.2);
}

.memory-empty {
  color: #66789c;
  font-weight: 700;
}

.memory-inline-word {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff0af 0%, #ffca4a 100%);
  font-weight: 800;
  color: var(--ink);
}

.memory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.volume-control {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  font-weight: 800;
  color: var(--ink);
}

.volume-label,
.volume-value {
  white-space: nowrap;
}

.volume-slider {
  width: 100%;
  accent-color: var(--melon);
}

.progress-track-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  font-weight: 800;
}

.progress-track-head strong {
  font-family: "Baloo 2", cursive;
  font-size: 1.25rem;
}

.progress-bar-shell {
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(47, 99, 239, 0.12);
  box-shadow: inset 0 0 0 2px rgba(47, 99, 239, 0.08);
}

.progress-bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--leaf), var(--gold), var(--melon));
  transition: width 220ms ease;
}

.verse-reference {
  display: block;
  width: 100%;
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(47, 99, 239, 0.1);
  color: #29487a;
  font-size: 0.98rem;
  font-weight: 700;
  text-align: left;
  border: none;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(47, 99, 239, 0.12);
}

.answer-button {
  width: 100%;
  border: none;
  border-radius: 20px;
  padding: 16px 18px;
  text-align: left;
  font-weight: 800;
  color: var(--ink);
  background: linear-gradient(180deg, #fff8e7 0%, #ffd990 100%);
  box-shadow: 0 10px 18px rgba(255, 184, 31, 0.16);
  cursor: pointer;
}

.answers .answer-button:nth-child(1) {
  background: linear-gradient(180deg, #4e83f3 0%, #204ebf 100%);
  color: #fffef8;
}

.answers .answer-button:nth-child(2) {
  background: linear-gradient(180deg, #87dd47 0%, #4f9c22 100%);
  color: #fffef8;
}

.answers .answer-button:nth-child(3) {
  background: linear-gradient(180deg, #ff8b40 0%, #dc5322 100%);
  color: #fffef8;
}

.answers .answer-button:nth-child(4) {
  background: linear-gradient(180deg, #ab63f0 0%, #6e35bf 100%);
  color: #fffef8;
}

.level-button:hover,
.level-button:focus-visible,
.character-button:hover,
.character-button:focus-visible,
.mode-button:hover,
.mode-button:focus-visible,
.answer-button:hover:not(:disabled),
.answer-button:focus-visible:not(:disabled),
.ghost-button:hover,
.ghost-button:focus-visible,
.next-button:hover:not(:disabled),
.next-button:focus-visible:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 22px rgba(36, 64, 90, 0.16);
  outline: 3px solid rgba(47, 99, 239, 0.3);
}

.answer-button.correct {
  background: linear-gradient(180deg, #a7eb6d 0%, #5ea82f 100%);
  color: #fffef8;
}

.answer-button.wrong {
  background: linear-gradient(180deg, #ff9f87 0%, #de5c39 100%);
  color: #fffef8;
}

.answer-button:disabled {
  cursor: default;
}

.feedback-row,
.reward-head {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.feedback {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.next-button,
.ghost-button {
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 800;
  cursor: pointer;
}

.next-button {
  color: white;
  background: linear-gradient(135deg, var(--melon), var(--gold));
  box-shadow: 0 12px 22px rgba(255, 138, 91, 0.28);
}

.next-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.ghost-button {
  background: white;
  color: var(--ink);
  border: 2px solid rgba(47, 99, 239, 0.22);
}

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

.leaderboard-item,
.leaderboard-empty {
  display: grid;
  grid-template-columns: 70px 1.2fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fffef8 0%, #eef4ff 100%);
  border: 2px solid rgba(47, 99, 239, 0.14);
}

.leaderboard-empty {
  grid-template-columns: 1fr;
}

.leader-rank {
  font-family: "Baloo 2", cursive;
  font-size: 1.5rem;
  color: var(--berry);
}

.leader-meta strong::before {
  content: "🎈 ";
}

.leader-meta strong,
.leader-score strong {
  display: block;
}

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

.hidden {
  display: none;
}

.reward-burst {
  min-height: 32px;
  margin-top: 14px;
  font-family: "Baloo 2", cursive;
  font-size: 1.35rem;
  color: var(--berry);
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease;
}

.reward-burst.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.save-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(35, 74, 107, 0.92);
  color: #fffef8;
  font-family: "Baloo 2", cursive;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 18px 40px rgba(21, 49, 73, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease;
}

.save-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(36, 64, 90, 0.45);
  pointer-events: auto;
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, #fffef8 0%, #eef4ff 100%);
  box-shadow: var(--shadow);
  border: 3px solid rgba(255, 255, 255, 0.8);
  pointer-events: auto;
}

.modal-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.modal-icon-button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  padding: 14px 18px;
  border-radius: 22px;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.button-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.button-text {
  font-size: 1rem;
  font-weight: 800;
}

.modal-close {
  width: auto;
  flex-shrink: 0;
}

.modal-audio-button {
  width: auto;
  flex-shrink: 0;
}

.modal-verse-text {
  margin: 18px 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #29487a;
}

.speech-message {
  margin: 14px 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #586a92;
}

.celebration {
  animation: pop 300ms ease;
}

.burst {
  animation: burst 700ms ease;
}

@keyframes twinkleFloat {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 0.75;
  }
  50% {
    transform: translateY(-14px) scale(1.08) rotate(10deg);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 0.78;
  }
}

@keyframes cloudDrift {
  0% {
    transform: translateX(0) translateY(0);
  }
  50% {
    transform: translateX(18px) translateY(-10px);
  }
  100% {
    transform: translateX(0) translateY(0);
  }
}

@keyframes doveGlide {
  0% {
    transform: translateX(0) translateY(0) rotate(-6deg);
  }
  50% {
    transform: translateX(-18px) translateY(-14px) rotate(4deg);
  }
  100% {
    transform: translateX(0) translateY(0) rotate(-6deg);
  }
}

@keyframes pop {
  0% {
    transform: scale(0.98);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes burst {
  0% {
    transform: scale(0.96);
    box-shadow: 0 0 0 rgba(255, 183, 3, 0);
  }
  40% {
    transform: scale(1.02);
    box-shadow: 0 0 0 18px rgba(255, 183, 3, 0.12);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 183, 3, 0);
  }
}

@keyframes floatSpark {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-6px) rotate(8deg);
  }
}

@keyframes characterBob {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-4px) rotate(1.5deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes characterNod {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(-5deg) scale(1.05);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

@keyframes sceneSparkle {
  0% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
}

@media (max-width: 820px) {
  .hero-card,
  .level-grid,
  .character-grid,
  .timer-grid,
  .theme-grid,
  .age-path-grid,
  .summary-grid,
  .score-panel,
  .journey-panel,
  .memory-panel {
    grid-template-columns: 1fr;
  }

  .leaderboard-item {
    grid-template-columns: 1fr;
  }

  .sticker-cloud {
    font-size: 3.2rem;
  }
}

@media (max-width: 760px) {
  body {
    padding: 10px;
    padding-top: max(18px, calc(env(safe-area-inset-top, 0px) + 10px));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .app-shell {
    gap: 14px;
  }

  .hero-card {
    gap: 10px;
    padding: 16px 14px 14px;
    border-radius: 30px;
  }

  .game-card,
  .hero-card,
  .reward-card {
    padding: 16px 14px;
    border-radius: 26px;
  }

  .eyebrow,
  .round-tag {
    font-size: 0.72rem;
  }

  h1 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    font-size: clamp(1.65rem, 7.4vw, 2.45rem);
    line-height: 0.98;
  }

  .subtitle {
    margin-top: 10px;
    font-size: 0.9rem;
    line-height: 1.42;
  }

  .score-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .score-box {
    padding: 10px;
    border-radius: 20px;
  }

  .score-box strong,
  .summary-box strong,
  .journey-box strong,
  .memory-box strong {
    font-size: 1.55rem;
  }

  .card-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    border-radius: 14px;
    font-size: 1rem;
  }

  .score-label {
    font-size: 0.72rem;
    letter-spacing: 0.07em;
  }

  .score-box strong {
    margin-top: 6px;
    line-height: 1;
  }

  .title-icon {
    min-width: 44px;
    height: 44px;
    padding: 0 10px;
    margin-right: 0;
    border-radius: 15px;
    font-size: 1rem;
  }

  .section-icon {
    min-width: 36px;
    height: 34px;
    padding: 0 8px;
    margin-right: 6px;
    border-radius: 12px;
    font-size: 0.82rem;
  }

  .title-icon .icon-svg {
    width: 22px;
    height: 22px;
  }

  .section-icon .icon-svg,
  .card-icon .icon-svg {
    width: 18px;
    height: 18px;
  }

  .feedback-row,
  .reward-head {
    align-items: stretch;
  }

  .next-button,
  .ghost-button {
    width: 100%;
  }

  .action-buttons {
    width: 100%;
  }

  .save-toast {
    right: 16px;
    bottom: 16px;
    font-size: 0.95rem;
  }

  .modal-head {
    flex-direction: column;
  }

  .modal-actions {
    width: 100%;
    flex-direction: column;
  }

  .volume-control {
    grid-template-columns: 1fr;
  }

  .name-row {
    grid-template-columns: 1fr;
  }

  .answer-card {
    padding: 16px 14px;
    border-radius: 26px;
  }

  .age-adventure-card {
    padding: 18px;
  }

  .age-adventure-icons {
    position: static;
    transform: none;
    display: flex;
    margin-bottom: 10px;
  }

  .text-input {
    min-height: 54px;
    font-size: 16px;
  }

  .question-wrap {
    margin-bottom: 12px;
  }

  .panel-head {
    margin-bottom: 8px;
  }

  .panel-head p,
  .hint,
  .name-note {
    font-size: 0.88rem;
    line-height: 1.38;
  }

  .age-path-button,
  .character-button,
  .mode-button,
  .level-button {
    padding: 14px 12px;
    border-radius: 20px;
  }

  .character-illustration {
    min-height: 84px;
    margin-bottom: 10px;
  }

  .character-face {
    font-size: 1.5rem;
  }

  .character-scene {
    font-size: 0.82rem;
  }

  .start-screen {
    margin-top: -2px;
  }

  .start-screen .question-wrap h2,
  .start-screen .panel-head h3 {
    font-size: clamp(1.45rem, 6.2vw, 1.9rem);
    line-height: 1.02;
  }

  .mini-game-badge {
    margin-top: 10px;
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  .start-screen .next-button {
    position: sticky;
    bottom: 8px;
    z-index: 2;
    box-shadow: 0 16px 24px rgba(36, 64, 90, 0.14);
  }

  .answer-button,
  .memory-chip,
  .level-button,
  .character-button,
  .mode-button {
    min-height: 54px;
  }

  .sticker-star {
    font-size: 1.5rem;
  }

  .sticker-dove {
    font-size: 2rem;
  }
}
