/* ============================================
   Poppu Math Kids — Base styles
   Warm cream, pastel accents (shared DNA with Typing Kids)
   ============================================ */

:root {
  --bg: #fff8f0;
  --bg-soft: #fff3e6;
  --card: #ffffff;
  --text: #3d3a35;
  --text-soft: #6e6960;
  --accent-blue: #a8d4f0;
  --accent-green: #b8e6b8;
  --accent-yellow: #ffe566;
  --accent-orange: #ffd4a8;
  --accent-pink: #ffc4d6;
  --accent-purple: #d4c4f0;
  --primary: #6cb4ee;
  --primary-deep: #2273a9;
  --success: #5cb85c;
  --shadow: 0 8px 32px rgba(61, 58, 53, 0.08);
  --shadow-soft: 0 4px 16px rgba(61, 58, 53, 0.06);
  --radius: 24px;
  --radius-sm: 16px;
  --font: 'Nunito', system-ui, -apple-system, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.4;
}

.hidden {
  display: none !important;
}

/* Sky */
.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(168, 212, 240, 0.35), transparent 50%),
    radial-gradient(ellipse 60% 40% at 85% 20%, rgba(255, 196, 214, 0.25), transparent 45%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(184, 230, 184, 0.3), transparent 50%),
    var(--bg);
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 100px;
  opacity: 0.85;
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud-1 {
  width: 120px;
  height: 40px;
  top: 12%;
  left: -10%;
  animation: cloud-drift 48s linear infinite;
}
.cloud-1::before {
  width: 50px;
  height: 50px;
  top: -28px;
  left: 18px;
}
.cloud-1::after {
  width: 40px;
  height: 40px;
  top: -20px;
  left: 55px;
}

.cloud-2 {
  width: 90px;
  height: 32px;
  top: 22%;
  left: -15%;
  animation: cloud-drift 62s linear infinite;
  animation-delay: -20s;
  opacity: 0.6;
}
.cloud-2::before {
  width: 40px;
  height: 40px;
  top: -22px;
  left: 14px;
}
.cloud-2::after {
  width: 32px;
  height: 32px;
  top: -16px;
  left: 42px;
}

.cloud-3 {
  width: 140px;
  height: 44px;
  top: 8%;
  left: -12%;
  animation: cloud-drift 55s linear infinite;
  animation-delay: -35s;
  opacity: 0.7;
}
.cloud-3::before {
  width: 55px;
  height: 55px;
  top: -30px;
  left: 25px;
}
.cloud-3::after {
  width: 45px;
  height: 45px;
  top: -22px;
  left: 70px;
}

#fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* Floating controls */
.back-btn,
.help-btn,
.mute-btn {
  position: fixed;
  z-index: 40;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  top: calc(12px + var(--safe-top));
  transition: transform 0.15s ease;
}

.back-btn:active,
.help-btn:active,
.mute-btn:active {
  transform: scale(0.94);
}

.back-btn {
  left: 12px;
}
.help-btn {
  right: 68px;
}
.mute-btn {
  right: 12px;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(56px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
  min-height: 100dvh;
}

/* Start screen */
.start-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  animation: fade-up 0.45s ease both;
}

.brand-mascot img {
  width: 110px;
  height: auto;
  animation: float-gentle 3.2s ease-in-out infinite;
  user-select: none;
  -webkit-user-drag: none;
}

h1 {
  font-size: clamp(1.65rem, 5vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text);
}

.subtitle {
  font-weight: 700;
  color: var(--primary-deep);
  font-size: 1.05rem;
  margin-top: -6px;
}

.brand-host {
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.95rem;
}

.lang-pick {
  display: flex;
  gap: 8px;
}

.lang-btn {
  border: 2px solid transparent;
  background: var(--card);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  color: var(--text);
}

.lang-btn.is-active {
  border-color: var(--primary);
  background: #e8f4fc;
}

.collection-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

.collection-bar > span {
  background: var(--card);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.friendship-chip {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

/* World map */
.world-map {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.world-map-title {
  font-weight: 800;
  margin-bottom: 10px;
  font-size: 1rem;
}

.world-stations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.world-stations-4 {
  grid-template-columns: 1fr 1fr;
}

@media (min-width: 480px) {
  .world-stations-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.station-btn {
  border: 3px solid transparent;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition:
    border-color 0.15s,
    transform 0.15s,
    background 0.15s;
}

.station-btn:active {
  transform: scale(0.97);
}

.station-btn.is-active {
  border-color: var(--primary);
  background: #e8f4fc;
  box-shadow: 0 0 0 3px rgba(108, 180, 238, 0.25);
}

.station-emoji {
  font-size: 1.75rem;
}

.station-name {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text);
}

.station-desc {
  font-size: 0.72rem;
  color: var(--text-soft);
  font-weight: 600;
}

.start-card {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 16px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.mission-title {
  font-weight: 800;
  font-size: 1.05rem;
}

.mission-goal {
  font-size: 1.15rem;
  font-weight: 700;
}

.mission-goal strong {
  color: var(--primary-deep);
  font-size: 1.35rem;
}

.length-pick {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.length-btn {
  flex: 1;
  max-width: 160px;
  border: 3px solid transparent;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-weight: 800;
}

.length-btn.is-active {
  border-color: var(--accent-yellow);
  background: #fff9e0;
}

.length-emoji {
  font-size: 1.4rem;
}

.hint {
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.9rem;
}

.btn-primary,
.btn-secondary,
.btn-daily,
.btn-reset {
  font-family: inherit;
  font-weight: 800;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  padding: 14px 28px;
  font-size: 1.05rem;
  transition:
    transform 0.12s,
    box-shadow 0.12s;
}

.btn-primary:active,
.btn-secondary:active,
.btn-daily:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(180deg, #2b7cb3, var(--primary-deep));
  color: #fff;
  box-shadow: 0 6px 0 #1c5d8c, 0 8px 20px rgba(34, 115, 169, 0.35);
}

.btn-start {
  width: 100%;
  max-width: 280px;
  margin-top: 4px;
  padding: 16px 28px;
  font-size: 1.15rem;
}

.btn-secondary {
  background: var(--bg-soft);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.btn-daily {
  background: var(--accent-green);
  color: var(--text);
  width: 100%;
  margin-top: 8px;
  font-size: 0.95rem;
  padding: 12px 16px;
}

.btn-daily:disabled {
  opacity: 0.65;
  cursor: default;
}

.btn-reset {
  background: #ffe8e8;
  color: #a04444;
  font-size: 0.9rem;
  padding: 10px 16px;
  margin-top: 10px;
}

.daily-card {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.daily-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.daily-title {
  font-weight: 800;
}

.daily-desc {
  font-size: 0.9rem;
  color: var(--text-soft);
  font-weight: 600;
  margin-top: 4px;
}

.parent-dash {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.parent-dash summary {
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.parent-dash summary::-webkit-details-marker {
  display: none;
}

.parent-stats {
  margin-top: 12px;
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.95rem;
}

.a11y-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.a11y-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  min-height: 44px;
  padding: 4px;
}

.a11y-check input {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Game screen */
.game-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: fade-up 0.35s ease both;
  padding-bottom: 8px;
}

.game-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.star-meter {
  background: var(--card);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: var(--shadow-soft);
}

.combo-badge {
  background: var(--accent-yellow);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 0.85rem;
  animation: pop-in 0.3s ease;
}

.game-mascot-wrap img {
  width: 48px;
  height: auto;
}

.journey {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 10px 12px 14px;
  box-shadow: var(--shadow-soft);
}

.journey-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-soft);
}

.journey-track {
  position: relative;
  margin-top: 8px;
  height: 36px;
}

.journey-nodes {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 4px;
}

.journey-node {
  font-size: 0.95rem;
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s;
}

.journey-node.is-done {
  opacity: 1;
  color: #8f6800;
}

.journey-node.is-current {
  transform: scale(1.25);
}

.journey-mascot {
  position: absolute;
  bottom: 0;
  left: -18px;
  transition: left 0.4s ease;
  pointer-events: none;
}

.problem-prompt {
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: 800;
  text-align: center;
  margin-top: 4px;
}

.problem-stage {
  width: 100%;
  min-height: 140px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.object-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 100%;
}

.obj-emoji {
  font-size: clamp(1.75rem, 6vw, 2.4rem);
  line-height: 1;
  animation: pop-in 0.35s ease both;
}

.obj-emoji:nth-child(2) {
  animation-delay: 0.04s;
}
.obj-emoji:nth-child(3) {
  animation-delay: 0.08s;
}
.obj-emoji:nth-child(4) {
  animation-delay: 0.12s;
}
.obj-emoji:nth-child(5) {
  animation-delay: 0.16s;
}

.big-number {
  font-size: clamp(4.5rem, 22vw, 7rem);
  font-weight: 900;
  color: var(--primary-deep);
  line-height: 1;
  text-shadow: 0 4px 0 rgba(74, 159, 216, 0.2);
}

.big-number.is-hear {
  color: var(--accent-purple);
  font-size: clamp(4rem, 18vw, 6rem);
}

.add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.add-group {
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 10px;
  min-width: 72px;
}

.math-op {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--text);
}

.math-op.vs {
  font-size: 1.1rem;
  color: var(--text-soft);
}

.compare-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.compare-side {
  flex: 1;
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 12px 8px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.speak-btn {
  border: none;
  background: var(--card);
  border-radius: 999px;
  padding: 10px 18px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  color: var(--text);
}

.speak-btn.is-speaking {
  animation: glow-pulse 1s ease infinite;
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 360px;
}

.choices:has(.choice-btn:nth-child(3):last-child) {
  grid-template-columns: repeat(3, 1fr);
}

.choice-btn {
  border: 3px solid transparent;
  background: var(--card);
  border-radius: var(--radius);
  min-height: 72px;
  font-family: inherit;
  font-weight: 900;
  font-size: clamp(1.75rem, 7vw, 2.25rem);
  cursor: pointer;
  box-shadow: var(--shadow);
  color: var(--text);
  transition:
    transform 0.12s,
    background 0.15s,
    border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.choice-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.choice-compare {
  font-size: clamp(1rem, 3.5vw, 1.15rem);
  min-height: 64px;
  padding: 12px;
}

.choice-btn.is-correct {
  background: var(--accent-green);
  border-color: var(--success);
  animation: pop-in 0.3s ease;
}

.choice-btn.is-wrong {
  background: #ffe0e0;
  border-color: #e88888;
  animation: shake 0.35s ease;
}

.encouragement {
  min-height: 1.4em;
  font-weight: 800;
  color: var(--primary-deep);
  font-size: 1.1rem;
  text-align: center;
}

/* Victory */
.victory-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  animation: fade-up 0.45s ease both;
  padding-top: 24px;
}

.victory-screen h2 {
  font-size: 1.85rem;
  font-weight: 900;
}

.victory-praise {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-deep);
}

.victory-stars-line {
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--card);
  padding: 12px 24px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.victory-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 260px;
  margin-top: 8px;
}

/* Help */
.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(61, 58, 53, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.help-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 20px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow);
  text-align: center;
  animation: fade-up 0.3s ease;
}

.help-card h2 {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.help-body {
  white-space: pre-line;
  text-align: left;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 18px;
  line-height: 1.55;
}

/* A11y */
body.a11y-large {
  font-size: 112%;
}

body.a11y-large .choice-btn {
  min-height: 84px;
  font-size: 2.4rem;
}

body.a11y-large .obj-emoji {
  font-size: 2.6rem;
}

body.a11y-contrast {
  --bg: #fffef8;
  --text: #1a1a1a;
  --text-soft: #333;
  --card: #fff;
  --primary-deep: #14507c;
}

body.a11y-contrast .choice-btn {
  border-color: #333;
}

body.a11y-contrast .btn-primary {
  background: #14507c;
  box-shadow: 0 6px 0 #0e3a5a, 0 8px 20px rgba(20, 80, 124, 0.35);
  outline: 2px solid #000;
}

body.a11y-contrast .victory-friend {
  color: #a02457;
}

body.a11y-contrast .journey-node.is-done {
  color: #6d5000;
}

body.a11y-contrast .big-letter.is-hear {
  color: #7a5200;
}

/* Mobile safe tweaks */
@media (max-width: 380px) {
  .world-stations-4 {
    grid-template-columns: 1fr 1fr;
  }

  .choice-btn {
    min-height: 64px;
  }
}

/* ========== v1.1 improvements ========== */

.mode-chip {
  background: #e8f4fc;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 0.8rem;
  white-space: nowrap;
}

.game-header {
  flex-wrap: wrap;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.count-along-btn {
  background: #fff9e0;
}

.badge-book {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.badge-book summary {
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.badge-book summary::-webkit-details-marker {
  display: none;
}

.badge-hint {
  font-size: 0.85rem;
  color: var(--text-soft);
  font-weight: 600;
  margin: 8px 0;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.badge-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-weight: 900;
  font-size: 1.15rem;
  background: var(--bg-soft);
}

.badge-cell.is-unlocked {
  background: linear-gradient(180deg, #ffe566, #ffd54a);
  box-shadow: 0 3px 0 #e0b800;
}

.badge-cell.is-locked {
  opacity: 0.55;
  font-size: 0.95rem;
}

.compare-side.compare-pick {
  border: 3px solid transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s, transform 0.12s, background 0.15s;
}

.compare-side.compare-pick:active:not(:disabled) {
  transform: scale(0.98);
}

.compare-side.compare-pick.is-correct {
  border-color: var(--success);
  background: var(--accent-green);
}

.compare-side.compare-pick.is-wrong {
  border-color: #e88888;
  background: #ffe0e0;
  opacity: 0.7;
}

.compare-side.compare-pick.is-hint,
.choice-btn.is-hint {
  animation: hint-pulse 0.9s ease infinite;
  border-color: var(--primary);
}

.obj-emoji.is-count-lit {
  transform: scale(1.08);
  filter: drop-shadow(0 0 4px rgba(108, 180, 238, 0.6));
}

.obj-emoji.is-count-active {
  transform: scale(1.22);
  filter: drop-shadow(0 0 8px rgba(255, 200, 50, 0.9));
}

.victory-stats {
  width: 100%;
  max-width: 320px;
  display: grid;
  gap: 8px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.victory-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 0.92rem;
}

.victory-stat strong {
  font-weight: 900;
  color: var(--primary-deep);
}

.victory-friend {
  font-weight: 800;
  color: #c23a75;
  font-size: 1.05rem;
  animation: pop-in 0.4s ease;
}

.tutorial-card {
  max-width: 420px;
}

.tutorial-mascot {
  margin-bottom: 4px;
}

.tutorial-mascot img {
  width: 80px;
  height: auto;
  animation: float-gentle 3s ease-in-out infinite;
}

.tutorial-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 8px 0 12px;
}

.tutorial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddd;
}

.tutorial-dot.is-active {
  background: var(--primary-deep);
  transform: scale(1.2);
}

.tutorial-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.choice-btn:focus-visible,
.compare-pick:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.station-btn:focus-visible {
  outline: 3px solid var(--primary-deep);
  outline-offset: 2px;
}

@keyframes hint-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(108, 180, 238, 0.5);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(108, 180, 238, 0.15);
  }
}

/* ========== v2.0 ========== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: #000;
  color: #fff;
  padding: 8px 16px;
  font-weight: 800;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

.world-stations-6 {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 420px) {
  .world-stations-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.mission-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}
@media (max-width: 480px) {
  .mission-row {
    grid-template-columns: 1fr;
  }
}

.weekly-track {
  height: 6px;
  background: var(--bg-soft);
  border-radius: 99px;
  margin: 8px 0;
  overflow: hidden;
}
.weekly-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6cb4ee, #b8e6b8);
  transition: width 0.3s ease;
}

.sibling-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 4px 8px;
  margin-top: 8px;
  font-weight: 800;
  color: var(--primary-deep);
  text-decoration: none;
  font-size: 0.95rem;
}
.sibling-link:hover {
  text-decoration: underline;
}

.parent-name-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  font-weight: 700;
  font-size: 0.9rem;
}
.parent-name-field input {
  font-family: inherit;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid #e8e4dc;
  font-size: 1rem;
}

.badge-cell small {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.8;
}
.badge-lock {
  font-size: 0.9rem;
}

.obj-emoji.is-removed {
  opacity: 0.25;
  filter: grayscale(1);
  text-decoration: line-through;
}

.sub-wrap {
  width: 100%;
  text-align: center;
}
.sub-label {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 10px;
  color: var(--primary-deep);
}

.pattern-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
}
.pattern-cell {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.5rem;
  box-shadow: var(--shadow-soft);
}
.pattern-cell.is-question {
  background: #e8f4fc;
  border: 3px dashed var(--primary);
  color: var(--primary-deep);
}

.lucky-flash {
  background: var(--accent-yellow);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 900;
  animation: pop-in 0.35s ease;
}

body.a11y-motion *,
body.a11y-motion *::before,
body.a11y-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

.brand-mascot img {
  width: 100px;
}

/* ========== Public launch polish ========== */
.age-badge {
  display: inline-block;
  background: #e8f4fc;
  color: var(--primary-deep);
  font-weight: 800;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 999px;
  margin-top: -4px;
}

.install-hint {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  text-align: center;
  max-width: 320px;
}

.site-footer {
  width: 100%;
  margin-top: 8px;
  padding: 16px 8px 8px;
  text-align: center;
  border-top: 2px solid rgba(61, 58, 53, 0.06);
}

.footer-brand {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.footer-brand a {
  color: var(--primary-deep);
  text-decoration: none;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: center;
}

.footer-nav a {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-soft);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
}

.footer-nav a:hover {
  color: var(--primary-deep);
  text-decoration: underline;
}

.offline-banner {
  position: fixed;
  top: calc(8px + var(--safe-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  background: #3d3a35;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  max-width: 90vw;
  text-align: center;
}

.boot-error {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(255, 248, 240, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  font-weight: 700;
}

.noscript-box {
  position: relative;
  z-index: 90;
  margin: 24px auto;
  max-width: 400px;
  padding: 20px;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  font-family: system-ui, sans-serif;
  text-align: center;
  font-weight: 600;
}

/* ========== Compact start (mobile density) ========== */
@media (max-width: 480px) {
  .start-screen {
    gap: 10px;
  }
  .brand-mascot img {
    width: 72px;
  }
  h1 {
    font-size: 1.45rem;
  }
  .subtitle {
    font-size: 0.95rem;
  }
  .collection-bar > span {
    font-size: 0.75rem;
    padding: 5px 9px;
  }
  .world-map {
    padding: 10px;
  }
  .station-btn {
    padding: 8px 6px;
  }
  .station-emoji {
    font-size: 1.35rem;
  }
  .station-name {
    font-size: 0.72rem;
  }
  .station-desc {
    display: none;
  }
  .start-card {
    padding: 14px 12px 16px;
    gap: 10px;
  }
  .mission-title {
    font-size: 0.95rem;
  }
  .btn-start {
    padding: 14px 20px;
    font-size: 1.05rem;
  }
  .daily-card {
    padding: 10px;
  }
  .install-hint {
    font-size: 0.78rem;
  }
  .site-footer {
    padding-top: 10px;
  }
}

/* Collapse parent/badge by default feel — tighter summary */
.badge-book summary,
.parent-dash summary {
  font-size: 0.95rem;
}

/* Ensure choice hit targets stay large on compact phones */
@media (max-width: 380px) {
  .choice-btn {
    min-height: 68px;
    font-size: 1.85rem;
  }
}

/* ========== v2.1 10/10 polish ========== */
.world-stations-7 {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (min-width: 520px) {
  .world-stations-7 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.start-extra-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
  margin-top: 4px;
}

.btn-sm {
  padding: 10px 16px !important;
  font-size: 0.9rem !important;
  box-shadow: var(--shadow-soft) !important;
  min-height: 44px;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.sticker-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 1.6rem;
  background: var(--bg-soft);
}

.sticker-cell.is-unlocked {
  background: linear-gradient(180deg, #fff9e0, #ffe8f0);
  box-shadow: 0 3px 0 #f0c0d0;
  animation: pop-in 0.35s ease;
}

.sticker-cell.is-locked {
  opacity: 0.45;
  font-size: 1rem;
}

.numbers-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.number-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  max-width: 100%;
  padding: 8px;
  background: var(--bg-soft);
  border-radius: 14px;
}

.nl-tick {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.nl-tick.is-on {
  background: var(--primary);
  color: #fff;
  transform: scale(1.15);
  box-shadow: 0 0 0 3px rgba(108, 180, 238, 0.35);
}

.pattern-cell.is-emoji {
  font-size: 1.6rem;
  width: 52px;
  height: 52px;
}

.choice-emoji {
  font-size: clamp(1.5rem, 6vw, 2rem) !important;
}

/* Keyboard focus ring always visible for a11y 10 */
.choice-btn:focus,
.compare-pick:focus {
  outline: 3px solid var(--primary-deep);
  outline-offset: 2px;
}

/* ── Reading Kids specific ─────────────────────────────── */
.world-stations-6 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}
@media (max-width: 480px) {
  .world-stations-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.big-letter {
  font-family: "Baloo 2", "Nunito", system-ui, sans-serif;
  font-size: clamp(4.5rem, 18vw, 7rem);
  font-weight: 800;
  line-height: 1;
  color: var(--primary-deep);
  text-align: center;
  text-shadow: 0 4px 0 rgba(34, 115, 169, 0.15);
  padding: 0.4rem 0;
}
.big-letter.is-hear {
  color: #a86f00;
}

.word-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.word-visual.is-soft .word-image {
  max-height: 88px;
  opacity: 0.92;
}
.word-image {
  width: min(180px, 46vw);
  height: min(180px, 46vw);
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 6px 18px rgba(61, 58, 53, 0.08);
}
.word-emoji {
  font-size: 4.5rem;
  line-height: 1;
}
.sound-hint {
  margin: 0.35rem 0 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #5a554c;
  text-align: center;
}

.syllable-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.syl-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.2rem;
  min-height: 3.2rem;
  padding: 0.35rem 0.7rem;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #e8f4fc 100%);
  border: 3px solid #6cb4ee;
  font-size: 1.55rem;
  font-weight: 900;
  color: #3d3a35;
  box-shadow: 0 4px 0 rgba(108, 180, 238, 0.35);
}
.syl-plus {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-soft);
}

.listen-cue {
  font-size: 5rem;
  line-height: 1;
  text-align: center;
  animation: soft-bounce 1.4s ease-in-out infinite;
}
@keyframes soft-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
body.a11y-motion .listen-cue { animation: none; }

.choices-letters,
.choices-words {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  gap: 0.65rem;
}
.choices-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.choice-letter {
  font-size: clamp(1.8rem, 7vw, 2.4rem) !important;
  font-weight: 900 !important;
  min-height: 4.2rem;
}
.choice-word {
  font-size: clamp(1.05rem, 4.2vw, 1.35rem) !important;
  font-weight: 800 !important;
  min-height: 3.6rem;
  padding: 0.7rem 0.5rem !important;
  word-break: break-word;
}
.choice-image {
  padding: 0.45rem !important;
  min-height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.choice-image img {
  width: 100%;
  max-height: 5.5rem;
  object-fit: contain;
  border-radius: 10px;
}
.choice-emoji-fallback {
  font-size: 2.6rem;
}

.badge-grid {
  grid-template-columns: repeat(auto-fill, minmax(2.6rem, 1fr)) !important;
}
.badge-cell strong {
  font-size: 1rem;
}

.sibling-link + .sibling-link {
  margin-top: 0.35rem;
}
