@font-face { font-family: "Lucky"; src: url("../assets/fonts/Luckiest.ttf"); font-display: swap; }
@font-face { font-family: "Fred"; src: url("../assets/fonts/Fredoka.ttf"); font-display: swap; }

:root { --alt: 0; --r: 22px; }
body[data-theme="cosmic"]   { --sky0: #3b7dd8; --sky1: #1a2a6c; --space: #07061a; --ink: #f4f1ff; --mute: #a9a3d6; --card: rgba(20,16,58,.82); --line: rgba(255,255,255,.14); --accent: #ff4f8b; --accent2: #ffd23f; --btn-ink: #1b1035; }
body[data-theme="daylight"] { --sky0: #bfe7ff; --sky1: #7ec8ff; --space: #2b3a8f; --ink: #1b1035; --mute: #55508a; --card: rgba(255,255,255,.9); --line: rgba(27,16,53,.14); --accent: #ff3d7f; --accent2: #ffb400; --btn-ink: #1b1035; }
body[data-theme="sunset"]   { --sky0: #ffb36b; --sky1: #d9487d; --space: #1e0b2e; --ink: #fff6ee; --mute: #f2c6d8; --card: rgba(46,12,52,.8); --line: rgba(255,255,255,.18); --accent: #ffd23f; --accent2: #7df9ff; --btn-ink: #2a0b26; }
body[data-theme="contrast"] { --sky0: #000; --sky1: #000; --space: #000; --ink: #fff; --mute: #fff; --card: #000; --line: #fff; --accent: #ffff00; --accent2: #00ffff; --btn-ink: #000; }
body[data-size="s"] { font-size: 15px; } body[data-size="m"] { font-size: 17px; }
body[data-size="l"] { font-size: 19px; } body[data-size="xl"] { font-size: 22px; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: "Fred", system-ui, sans-serif; color: var(--ink); background: var(--space); overflow-x: hidden;
  -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }

/* sky: blends from blue sky to space as --alt goes 0 -> 1 */
#sky { position: fixed; inset: 0; z-index: -2;
  background: linear-gradient(180deg, var(--space) calc(-60% + var(--alt) * 160%), var(--sky1) calc(10% + var(--alt) * 120%), var(--sky0) calc(70% + var(--alt) * 100%));
  transition: background 1.2s ease; }
#stars { position: absolute; inset: 0; opacity: calc(.15 + var(--alt) * .85); transition: opacity 1.2s; }
#stars i { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: #fff; animation: tw var(--d) ease-in-out infinite alternate; }
@keyframes tw { from { opacity: .25 } to { opacity: 1 } }
#planet { position: absolute; right: -90px; bottom: calc(-240px + var(--alt) * 300px); width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe3a3, #ff9f6b 45%, #b8476d 75%, #4a1d4f); box-shadow: 0 0 80px rgba(255,180,120,.35);
  opacity: calc(var(--alt) * .55); transition: bottom 1.2s, opacity 1.2s; }
body[data-theme="contrast"] #planet, body[data-theme="contrast"] #stars { display: none; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; max-width: 760px; margin: 0 auto; }
.brand { text-align: center; line-height: 1; }
.brand .b1 { display: block; font-family: "Lucky"; font-size: 2rem; letter-spacing: 2px; color: var(--accent2); -webkit-text-stroke: 1.5px rgba(0,0,0,.35); }
.brand .b2 { display: block; font-size: .72rem; color: var(--mute); letter-spacing: .5px; margin-top: 3px; }
.top-right { display: flex; gap: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 1.1rem; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--accent2); }

main { max-width: 640px; margin: 0 auto; padding: 0 14px 40px; }
.screen { display: none; animation: in .35s ease; } .screen.active { display: block; }
@keyframes in { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
.reduced * { animation: none !important; transition: none !important; }
h1 { font-family: "Lucky"; font-size: 2.3rem; letter-spacing: 1px; margin: .2em 0; line-height: 1.05; }
h2 { font-family: "Lucky"; font-size: 1.7rem; letter-spacing: 1px; margin: .6em 0 .3em; }
h3 { font-size: .8rem; letter-spacing: 2px; text-transform: uppercase; color: var(--mute); margin: 1.2em 0 .5em; }
.sub { color: var(--mute); line-height: 1.45; }
.fine { font-size: .8rem; color: var(--mute); }

/* home */
.hero { text-align: center; padding: 10px 0 6px; }
.mascot { width: 150px; filter: drop-shadow(0 10px 0 rgba(0,0,0,.25)); }
.bob { animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-4deg) } }
.nomascot .mascot, .nomascot .rocket img { visibility: hidden; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.mode { text-align: left; padding: 16px; border-radius: var(--r); border: 2px solid var(--line); background: var(--card); cursor: pointer; display: grid; gap: 3px; transition: transform .15s, border-color .15s; }
.mode:hover { transform: translateY(-3px); border-color: var(--accent2); }
.mode.daily { grid-column: 1 / -1; background: linear-gradient(135deg, var(--accent), #8a4bff); border: none; color: #fff; }
.mi { font-size: 1.6rem; } .mt { font-family: "Lucky"; font-size: 1.35rem; letter-spacing: 1px; } .md { font-size: .85rem; opacity: .85; }
.streak { text-align: center; margin-top: 14px; color: var(--mute); }

.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.pack { padding: 18px 14px; border-radius: 18px; border: 2px solid var(--line); background: var(--card); cursor: pointer; text-align: left; display: grid; gap: 4px; }
.pack:hover { border-color: var(--accent2); } .pack small { color: var(--mute); }

.pl { display: flex; gap: 8px; margin-bottom: 8px; }
.pl input { flex: 1; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); }
.row { display: flex; gap: 10px; justify-content: center; margin: 14px 0; } .row.wrap { flex-wrap: wrap; justify-content: flex-start; }

/* buttons */
.btn { padding: 13px 22px; border-radius: 16px; border: none; cursor: pointer; font-family: "Lucky"; letter-spacing: 1px; font-size: 1.05rem;
  background: var(--accent2); color: var(--btn-ink); box-shadow: 0 5px 0 rgba(0,0,0,.3); transition: transform .1s; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.3); }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); box-shadow: none; }
.btn.danger { background: #ff5a6e; color: #fff; }
.btn.small { padding: 9px 16px; font-size: .9rem; }
.btn:disabled { opacity: .5; }
.hide { display: none !important; }

/* game */
.hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 6px 0 12px; }
.hud-box { display: grid; } .hud-box.r { text-align: right; }
.hl { font-size: .68rem; letter-spacing: 2px; color: var(--mute); } .hv { font-family: "Lucky"; font-size: 1.5rem; letter-spacing: 1px; }
.hud-mid { text-align: center; display: grid; gap: 4px; justify-items: center; }
#dots { display: flex; gap: 4px; } .dot { width: 14px; height: 14px; border-radius: 4px; background: var(--line); border: 1px solid var(--line); }
.dot.cur { outline: 2px solid var(--accent2); }
.track { position: fixed; left: max(8px, calc(50% - 360px)); top: 90px; bottom: 30px; width: 10px; border-radius: 10px; background: var(--line); z-index: 1; }
.track-fill { position: absolute; bottom: 0; left: 0; right: 0; height: 0; border-radius: 10px; background: linear-gradient(0deg, var(--accent), var(--accent2)); transition: height 1s cubic-bezier(.2,.8,.2,1); }
.rocket { position: absolute; left: -26px; bottom: calc(var(--alt) * (100% - 60px)); width: 62px; transition: bottom 1s cubic-bezier(.2,.8,.2,1); }
.rocket img { width: 62px; transform: rotate(-90deg); filter: drop-shadow(0 4px 0 rgba(0,0,0,.3)); }
.flame { position: absolute; left: 22px; bottom: -14px; width: 18px; height: 22px; border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%; background: radial-gradient(#fff6b0, #ffb400 50%, #ff4f8b); opacity: 0; }
.rocket.boost .flame { animation: flame .9s ease-out; } @keyframes flame { 0%,70% { opacity: 1; transform: scaleY(1.6) } 100% { opacity: 0 } }
@media (max-width: 760px) { .track { display: none; } }

.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 18px 20px; backdrop-filter: blur(6px); }
.prompt-card .pk { font-size: .72rem; letter-spacing: 3px; color: var(--accent); font-weight: 700; }
.prompt-card .pq { font-family: "Lucky"; font-size: 2rem; letter-spacing: .5px; line-height: 1.1; margin: 6px 0 4px; }
.prompt-card .ph { font-size: .8rem; color: var(--mute); }
.pop { animation: pop .45s cubic-bezier(.2,1.4,.4,1); } @keyframes pop { from { transform: scale(.9); opacity: 0 } }
.turn { display: none; margin: 10px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--accent); color: #fff; text-align: center; }
.turn.on { display: block; }

.answer { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 16px; }
.answer input { width: 100%; padding: 16px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); font-size: 1.15rem; outline: none; }
.answer input:focus { border-color: var(--accent2); }
.timer { position: relative; width: 54px; height: 54px; display: grid; place-items: center; }
.timer svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.tbg { fill: none; stroke: var(--line); stroke-width: 4; } .tfg { fill: none; stroke: var(--accent2); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.timer span { font-family: "Lucky"; font-size: 1.2rem; }
.timer.low .tfg { stroke: #ff5a6e; } .timer.low span { color: #ff5a6e; animation: throb .5s infinite alternate; }
@keyframes throb { to { transform: scale(1.2) } }
.timer.off .tfg { stroke: var(--line); }
.btn.go { padding: 16px 18px; }
.msg { min-height: 1.4em; text-align: center; margin-top: 8px; color: var(--accent2); }
.game-actions { justify-content: space-between; }

.reveal { display: none; margin-top: 14px; } .reveal.on { display: block; animation: pop .45s cubic-bezier(.2,1.4,.4,1); }
.rv-row { text-align: center; padding: 6px 0 12px; border-bottom: 1px dashed var(--line); }
.rv-row:last-of-type { border-bottom: none; }
.rv-who { font-size: .8rem; letter-spacing: 2px; color: var(--mute); text-transform: uppercase; }
.rv-ans { font-size: 1.4rem; margin-top: 8px; text-transform: capitalize; } .rv-pts { font-family: "Lucky"; font-size: 1.3rem; color: var(--accent2); }
.rv-pct, .rv-note { font-size: .82rem; color: var(--mute); }
.rv-pass { text-align: center; font-size: 1.4rem; padding: 18px 0; }
.badge { display: inline-flex; gap: 6px; align-items: center; font-family: "Lucky"; letter-spacing: 2px; font-size: 1.25rem; color: var(--c); text-shadow: 0 0 18px var(--c); }
.badge .cbm { display: none; font-family: "Fred"; } .cb .badge .cbm { display: inline; }
.rv-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; text-align: left; }
.rv-lists h4 { margin: 0 0 6px; font-size: .72rem; letter-spacing: 2px; color: var(--mute); text-transform: uppercase; }
.rv-lists ol { margin: 0; padding-left: 18px; font-size: .9rem; } .rv-lists li { margin: 2px 0; }
.rv-lists li span { text-transform: capitalize; } .rv-lists em { font-style: normal; color: var(--mute); font-size: .75rem; margin-left: 6px; }

/* results */
.res-head { display: flex; align-items: center; gap: 16px; justify-content: center; margin-top: 10px; }
.res-head .mascot { width: 110px; }
.res-stage { font-size: .85rem; letter-spacing: 2px; color: var(--mute); text-transform: uppercase; }
.res-score { font-family: "Lucky"; font-size: 3.6rem; line-height: 1; } .res-score small { font-size: 1.3rem; color: var(--mute); }
.grid-emoji { text-align: center; font-size: 2rem; letter-spacing: 4px; margin: 14px 0 0; }
.cb .grid-emoji { font-family: "Fred"; font-size: 1.8rem; }
.pl-row { display: flex; justify-content: space-between; padding: 10px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); margin: 6px 0; font-size: 1rem; letter-spacing: 0; }
.review { margin-top: 8px; } .rev { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.rq { font-size: .85rem; color: var(--mute); } .ra { margin-top: 3px; text-transform: capitalize; } .ra .badge { text-transform: none; } .ra .badge { font-size: .9rem; margin: 0 6px; }

/* modals */
.modal { position: fixed; inset: 0; background: rgba(5,4,20,.6); display: none; align-items: flex-end; justify-content: center; z-index: 50; backdrop-filter: blur(3px); }
.modal.on { display: flex; }
.sheet { width: min(640px, 100%); max-height: 88vh; display: flex; flex-direction: column; background: var(--space); border: 2px solid var(--line); border-bottom: none; border-radius: 26px 26px 0 0; animation: up .3s ease; }
body[data-theme="daylight"] .sheet { background: #f4f8ff; }
@keyframes up { from { transform: translateY(40px); opacity: 0 } }
@media (min-width: 700px) { .modal { align-items: center; } .sheet { border-radius: 26px; border-bottom: 2px solid var(--line); } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px 0; }
.sheet-head h2 { margin: .4em 0; }
.sheet-body { overflow: auto; padding: 0 18px 22px; line-height: 1.45; }
.set { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.set span small { display: block; font-size: .75rem; color: var(--mute); }
.set-col { flex-direction: column; align-items: flex-start; }
.set select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); max-width: 55%; }
.set input[type=range] { width: 45%; accent-color: var(--accent2); }
.sw { position: relative; width: 50px; height: 28px; flex: none; } .sw input { opacity: 0; width: 0; height: 0; }
.sw span { position: absolute; inset: 0; border-radius: 20px; background: var(--line); cursor: pointer; transition: background .2s; }
.sw span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.sw input:checked + span { background: var(--accent); } .sw input:checked + span::after { transform: translateX(22px); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 20px; border: 1px solid var(--line); font-size: .85rem; cursor: pointer; }
.chip input { accent-color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; }
.stat-grid b { display: block; font-family: "Lucky"; font-size: 1.8rem; } .stat-grid span { font-size: .7rem; color: var(--mute); }
.bar { display: grid; grid-template-columns: 150px 1fr 34px; gap: 8px; align-items: center; margin: 5px 0; }
.bar .badge { font-size: .85rem; }
.bar i { display: block; height: 12px; border-radius: 6px; width: var(--w); background: var(--c); min-width: 3px; }
.tiers > div { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.tiers .badge { font-size: 1rem; } .tiers span { color: var(--mute); font-size: .85rem; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--accent2); color: var(--btn-ink); padding: 10px 18px; border-radius: 14px; opacity: 0; transition: .25s; z-index: 60; pointer-events: none; font-weight: 600; text-align: center; max-width: 90vw; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }

@media (max-width: 480px) {
  h1 { font-size: 1.8rem; } .prompt-card .pq { font-size: 1.6rem; }
  .modes { grid-template-columns: 1fr 1fr; } .mode { padding: 13px; }
  .answer { grid-template-columns: auto 1fr; } .btn.go { grid-column: 1 / -1; }
  .rv-lists { grid-template-columns: 1fr; } .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .bar { grid-template-columns: 120px 1fr 30px; }
}

/* light themes: tier colours need contrast on a pale card */
body[data-theme="daylight"] .badge { filter: brightness(.62) saturate(1.6); text-shadow: none; }
body[data-theme="daylight"] .bar i { filter: brightness(.8) saturate(1.4); }

/* ---------- answer bar docked at the bottom ---------- */
#game.active { padding-bottom: 170px; }
.dock { display: none; position: fixed; left: 0; right: 0; bottom: var(--kb, 0px); z-index: 30;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, rgba(5,4,20,.75) 28%, rgba(5,4,20,.92));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
#game.active .dock { display: block; }
body[data-theme="daylight"] .dock { background: linear-gradient(180deg, transparent, rgba(255,255,255,.8) 28%, rgba(255,255,255,.95)); }
.dock-in { max-width: 640px; margin: 0 auto; }
.dock .answer { margin-top: 0; grid-template-columns: auto 1fr auto; }
.dock .btn.go { grid-column: auto; }
.dock .msg { margin: 0 0 6px; min-height: 0; } .dock .msg:empty { display: none; }
.dock .game-actions { margin-top: 8px; } .dock .game-actions .btn { flex: 1; }
.dock .answer.hide + .game-actions { margin-top: 0; }
.dock #btnNext { font-size: 1.15rem; padding: 15px; }
@media (max-width: 480px) { .dock .btn.go { padding: 14px 12px; font-size: .95rem; } .dock .timer { width: 46px; height: 46px; } .dock .answer input { padding: 13px 12px; } }

/* ---------- falling cards ---------- */
.drop { animation: dropIn .6s cubic-bezier(.25,1.45,.45,1); }
@keyframes dropIn { 0% { transform: translateY(-70vh) rotate(-3deg); opacity: 0 } 55% { opacity: 1 } 100% { transform: none } }
.reveal.on { animation: dropIn .55s cubic-bezier(.25,1.4,.45,1); }
.reveal.on .rv-lists li { animation: fallIn .45s cubic-bezier(.25,1.5,.5,1) both; }
.reveal.on .rv-lists li:nth-child(2) { animation-delay: .07s } .reveal.on .rv-lists li:nth-child(3) { animation-delay: .14s }
.reveal.on .rv-lists li:nth-child(4) { animation-delay: .21s } .reveal.on .rv-lists li:nth-child(5) { animation-delay: .28s }
@keyframes fallIn { from { transform: translateY(-40px); opacity: 0 } }
.grid-emoji .ge { display: inline-block; animation: geFall .5s cubic-bezier(.25,1.6,.5,1) both; }
@keyframes geFall { from { transform: translateY(-120px) rotate(-30deg); opacity: 0 } }
.res-score .bump, #resScore.bump { display: inline-block; animation: bump .4s cubic-bezier(.2,1.8,.4,1); }
@keyframes bump { 40% { transform: scale(1.25) } }

/* ---------- launch sequence overlay ---------- */
#flight { display: none; position: fixed; inset: 0; z-index: 55; place-items: center; cursor: pointer;
  background: radial-gradient(ellipse at 50% 110%, rgba(255,120,80,.25), transparent 55%), linear-gradient(180deg, #03021a 0%, #0d0b3a 55%, #1c3f8f 100%); }
#flight.on { display: grid; animation: flIn .2s ease; } #flight.out { animation: flOut .26s ease forwards; }
@keyframes flIn { from { opacity: 0 } } @keyframes flOut { to { opacity: 0; transform: scale(1.04) } }
.fl-shaft { --H: min(66vh, 540px); position: relative; height: var(--H); width: min(94vw, 520px); }
#flight.quake .fl-shaft { animation: quake .45s ease-out; }
@keyframes quake { 15% { transform: translate(-7px, 4px) } 30% { transform: translate(6px, -5px) } 45% { transform: translate(-4px, 3px) } 60% { transform: translate(3px, -2px) } 80% { transform: translate(-1px, 1px) } }
.fl-lv { position: absolute; left: 0; right: 0; bottom: calc((var(--k) + 1) * var(--H) / 7); display: grid; grid-template-columns: 108px 1fr 118px; align-items: center; gap: 8px; transform: translateY(50%); opacity: .45; transition: opacity .2s, transform .2s; }
.fl-name { font-family: "Lucky"; letter-spacing: 1.5px; font-size: .95rem; color: var(--c); text-align: right; }
.fl-place { font-size: .72rem; color: #b9b4e8; letter-spacing: .5px; }
.fl-line { height: 2px; background: repeating-linear-gradient(90deg, var(--c) 0 10px, transparent 10px 18px); opacity: .6; border-radius: 2px; }
.fl-lv.hit { opacity: 1; } .fl-lv.hit .fl-line { opacity: 1; background: var(--c); box-shadow: 0 0 14px var(--c); animation: zap .35s ease-out; }
@keyframes zap { from { transform: scaleX(.2) } }
.fl-lv.here { transform: translateY(50%) scale(1.06); } .fl-lv.here .fl-name { text-shadow: 0 0 16px var(--c); font-size: 1.1rem; }
.fl-pad { position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 50%); width: 150px; padding: 6px 0; text-align: center; font-size: .7rem; letter-spacing: 3px; color: #b9b4e8;
  border-top: 4px solid #6c66a8; border-radius: 4px; }
.fl-rocket { --y: 0; position: absolute; left: 50%; bottom: 0; width: 70px; margin-left: -35px; transform: translateY(calc(var(--y) * var(--H) / -7)); z-index: 2; }
.fl-body { position: relative; transform: translateY(-62%); }
.fl-body img { width: 70px; display: block; transform: rotate(-90deg); filter: drop-shadow(0 4px 0 rgba(0,0,0,.35)); }
.fl-fire { position: absolute; left: 50%; top: 88%; width: 22px; height: 30px; margin-left: -11px; border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%;
  background: radial-gradient(circle at 50% 30%, #fff 0 18%, #ffd23f 35%, #ff6b3d 70%, transparent 72%); opacity: 0; transform-origin: 50% 0; }
.fl-rocket.lit .fl-fire { opacity: 1; animation: fire .09s infinite alternate; }
.fl-rocket.moving .fl-fire { height: 52px; }
@keyframes fire { to { transform: scaleY(1.35) scaleX(.85) } }
.fl-trail { position: absolute; left: 50%; top: 10px; width: 6px; margin-left: -3px; height: 0; border-radius: 3px; background: linear-gradient(180deg, rgba(255,210,63,.9), rgba(255,255,255,.0)); transition: height .3s; }
.fl-rocket.moving .fl-trail { height: 220px; }
.fl-rocket.shake .fl-body { animation: rumble .06s infinite alternate; }
@keyframes rumble { from { transform: translate(-2px, -62%) } to { transform: translate(2px, -61%) } }
.fl-rocket.stall .fl-body { animation: stall .32s ease-in-out; }
@keyframes stall { 30% { transform: translateY(-62%) rotate(-14deg) } 70% { transform: translateY(-62%) rotate(12deg) } }
.fl-rocket.fall .fl-body { animation: tumble .76s linear forwards; }
@keyframes tumble { to { transform: translateY(-62%) rotate(540deg) } }
.fl-stamp { position: fixed; left: 50%; top: 22%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; opacity: 0; z-index: 3; }
.fl-stamp b { display: block; font-family: "Lucky"; font-size: clamp(2.6rem, 11vw, 4.6rem); letter-spacing: 3px; color: var(--c); line-height: 1;
  -webkit-text-stroke: 2px rgba(0,0,0,.45); text-shadow: 0 0 30px var(--c), 0 6px 0 rgba(0,0,0,.35); }
.fl-stamp span { display: block; margin-top: 6px; font-size: 1.2rem; color: #fff; }
.fl-stamp em { display: inline-block; margin-top: 8px; font-style: normal; font-family: "Lucky"; letter-spacing: 1px; padding: 4px 12px; border-radius: 12px; background: var(--c); color: #1b1035; }
.fl-stamp.on { animation: stampDrop .5s cubic-bezier(.3,1.6,.5,1) forwards; }
.fl-stamp.crooked { animation: stampCrooked 1s cubic-bezier(.3,1.5,.5,1) forwards; }
@keyframes stampDrop { 0% { opacity: 0; transform: translate(-50%, -160%) scale(1.8) rotate(-10deg) } 60% { opacity: 1 } 100% { opacity: 1; transform: translate(-50%, -50%) rotate(-3deg) } }
@keyframes stampCrooked { 0% { opacity: 0; transform: translate(-50%, -180%) rotate(0) } 40% { opacity: 1; transform: translate(-50%, -50%) rotate(0) } 60% { transform: translate(-50%, -46%) rotate(16deg) } 80% { transform: translate(-50%, -48%) rotate(9deg) } 100% { opacity: 1; transform: translate(-50%, -47%) rotate(12deg) } }
.fl-rays { position: absolute; inset: -50%; opacity: 0; pointer-events: none;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,210,63,.18) 0 8deg, transparent 8deg 20deg); }
#flight.rays .fl-rays { opacity: 1; animation: spin 6s linear infinite, flIn .4s ease; }
@keyframes spin { to { transform: rotate(360deg) } }
.fl-skip { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; font-size: .75rem; letter-spacing: 2px; color: #8d88c4; }
@media (max-width: 480px) { .fl-lv { grid-template-columns: 92px 1fr 96px; } .fl-name { font-size: .8rem; } .fl-place { font-size: .62rem; } }
.toast.top { bottom: auto; top: 76px; transform: translate(-50%, -20px); } .toast.top.on { transform: translate(-50%, 0); }
.heart { font-size: 1.15rem; color: #ff4f6e; text-shadow: 0 0 10px rgba(255,79,110,.6); transition: .3s; }
.heart.lost { color: var(--line); text-shadow: none; transform: scale(.8); filter: grayscale(1); }
.ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.ach div { display: grid; grid-template-columns: 34px 1fr; column-gap: 8px; align-items: center; padding: 8px; border-radius: 12px; border: 1px solid var(--line); opacity: .45; filter: grayscale(1); }
.ach div.got { opacity: 1; filter: none; border-color: var(--accent2); }
.ach i { grid-row: span 2; font-style: normal; font-size: 1.5rem; text-align: center; } .ach b { font-size: .85rem; } .ach small { font-size: .7rem; color: var(--mute); }
.install { display: block; margin: 14px auto 0; } .install.hide { display: none; }
/* ad offers (Android app only) */
.ad-offer { display: block; width: 100%; margin-top: 12px; background: linear-gradient(135deg, #ff4f8b, #ff8a3d); color: #fff; }
.ad-offer small, #btnHint small { opacity: .75; font-weight: 400; }
.bonus { position: fixed; inset: 0; z-index: 58; display: grid; place-items: center; background: rgba(5,4,20,.72); }
.bonus-card { width: min(88vw, 360px); padding: 22px; border-radius: 22px; text-align: center; background: var(--space); border: 2px solid var(--accent2); }
.bonus-card b:first-child { font-family: "Lucky"; font-size: 1.6rem; color: var(--accent2); letter-spacing: 1px; }
.bonus-n { color: var(--mute); }

/* ================= v1.1: brand, Dive/Launch, Hangar, new modes ================= */
:root { --t1: #fff6b0; --t2: #ffb400; --t3: #ff4f8b; }
.brand .b1 { font-size: 1.6rem; }
.brand .b1b { display: block; font-family: "Lucky"; font-size: .92rem; letter-spacing: 4px; color: var(--ink); margin-top: 1px; }
.brand .b2 { font-size: .62rem; margin-top: 4px; }
img.pixel { image-rendering: pixelated; }

/* Dive / Launch switch on the home screen */
.journey { display: inline-flex; gap: 4px; padding: 4px; margin-top: 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.journey button { border: none; background: transparent; padding: 9px 18px; border-radius: 12px; cursor: pointer; font-family: "Lucky"; letter-spacing: 1px; font-size: 1rem; color: var(--mute); }
.journey button.on { background: var(--accent2); color: var(--btn-ink); box-shadow: 0 3px 0 rgba(0,0,0,.3); }

/* home cards */
.mode.new { position: relative; }
.mode.new::after { content: "NEW"; position: absolute; top: -8px; right: 10px; padding: 2px 7px; border-radius: 8px; background: var(--accent2); color: var(--btn-ink); font-size: .62rem; font-weight: 700; letter-spacing: 1px; }
.mode.hangar { grid-column: 1 / -1; grid-template-columns: 54px 1fr auto; align-items: center; gap: 12px; }
.mode.hangar img { width: 54px; height: 44px; object-fit: contain; }
.mode.hangar > span { display: grid; gap: 2px; }
.coins { font-family: "Lucky"; letter-spacing: 1px; padding: 6px 10px; border-radius: 12px; background: rgba(0,0,0,.25); color: var(--accent2); white-space: nowrap; text-transform: capitalize; }
.coins.big { margin-left: auto; margin-right: 10px; font-size: 1.1rem; }

/* trail colours (Hangar) */
.flame { background: radial-gradient(var(--t1), var(--t2) 50%, var(--t3)); }
.fl-fire { background: radial-gradient(circle at 50% 30%, #fff 0 18%, var(--t1) 30%, var(--t2) 52%, var(--t3) 72%, transparent 74%); }
.fl-trail { background: linear-gradient(180deg, var(--t2), transparent); }

/* ---------- Dive: the krill sinks instead of climbing ---------- */
.fl-flip { display: block; }
#flight.dive .fl-flip { transform: scaleY(-1); }
#flight.dive .fl-name, #flight.dive .fl-place { transform: scaleY(-1); }
#flight.dive .fl-pad { transform: translate(-50%, 50%) scaleY(-1); border-top-color: #67e8ee; color: #bfe9ff; }
#flight.dive .fl-fire { width: 26px; height: 40px; margin-left: -13px; border-radius: 0; animation: none;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.95) 0 3px, transparent 4px), radial-gradient(circle at 70% 55%, var(--t1) 0 5px, transparent 6px),
    radial-gradient(circle at 38% 85%, rgba(255,255,255,.8) 0 4px, transparent 5px); }
#flight.dive .fl-rocket.lit .fl-fire { animation: bubbles .5s linear infinite; }
@keyframes bubbles { from { transform: translateY(0) } to { transform: translateY(8px) } }
#flight.dive .fl-trail { width: 10px; margin-left: -5px; background: radial-gradient(circle, var(--t1) 0 2.5px, transparent 3.5px) center top / 10px 14px repeat-y; opacity: .8; }
#flight.dive .fl-rays { background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(103,232,238,.16) 0 8deg, transparent 8deg 20deg); }

/* ---------- depth / altitude meter on phones ---------- */
@media (max-width: 760px) {
  #game.active { padding-right: 40px; }
  .track { display: block; left: auto; right: 22px; top: 118px; bottom: 200px; width: 6px; }
  .rocket { left: -17px; width: 40px; } .rocket img { width: 40px; }
  .flame { left: 12px; width: 14px; height: 18px; }
}
body.dive .track-fill { top: 0; bottom: auto; background: linear-gradient(180deg, var(--accent2), var(--accent)); transition: height 1s cubic-bezier(.2,.8,.2,1); }
body.dive .rocket { bottom: auto; top: calc(var(--alt) * (100% - 44px)); transition: top 1s cubic-bezier(.2,.8,.2,1); }
body.dive .rocket img { transform: rotate(90deg); }
body.dive .flame { bottom: auto; top: -12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff 0 25%, var(--t1) 40%, transparent 70%); }

/* ---------- Launch scenery: hill, pad and clouds that drop away as you climb ---------- */
#scenery { position: absolute; inset: 0; pointer-events: none; transform: translateY(calc(var(--alt) * 75vh)); opacity: calc(1 - var(--alt) * 1.3); transition: transform 1.2s ease, opacity 1.2s; }
body.dive #scenery, body[data-theme="contrast"] #scenery { display: none; }
.sc-hill { position: absolute; left: -15%; right: -15%; bottom: -14vh; height: 28vh; border-radius: 50% 50% 0 0; background: linear-gradient(#4bd38a, #1f8f5a); box-shadow: inset 0 6px 0 rgba(255,255,255,.18); }
body[data-theme="sunset"] .sc-hill { background: linear-gradient(#b8476d, #5a1d4f); }
.sc-pad { position: absolute; left: 50%; bottom: 13vh; width: 130px; height: 14px; margin-left: -65px; border-radius: 5px; background: #5a5f86; border-top: 4px solid #8f95c4; }
.sc-tower { position: absolute; left: calc(50% + 46px); bottom: calc(13vh + 14px); width: 12px; height: 16vh; border: 2px solid #c9cde8; background: repeating-linear-gradient(45deg, #c9cde8 0 4px, transparent 4px 9px); }
.sc-cloud { position: absolute; width: 120px; height: 38px; border-radius: 40px; background: rgba(255,255,255,.55); animation: drift 40s linear infinite alternate; }
.sc-cloud::before, .sc-cloud::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.sc-cloud::before { width: 54px; height: 54px; top: -26px; left: 18px; } .sc-cloud::after { width: 42px; height: 42px; top: -18px; left: 60px; }
.sc-cloud.c1 { left: 6%; bottom: 34vh; } .sc-cloud.c2 { right: 4%; bottom: 46vh; transform: scale(.7); animation-duration: 55s; } .sc-cloud.c3 { left: 30%; bottom: 60vh; transform: scale(.5); opacity: .7; animation-duration: 70s; }
@keyframes drift { to { translate: 40px 0; } }

/* ---------- results: challenge + stars ---------- */
.chal-box { margin: 10px 0; padding: 16px; border-radius: var(--r); background: var(--card); border: 2px solid var(--accent2); text-align: center; }
.chal-box .code { font-family: "Lucky"; font-size: 2.2rem; letter-spacing: 5px; margin: 4px 0; }
.btn.wide { display: block; width: 100%; }
.earned { text-align: center; margin: 10px 0; color: var(--accent2); }
.linkbtn { border: none; background: none; color: var(--ink); text-decoration: underline; cursor: pointer; padding: 0; }
.code-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.code-row span { font-family: "Lucky"; font-size: 1.3rem; letter-spacing: 2px; }
.code-row input { padding: 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-family: "Lucky"; font-size: 1.3rem; letter-spacing: 4px; text-transform: uppercase; min-width: 0; }
.pl-row.arch { align-items: center; gap: 10px; } .pl-row.arch span { flex: 1; } .pl-row.arch .btn { padding: 7px 12px; }
.rv-lists.one { grid-template-columns: 1fr; }

/* ---------- Hangar ---------- */
.hg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.hg { display: grid; justify-items: center; gap: 6px; padding: 12px 8px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); text-align: center; }
.hg.on { border-color: var(--accent2); }
.hg img { width: 72px; height: 64px; object-fit: contain; }
.trail-sw { display: block; width: 90%; height: 26px; margin: 19px 0; border-radius: 13px; background: linear-gradient(90deg, var(--c), var(--b) 55%, var(--a)); box-shadow: 0 0 14px var(--b); }
.hg .eq { font-size: .75rem; letter-spacing: 2px; color: #7dff9b; padding: 8px 0; }
.hg .lock { font-size: .8rem; color: var(--mute); padding: 8px 0; }

/* ---------- first-run tutorial ---------- */
.tut { position: fixed; inset: 0; z-index: 65; display: grid; place-items: center; background: rgba(5,4,20,.72); backdrop-filter: blur(4px); }
.tut-card { width: min(92vw, 400px); padding: 22px; border-radius: 24px; background: var(--space); border: 2px solid var(--line); text-align: center; animation: pop .4s cubic-bezier(.2,1.4,.4,1); }
.tut-card .hl { color: var(--accent); }
.tut-card h2 { margin: .3em 0; }
.tut-card p { color: var(--mute); line-height: 1.45; }
.tut-demo { text-align: left; padding: 12px; border-radius: 16px; background: var(--card); }
.tut-demo .pk { font-size: .7rem; letter-spacing: 3px; color: var(--accent); font-weight: 700; } .tut-demo .pq { font-family: "Lucky"; font-size: 1.4rem; margin: 2px 0 6px; }
.tut-demo .pl-row.hl2 { border-color: var(--accent2); }
.tut-big { font-family: "Lucky"; font-size: 3rem; color: var(--accent2); margin: 10px 0; }
.tut-modes { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; } .tut-modes span { padding: 7px 11px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: .9rem; }
.tut-dots { display: flex; justify-content: center; gap: 6px; margin: 12px 0 0; } .tut-dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--line); } .tut-dots i.on { width: 22px; background: var(--accent2); }

.rv-typed { opacity: .6; text-decoration: line-through; font-weight: 400; }

/* ================= v1.2: pixel-art look (assets/v2) ================= */
body[data-theme="deep-dive"] { --space: #2a1a0e; --ink: #3a2312; --mute: #7a5634; --card: #f6e6c0; --line: #c08a4e;
  --accent: #c8461f; --accent2: #1f8f86; --btn-ink: #fff8e6; --ocean-art: url("../assets/geo/zone_1.webp"); }
html body[data-theme="deep-dive"] #sky { background: linear-gradient(180deg, rgba(4,14,30,.30), rgba(4,14,30,.42) 60%, rgba(4,14,30,.18)), var(--ocean-art) center / cover no-repeat, var(--space); transition: background .8s; }
html body[data-theme="deep-dive"] #sky::before { opacity: 0; }
img[src*="assets/geo/"] { image-rendering: auto; }

/* splash */
#splash { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 10px;
  background: url("../assets/geo/splash_bg.webp") center / cover, #e9d3a3; transition: opacity .5s; }
#splash.gone { opacity: 0; pointer-events: none; }
#splash .sp-logo { width: min(78vw, 420px); filter: drop-shadow(0 6px 0 rgba(0,0,0,.25)); animation: pop .6s cubic-bezier(.2,1.4,.4,1); }
#splash .sp-krill { width: min(40vw, 200px); animation: bob 1.6s ease-in-out infinite; }
#splash .sp-bar { width: min(60vw, 260px); height: 14px; border-radius: 8px; background: #f4fbff; border: 3px solid #0b2540; overflow: hidden; }
#splash .sp-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #19c3d6, #3fe0ef); animation: load 1s ease-out forwards; }
#splash .sp-txt { font-family: "Lucky"; color: #fff; letter-spacing: 2px; text-shadow: 0 2px 0 #0b2540; }
@keyframes load { to { width: 100%; } }

/* header logo */
.brand .logo { display: block; height: 50px; margin: 0 auto -2px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.25)); }
.brand .b2 { display: block; text-align: center; }

/* home icons */
.mode .mi img { width: 46px; height: 46px; object-fit: contain; display: block; filter: drop-shadow(0 3px 0 rgba(0,0,0,.25)); }
.mode.hangar img { width: 54px; height: 54px; }
.btn .ib { width: 22px; height: 22px; vertical-align: -5px; }

/* prompt card: pixel sonar screen (rim only, solid centre so text stays sharp) */
.prompt-card { border-style: solid; border-width: 40px 24px 32px; border-image: url("../assets/geo/frame_map.webp") 125 72 92 fill / 40px 24px 32px stretch;
  background: none; box-shadow: none; padding: 6px 12px; margin-top: -6px; color: #3a2312; backdrop-filter: none; }
.prompt-card .pq { text-shadow: none; color: #3a2312; } .prompt-card .pk { color: #c8461f; } .prompt-card .ph { color: #7a5634; }

/* timer ring */
.timer { background: url("../assets/geo/timer_ring.webp") center / 100% 100% no-repeat; }
.timer .tbg { opacity: 0; }

/* tier badges + reveal krill */
.badge img { width: 26px; height: 26px; vertical-align: -8px; margin-right: 4px; }
.rv-krill { display: block; width: 110px; margin: -8px auto -6px; animation: pop .45s cubic-bezier(.2,1.4,.4,1); }

/* results: rays + chest + krill */
.res-art { position: relative; width: 150px; height: 140px; flex: none; }
.res-art .rays { position: absolute; left: 5px; top: 0; width: 140px; animation: spin 14s linear infinite; opacity: .55; }
.res-art .chest { position: absolute; left: 18px; bottom: -6px; width: 114px; }
.res-art .rk { position: absolute; left: 30px; top: -18px; width: 92px; animation: bob 1.8s ease-in-out infinite; }
.res-stage { display: inline-block; padding: 22px 46px 30px; background: url("../assets/geo/ribbon.webp") center / 100% 160% no-repeat; color: #4a2810; text-shadow: 0 1px 0 #fff3c9; }
@keyframes spin { to { transform: rotate(360deg); } }

/* packs + tutorial */
.pack img { width: 56px; height: 56px; object-fit: contain; display: block; margin: 0 auto 4px; }
.tut-krill { display: block; width: 120px; margin: -70px auto 0; filter: drop-shadow(0 4px 0 rgba(0,0,0,.3)); }
.tut-card { margin-top: 50px; }

/* ================= v1.2: Quiz Ladder, Sink or Swim, buddies (js/arcade.js) ================= */
#arcade { padding-bottom: 30px; }
.ar-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 10px; }
.ar-depth { font-family: "Lucky"; font-size: 1.6rem; color: var(--accent); text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.hearts i { font-style: normal; color: #ff4f6e; font-size: 1.2rem; margin-left: 2px; } .hearts i.off { color: rgba(255,255,255,.25); }
.ar-body { display: grid; grid-template-columns: 74px 1fr; gap: 10px; }
.ladder { display: flex; flex-direction: column; gap: 3px; }
.ladder .lr { display: flex; align-items: center; gap: 4px; font-size: .62rem; color: var(--mute); }
.ladder .lr b { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.35); border: 2px solid var(--line); color: var(--ink); font-size: .65rem; }
.ladder .lr.safe b { border-color: #7dff9b; } .ladder .lr.done b { background: #2bbf74; border-color: #7dff9b; }
.ladder .lr.now b { background: var(--accent2); color: var(--btn-ink); transform: scale(1.2); } .ladder .lr.now span { color: var(--ink); font-weight: 700; }
.ar-main { min-width: 0; } .ar-main.solo { max-width: 520px; margin: 0 auto; }
.ar-head { display: flex; align-items: center; gap: 8px; } .ar-krill { width: 76px; flex: none; }
.ar-qn { font-size: .7rem; letter-spacing: 2px; color: var(--accent2); font-weight: 700; } .ar-pack { font-size: .75rem; color: var(--mute); }
.ar-q { margin: 8px 0; padding: 14px; border-radius: 18px; background: #f4fbff; color: #0b2540; font-family: "Lucky"; font-size: 1.25rem; line-height: 1.2; border: 3px solid #0b2540; box-shadow: 0 4px 0 rgba(0,0,0,.3); }
.ar-q.big { font-size: 1.4rem; text-align: center; padding: 20px 16px; }
.ar-timer { height: 8px; border-radius: 4px; background: rgba(0,0,0,.35); overflow: hidden; margin-bottom: 10px; }
.ar-timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ffd23f, #ffb547); transition: width .1s linear; } .ar-timer i.low { background: #ff5a6e; }
.ar-opts { display: grid; gap: 8px; }
.ar-opt { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 13px 16px; border-radius: 26px; border: 3px solid #0b2540; background: linear-gradient(#2f8fe0, #1c63b8); color: #fff; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; box-shadow: inset 0 3px 0 rgba(255,255,255,.25), 0 4px 0 rgba(0,0,0,.3); text-align: left; }
.ar-opt em { font-style: normal; font-size: .75rem; opacity: .9; white-space: nowrap; }
.ar-opt.right { background: linear-gradient(#3fd18a, #1f9b5f); } .ar-opt.wrong { background: linear-gradient(#ff6f8e, #d43c5d); } .ar-opt.gone { visibility: hidden; }
.ar-help { display: flex; justify-content: center; gap: 14px; margin: 12px 0 6px; }
.ar-hb { display: grid; justify-items: center; gap: 2px; border: none; background: none; color: var(--ink); font: inherit; font-size: .7rem; cursor: pointer; }
.ar-hb img { width: 52px; height: 52px; } .ar-hb:disabled { opacity: .3; filter: grayscale(1); }
.ar-say { padding: 12px 14px; border-radius: 16px; margin: 8px 0; line-height: 1.4; border: 2px solid; } .ar-say b { margin-right: 4px; } .ar-say i { color: var(--accent); font-style: normal; font-weight: 700; }
.ar-say.ok { background: rgba(31,155,95,.25); border-color: #3fd18a; } .ar-say.no { background: rgba(212,60,93,.22); border-color: #ff6f8e; }
.ar-mini { width: 46px; vertical-align: middle; margin-right: 6px; }
.tf-stage { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin: 4px 0; } .tf-stage .ar-krill { width: 130px; } .tf-judge { width: 100px; }
.tf-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tf { padding: 14px 6px; border-radius: 22px; border: 3px solid #0b2540; color: #fff; font-family: "Lucky"; font-size: 1.5rem; letter-spacing: 1px; cursor: pointer; box-shadow: inset 0 3px 0 rgba(255,255,255,.25), 0 5px 0 rgba(0,0,0,.3); }
.tf small { display: block; font-family: inherit; font-size: .7rem; letter-spacing: 0; opacity: .9; font-family: system-ui; }
.tf.swim { background: linear-gradient(#3fd18a, #1f9b5f); } .tf.sink { background: linear-gradient(#ff6f8e, #d43c5d); }
.ar-end { text-align: center; padding: 20px 16px; } .ar-end .res-art { margin: 0 auto 6px; }
.ar-big { font-family: "Lucky"; font-size: 3rem; color: var(--accent); margin: 8px 0 0; } .ar-best { color: #7dff9b; font-weight: 700; letter-spacing: 2px; }
.ar-end .row { justify-content: center; margin: 12px 0 8px; }
/* buddies on home */
.buddies { margin: 14px 0 4px; padding: 12px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.bd-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; } .bd-head small { color: var(--mute); font-size: .72rem; }
.bd-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 8px; }
.bd { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 14px; border: 2px solid transparent; background: rgba(0,0,0,.2); color: var(--ink); font: inherit; font-size: .58rem; cursor: pointer; }
.bd img { width: 44px; height: 44px; object-fit: contain; } .bd.on { border-color: var(--accent2); } .bd.lock img { filter: brightness(0) opacity(.45); } .bd.lock { color: var(--mute); cursor: default; }
.hero { position: relative; } .pal { position: absolute; width: 74px; left: calc(50% + 50px); top: 40px; animation: bob 2.2s ease-in-out infinite reverse; }

/* pixel-art skins stay crisp when scaled */
img[src*="neon-krill"] { image-rendering: pixelated; }

/* website only: link to the Android app (hidden inside the app) */
.play-link { display: inline-block; margin: 12px auto 0; text-decoration: none; background: #ffd23f; color: #0b1a33; }
body.in-app .play-link { display: none; }
