/* SparkGlee — core styles. Game-specific CSS lives in css/games-*.css. */
:root {
  --ink: #2b1b4f;
  --ink-soft: #5b4b85;
  --sky1: #6a5cff;
  --sky2: #3fc5ff;
  --sky3: #ffd1f0;
  --card: rgba(255, 255, 255, 0.92);
  --gold: #ffc531;
  --pink: #ff5ca8;
  --green: #22c983;
  --radius: 26px;
  --shadow: 0 10px 30px rgba(43, 27, 79, 0.18);
  --font: 'Fredoka', 'Baloo 2', 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(170deg, var(--sky1) 0%, #8d6bff 35%, var(--sky2) 75%, #8ef0ff 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
input, select { font-family: inherit; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
#app { position: relative; z-index: 2; min-height: 100vh; min-height: 100dvh; }

/* ---------- living sky ---------- */
#sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
#sky .sun { position: absolute; top: -120px; right: -80px; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, #fff7c2 0%, #ffe066 35%, rgba(255, 224, 102, 0) 70%); animation: sunpulse 6s ease-in-out infinite; }
#sky .cloud { position: absolute; width: 180px; height: 60px; background: #fff; border-radius: 60px; opacity: .55; filter: blur(1px);
  animation: drift linear infinite; }
#sky .cloud::before, #sky .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
#sky .cloud::before { width: 80px; height: 80px; top: -40px; left: 25px; }
#sky .cloud::after { width: 100px; height: 100px; top: -55px; left: 70px; }
#sky .c1 { top: 12%; animation-duration: 70s; animation-delay: -10s; }
#sky .c2 { top: 32%; transform: scale(.6); animation-duration: 95s; animation-delay: -50s; opacity: .4; }
#sky .c3 { top: 58%; transform: scale(.8); animation-duration: 80s; animation-delay: -30s; opacity: .35; }
#sky .hills { position: absolute; bottom: 0; left: 0; width: 100%; height: 26vh; }
#sky .twinkle { position: absolute; width: 4px; height: 4px; background: #fff; border-radius: 50%; animation: twinkle 3s ease-in-out infinite; }
@keyframes drift { from { left: -240px; } to { left: 110%; } }
@keyframes sunpulse { 50% { transform: scale(1.08); } }
@keyframes twinkle { 50% { opacity: .1; transform: scale(.4); } }

/* ---------- generic ---------- */
.screen { padding: max(12px, env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); max-width: 1100px; margin: 0 auto;
  animation: screenIn .35s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes screenIn { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-size: 18px; font-weight: 600;
  background: #fff; color: var(--ink); box-shadow: 0 5px 0 rgba(43, 27, 79, .2), 0 8px 18px rgba(43, 27, 79, .15); transition: transform .08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(43, 27, 79, .2); }
.btn.big { padding: 16px 26px; font-size: 21px; }
.btn.huge { padding: 22px 54px; font-size: 32px; }
.btn.primary { background: linear-gradient(180deg, #4fe39a, #18b874); color: #fff; box-shadow: 0 6px 0 #0d8a55, 0 10px 22px rgba(13, 138, 85, .4); text-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.btn.gold { background: linear-gradient(180deg, #ffe066, #ffb300); color: #5a3a00; box-shadow: 0 6px 0 #c98500, 0 10px 22px rgba(201, 133, 0, .4); }
.btn.ghost { background: rgba(255, 255, 255, .25); color: #fff; box-shadow: none; }
.btn.danger { background: #ffe1e6; color: #c0213f; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.row-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.icon-btn { width: 52px; height: 52px; border-radius: 18px; background: rgba(255, 255, 255, .9); font-size: 24px; box-shadow: 0 4px 0 rgba(43, 27, 79, .18); flex: none; }
.icon-btn:active { transform: translateY(3px); box-shadow: none; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.bar { height: 12px; border-radius: 99px; background: rgba(43, 27, 79, .1); overflow: hidden; flex: 1; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffd93d, #ff8a3d); transition: width .6s cubic-bezier(.2, .9, .3, 1.2); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .85); font-weight: 600; font-size: 14px; }
.chip.gold { background: #fff1b8; }
.muted { color: var(--ink-soft); opacity: .85; font-size: 14px; }
.page-title { color: #fff; text-align: center; font-size: clamp(28px, 6vw, 42px); margin: 10px 0 6px; text-shadow: 0 3px 0 rgba(43, 27, 79, .25); }
.buddy-svg { display: inline-block; line-height: 0; }
.buddy-svg svg { width: 100%; height: 100%; overflow: visible; }
.bob svg { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6%) scale(1.02, .98); } }
.creature-svg .cr-eyes { transform-origin: 100px 108px; animation: blink 5s infinite; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.creature-svg .cr-sparkles { animation: twinkle 2s ease-in-out infinite; }

/* ---------- splash / onboarding ---------- */
.splash, .onboard { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.splash-logo { font-size: clamp(54px, 14vw, 110px); font-weight: 700; letter-spacing: -1px; line-height: 1; filter: drop-shadow(0 6px 0 rgba(43, 27, 79, .25)); }
.splash-logo span:first-child { color: #fff; }
.splash-logo span:last-child { background: linear-gradient(90deg, #ffe066, #ff9ad5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.splash-crew { display: flex; gap: 8px; margin: 6px 0 18px; }
.splash-crew .buddy-svg { width: clamp(90px, 22vw, 150px); height: clamp(90px, 22vw, 150px); }
.splash-crew .buddy-svg:nth-child(2) { transform: translateY(-20px) scale(1.2); }
.splash-crew .buddy-svg:nth-child(3) svg { animation-delay: -.8s; }
.splash-sub { color: #fff; opacity: .9; font-size: 18px; }
.onboard-pip .buddy-svg { width: 160px; height: 160px; }
.onboard-title { color: #fff; font-size: clamp(32px, 8vw, 52px); margin: 0; text-shadow: 0 4px 0 rgba(43, 27, 79, .25); }
.onboard-sub { color: #fff; font-size: 20px; margin: 0 0 10px; opacity: .95; }
.age-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 14px; width: min(560px, 100%); }
.age-btn { height: 88px; border-radius: 28px; font-size: 40px; font-weight: 700; color: #fff; background: hsl(calc(var(--i) * 33) 85% 60%);
  box-shadow: 0 7px 0 hsl(calc(var(--i) * 33) 70% 42%); animation: popIn .5s backwards; animation-delay: calc(var(--i) * 45ms); text-shadow: 0 3px 0 rgba(0, 0, 0, .18); }
.age-btn:active { transform: translateY(5px); box-shadow: 0 2px 0 hsl(calc(var(--i) * 33) 70% 42%); }
.starter-grid { display: grid; grid-template-columns: repeat(2, minmax(140px, 200px)); gap: 18px; }
.starter { background: rgba(255, 255, 255, .9); border-radius: 30px; padding: 14px 10px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center;
  font-size: 22px; font-weight: 600; animation: popIn .5s backwards; animation-delay: calc(var(--i) * 90ms); }
.starter .buddy-svg { width: 120px; height: 120px; }
.starter:active { transform: scale(.95); }
.name-input { font-size: 28px; padding: 14px 22px; border-radius: 22px; border: 4px solid #fff; width: min(380px, 100%); text-align: center; outline: none; color: var(--ink); }
@keyframes popIn { from { opacity: 0; transform: scale(.4) translateY(20px); } }

/* ---------- topbar ---------- */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; position: sticky; top: 0; z-index: 10; padding: 8px 0; }
button.me { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .92); border-radius: 99px; padding: 4px 14px 4px 4px; box-shadow: 0 4px 0 rgba(43, 27, 79, .15); min-width: 0; }
button.me .buddy-svg { width: 44px; height: 44px; }
.me-name { font-weight: 600; font-size: 18px; max-width: 26vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pills { display: flex; gap: 6px; margin-left: auto; }
.pill { display: flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, .92); border-radius: 99px; padding: 8px 12px; font-weight: 700; font-size: 17px; box-shadow: 0 4px 0 rgba(43, 27, 79, .15); }
.pill.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.25); } }
.grown { font-size: 20px; }

/* ---------- home hero ---------- */
.hero { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, rgba(255, 255, 255, .95), rgba(255, 240, 252, .92));
  border-radius: 32px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 14px; flex-wrap: wrap; }
.hero-left { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; min-width: 0; }
.hero-buddy-svg { width: 116px; height: 116px; flex: none; cursor: pointer; }
.hero-buddy-svg.boing { animation: boing .6s; }
@keyframes boing { 30% { transform: scale(1.2, .8); } 60% { transform: scale(.9, 1.12) translateY(-10px); } }
.speech { position: relative; background: #f1ecff; border-radius: 22px; padding: 12px 16px; font-size: 19px; font-weight: 500; }
.speech::before { content: ''; position: absolute; left: -10px; top: 50%; border: 10px solid transparent; border-right-color: #f1ecff; transform: translateY(-50%); border-left: 0; }
.hero-acts { display: flex; gap: 10px; flex: 1 1 260px; justify-content: space-around; align-items: flex-start; }
.hero-act { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; border-radius: 24px; background: #fff; min-width: 86px;
  box-shadow: 0 5px 0 rgba(43, 27, 79, .12); font-weight: 700; font-size: 15px; }
.hero-act:active { transform: translateY(3px); }
.act-emoji { font-size: 40px; line-height: 1; display: block; }
.hero-act.ready { background: linear-gradient(180deg, #fff6c9, #ffe27a); animation: wiggle 2s ease-in-out infinite; box-shadow: 0 5px 0 #e6b800, 0 0 24px rgba(255, 210, 60, .8); }
.hero-act.chest.opening .act-emoji { animation: chestOpen .6s; }
@keyframes chestOpen { 30% { transform: scale(1.4) rotate(-10deg); } 60% { transform: scale(1.5) rotate(10deg); } }
.hero-act.used { opacity: .8; }
.egg-ring { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#ffb300 calc(var(--pct) * 1%), rgba(43, 27, 79, .1) 0); }
.egg-ring .act-emoji { background: #fff; border-radius: 50%; width: 44px; height: 44px; display: grid; place-items: center; font-size: 28px; }
.wiggle, .hero-act.ready { transform-origin: 50% 80%; }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-7deg); } 85% { transform: rotate(7deg); } 92% { transform: rotate(-4deg); } }

/* quests */
.quests { margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 20px; margin-bottom: 8px; }
.card-sub { font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.quest { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-radius: 14px; }
.quest-check { font-size: 24px; }
.quest-body { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.quest-text { font-weight: 500; font-size: 17px; }
.quest-n { font-weight: 700; color: var(--ink-soft); min-width: 36px; text-align: right; }
.quest.done .quest-text { text-decoration: line-through; opacity: .6; }
.quest.done .bar i { background: linear-gradient(90deg, #4fe39a, #18b874); }

/* shelves + tiles */
.shelf { margin: 6px -16px 18px; }
.shelf-title { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 24px; margin: 0 16px 8px; text-shadow: 0 2px 0 rgba(43, 27, 79, .3); }
.shelf-emoji { font-size: 28px; }
.shelf-count { margin-left: auto; font-size: 14px; background: rgba(255, 255, 255, .25); padding: 4px 10px; border-radius: 99px; text-shadow: none; }
.tiles { display: flex; gap: 14px; overflow-x: auto; padding: 6px 16px 14px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.tiles::-webkit-scrollbar { display: none; }
.tile { position: relative; flex: none; width: 150px; scroll-snap-align: start; border-radius: 28px; padding: 10px 10px 12px; color: #fff; text-align: left;
  background: linear-gradient(160deg, var(--c1), var(--c2)); box-shadow: 0 7px 0 rgba(43, 27, 79, .22), 0 12px 24px rgba(43, 27, 79, .18); transition: transform .12s; }
.tile:active { transform: translateY(5px) scale(.98); box-shadow: 0 2px 0 rgba(43, 27, 79, .22); }
.tile.big { width: 172px; }
.tile-art { height: 104px; border-radius: 22px; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .55), rgba(255, 255, 255, .12) 60%);
  display: grid; place-items: center; overflow: hidden; position: relative; }
.tile-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .45) 50%, transparent 60%);
  transform: translateX(-100%); animation: shine 5s ease-in-out infinite; }
@keyframes shine { 0%, 70% { transform: translateX(-100%); } 90%, 100% { transform: translateX(100%); } }
.tile-emoji { font-size: 62px; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .2)); transition: transform .2s; }
.tile:hover .tile-emoji { transform: scale(1.12) rotate(-6deg); }
.tile-title { font-weight: 700; font-size: 17px; margin: 8px 2px 2px; line-height: 1.1; text-shadow: 0 2px 0 rgba(0, 0, 0, .15); min-height: 2.2em; }
.tile-meta { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin: 0 2px; }
.tile-stars { color: #fff36b; letter-spacing: 1px; text-shadow: 0 1px 0 rgba(0, 0, 0, .25); font-size: 16px; }
.tile-age { background: rgba(255, 255, 255, .25); border-radius: 99px; padding: 2px 8px; font-weight: 600; }
.badge { position: absolute; top: -6px; right: -4px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; box-shadow: 0 3px 8px rgba(0, 0, 0, .2); }
.badge.new { background: #ff3d7f; color: #fff; animation: pulse 1.6s infinite; }
.badge.free { background: #ffe066; color: #6b4600; }
.badge.lock { background: #fff; font-size: 16px; padding: 4px 7px; }
.tile.locked .tile-art { filter: saturate(.55); }
.plus-banner { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 18px; border-radius: 24px; margin: 4px 0 10px;
  background: linear-gradient(90deg, #fff, #fff4fb); box-shadow: var(--shadow); font-size: 26px; }
.plus-banner div { flex: 1; display: flex; flex-direction: column; font-size: 17px; }
.plus-banner small { color: var(--ink-soft); font-size: 13px; }
.foot { text-align: center; color: #fff; opacity: .8; font-size: 14px; margin-top: 10px; }

/* ---------- game screen ---------- */
.game-screen { min-height: 100dvh; display: flex; flex-direction: column; gap: 8px; max-width: 900px;
  background: transparent; position: relative; }
body:has(.game-screen) { background: linear-gradient(165deg, var(--gc1, #6a5cff), var(--gc2, #3fc5ff)); }
.game-screen::before { content: ''; position: fixed; inset: 0; z-index: -1; background:
  radial-gradient(circle at 15% 20%, rgba(255, 255, 255, .25), transparent 30%),
  radial-gradient(circle at 85% 70%, rgba(255, 255, 255, .18), transparent 35%),
  linear-gradient(165deg, var(--c1), var(--c2)); }
.game-head { display: flex; align-items: center; gap: 10px; }
.game-title { flex: 1; display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: clamp(18px, 4.5vw, 26px); text-shadow: 0 2px 0 rgba(0, 0, 0, .2); min-width: 0; }
.game-title span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-emoji { font-size: 1.4em; }
.level-badge { background: rgba(255, 255, 255, .92); border-radius: 99px; padding: 8px 14px; font-weight: 700; color: var(--ink); }
.pips { display: flex; gap: 6px; justify-content: center; }
.pips i { width: 26px; height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .35); transition: all .3s; }
.pips i.now { background: #fff; transform: scaleY(1.3); }
.pips i.won { background: #ffe066; box-shadow: 0 0 10px #ffe066; }
.pips i.tried { background: rgba(255, 255, 255, .75); }
.prompt { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .95); border-radius: 26px; padding: 10px 14px 10px 10px;
  box-shadow: 0 6px 0 rgba(43, 27, 79, .15); min-height: 66px; }
.prompt.pop { animation: promptPop .4s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes promptPop { from { transform: scale(.9); opacity: .4; } }
.prompt-text { flex: 1; font-size: clamp(20px, 5vw, 30px); font-weight: 600; text-align: center; line-height: 1.15; }
.speak { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(180deg, #8f7bff, #6a5cff); font-size: 22px; flex: none; box-shadow: 0 4px 0 #4a3bc7; }
.speak:active { transform: translateY(3px); box-shadow: none; }
.stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; position: relative; min-height: 340px; padding-bottom: 8px; }
.scene { position: relative; flex: 1; width: 100%; min-height: 220px; border-radius: 30px; background: rgba(255, 255, 255, .2);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .35); overflow: hidden; }
.big-emoji { font-size: clamp(80px, 22vw, 150px); line-height: 1; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .18)); animation: popIn .45s; }
.row { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.game-buddy { width: 56px; height: 56px; flex: none; margin: -6px 0; pointer-events: none; }
.game-buddy svg { width: 100%; height: 100%; animation: bob 2.4s ease-in-out infinite; }
.game-buddy.cheer { animation: cheer .7s; }
.game-buddy.oops { animation: oops .5s; }
@keyframes cheer { 30% { transform: translateY(-30px) rotate(-10deg) scale(1.15); } 60% { transform: translateY(-8px) rotate(8deg); } }
@keyframes oops { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

.choices { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 640px; }
.choice { min-height: 86px; border-radius: 26px; background: linear-gradient(180deg, #fff, #f1ecff); font-size: clamp(34px, 9vw, 54px); font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; box-shadow: 0 7px 0 rgba(43, 27, 79, .2), 0 10px 20px rgba(43, 27, 79, .15);
  animation: popIn .4s backwards; transition: transform .08s; color: var(--ink); line-height: 1.05; }
.choice:active { transform: translateY(5px); box-shadow: 0 2px 0 rgba(43, 27, 79, .2); }
.choices.numbers .choice { font-size: clamp(36px, 10vw, 56px); }
.choices.wide { grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
.choices.wide .choice { font-size: clamp(18px, 4.8vw, 26px); min-height: 72px; padding: 10px 14px; }
.choice small { display: block; font-size: .4em; font-weight: 600; color: var(--ink-soft); }
.choice.is-correct, .is-correct { background: linear-gradient(180deg, #7ef0b4, #22c983) !important; color: #fff !important; animation: correctPop .5s !important; box-shadow: 0 0 0 5px #fff, 0 0 30px #7ef0b4 !important; }
@keyframes correctPop { 40% { transform: scale(1.15) rotate(-3deg); } }
.shake { animation: shake .45s !important; }
@keyframes shake { 20%, 60% { transform: translateX(-10px) rotate(-2deg); } 40%, 80% { transform: translateX(10px) rotate(2deg); } }
.hint { animation: hintGlow 1s ease-in-out infinite !important; box-shadow: 0 0 0 5px #ffe066, 0 0 34px #ffe066 !important; }
@keyframes hintGlow { 50% { transform: scale(1.08); } }
.pop-in { animation: popIn .45s backwards; }
.float { animation: floaty 3s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-10px); } }

/* ---------- results ---------- */
.results-card { position: relative; background: #fff; border-radius: 36px; padding: 70px 20px 22px; margin: 70px auto 0; max-width: 520px; text-align: center; box-shadow: var(--shadow);
  animation: popIn .5s; }
.results-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 110px; border-radius: 36px 36px 0 0; background: linear-gradient(135deg, var(--c1), var(--c2)); opacity: .2; }
.results-buddy { position: absolute; top: -78px; left: 50%; transform: translateX(-50%); width: 150px; height: 150px; }
.results-buddy .buddy-svg { width: 100%; height: 100%; }
.celebrate svg { animation: celebrate 1s ease-in-out infinite; }
@keyframes celebrate { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-14px) rotate(-6deg); } 75% { transform: translateY(-14px) rotate(6deg); } }
.results-title { font-size: 40px; margin: 0; position: relative; }
.rstars { display: flex; justify-content: center; gap: 10px; margin: 8px 0; }
.rstar { font-size: 64px; color: #e7e2f5; transition: all .3s; transform: scale(.8); }
.rstar:nth-child(2) { transform: scale(.95) translateY(-12px); font-size: 78px; }
.rstar.on { color: #ffcc1a; text-shadow: 0 0 20px rgba(255, 204, 26, .8), 0 4px 0 #e09b00; animation: starPop .5s; }
@keyframes starPop { 0% { transform: scale(2.2) rotate(-30deg); opacity: 0; } 70% { transform: scale(.9); } }
.results-score { color: var(--ink-soft); font-size: 17px; }
.reward { display: inline-flex; align-items: center; gap: 6px; margin: 12px auto 4px; font-size: 32px; font-weight: 700; background: #eef7ff; padding: 6px 18px; border-radius: 99px; }
.levelup { margin: 10px auto; background: linear-gradient(90deg, #7b5cff, #ff5ca8); color: #fff; padding: 8px 16px; border-radius: 99px; display: inline-block; font-weight: 700; animation: pulse 1.2s 3; }
.quest-done { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0; }
.quest-done .chip { background: #e9fff3; }
.egg-progress { display: flex; align-items: center; gap: 10px; margin: 14px 8px 4px; font-weight: 700; font-size: 18px; }
.next-up { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink-soft); font-weight: 600; }

/* ---------- hatchery ---------- */
.hatchery, .book { text-align: center; }
.nest-stage { position: relative; height: 360px; display: grid; place-items: center; margin: 0 auto; max-width: 420px; }
.rays { position: absolute; width: 520px; height: 520px; left: 50%; top: 50%; margin: -260px 0 0 -260px; border-radius: 50%; opacity: .45;
  background: repeating-conic-gradient(rgba(255, 255, 255, .6) 0 10deg, transparent 10deg 20deg); animation: spin 18s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 65%); mask: radial-gradient(circle, #000 20%, transparent 65%); }
.rays.on { opacity: 1; background: repeating-conic-gradient(var(--rc) 0 10deg, transparent 10deg 20deg); animation-duration: 8s; }
@keyframes spin { to { transform: rotate(360deg); } }
.nest { position: absolute; bottom: 40px; width: 220px; height: 70px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 30%, #c98a4b, #8a5526 70%); box-shadow: inset 0 8px 0 rgba(255, 255, 255, .2), 0 10px 20px rgba(0, 0, 0, .2); }
.egg { position: relative; z-index: 2; width: 170px; height: 220px; margin-bottom: 60px; }
.egg.can { animation: eggIdle 2.4s ease-in-out infinite; }
.egg.cant { filter: grayscale(.5) brightness(.95); }
@keyframes eggIdle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-6deg); } 92% { transform: rotate(6deg); } }
.egg.wobble { animation: eggWobble .4s; }
@keyframes eggWobble { 25% { transform: rotate(-12deg) scale(1.05); } 75% { transform: rotate(12deg) scale(1.05); } }
.egg-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 14px 18px rgba(0,0,0,.2)); }
.egg-crack { fill: none; stroke: #4a2c55; stroke-linecap: round; stroke-linejoin: round; animation: eggCrack .28s ease-out forwards; }
.egg-crack-edge { fill: none; stroke: rgba(255,255,255,.85); stroke-linecap: round; stroke-linejoin: round; animation: eggCrack .28s ease-out forwards; }
@keyframes eggCrack { to { stroke-dashoffset: 0; } }
.egg-chip { transform-box: fill-box; transform-origin: center; animation: eggChip .8s ease-out forwards; }
@keyframes eggChip { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }
.egg-top { transform-box: view-box; transform-origin: 20% 45%; animation: eggLid .7s cubic-bezier(.3,.7,.4,1) forwards; }
@keyframes eggLid { 30% { transform: translate(0, -10px) rotate(-6deg); } 100% { transform: translate(-26px, -70px) rotate(-38deg); opacity: 0; } }
.egg-glow { filter: blur(6px); animation: eggGlow .8s ease-out forwards; opacity: 0; }
@keyframes eggGlow { 30% { opacity: 1; } 100% { opacity: 1; transform: scale(1.4); transform-origin: center; transform-box: fill-box; } }
.a11y-calm .egg-chip { display: none; }
.reveal { position: relative; z-index: 2; width: 240px; height: 240px; margin-bottom: 50px; animation: revealIn .8s cubic-bezier(.2, .9, .3, 1.5); }
.reveal .buddy-svg { width: 100%; height: 100%; }
@keyframes revealIn { from { transform: scale(0) rotate(-40deg); } }
.hatch-label { color: #fff; font-size: 24px; font-weight: 600; text-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.hatch-cost { color: #fff; opacity: .85; margin: 8px 0 14px; }
.hatch-result { animation: popIn .5s; }
.hatch-result h2 { color: #fff; font-size: 44px; margin: 6px 0 0; text-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
.hatch-result p { color: #fff; margin: 4px 0; }
.rarity { display: inline-block; padding: 5px 14px; border-radius: 99px; font-weight: 700; color: #2b1b4f; }

/* ---------- collection ---------- */
.book-progress { display: flex; align-items: center; gap: 10px; max-width: 460px; margin: 6px auto; color: #fff; font-weight: 600; }
.book-progress .bar { background: rgba(255, 255, 255, .3); }
.legend { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; margin: 10px 0 20px; }
.book-card { position: relative; background: #fff; border-radius: 24px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center;
  box-shadow: 0 0 0 4px var(--rc), 0 6px 0 rgba(43, 27, 79, .15); animation: popIn .4s backwards; animation-delay: calc(var(--i) * 25ms); }
.book-card .buddy-svg { width: 84px; height: 84px; }
.book-card.missing { background: rgba(255, 255, 255, .45); box-shadow: 0 0 0 3px rgba(255, 255, 255, .6); }
.book-card.missing .buddy-svg { filter: brightness(0) opacity(.25); }
.book-card.legendary.owned { background: linear-gradient(160deg, #fff8d6, #fff); }
.book-card.epic.owned { background: linear-gradient(160deg, #f5e9ff, #fff); }
.book-name { font-weight: 600; font-size: 15px; }
.book-n { position: absolute; top: 6px; right: 8px; font-weight: 700; font-size: 13px; background: #f1ecff; border-radius: 99px; padding: 1px 6px; }
.creature-detail { text-align: center; }
.creature-detail .buddy-svg { width: 220px; height: 220px; }
.creature-detail h2 { font-size: 36px; margin: 8px 0 0; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(30, 16, 70, .55); display: grid; place-items: center; padding: 16px; animation: fadeIn .2s; backdrop-filter: blur(4px); }
.modal-back.closing { animation: fadeOut .2s forwards; }
@keyframes fadeIn { from { opacity: 0; } } @keyframes fadeOut { to { opacity: 0; } }
.modal { position: relative; background: #fff; border-radius: 32px; padding: 26px 20px 22px; width: min(460px, 100%); max-height: 90dvh; overflow: auto; box-shadow: var(--shadow); animation: popIn .35s; }
.modal-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; background: #f1ecff; font-size: 18px; }
.locked { text-align: center; }
.locked-art { width: 120px; height: 120px; margin: 0 auto; border-radius: 34px; display: grid; place-items: center; font-size: 70px; background: linear-gradient(160deg, var(--c1), var(--c2)); }
.profiles h2, .gate h2, .locked h2 { margin: 6px 0; text-align: center; }
.profile-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; }
.profile { display: flex; flex-direction: column; align-items: center; padding: 10px; border-radius: 22px; background: #f6f3ff; }
.profile.cur { box-shadow: 0 0 0 4px #7b5cff; }
.profile .buddy-svg { width: 80px; height: 80px; }
.profiles > .btn { width: 100%; }

/* parent gate (adult styling) */
.modal.adult { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
.gate { text-align: center; }
.gate p { color: #555; margin: 4px 0; }
.gate-q { font-size: 24px; font-weight: 700; margin: 8px 0; }
.gate-display { height: 52px; border-radius: 14px; background: #f3f3f7; font-size: 30px; font-weight: 700; display: grid; place-items: center; margin: 8px auto; width: 160px; letter-spacing: 4px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 260px; margin: 10px auto 0; }
.key { height: 52px; border-radius: 14px; background: #eef0f6; font-size: 22px; font-weight: 600; font-family: system-ui, sans-serif; }
.key:active { background: #dfe3ee; }

/* ---------- parent zone ---------- */
.parent { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: #f7f7fb; color: #1f1d2b; min-height: 100dvh; max-width: none;
  margin: 0; padding-left: max(16px, calc((100vw - 820px) / 2)); padding-right: max(16px, calc((100vw - 820px) / 2)); }
body:has(.parent) #sky { display: none; }
body:has(.parent) { background: #f7f7fb; }
.pz-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; }
.pz-head h1 { margin: 0; font-size: 28px; } .pz-head small { color: #777; }
.pz-tabs { display: flex; gap: 6px; background: #ececf4; border-radius: 14px; padding: 4px; margin: 8px 0 16px; }
.pz-tabs button { flex: 1; padding: 10px; border-radius: 10px; font-weight: 600; font-family: inherit; }
.pz-tabs button.on { background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .08); }
.parent h2 { font-size: 22px; margin: 6px 0 12px; } .parent h3 { margin: 22px 0 8px; font-size: 17px; }
.parent .btn { font-family: inherit; font-size: 16px; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.parent .btn.primary { box-shadow: 0 3px 0 #0d8a55; }
.pz-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.pz-stat { background: #fff; border-radius: 16px; padding: 14px; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.pz-stat b { display: block; font-size: 30px; } .pz-stat small { color: #777; }
.pz-subject { background: #fff; border-radius: 14px; padding: 12px; margin-bottom: 8px; }
.pz-sub-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 600; gap: 8px; flex-wrap: wrap; }
.pz-sub-head span:last-child { color: #777; font-weight: 400; font-size: 14px; }
.pz-skill, .pz-recent { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; font-size: 15px; flex-wrap: wrap; }
.pz-lv { color: #6a5cff; font-weight: 600; }
.pz-recent small { color: #999; width: 100%; }
.pz-row { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 8px; font-weight: 500; }
.pz-row input[type=checkbox] { width: 24px; height: 24px; accent-color: #6a5cff; }
.pz-row select { font-size: 16px; padding: 6px 10px; border-radius: 8px; border: 1px solid #ddd; }
.pz-kid { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px; padding: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.pz-kid .buddy-svg { width: 56px; height: 56px; } .pz-kid > div { flex: 1; min-width: 140px; } .pz-kid small { color: #777; }
.plans .perks { list-style: none; padding: 0; margin: 12px 0; } .plans .perks li { padding: 4px 0; color: #2a7a52; font-weight: 500; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 12px 0; }
.plan { position: relative; background: #fff; border-radius: 20px; padding: 18px; box-shadow: 0 1px 4px rgba(0, 0, 0, .08); display: flex; flex-direction: column; }
.plan.best { box-shadow: 0 0 0 3px #6a5cff, 0 8px 24px rgba(106, 92, 255, .2); }
.plan-tag { position: absolute; top: -12px; left: 18px; background: #6a5cff; color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; }
.plan h3 { margin: 0 0 6px; } .price { font-size: 30px; font-weight: 700; } .price small { font-size: 14px; color: #777; font-weight: 400; }
.plan p { color: #666; flex: 1; } .plan .btn { width: 100%; }

/* ---------- sleepy ---------- */
.sleepy { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff; gap: 8px; }
body:has(.sleepy) { background: linear-gradient(180deg, #1a1446, #3b2a8a); }
.moon { font-size: 80px; animation: floaty 4s ease-in-out infinite; }
.sleep { width: 180px; height: 180px; } .sleep svg { animation: bob 4s ease-in-out infinite; } .sleep .cr-eyes { transform: scaleY(.1) !important; animation: none !important; }

/* ---------- toast / tokens ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; display: flex; gap: 8px; align-items: center;
  background: #fff; padding: 12px 20px; border-radius: 99px; box-shadow: var(--shadow); font-weight: 600; font-size: 17px; animation: toastIn .35s cubic-bezier(.2, .9, .3, 1.4); max-width: 92vw; }
.toast.out { animation: fadeOut .4s forwards; }
@keyframes toastIn { from { transform: translate(-50%, 40px); opacity: 0; } }
.fly-token { position: fixed; z-index: 65; font-size: 28px; pointer-events: none; transform: translate(-50%, -50%); }

@media (max-width: 420px) {
  .pill { padding: 6px 9px; font-size: 15px; }
  .me-name { display: none; }
  button.me { padding: 3px; }
  .tile { width: 138px; } .tile.big { width: 150px; }
  .hero-buddy-svg { width: 92px; height: 92px; }
  .speech { font-size: 16px; }
  .choices { gap: 9px; }
  .choice { min-height: 76px; border-radius: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.btn.armed { background: #c0213f; color: #fff; }

/* ======================= v2: Pip, tricks, a11y, bosses, insights ======================= */
/* ---- Pip figure (roles) ---- */
.pip { position: relative; width: 84px; height: 84px; flex: none; }
.pip.small { width: 58px; height: 58px; }
.pip.big { width: 150px; height: 150px; }
.pip-body, .pip-body svg { width: 100%; height: 100%; display: block; overflow: visible; }
.pip-body svg { animation: bob 2.4s ease-in-out infinite; }
.pip.role-opponent .pip-body svg .cr-body { filter: hue-rotate(120deg) saturate(1.3); }
.pip.role-opponent.hit { animation: bossHit .5s; }
.pip.role-opponent.gloat { animation: bossGloat .6s; }
@keyframes bossHit { 20% { transform: translateX(-10px) rotate(-12deg); filter: brightness(2); } 60% { transform: translateX(8px) rotate(6deg); } }
@keyframes bossGloat { 40% { transform: translateY(-14px) scale(1.1); } }
.pip-pop { position: fixed; left: max(10px, env(safe-area-inset-left)); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 55; display: flex; align-items: flex-end; gap: 6px; max-width: min(440px, calc(100vw - 20px)); animation: pipIn .45s cubic-bezier(.2,.9,.3,1.4); cursor: pointer; }
.pip-pop.out { animation: fadeOut .3s forwards; }
@keyframes pipIn { from { transform: translateY(120%); } }
.pip-bubble { background: #fff; border-radius: 22px 22px 22px 6px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 17px; display: flex; flex-direction: column; gap: 2px; border: 3px solid var(--rc, #6a5cff); }
.pip-bubble b { font-size: 13px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.role-guide ~ .pip-bubble { border-color: #21c87a; } .role-instructor ~ .pip-bubble { border-color: #6a5cff; }
.role-coach ~ .pip-bubble { border-color: #ff8a3d; } .role-mentor ~ .pip-bubble { border-color: #18b6d9; } .role-opponent ~ .pip-bubble { border-color: #ff4f6d; }

/* ---- Pip's Tricks ---- */
.modal.trick-modal { width: min(560px, 100%); }
.trick-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.trick-head small { color: #6a5cff; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.trick-head h2 { margin: 0; font-size: 26px; }
.trick-stage { min-height: 190px; border-radius: 24px; background: linear-gradient(160deg, #f3efff, #eafaff); display: grid; place-items: center; padding: 16px; overflow: hidden; }
.trick-step { animation: popIn .45s; text-align: center; font-size: 22px; }
.trick-note { text-align: center; font-size: 21px; font-weight: 600; margin: 12px 4px 6px; min-height: 2.4em; }
.trick-dots { display: flex; gap: 6px; justify-content: center; }
.trick-dots i { width: 10px; height: 10px; border-radius: 50%; background: #e2dcf7; } .trick-dots i.on { background: #6a5cff; }
.demo-row { font-size: clamp(34px, 9vw, 52px); display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.demo-row b { font-size: .6em; color: #6a5cff; }
.demo-big { font-size: clamp(56px, 16vw, 96px); font-weight: 700; line-height: 1.1; }
.demo-eq { font-size: clamp(30px, 8vw, 48px); font-weight: 700; letter-spacing: .04em; }
.demo-hl { display: inline-block; padding: 0 .2em; border-radius: 12px; background: #fff3a0; box-shadow: 0 0 0 4px #ffd93d; animation: hintGlow 1s ease-in-out infinite; }
.demo-arrow { display: inline-block; animation: arrowBob .8s ease-in-out infinite; }
@keyframes arrowBob { 50% { transform: translateY(-8px); } }
.trick-btn { font-size: 22px; }

/* ---- phase chip (review / new challenge) ---- */
.prompt { position: relative; }
.phase-chip { position: absolute; top: -12px; right: 14px; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 99px; color: #fff; }
.phase-chip:empty { display: none; }
.phase-chip.review { background: #21c87a; } .phase-chip.stretch { background: linear-gradient(90deg, #7b5cff, #ff5ca8); animation: pulse 1.4s infinite; }

/* ---- captions & sound cues (deaf / HoH) ---- */
.captions { position: fixed; left: 50%; top: calc(8px + env(safe-area-inset-top)); transform: translate(-50%, -160%); z-index: 66; max-width: min(92vw, 640px);
  background: rgba(20, 12, 50, .92); color: #fff; font-size: clamp(18px, 4.5vw, 24px); font-weight: 600; padding: 10px 18px; border-radius: 18px; text-align: center;
  transition: transform .25s; pointer-events: none; }
.captions.show { transform: translate(-50%, 0); }
.sound-cue { position: fixed; inset: 0; z-index: 64; pointer-events: none; border: 10px solid transparent; animation: cue .55s forwards; }
.sound-cue.good { border-color: #22c983; } .sound-cue.bad { border-color: #ffb300; }
@keyframes cue { from { opacity: 1; } to { opacity: 0; } }

/* ---- accessibility modes ---- */
body.font-lexend { --font: 'Lexend', 'Fredoka', system-ui, sans-serif; letter-spacing: .03em; word-spacing: .12em; }
body.font-atkinson { --font: 'Atkinson Hyperlegible', 'Fredoka', system-ui, sans-serif; }
body.font-lexend, body.font-atkinson { font-family: var(--font); }
body.a11y-lowvision { font-size: 118%; }
body.a11y-lowvision .prompt-text { font-size: clamp(26px, 6.5vw, 38px); }
body.a11y-lowvision .choice, body.a11y-motor .choice { min-height: 104px; }
body.a11y-lowvision .prompt, body.a11y-lowvision .choice, body.a11y-lowvision .tile { outline: 3px solid #1b1040; }
body.a11y-lowvision .tile-title { font-size: 19px; }
body.a11y-motor .choices { gap: 18px; }
body.a11y-motor button, body.a11y-motor .draggable { min-width: 56px; min-height: 56px; }
/* Calm: let things appear normally, but stop anything that keeps looping (bobbing, pulsing, twinkling). */
body.a11y-calm *, body.a11y-calm *::before, body.a11y-calm *::after { animation-iteration-count: 1 !important; }
body.a11y-calm .shake, body.a11y-calm .g-meteors.shake { animation: none !important; }
body.a11y-calm #sky .twinkle, body.a11y-calm .tile-art::after { display: none; }
:focus-visible { outline: 4px solid #ffd93d; outline-offset: 3px; }

/* ---- needs picker ---- */
.needs .onboard-sub { max-width: 560px; }
.needs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; width: min(760px, 100%); }
.need { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px; border-radius: 22px; background: rgba(255,255,255,.92); text-align: center; box-shadow: 0 5px 0 rgba(43,27,79,.15); border: 4px solid transparent; }
.need .need-icon { font-size: 36px; } .need b { font-size: 18px; } .need small { color: var(--ink-soft); font-size: 13px; line-height: 1.3; }
.need.on { border-color: #22c983; background: #eafff4; }
.need.on::after { content: '✓ On'; font-weight: 700; color: #138a5a; font-size: 13px; }
.needs-grid.adult .need { font-family: inherit; box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* ---- home additions ---- */
.tile.off-age { opacity: .78; }
.boss-tile .tile-art { background: radial-gradient(circle at 50% 30%, rgba(255,80,120,.45), rgba(0,0,0,.15) 70%); }
.boss-tile .tile-pip { width: 92px; height: 92px; }
.boss-tile .tile-meta { gap: 4px; } /* "3 more" + "Benchmark" fit on one line at 138–150px wide */
.boss-tile .tile-stars { font-size: 13px; white-space: nowrap; } .boss-tile .tile-age { font-size: 11px; padding: 2px 6px; white-space: nowrap; }
.boss-tile.locked .tile-art { filter: grayscale(.6) brightness(.85); }
.boss-tile.ready { box-shadow: 0 7px 0 rgba(43,27,79,.3), 0 0 26px rgba(255,92,168,.65); }
.review-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 16px; margin: -4px 0 18px; border-radius: 26px;
  background: linear-gradient(90deg, #eafff4, #e8f8ff); box-shadow: var(--shadow); }
.review-card > div:not(.pip) { flex: 1; display: flex; flex-direction: column; } .review-card b { font-size: 20px; } .review-card small { color: var(--ink-soft); }
.review-go { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(180deg, #4fe39a, #18b874); color: #fff; display: grid; place-items: center; font-size: 22px; box-shadow: 0 4px 0 #0d8a55; }
.grown { position: relative; }
.dot-badge { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; border-radius: 99px; background: #ff3d7f; color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.mentor { display: flex; align-items: center; gap: 10px; text-align: left; background: #eaf8ff; border-radius: 20px; padding: 8px 12px; margin: 12px 0 0; }
.mentor p { margin: 0; font-weight: 500; }

/* ---- boss battle HUD ---- */
.boss-hud { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.25); border-radius: 22px; padding: 4px 12px 4px 4px; }
.boss-hud .pip { width: 62px; height: 62px; }
.boss-hp { flex: 1; height: 22px; border-radius: 99px; background: rgba(255,255,255,.25); position: relative; overflow: hidden; }
.boss-hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff4f6d, #ffb347); border-radius: inherit; transition: width .5s cubic-bezier(.2,.9,.3,1.2); }
.boss-hp span { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.5); }

/* ---- boss report card ---- */
.report-card .results-buddy { top: -80px; }
.rc-sub { color: var(--ink-soft); margin: 6px 0 12px; }
.rc-meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.rc-meter { background: #f5f2ff; border-radius: 18px; padding: 10px 6px; display: flex; flex-direction: column; gap: 2px; }
.rc-meter small { color: var(--ink-soft); font-weight: 600; } .rc-meter b { font-size: 26px; }
.rc-skills { display: flex; flex-direction: column; gap: 10px; text-align: left; margin: 12px 0; }
.rc-skill-head { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; margin-bottom: 4px; }
.delta { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.delta.up { color: #138a5a; } .delta.down { color: #c76a00; } .delta.new { color: #6a5cff; }

/* ---- parent: insights & benchmarks ---- */
.ins-intro p { color: #444; max-width: 70ch; }
.ins-disclaimer { background: #fff7e0; border-radius: 12px; padding: 10px 12px; border-left: 4px solid #ffb300; font-size: 14px; }
.ins-card { background: #fff; border-radius: 16px; padding: 14px 16px; margin: 12px 0; box-shadow: 0 1px 4px rgba(0,0,0,.08); border-left: 6px solid #9aa6c3; }
.ins-card.notice { border-left-color: #ff8a3d; } .ins-card.watch { border-left-color: #6a5cff; } .ins-card.ok { border-left-color: #22c983; }
.ins-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .ins-head b { font-size: 18px; }
.ins-level { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 99px; background: #f1ecff; color: #4a3bc7; }
.ins-card.notice .ins-level { background: #fff0e3; color: #b35400; }
.ins-card h4 { margin: 12px 0 4px; font-size: 14px; color: #555; } .ins-card ul { margin: 0; padding-left: 20px; } .ins-card li { margin: 3px 0; }
.ins-res a { color: #4a3bc7; font-weight: 600; }
.bench-spark { display: flex; align-items: flex-end; gap: 4px; height: 44px; margin: 6px 0; }
.bench-spark i { flex: 1; max-width: 22px; background: linear-gradient(180deg, #8f7bff, #6a5cff); border-radius: 4px 4px 0 0; }
.bench-skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 12px; font-size: 14px; color: #555; }
.bench-skill { display: flex; justify-content: space-between; gap: 8px; }
.plan.owned { box-shadow: 0 0 0 3px #22c983; }
.pz-tabs { overflow-x: auto; scrollbar-width: none; } .pz-tabs button { white-space: nowrap; }

/* ---- drag & drop ---- (no square outlines: glows follow the item's own shape) */
.draggable { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.draggable:focus { outline: none; }
.draggable:focus-visible { outline: none; filter: drop-shadow(0 0 4px #3d8bff) drop-shadow(0 0 8px #3d8bff); }
.draggable.dragging { cursor: grabbing; transform: scale(1.12) rotate(-3deg); filter: drop-shadow(0 12px 14px rgba(0,0,0,.3)); transition: transform .12s; }
.draggable.loose:not(.dragging) { filter: drop-shadow(0 6px 8px rgba(0,0,0,.22)); }
.draggable.picked { outline: none; transform: scale(1.1); filter: drop-shadow(0 0 5px #ffd93d) drop-shadow(0 0 10px #ffb800); animation: drag-bob .9s ease-in-out infinite alternate; }
@keyframes drag-bob { from { transform: scale(1.06) translateY(0); } to { transform: scale(1.1) translateY(-5px); } }
.drag-ghost { display: none; }
.drop-over { outline: none !important; box-shadow: 0 0 0 6px rgba(34,201,131,.55), 0 0 24px 6px rgba(34,201,131,.45) !important; transform: scale(1.04); transition: transform .12s, box-shadow .12s; }
body.a11y-calm .draggable.picked { animation: none; }
@media (max-width: 420px) { .rc-meters { grid-template-columns: 1fr 1fr 1fr; } .rc-meter b { font-size: 20px; } }

body:has(.game-screen) .pip-pop { bottom: auto; top: calc(178px + env(safe-area-inset-top)); }

.admin-badge { background: #1b1040; color: #ffd93d; font-weight: 700; font-size: 12px; letter-spacing: .08em; padding: 5px 9px; border-radius: 99px; }
.pz-notice { font-size: 12px; line-height: 1.4; margin: -4px 0 10px; }

/* ---------- results: fit one screen, no scrolling (desktop and phone) ---------- */
.screen.results { height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.screen.results .results-card.res-fit { flex: 0 1 auto; min-height: 0; margin: clamp(8px, 2.5vh, 28px) auto auto; width: 100%; max-width: 520px;
  padding: clamp(10px, 2vh, 20px) clamp(12px, 3vw, 22px) clamp(10px, 2vh, 18px); display: flex; flex-direction: column; gap: clamp(6px, 1.3vh, 12px); }
.res-fit::before { height: clamp(70px, 13vh, 100px); }
.res-fit .res-head { position: relative; display: flex; align-items: center; justify-content: center; gap: clamp(8px, 2vw, 16px); }
.res-fit .results-buddy { position: relative; top: auto; left: auto; transform: none; flex: none; width: clamp(64px, 12vh, 112px); height: clamp(64px, 12vh, 112px); }
.res-fit .res-headtext { display: flex; flex-direction: column; align-items: center; }
.res-fit .results-title { font-size: clamp(26px, 5vh, 40px); line-height: 1.05; }
.res-fit .rstars { margin: 2px 0 0; gap: 6px; }
.res-fit .rstar { font-size: clamp(34px, 6.5vh, 56px); }
.res-fit .rstar:nth-child(2) { font-size: clamp(42px, 8vh, 68px); transform: scale(.95) translateY(-6px); }
.res-fit .results-score { font-size: clamp(14px, 2vh, 17px); }
.res-fit .res-chips { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.res-fit .reward { margin: 0; font-size: clamp(22px, 3.6vh, 30px); padding: 3px 14px; }
.res-fit .levelup { margin: 0; padding: 5px 12px; font-size: 15px; }
.res-fit .quest-chip { background: #e9fff3; }
.res-fit .mentor { margin: 0; padding: 6px 10px; }
.res-fit .mentor p { font-size: clamp(14px, 2vh, 16px); line-height: 1.3; }
.res-fit .res-egg { display: flex; align-items: center; gap: 10px; }
.res-fit .egg-progress { flex: 1; margin: 0 4px; font-size: 16px; }
.res-fit .res-hatch { flex: none; padding: 10px 16px; font-size: 17px; }
.res-fit .row-btns { margin-top: 0; }
.res-fit .row-btns .btn.big { padding-top: clamp(10px, 1.8vh, 16px); padding-bottom: clamp(10px, 1.8vh, 16px); }
.next-mini { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 14px; border-radius: 18px; text-align: left; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 4px 0 rgba(43, 27, 79, .15); font-family: inherit; }
.next-mini .next-emo { font-size: clamp(26px, 4.4vh, 36px); line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.next-mini small { display: block; font-size: 12px; opacity: .9; font-weight: 600; }
.next-mini b { display: block; font-size: clamp(15px, 2.2vh, 18px); text-shadow: 0 1px 0 rgba(0,0,0,.2); }
.next-mini .next-go { margin-left: auto; font-size: 18px; }
@media (max-height: 640px) { .res-fit .mentor { display: none; } }
.splash-brand { display: flex; align-items: center; justify-content: center; gap: clamp(6px, 1.5vw, 14px); }
.splash-mark { width: clamp(64px, 15vw, 120px); height: clamp(64px, 15vw, 120px); flex: none; animation: splashMark 2.4s ease-in-out infinite; }
.splash-mark svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 6px 0 rgba(43, 27, 79, .2)); }
@keyframes splashMark { 0%, 100% { transform: rotate(-6deg) scale(1); } 50% { transform: rotate(6deg) scale(1.06); } }
body.a11y-calm .splash-mark { animation: none; }
@media (max-width: 560px) { .splash-brand { flex-direction: column; gap: 2px; } .splash-mark { width: 92px; height: 92px; } }

/* ---------- scrolling tile rows: arrows, edge fade, mouse drag ---------- */
.tiles-wrap { position: relative; }
.tiles-wrap .tiles { scroll-snap-type: x proximity; cursor: grab; }
.tiles-wrap .tiles.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.tiles-wrap .tiles.dragging .tile { pointer-events: none; }
.tiles-wrap.more-right .tiles { -webkit-mask: linear-gradient(90deg, #000 calc(100% - 56px), transparent); mask: linear-gradient(90deg, #000 calc(100% - 56px), transparent); }
.tiles-wrap.more-left .tiles { -webkit-mask: linear-gradient(90deg, transparent, #000 56px); mask: linear-gradient(90deg, transparent, #000 56px); }
.tiles-wrap.more-left.more-right .tiles { -webkit-mask: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent); mask: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent); }
.row-arrow { position: absolute; top: 50%; translate: 0 -60%; z-index: 3; width: 48px; height: 48px; border-radius: 50%; display: none; place-items: center;
  background: #fff; color: var(--ink); font-size: 32px; font-weight: 700; line-height: 1; box-shadow: 0 6px 14px rgba(43, 27, 79, .3); padding-bottom: 4px; }
.row-arrow.left { left: 10px; } .row-arrow.right { right: 10px; }
.tiles-wrap.more-left .row-arrow.left, .tiles-wrap.more-right .row-arrow.right { display: grid; }
.row-arrow:hover { transform: scale(1.08); }
@media (pointer: coarse) { .row-arrow { width: 40px; height: 40px; font-size: 26px; opacity: .92; } }
