/* ============================================================
   Neo — bright, soft, toddler-friendly theme.
   Light mode, big rounded tap targets, Fredoka + Nunito.
   ============================================================ */
:root {
  --sky1: oklch(0.98 0.02 280);
  --sky2: oklch(0.93 0.055 245);
  --card: oklch(0.99 0.008 280);
  --card-soft: oklch(0.96 0.02 280);
  --ink: oklch(0.38 0.06 285);
  --ink-dim: oklch(0.55 0.045 285);

  --blue: oklch(0.66 0.13 265);   --blue-d: oklch(0.55 0.13 265);
  --pink: oklch(0.76 0.13 350);   --pink-d: oklch(0.64 0.15 350);
  --mint: oklch(0.82 0.12 165);   --mint-d: oklch(0.66 0.13 165);
  --sun:  oklch(0.87 0.15 90);    --sun-d:  oklch(0.74 0.15 78);
  --carrot: oklch(0.72 0.17 50);  --carrot-d: oklch(0.61 0.17 50);
  --green: oklch(0.80 0.16 150);  --green-d: oklch(0.63 0.16 150);
  --lilac: oklch(0.76 0.10 300);
  --red: oklch(0.70 0.17 25);

  --radius: 26px; --radius-lg: 34px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 10px 26px oklch(0.55 0.08 265 / 0.20);
  --shadow-sm: 0 6px 16px oklch(0.55 0.08 265 / 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: 'Nunito', system-ui, sans-serif; color: var(--ink);
  background: linear-gradient(180deg, var(--sky1), var(--sky2)); background-attachment: fixed;
  min-height: 100dvh; overflow-x: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
h1, h2, h3, .btn, .land__name, .screen-title, .welcome__logo, .choice, .equation, .counter, .play-title { font-family: 'Fredoka', 'Nunito', sans-serif; }
.hidden { display: none !important; }

/* clouds */
#clouds { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.cloud { position: absolute; width: 120px; height: 44px; background: oklch(1 0 0 / 0.7); border-radius: 999px; filter: blur(2px); animation: drift linear infinite; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: inherit; border-radius: 50%; }
.cloud::before { width: 60px; height: 60px; top: -26px; left: 18px; }
.cloud::after { width: 44px; height: 44px; top: -16px; right: 20px; }
@keyframes drift { from { transform: translateX(-160px); } to { transform: translateX(110vw); } }

#app { position: relative; z-index: 1; }

/* ============ TOP BAR ============ */
#topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px clamp(12px, 4vw, 28px); background: oklch(1 0 0 / 0.55); backdrop-filter: blur(8px); }
.hero-chip { display: flex; align-items: center; gap: 8px; background: var(--card); border: none; border-radius: 999px; padding: 5px 16px 5px 5px; cursor: pointer; color: var(--ink); font-weight: 700; font-size: 18px; box-shadow: var(--shadow-sm); transition: transform 0.15s var(--ease); }
.hero-chip:active { transform: scale(0.95); }
.hero-chip__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--card-soft); }
.counters { display: flex; gap: 8px; }
.counter { display: flex; align-items: center; gap: 6px; background: var(--card); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 18px; box-shadow: var(--shadow-sm); font-variant-numeric: tabular-nums; }
.counter--carrot { color: var(--carrot-d); }
.counter--star { color: var(--sun-d); }
.counter--streak { color: var(--pink-d); }
.counter.bump { animation: bump 0.4s var(--ease); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ============ SCREENS ============ */
.screen { max-width: 880px; margin: 0 auto; padding: clamp(14px, 3vw, 26px) clamp(14px, 4vw, 26px) 120px; animation: screen-in 0.4s var(--ease) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.screen-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.screen-title { font-size: clamp(26px, 6vw, 36px); font-weight: 700; }

/* ============ BUTTONS ============ */
.btn { font-family: 'Fredoka'; font-weight: 600; font-size: 20px; color: white; border: none; border-radius: var(--radius); padding: 16px 28px; cursor: pointer; background: var(--blue); box-shadow: 0 6px 0 var(--blue-d), var(--shadow-sm); transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease); min-height: 58px; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--blue-d); }
.btn:focus-visible { outline: 4px solid var(--sun); outline-offset: 3px; }
.btn--big { font-size: 26px; padding: 20px 40px; border-radius: var(--radius-lg); }
.btn--go { background: var(--carrot); box-shadow: 0 6px 0 var(--carrot-d), var(--shadow-sm); }
.btn--back { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); padding: 12px 22px; }
.btn--back:active { transform: scale(0.95); box-shadow: var(--shadow-sm); }
.btn--small { padding: 10px 20px; min-width: 52px; font-size: 24px; }

/* ============ NAME SCREEN ============ */
.welcome { text-align: center; padding-top: clamp(10px, 5vh, 50px); }
.welcome__bunny { width: clamp(150px, 44vw, 200px); height: clamp(150px, 44vw, 200px); margin: 0 auto; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
.welcome__logo { font-size: clamp(56px, 17vw, 100px); font-weight: 700; line-height: 0.9; color: var(--blue); }
.welcome__sub { font-family: 'Fredoka'; letter-spacing: 6px; font-size: clamp(16px, 4.5vw, 24px); color: var(--pink-d); margin-top: 2px; text-transform: uppercase; }
.welcome__q { font-size: clamp(22px, 6vw, 32px); margin: 22px 0 18px; color: var(--ink); }
.name-input { font-family: 'Fredoka'; font-size: 28px; text-align: center; padding: 16px 24px; border-radius: var(--radius); border: 3px solid var(--blue); background: var(--card); color: var(--ink); width: min(380px, 86vw); margin-bottom: 20px; outline: none; }
.name-input:focus { border-color: var(--pink); box-shadow: 0 0 0 5px oklch(0.76 0.13 350 / 0.25); }
.textlink { background: none; border: none; color: var(--ink-dim); cursor: pointer; font-family: 'Nunito'; font-weight: 700; font-size: 16px; text-decoration: underline; margin-top: 18px; padding: 8px; }
.code-restore { margin-top: 12px; }
.code-field { letter-spacing: 4px; text-transform: uppercase; }
.code-msg { font-size: 15px; font-weight: 700; color: var(--carrot-d); margin-top: 8px; min-height: 20px; }

/* ============ HOME / MAP ============ */
.home-hero { text-align: center; padding: 8px 0 6px; }
.home-bunny { width: clamp(160px, 46vw, 220px); height: clamp(160px, 46vw, 220px); margin: 0 auto; animation: bob 3.2s ease-in-out infinite; }
.home-speech { display: inline-block; background: var(--card); color: var(--ink); font-weight: 800; padding: 12px 22px; border-radius: 20px; font-size: 18px; box-shadow: var(--shadow-sm); position: relative; }
.home-speech::before { content: ''; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); border: 9px solid transparent; border-bottom-color: var(--card); border-top: 0; }
.map-title { text-align: center; font-size: clamp(20px, 5vw, 28px); margin: 22px 0 14px; color: var(--ink); }
.lands { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-width: 760px; margin: 0 auto; }
.land { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 12px; border: none; border-radius: var(--radius-lg); cursor: pointer; background: var(--card); box-shadow: var(--shadow); position: relative; transition: transform 0.15s var(--ease); }
.land:active { transform: scale(0.96); }
.land__icon { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; font-size: 40px; background: var(--land); box-shadow: 0 6px 0 oklch(0 0 0 / 0.08); }
.land__info { text-align: center; }
.land__name { font-weight: 600; font-size: 19px; color: var(--ink); }
.land__stars { letter-spacing: 2px; font-size: 15px; margin-top: 2px; }
.land__sub { font-size: 13px; color: var(--ink-dim); font-weight: 700; }
.land--soon { opacity: 0.6; }
.land__badge { position: absolute; top: 10px; right: 10px; font-size: 12px; font-weight: 800; background: var(--ink); color: white; padding: 3px 10px; border-radius: 999px; opacity: 0.75; }

/* ============ PLAY SCREEN ============ */
.play-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.play-title { flex: 1; text-align: center; font-size: clamp(20px, 5vw, 28px); font-weight: 700; }
.play-progress { display: flex; gap: 7px; }
.pdot { width: 15px; height: 15px; border-radius: 50%; background: oklch(0.85 0.03 265); transition: all 0.3s var(--ease); }
.pdot.done { background: var(--green); }
.pdot.current { background: var(--sun); transform: scale(1.3); }

.play-buddy-row { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 6px 0 14px; }
.play-buddy { width: 92px; height: 92px; flex: 0 0 auto; border: none; cursor: pointer; background: var(--card); border-radius: 26px; box-shadow: var(--shadow-sm); background-size: 78% !important; animation: bob 2.8s ease-in-out infinite; }
.play-buddy.cheer { animation: cheer 0.55s var(--ease); }
@keyframes cheer { 0% { transform: scale(1) rotate(0); } 30% { transform: scale(1.16) rotate(-6deg); } 60% { transform: scale(1.08) rotate(6deg); } 100% { transform: scale(1); } }
.play-buddy.sadshake { animation: sadshake 0.5s ease; }
@keyframes sadshake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
.play-prompt { font-family: 'Fredoka'; font-weight: 600; font-size: clamp(22px, 6vw, 34px); color: var(--ink); text-align: left; max-width: 60%; }

.play-stage { max-width: 560px; margin: 0 auto; }
.q-visual { margin-bottom: 18px; text-align: center; }
.objs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.obj { font-size: clamp(34px, 9vw, 50px); animation: pop-in 0.3s var(--ease) both; }
.objop { font-size: 40px; color: var(--ink-dim); align-self: center; font-family: 'Fredoka'; }
@keyframes pop-in { from { transform: scale(0); } to { transform: scale(1); } }
.abc-pic { font-size: clamp(80px, 24vw, 120px); }
.match-target { display: grid; place-items: center; background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); }
.match-target .shapesvg { width: 96px; height: 96px; }

.choices { display: grid; gap: 14px; max-width: 520px; margin: 0 auto; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.choice { min-height: 100px; border: none; cursor: pointer; background: var(--card); border-radius: 24px; box-shadow: 0 6px 0 oklch(0.85 0.03 265), var(--shadow-sm); display: grid; place-items: center; font-weight: 700; transition: transform 0.1s var(--ease); padding: 12px; }
.choice:active { transform: translateY(4px); box-shadow: var(--shadow-sm); }
.choice:focus-visible { outline: 4px solid var(--sun); outline-offset: 3px; }
.choice--num { font-size: clamp(40px, 11vw, 52px); color: var(--blue-d); }
.choice--letter { font-size: clamp(42px, 12vw, 56px); color: var(--pink-d); }
.choice--color { min-height: 110px; box-shadow: 0 6px 0 oklch(0 0 0 / 0.12), var(--shadow-sm); }
.shapesvg { width: 70px; height: 70px; }
.choice.right { box-shadow: 0 0 0 5px var(--green), var(--shadow-sm); animation: cheer 0.5s var(--ease); }
.choice.wrong { box-shadow: 0 0 0 5px var(--red), var(--shadow-sm); animation: sadshake 0.4s ease; }
.choice.dim { opacity: 0.4; }

.feedback-pop { position: fixed; left: 50%; top: 36%; transform: translate(-50%, -50%) scale(0); font-family: 'Fredoka'; font-weight: 700; font-size: clamp(40px, 11vw, 68px); color: var(--green-d); text-shadow: 0 4px 16px oklch(0.8 0.05 265 / 0.6); z-index: 40; pointer-events: none; text-align: center; white-space: nowrap; }
.feedback-pop.show { animation: fb 1s var(--ease); }
@keyframes fb { 0% { transform: translate(-50%, -50%) scale(0) rotate(-8deg); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; } 70% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -62%) scale(1); opacity: 0; } }

/* ============ DRESS UP ============ */
.dressup-preview { text-align: center; margin-bottom: 16px; }
.dressup-bunny { width: clamp(150px, 42vw, 200px); height: clamp(150px, 42vw, 200px); margin: 0 auto; animation: bob 3s ease-in-out infinite; }
.collection-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); max-width: 760px; margin: 0 auto; }
.collect-card { background: var(--card); border: none; cursor: pointer; border-radius: var(--radius); padding: 12px 10px; text-align: center; box-shadow: var(--shadow-sm); transition: transform 0.15s var(--ease); position: relative; }
.collect-card:active { transform: scale(0.96); }
.collect-card.equipped { box-shadow: 0 0 0 4px var(--green), var(--shadow-sm); }
.collect-card.locked { filter: saturate(0.85); }
.collect-card__art { width: 100%; aspect-ratio: 1; border-radius: 20px; margin-bottom: 6px; background: var(--card-soft); background-size: 86%; }
.collect-card__name { font-family: 'Fredoka'; font-weight: 600; font-size: 17px; color: var(--ink); }
.collect-card__sub { font-size: 13px; font-weight: 700; color: var(--ink-dim); }
.collect-card__price { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; background: var(--carrot); color: white; font-weight: 800; padding: 3px 12px; border-radius: 999px; font-size: 14px; }
.collect-card.equipped::after { content: '✓'; position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: white; display: grid; place-items: center; font-weight: 800; font-size: 15px; }

/* ============ OVERLAY POPUP ============ */
.overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: oklch(0.5 0.08 265 / 0.5); backdrop-filter: blur(5px); padding: 20px; }
.popup { position: relative; background: var(--card); color: var(--ink); border-radius: var(--radius-lg); padding: 30px 26px 24px; text-align: center; max-width: 380px; width: 100%; box-shadow: var(--shadow); animation: popup-in 0.5s var(--ease) both; }
@keyframes popup-in { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.popup__art { width: 150px; height: 150px; margin: 0 auto 12px; background-size: contain; background-repeat: no-repeat; background-position: center; animation: bob 2.6s ease-in-out infinite; }
.popup__title { font-family: 'Fredoka'; font-weight: 700; font-size: 30px; }
.popup__msg { font-size: 18px; font-weight: 700; color: var(--ink-dim); margin: 6px 0 12px; }
.popup__rewards { display: flex; justify-content: center; gap: 14px; margin-bottom: 18px; font-size: 22px; font-weight: 800; }
.popup__rewards span { display: inline-flex; align-items: center; gap: 6px; }
.popup .btn { width: 100%; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: var(--radius-lg); }
.cfetti { position: absolute; width: 12px; height: 12px; top: -20px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(460px) rotate(720deg); opacity: 0; } }

/* ============ PARENTS / SYNC ============ */
.sync-code-label { font-size: 14px; font-weight: 800; color: var(--ink-dim); margin-top: 8px; }
.sync-code { font-family: 'Fredoka'; font-weight: 700; font-size: 32px; letter-spacing: 3px; color: var(--blue-d); margin: 4px 0 12px; user-select: all; -webkit-user-select: all; }
.age-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 16px 0 4px; }
.age-label { font-weight: 800; color: var(--ink-dim); font-size: 14px; }
.age-btn { font-family: 'Fredoka'; font-weight: 600; font-size: 15px; padding: 10px 14px; border-radius: 16px; border: 2px solid var(--card-soft); background: var(--card-soft); color: var(--ink); cursor: pointer; }
.age-btn.is-active { background: var(--blue); border-color: var(--blue); color: white; }
.sync-status { font-size: 15px; font-weight: 700; color: var(--ink-dim); margin: 12px 0 4px; }

/* ============ CORNER BUTTONS ============ */
.corner-btn { position: fixed; bottom: 16px; right: 16px; z-index: 50; width: 54px; height: 54px; border-radius: 50%; border: none; cursor: pointer; background: var(--card); font-size: 24px; box-shadow: var(--shadow-sm); }
.corner-btn:active { transform: scale(0.92); }
.parents-btn { left: 16px; right: auto; }

@media (max-width: 420px) {
  .play-prompt { font-size: 22px; max-width: 100%; }
  .play-buddy-row { flex-direction: column; }
  .counter { padding: 6px 11px; font-size: 16px; }
  .hero-chip__name { display: none; }
}
