/* ==========================================================================
   TickTock Town — premium storybook styles
   ========================================================================== */

:root {
  --c-sky-1: #bfe9ff;
  --c-sky-2: #ffeccf;
  --c-sun: #ffd86b;
  --c-grass: #a8d993;
  --c-grass-2: #8dc875;
  --c-cream: #fff7e8;
  --c-cream-2: #fff1dc;
  --c-peach: #ffd7a3;
  --c-pink: #ffb6bc;
  --c-coral: #f57859;
  --c-mint: #b8ebd5;
  --c-blue: #a7d2ff;
  --c-lilac: #d8c7ff;
  --c-brown: #7a543f;
  --c-ink: #35261e;
  --c-star: #ffc93c;
  --c-success: #63c48f;
  --c-warm: #ffb468;
  --shadow-soft: 0 10px 28px rgba(69, 42, 25, 0.12);
  --shadow-pop: 0 14px 34px rgba(69, 42, 25, 0.16);
  --radius: 24px;
  --tap: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --f-display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --f-body: "Nunito", "Avenir Next", system-ui, sans-serif;
}

body.opt-dyslexia {
  --f-display: "OpenDyslexic", "Baloo 2", system-ui, sans-serif;
  --f-body: "OpenDyslexic", "Nunito", system-ui, sans-serif;
}

body.opt-contrast {
  --c-sky-1: #eaf7ff;
  --c-sky-2: #fff8e8;
  --c-ink: #140f0c;
  --c-brown: #50392d;
}

body.opt-motion * {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--f-body);
  color: var(--c-ink);
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

body {
  background: linear-gradient(180deg, var(--c-sky-1) 0%, #e9f6ff 48%, var(--c-sky-2) 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.screen-root {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

.screen-root > * {
  position: absolute;
  inset: 0;
  animation: screen-in 320ms cubic-bezier(.2, .9, .3, 1.1) both;
}

.language,
.onboarding,
.settings,
.trophy-room,
.parent-gate,
.hub,
.game-screen {
  overflow-y: auto;
  overscroll-behavior: contain;
}

@keyframes screen-in {
  from { opacity: 0; transform: scale(.985) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--c-sky-1) 0%, #e3f5ff 56%, var(--c-sky-2) 100%);
}

.sun {
  position: absolute;
  top: 6%;
  right: 10%;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff2a9 0%, #ffd970 56%, #ffb464 100%);
  box-shadow: 0 0 70px rgba(255, 206, 108, 0.5);
  animation: sun-pulse 6s ease-in-out infinite;
}

@keyframes sun-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.clouds .cloud {
  position: absolute;
  width: 140px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 20px rgba(255, 255, 255, 0.24);
}

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

.clouds .cloud::before {
  width: 58px;
  height: 58px;
  top: -25px;
  left: 20px;
}

.clouds .cloud::after {
  width: 46px;
  height: 46px;
  top: -18px;
  right: 22px;
}

.clouds .c1 {
  top: 16%;
  left: -18%;
  animation: drift 45s linear infinite;
}

.clouds .c2 {
  top: 25%;
  left: -50%;
  transform: scale(.82);
  animation: drift 64s linear infinite;
}

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(145vw); }
}

.hills {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background:
    radial-gradient(76% 90% at 16% 100%, var(--c-grass-2) 0%, var(--c-grass-2) 52%, transparent 53%),
    radial-gradient(76% 100% at 82% 100%, var(--c-grass) 0%, var(--c-grass) 58%, transparent 59%),
    linear-gradient(180deg, transparent 0%, #8dd18b 44%, #79b968 100%);
}

.panel {
  background: linear-gradient(180deg, rgba(255, 249, 238, .94), rgba(255, 241, 221, .95));
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.eyebrow {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(53, 38, 30, 0.62);
}

.sparkle-band {
  position: absolute;
  inset: 12% 0 auto;
  height: 120px;
  background:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,.7) 0, rgba(255,255,255,0) 18px),
    radial-gradient(circle at 52% 30%, rgba(255,255,255,.8) 0, rgba(255,255,255,0) 20px),
    radial-gradient(circle at 80% 68%, rgba(255,240,190,.75) 0, rgba(255,240,190,0) 22px);
  animation: sparkle-band 6s linear infinite;
  opacity: .75;
}

@keyframes sparkle-band {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(14px); }
}

/* Splash */
.splash {
  display: grid;
  place-items: center;
  cursor: pointer;
}

.title-wrap {
  position: relative;
  z-index: 2;
  text-align: center;
  display: grid;
  gap: 14px;
}

.game-title {
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(52px, 12vw, 96px);
  line-height: .92;
  letter-spacing: -1px;
  text-shadow: 3px 3px 0 #fff, 8px 8px 0 rgba(255, 198, 126, .9);
  animation: title-bob 3.2s ease-in-out infinite;
}

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

.subtitle {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

/* Tikko */
.tikko-slot {
  display: inline-block;
  position: relative;
  z-index: 2;
}

.tikko-slot.big { width: 180px; height: 180px; }
.tikko-slot.medium { width: 138px; height: 138px; }
.tikko-slot.small { width: 96px; height: 96px; }
.tikko-slot.float-hub {
  position: absolute;
  right: 18px;
  bottom: 120px;
  animation: tikko-float 4.6s ease-in-out infinite;
  z-index: 2;
}

@keyframes tikko-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}

.tikko-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.tikko-body { animation: body-bob 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
.tikko-wing { transform-origin: 50% 30%; animation: wing 1.4s ease-in-out infinite; }
.tikko-eye-lid { animation: blink 4.3s ease-in-out infinite; transform-origin: 50% 50%; }
.tikko-slot.cheer .tikko-body { animation: cheer .6s ease-out; }
.tikko-slot.sad .tikko-body { animation: headshake .6s ease-in-out; }

@keyframes body-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes wing { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-16deg); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(0); } 96% { transform: scaleY(1); } }
@keyframes cheer { 0% { transform: translateY(0) scale(1); } 50% { transform: translateY(-18px) scale(1.08); } 100% { transform: translateY(0) scale(1); } }
@keyframes headshake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }

/* Buttons / inputs */
.primary-btn,
.ghost-btn,
.chip,
.hud-chip,
.lang-btn,
.building,
.outfit,
.market-card,
.pause-btn,
.sound-btn,
.back-btn {
  min-height: var(--tap);
}

.primary-btn,
.ghost-btn,
.chip,
.link-btn {
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 900;
  transition: transform .14s ease, box-shadow .14s ease;
}

.primary-btn {
  background: linear-gradient(180deg, #ffcb73 0%, #f29d47 100%);
  color: var(--c-ink);
  box-shadow: 0 10px 18px rgba(242, 157, 71, .25);
}

.primary-btn.small {
  padding: 12px 18px;
  min-height: 48px;
}

.ghost-btn,
.chip {
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid rgba(122, 84, 63, 0.16);
}

.chip.active,
.lang-btn.active,
.outfit.active {
  background: linear-gradient(180deg, #fff9e9, #ffe9bc);
  border-color: rgba(245, 120, 89, 0.32);
  box-shadow: 0 8px 18px rgba(245, 120, 89, 0.16);
}

.danger-chip {
  background: #fff3ef;
  color: #a94c3b;
}

.primary-btn:active,
.ghost-btn:active,
.chip:active,
.lang-btn:active,
.building:active,
.outfit:active,
.market-card:active,
.hud-chip:active,
.pause-btn:active,
.sound-btn:active,
.back-btn:active {
  transform: scale(.96);
}

/* Language */
.language,
.onboarding,
.settings,
.trophy-room,
.parent-gate {
  padding: calc(18px + var(--safe-top)) 16px calc(18px + var(--safe-bottom));
}

.language {
  display: grid;
  place-content: center;
  gap: 20px;
}

.hero-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
}

.hero-copy h2,
.room-top h2,
.stage-banner h2,
.overlay-card h2,
.speech-bubble .coach-text {
  margin: 0;
  font-family: var(--f-display);
}

.hero-copy h2 { font-size: 34px; }
.hero-copy p { margin: 4px 0 0; opacity: .75; }

.lang-buttons {
  display: grid;
  gap: 16px;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(100%, 420px);
  padding: 20px;
  background: var(--c-cream);
  border: 4px solid rgba(255,255,255,.82);
  border-radius: 28px;
  box-shadow: var(--shadow-pop);
}

.flag { font-size: 42px; }
.lang-meta { text-align: left; }
.lang-name { font-size: 24px; font-weight: 900; }
.lang-sample { font-size: 14px; opacity: .72; }

/* Onboarding */
.onboarding {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  align-items: start;
}

.coach-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.speech-bubble {
  position: relative;
  padding: 18px 18px 18px 20px;
  background: rgba(255, 251, 243, 0.97);
  border: 3px solid rgba(255,255,255,.82);
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
}

.speech-bubble::after {
  content: "";
  position: absolute;
  left: -14px;
  top: 26px;
  border-width: 12px 16px 12px 0;
  border-style: solid;
  border-color: transparent rgba(255, 251, 243, 0.97) transparent transparent;
}

.step-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.step-pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  background: rgba(168, 210, 255, .42);
}

.step-pill.active { background: var(--c-peach); }
.step-pill.done { background: var(--c-success); color: white; }

.coach-text {
  font-size: 28px;
  line-height: 1.06;
  margin-bottom: 14px;
}

.replay-btn,
.pause-btn,
.sound-btn,
.back-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow-soft);
  font-size: 20px;
}

.clock-stage {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
}

.clock-slot { display: grid; place-items: center; }
.clock-slot.huge { width: min(86vw, 460px); height: min(86vw, 460px); margin: 0 auto; }

.onboard-readout {
  min-width: 120px;
}

.onboard-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Quick setup / settings / trophy */
.room-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.room-top.compact {
  margin-bottom: 12px;
}

.tikko-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.setting-group,
.reward-panel {
  margin-bottom: 14px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 248, 238, 0.92);
  box-shadow: var(--shadow-soft);
}

.setting-group h3,
.reward-panel h3 {
  margin: 0 0 12px;
  font-family: var(--f-display);
  font-size: 24px;
}

.row,
.profile-switcher,
.summary-grid,
.outfits,
.theme-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.slider-row,
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
}

.slider-row input[type="range"] {
  width: 48%;
}

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

.summary-tile {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.7);
  display: grid;
  gap: 8px;
}

.summary-tile span {
  font-size: 12px;
  opacity: .7;
}

.summary-tile strong {
  font-size: 28px;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.shelves {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.sticker-item,
.trophy-item,
.outfit {
  border-radius: 22px;
  background: rgba(255,255,255,.76);
  min-height: 92px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 12px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.sticker-item span,
.trophy-item,
.outfit span { font-size: 34px; }
.sticker-item small,
.outfit small,
.trophy-item small { font-size: 12px; opacity: .72; }
.outfit.locked { opacity: .42; filter: grayscale(.7); }
.trophy-item.empty { opacity: .28; }

.reward-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px 18px;
}

.reward-icon { font-size: 34px; }

/* Hub */
.hub {
  overflow: hidden;
}

.hub-content {
  position: relative;
  z-index: 1;
  padding: calc(18px + var(--safe-top)) 16px calc(18px + var(--safe-bottom));
  display: grid;
  gap: 14px;
}

.stage-banner,
.mission-card {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
}

.stage-banner {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.stage-banner h2 {
  font-size: 32px;
  line-height: .96;
}

.stage-banner p,
.mission-copy p {
  margin: 6px 0 0;
  opacity: .76;
}

.mission-card {
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.mission-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255, 213, 114, 0.46);
  font-size: 30px;
}

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

.hud-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.86);
  box-shadow: var(--shadow-soft);
  font-weight: 800;
  min-height: 52px;
}

.hud-chip.pulse {
  animation: chip-pulse 1.4s ease-in-out infinite;
}

@keyframes chip-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.town {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 120px;
}

.building {
  position: relative;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 16px 12px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 249, 237, .96), rgba(255, 233, 198, .96));
  box-shadow: var(--shadow-pop);
  min-height: 132px;
  text-align: center;
  animation: building-sway 4s ease-in-out infinite;
}

.building:nth-child(even) { animation-delay: -2s; }

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

.building::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 22px;
  border: 2px dashed rgba(122, 84, 63, 0.12);
  pointer-events: none;
}

.building.decorated::after {
  content: "✨";
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 18px;
}

.building.locked {
  opacity: .48;
  filter: grayscale(.6);
}

.building.locked .b-stars::after {
  content: "🔒";
}

.b-icon { font-size: 42px; }
.b-label { font-weight: 900; font-size: 18px; }
.b-stars { min-height: 18px; font-size: 14px; color: var(--c-star); }

.b-bakery { background: linear-gradient(180deg, #fff6eb, #ffd9af); }
.b-garden { background: linear-gradient(180deg, #f2ffeb, #c2efc1); }
.b-station { background: linear-gradient(180deg, #eef7ff, #d1e6ff); }
.b-lighthouse { background: linear-gradient(180deg, #fff5e7, #ffe1c6); }
.b-market { background: linear-gradient(180deg, #fef0ff, #ebd8ff); }
.b-routine { background: linear-gradient(180deg, #fff9e9, #ffe7bb); }
.b-tower { background: linear-gradient(180deg, #edf4ff, #d9e6ff); }

/* Games */
.game-screen {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) 12px calc(18px + var(--safe-bottom));
  background:
    radial-gradient(circle at top right, rgba(255, 230, 190, 0.5), transparent 38%),
    linear-gradient(180deg, #d7efff 0%, #edf8ff 38%, #fff3db 100%);
}

.game-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.progress-dots {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  box-shadow: var(--shadow-soft);
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(122, 84, 63, 0.18);
}

.dot.current { background: var(--c-coral); transform: scale(1.08); }
.dot.done { background: var(--c-success); }

.game-body {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 14px;
}

.customer-card {
  width: min(100%, 520px);
  padding: 16px;
  border-radius: 26px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  background: rgba(255, 250, 242, 0.94);
  box-shadow: var(--shadow-soft);
}

.customer-avatar {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: rgba(255, 215, 163, 0.44);
  font-size: 36px;
}

.customer-text {
  display: grid;
  gap: 4px;
  font-size: 20px;
  font-weight: 800;
}

.caption-line {
  font-size: 14px;
  opacity: .7;
}

.game-clock {
  width: min(78vw, 360px);
  height: min(78vw, 360px);
}

.game-controls {
  display: flex;
  justify-content: center;
}

.digital-readout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 124px;
  min-height: 64px;
  padding: 10px 18px;
  border-radius: 20px;
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-soft);
  font-family: var(--f-display);
  font-size: 34px;
  letter-spacing: 1px;
}

.routine-page {
  width: min(100%, 360px);
  border-radius: 24px;
  padding: 18px;
  background: rgba(255,255,255,.74);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 10px;
  justify-items: center;
}

.routine-scene { font-size: 72px; }
.routine-caption { font-size: 26px; font-family: var(--f-display); }

.market-grid {
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.market-card {
  border-radius: 24px;
  padding: 12px;
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow-soft);
  min-height: 116px;
  display: grid;
  place-items: center;
  gap: 6px;
  font-weight: 900;
}

.market-card.selected { outline: 4px solid rgba(245, 120, 89, 0.3); }
.market-card.matched { background: linear-gradient(180deg, #ecfff2, #d8f4e0); }
.market-card.wrong { background: linear-gradient(180deg, #fff4ef, #ffd9c8); }
.market-card.mini-clock .clock { width: 100%; height: 100%; }
.speaker-card { font-size: 30px; }

.freeplay-scene {
  width: min(100%, 520px);
  height: 90px;
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  background: linear-gradient(180deg, #d7f2ff, #ffe7bd);
}

.freeplay-scene.theme-day {
  background:
    radial-gradient(circle at 16% 22%, rgba(255,255,255,.95) 0 26px, transparent 26px),
    linear-gradient(180deg, #d7f2ff, #ffe7bd);
}

.freeplay-scene.theme-evening {
  background:
    radial-gradient(circle at 78% 26%, rgba(255,210,120,.8) 0 18px, transparent 18px),
    linear-gradient(180deg, #ffd5af, #b2cdf8);
}

.freeplay-scene.theme-night {
  background:
    radial-gradient(circle at 18% 32%, rgba(255,255,255,.86) 0 8px, transparent 8px),
    radial-gradient(circle at 70% 18%, rgba(255,255,255,.72) 0 7px, transparent 7px),
    linear-gradient(180deg, #21345f, #4f6fa5);
}

/* Overlay / rewards */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(35, 21, 15, 0.18);
  backdrop-filter: blur(4px);
}

.overlay-card {
  width: min(90vw, 420px);
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 249, 237, .98), rgba(255, 236, 205, .98));
  box-shadow: var(--shadow-pop);
  text-align: center;
}

.overlay-card .emoji { font-size: 68px; margin-bottom: 8px; }
.overlay-card h2 { font-size: 40px; line-height: .95; margin-bottom: 8px; }
.overlay-card .msg { font-size: 19px; margin-bottom: 12px; }
.overlay-card .stars { font-size: 40px; letter-spacing: 6px; color: var(--c-star); }
.overlay-card .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti span {
  position: absolute;
  top: -10%;
  width: 12px;
  height: 20px;
  opacity: .9;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  from { transform: translateY(0) rotate(0); opacity: 1; }
  to { transform: translateY(115vh) rotate(520deg); opacity: .8; }
}

/* Clock */
.clock {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 22px rgba(69, 42, 25, 0.14));
}

.clock svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
}

.clock-face-bg { fill: #fffdf4; stroke: #fff; stroke-width: 4; }
.clock-ring { fill: none; stroke: #efe4cc; stroke-width: 8; }
.clock-tick { stroke: #6b4b3a; stroke-linecap: round; }
.clock-num {
  fill: var(--c-ink);
  font-family: var(--f-display);
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: central;
}
.clock-hand { stroke-linecap: round; }
.clock-hand.hour { stroke: #3a2a22; stroke-width: 10; }
.clock-hand.minute { stroke: #c6533e; stroke-width: 7; }
.clock-hand.dragging { stroke: #ef7d58; }
.clock-center { fill: #ffc93c; stroke: #6b4b3a; stroke-width: 3; }
.clock-quarter-overlay { fill: rgba(255, 179, 193, 0.32); }
.clock.correct .clock-face-bg { animation: face-glow .6s ease-out; }
.clock.wrong { animation: clock-wobble .4s ease-in-out; }

@keyframes face-glow {
  0% { fill: #fffdf4; }
  50% { fill: #f0ffe9; }
  100% { fill: #fffdf4; }
}

@keyframes clock-wobble {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-2deg); }
  75% { transform: rotate(2deg); }
}

/* Parent gate */
.parent-gate {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
}

.parent-gate h2 {
  margin: 0;
  font-family: var(--f-display);
  font-size: 34px;
}

.parent-gate p {
  margin: 0 0 8px;
  text-align: center;
  max-width: 320px;
}

.gate-slots {
  width: min(100%, 420px);
  display: grid;
  gap: 12px;
}

.gate-slot {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow-soft);
}

.gate-label {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  margin-bottom: 10px;
}

/* Responsive */
@media (min-width: 720px) {
  .hub-content {
    max-width: 900px;
    margin: 0 auto;
  }

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

  .language {
    max-width: 680px;
    margin: 0 auto;
  }

  .onboarding {
    max-width: 920px;
    margin: 0 auto;
  }

  .settings,
  .trophy-room {
    max-width: 900px;
    margin: 0 auto;
  }
}

@media (max-width: 560px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

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

  .mission-card {
    grid-template-columns: auto 1fr;
  }

  .mission-card .ghost-btn {
    grid-column: 1 / -1;
  }

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

  .speech-bubble::after {
    display: none;
  }

  .customer-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

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