/* =========================================================
   Sunny Park Colors — Tactile Solid-Color UI Stylesheet
   No heavy gradients or glow; solid colors + 3D bottom borders
   ========================================================= */

:root {
  --bg-sky: #87CEEB;
  --cream: #FFFDF5;
  --cream-dark: #E8DFC8;
  --ink: #263238;
  --ink-muted: #546E7A;
  --white: #FFFFFF;

  /* Core Color Palette */
  --red: #E53935;
  --red-dark: #B71C1C;
  --yellow: #FBC02D;
  --yellow-dark: #C49000;
  --blue: #1E88E5;
  --blue-dark: #125EA3;
  --green: #43A047;
  --green-dark: #2B6E2F;
  --orange: #FB8C00;
  --orange-dark: #C25E00;
  --purple: #8E24AA;
  --purple-dark: #5C1370;
  --mint: #26A69A;
  --mint-dark: #18756C;
  --sky: #29B6F6;
  --sky-dark: #0288D1;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --font-display: 'Fredoka', system-ui, -apple-system, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg-sky);
  user-select: none;
}

.hidden {
  display: none !important;
}

/* Crisp Lucide Vector Icons */
.lucide {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  vertical-align: middle;
}

.star-svg {
  color: var(--yellow-dark);
  fill: var(--yellow);
}

.trophy-badge {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: var(--yellow);
  border: 4px solid var(--yellow-dark);
  border-bottom-width: 7px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.trophy-badge .lucide {
  width: 36px;
  height: 36px;
}

.clue-icon {
  color: var(--orange-dark);
  width: 1.25em;
  height: 1.25em;
}

.chip-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.22);
  display: inline-block;
  flex-shrink: 0;
}

/* Full-Viewport 3D Canvas */
#canvas-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  touch-action: none;
}

#canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* =========================================================
   Tactile 3D Solid Buttons
   ========================================================= */
.tactile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  border: 3px solid transparent;
  border-bottom-width: 6px;
  cursor: pointer;
  transition: transform 0.08s ease, border-bottom-width 0.08s ease, background-color 0.15s ease;
  color: var(--white);
  line-height: 1.1;
  min-height: 44px;
}

.tactile-btn:active:not(:disabled) {
  transform: translateY(3px);
  border-bottom-width: 3px;
}

.tactile-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon {
  padding: 8px 12px;
  min-width: 44px;
  font-size: 1.15rem;
}

.btn-large {
  font-size: 1.25rem;
  padding: 14px 32px;
  border-radius: 20px;
}

.btn-full {
  width: 100%;
}

.btn-red {
  background: var(--red);
  border-color: var(--red-dark);
}

.btn-red:hover:not(:disabled) {
  background: #EF5350;
}

.btn-yellow {
  background: var(--yellow);
  border-color: var(--yellow-dark);
  color: var(--ink);
}

.btn-yellow:hover:not(:disabled) {
  background: #FFD54F;
}

.btn-blue {
  background: var(--blue);
  border-color: var(--blue-dark);
}

.btn-blue:hover:not(:disabled) {
  background: #42A5F5;
}

.btn-green {
  background: var(--green);
  border-color: var(--green-dark);
}

.btn-green:hover:not(:disabled) {
  background: #66BB6A;
}

.btn-orange {
  background: var(--orange);
  border-color: var(--orange-dark);
}

.btn-orange:hover:not(:disabled) {
  background: #FFA726;
}

.btn-purple {
  background: var(--purple);
  border-color: var(--purple-dark);
}

.btn-purple:hover:not(:disabled) {
  background: #AB47BC;
}

.btn-sky {
  background: var(--sky);
  border-color: var(--sky-dark);
}

.btn-sky:hover:not(:disabled) {
  background: #4FC3F7;
}

.btn-sun {
  background: var(--yellow);
  border-color: var(--yellow-dark);
  color: var(--ink);
}

.btn-sun:hover:not(:disabled) {
  background: #FFD54F;
}

.btn-mint {
  background: var(--mint);
  border-color: var(--mint-dark);
}

.btn-mint:hover:not(:disabled) {
  background: #4DB6AC;
}

.btn-cream {
  background: var(--cream);
  border-color: var(--cream-dark);
  color: var(--ink);
}

.btn-cream:hover:not(:disabled) {
  background: var(--white);
}

.btn-muted {
  background: #CFD8DC !important;
  border-color: #90A4AE !important;
  color: #546E7A !important;
}

/* =========================================================
   Top HUD Bar (Spans full wide desktop, wraps cleanly on mobile)
   ========================================================= */
.top-hud {
  position: fixed;
  top: 12px;
  left: 16px;
  right: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.top-hud>* {
  pointer-events: auto;
}

.hud-left,
.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.star-counter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--cream);
  border: 3px solid var(--yellow-dark);
  border-bottom-width: 5px;
  border-radius: var(--radius-md);
  padding: 6px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  min-height: 44px;
}

.star-total {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.version-pill {
  display: inline-flex;
  align-items: center;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

/* Station Navigation Pills */
.station-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--cream);
  border: 3px solid var(--cream-dark);
  border-bottom-width: 6px;
  border-radius: 20px;
  padding: 5px 8px;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}

.station-nav::-webkit-scrollbar {
  display: none;
}

.station-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 2px solid transparent;
  border-bottom-width: 4px;
  border-radius: 12px;
  padding: 6px 11px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: #ECEFF1;
  border-color: #CFD8DC;
  color: var(--ink-muted);
  white-space: nowrap;
  transition: transform 0.1s ease;
}

.station-pill:active {
  transform: translateY(2px);
}

.station-pill .pill-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.station-pill.active {
  color: var(--white);
  transform: translateY(-1px);
}

.station-pill.completed::after {
  content: '★';
  font-size: 0.85rem;
  margin-left: 2px;
}

/* =========================================================
   Toast Notification (3D toy taps & hints)
   ========================================================= */
.park-toast {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 0.98rem;
  padding: 9px 18px;
  border-radius: 999px;
  border: 3px solid #101619;
  border-bottom-width: 5px;
  pointer-events: none;
  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   Panel Solid Color Accent Bar & Entrance Animations
   ========================================================= */
.panel-accent-bar {
  width: 100%;
  height: 10px;
  background: var(--red);
  flex-shrink: 0;
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes slideUpCenter {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(14px);
  }

  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* =========================================================
   Dialogue Panel (Bottom-anchored, balanced wide desktop width)
   ========================================================= */
.dialogue-panel {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 22;
  width: min(780px, calc(100vw - 32px));
  background: var(--cream);
  border: 4px solid var(--ink);
  border-bottom-width: 8px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: slideUpCenter 0.22s ease-out;
}

.dialogue-inner {
  padding: 15px 20px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.dialogue-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 3px solid var(--ink);
  border-bottom-width: 5px;
  background: #FFE082;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  flex-shrink: 0;
}

.dialogue-avatar.avatar-mom {
  background: #B2DFDB;
}

.dialogue-avatar.avatar-leo {
  background: #FFCC80;
}

.dialogue-body {
  flex: 1;
  min-width: 0;
}

.dialogue-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.speaker-tag {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 3px 11px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--white);
}

.station-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 3px 11px;
  border-radius: 10px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-bottom-width: 4px;
  background: var(--red);
  color: var(--white);
  cursor: pointer;
}

.station-tag:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.mini-replay-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--white);
  color: var(--ink);
  border: 2px solid #B0BEC5;
  border-bottom-width: 4px;
  border-radius: 10px;
  padding: 3px 10px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
}

.mini-replay-btn:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.dialogue-text {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
}

.dialogue-actions {
  flex-shrink: 0;
}

/* =========================================================
   Interactive Quiz Panel
   Desktop (>=900px): Docked cleanly on the right so 3D scene shines!
   Mobile (<900px): Centered bottom sheet with scroll safety
   ========================================================= */
.quiz-panel {
  position: fixed;
  top: 78px;
  right: 20px;
  bottom: 20px;
  width: min(440px, 38vw);
  min-width: 340px;
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.quiz-card {
  pointer-events: auto;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  background: var(--cream);
  border: 4px solid var(--ink);
  border-bottom-width: 9px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  animation: popIn 0.22s ease-out;
}

.quiz-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quiz-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quiz-type-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 10px;
  background: var(--purple);
  color: var(--white);
}

.badge-blue {
  background: var(--blue);
}

.quiz-question {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.25;
  color: var(--ink);
}

.quiz-subtitle {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin-top: -6px;
}

.quiz-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Multiple Choice Grid */
.mc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mc-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 10px;
  background: var(--white);
  border: 3px solid #CFD8DC;
  border-bottom-width: 6px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, border-bottom-width 0.08s ease;
}

.mc-option:active:not(:disabled) {
  transform: translateY(3px);
  border-bottom-width: 3px;
}

.mc-swatch {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 3px solid rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.mc-option.is-correct {
  background: #C8E6C9;
  border-color: var(--green-dark);
  color: #1B5E20;
}

.mc-option.is-wrong {
  background: #FFCDD2;
  border-color: var(--red-dark);
  animation: shake 0.35s ease;
}

/* Fill-in-the-Blanks Letter Slots */
.letter-slots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
}

.letter-slot {
  width: 46px;
  height: 52px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  border-bottom-width: 6px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
}

.letter-slot.slot-fixed {
  background: #FFF3CD;
  border-color: var(--yellow-dark);
}

.letter-slot.slot-blank {
  background: #E3F2FD;
  border-style: dashed;
  border-color: var(--blue);
  color: var(--blue-dark);
}

.letter-slot.slot-filled {
  background: #C8E6C9;
  border-style: solid;
  border-color: var(--green-dark);
  color: #1B5E20;
}

.letter-bank {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.letter-tile {
  min-width: 48px;
  height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--yellow);
  border: 3px solid var(--yellow-dark);
  border-bottom-width: 6px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.letter-tile:active:not(:disabled) {
  transform: translateY(3px);
  border-bottom-width: 3px;
}

.letter-tile:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Fill-in-the-Blanks Word Sentence */
.sentence-box {
  background: var(--white);
  border: 3px solid #CFD8DC;
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.28rem;
  line-height: 1.5;
}

.sentence-blank {
  display: inline-block;
  min-width: 96px;
  padding: 2px 12px;
  margin: 0 4px;
  border-radius: 10px;
  border: 3px dashed var(--green);
  background: #E8F5E9;
  color: var(--green-dark);
}

.sentence-blank.filled {
  border-style: solid;
  background: var(--green);
  color: var(--white);
  border-color: var(--green-dark);
}

.word-bank {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

/* Guessing Riddle Clues */
.riddle-box {
  background: #FFF3E0;
  border: 3px solid var(--orange-dark);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.riddle-clue {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--ink);
}

/* Rainbow Color Mixing Equation */
.mix-equation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--white);
  border: 3px solid #CFD8DC;
  border-radius: var(--radius-md);
  padding: 14px 10px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.mix-blob {
  padding: 8px 14px;
  border-radius: 14px;
  color: var(--white);
  border: 3px solid rgba(0, 0, 0, 0.22);
  font-size: 1rem;
}

.mix-result-slot {
  padding: 8px 16px;
  border-radius: 14px;
  border: 3px dashed var(--ink-muted);
  background: #ECEFF1;
  color: var(--ink);
  min-width: 68px;
  text-align: center;
}

.mix-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.mix-step-dot {
  width: 28px;
  height: 10px;
  border-radius: 999px;
  background: #CFD8DC;
}

.mix-step-dot.done {
  background: var(--green);
}

.mix-step-dot.current {
  background: var(--orange);
}

/* Feedback Banner */
.quiz-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.96rem;
  border: 3px solid transparent;
}

.quiz-feedback.feedback-success {
  background: #DCEDC8;
  border-color: var(--green-dark);
  color: #1B5E20;
}

.quiz-feedback.feedback-hint {
  background: #FFF9C4;
  border-color: var(--yellow-dark);
  color: #5D4037;
}

/* =========================================================
   Compact 3D Click Challenge Banner
   ========================================================= */
.click3d-banner {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 24;
  width: min(760px, calc(100vw - 28px));
  background: var(--cream);
  border: 4px solid var(--blue-dark);
  border-bottom-width: 8px;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.click3d-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.click3d-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.click3d-prompt {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
}

.click3d-fallback {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fallback-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 12px;
  border: 2px solid #B0BEC5;
  border-bottom-width: 4px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}

.fallback-chip:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

/* =========================================================
   Welcome & Celebration Overlays
   Balanced wide layout on desktop, clean fit on small mobile
   ========================================================= */
.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(38, 50, 56, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.welcome-card {
  width: min(640px, 100%);
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--cream);
  border: 4px solid var(--ink);
  border-bottom-width: 10px;
  border-radius: 28px;
  padding: 28px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: popIn 0.28s ease-out;
}

.welcome-wide {
  width: min(820px, 100%);
}

.welcome-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  align-items: center;
  text-align: left;
}

.welcome-col-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.welcome-col-right {
  background: var(--white);
  border: 3px solid var(--cream-dark);
  border-bottom-width: 6px;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.welcome-top-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.welcome-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--yellow);
  border: 2px solid var(--yellow-dark);
  color: var(--ink);
}

.welcome-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 2.7rem);
  color: var(--ink);
  line-height: 1.1;
}

.welcome-desc {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-muted);
  max-width: 500px;
  line-height: 1.45;
}

.color-dots-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.color-dot {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 3px solid rgba(0, 0, 0, 0.22);
  border-bottom-width: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--white);
}

.dot-red {
  background: var(--red);
  border-color: var(--red-dark);
}

.dot-yellow {
  background: var(--yellow);
  border-color: var(--yellow-dark);
  color: var(--ink);
}

.dot-blue {
  background: var(--blue);
  border-color: var(--blue-dark);
}

.dot-green {
  background: var(--green);
  border-color: var(--green-dark);
}

.dot-orange {
  background: var(--orange);
  border-color: var(--orange-dark);
}

.dot-purple {
  background: var(--purple);
  border-color: var(--purple-dark);
}

.welcome-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.feature-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 2px solid var(--cream-dark);
  border-bottom-width: 4px;
  border-radius: 12px;
  padding: 6px 12px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.welcome-hint {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-muted);
}

/* Celebration Specific */
.learned-colors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 420px;
}

.learned-chip {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  padding: 10px 8px;
  border-radius: 14px;
  border: 3px solid transparent;
  border-bottom-width: 6px;
  color: var(--white);
  cursor: pointer;
}

.learned-chip:active {
  transform: translateY(3px);
  border-bottom-width: 3px;
}

.chip-red {
  background: var(--red);
  border-color: var(--red-dark);
}

.chip-yellow {
  background: var(--yellow);
  border-color: var(--yellow-dark);
  color: var(--ink);
}

.chip-blue {
  background: var(--blue);
  border-color: var(--blue-dark);
}

.chip-green {
  background: var(--green);
  border-color: var(--green-dark);
}

.chip-orange {
  background: var(--orange);
  border-color: var(--orange-dark);
}

.chip-purple {
  background: var(--purple);
  border-color: var(--purple-dark);
}

.tap-say-hint {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin-top: -6px;
}

.celebration-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

/* Shake Animation for gentle wrong feedback */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-6px);
  }

  75% {
    transform: translateX(6px);
  }
}

.shake {
  animation: shake 0.35s ease;
}

/* =========================================================
   Multi-Scene Hub / World Selector (Wide Desktop + Mobile)
   ========================================================= */
.hub-container {
  width: min(980px, 100%);
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--cream);
  border: 4px solid var(--ink);
  border-bottom-width: 10px;
  border-radius: 28px;
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: popIn 0.28s ease-out;
}

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

.hub-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.hub-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.8vw, 2.45rem);
  line-height: 1.1;
  color: var(--ink);
}

.hub-subtitle {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-muted);
  max-width: 640px;
}

.scene-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.scene-card {
  background: var(--white);
  border: 3px solid var(--ink);
  border-bottom-width: 7px;
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.scene-card.scene-locked {
  border-color: #B0BEC5;
  background: #F7F9FA;
}

.scene-card-accent {
  width: 100%;
  height: 10px;
  flex-shrink: 0;
}

.scene-card.scene-locked .scene-card-accent {
  opacity: 0.55;
}

.scene-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.scene-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scene-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 3px solid transparent;
  border-bottom-width: 5px;
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.scene-card.scene-locked .scene-icon-badge {
  opacity: 0.65;
}

.scene-meta-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.scene-topic-pill,
.scene-stage-pill {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ECEFF1;
  color: var(--ink);
}

.scene-stage-pill {
  background: #FFF3CD;
  color: #5D4037;
}

.scene-card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ink);
  line-height: 1.2;
}

.scene-card-desc {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-muted);
  line-height: 1.4;
}

.scene-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.scene-tag {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--cream);
  border: 2px solid var(--cream-dark);
  color: var(--ink);
}

.scene-card-footer {
  margin-top: 6px;
}

.scene-soon-btn {
  color: var(--ink-muted);
}

.hub-footer-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-align: center;
}

/* =========================================================
   Responsive Breakpoints (Tablet & Small Mobile Compatibility)
   ========================================================= */
@media (max-width: 900px) {
  .hub-container {
    padding: 18px 16px;
    gap: 14px;
  }

  .scene-hub-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .welcome-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    text-align: center;
  }

  .welcome-col-left {
    align-items: center;
  }

  .top-hud {
    top: 8px;
    left: 10px;
    right: 10px;
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .station-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }

  .quiz-panel {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    min-width: 0;
    max-height: 62dvh;
    align-items: flex-end;
  }

  .quiz-card-body {
    padding: 14px 15px 15px;
    gap: 10px;
  }

  .dialogue-panel {
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .dialogue-inner {
    padding: 12px 14px;
    gap: 10px;
  }

  .dialogue-avatar {
    width: 50px;
    height: 50px;
    font-size: 1.65rem;
  }

  .dialogue-text {
    font-size: 0.98rem;
  }

  .click3d-banner {
    bottom: 10px;
    width: calc(100vw - 20px);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
  }
}

@media (max-width: 480px) {
  .welcome-card {
    padding: 18px 14px;
    gap: 12px;
  }

  .welcome-col-right {
    padding: 14px;
  }

  .welcome-desc {
    font-size: 0.94rem;
  }

  .color-dot {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .hud-right .version-pill {
    display: none;
  }

  .btn-icon {
    padding: 6px 9px;
    min-width: 38px;
    min-height: 38px;
    font-size: 1rem;
  }

  .star-counter {
    padding: 4px 10px;
    min-height: 38px;
    font-size: 0.95rem;
  }

  .station-pill {
    padding: 4px 8px;
    font-size: 0.78rem;
  }

  .dialogue-inner {
    flex-wrap: wrap;
  }

  .dialogue-actions {
    width: 100%;
  }

  .dialogue-actions .tactile-btn {
    width: 100%;
  }

  .quiz-question {
    font-size: 1.12rem;
  }

  .letter-slot {
    width: 38px;
    height: 44px;
    font-size: 1.2rem;
  }

  .letter-tile {
    min-width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }

  .learned-colors-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}