/* Noggin Dash. Candy-bright, chunky, mobile first. All art slots have built-in fallbacks (see ng-art.js). */
:root {
  --bg1: #2a1470; --bg2: #5a2bb8; --bg3: #ff4d8d;
  --ink: #fff; --ink-dim: #d9ccff;
  --yellow: #ffd23f; --pink: #ff4d8d; --cyan: #35c2ff; --green: #4cd964; --red: #ff5a5f; --purple: #9b5de5; --orange: #ff9f1c;
  --panel: rgba(20, 8, 64, .55);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Avenir Next Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --speed: 1;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg1); color: var(--ink); font-family: var(--font); font-weight: 700; overscroll-behavior: none; }
body { touch-action: manipulation; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
.hidden { display: none !important; }
.bg { position: fixed; inset: 0; background: radial-gradient(120% 90% at 50% 0%, var(--bg2), var(--bg1) 70%); z-index: -1; overflow: hidden; }
.bg::before, .bg::after { content: ""; position: absolute; inset: -20%; background-image: radial-gradient(circle, rgba(255,255,255,.12) 2px, transparent 3px); background-size: 46px 46px; animation: drift 24s linear infinite; }
.bg::after { background-size: 90px 90px; opacity: .6; animation-duration: 40s; animation-direction: reverse; }
.bg-art { position: absolute; inset: 0; background: url(assets/art/bg-pattern.webp) center/cover; opacity: .55; mix-blend-mode: screen; }
.logo .art { width: min(88vw, 400px); aspect-ratio: 3 / 2; height: auto; }
.logo .art.has-img > :first-child { display: none; }
.logo .art > img { opacity: 1; position: static; }
@keyframes drift { to { transform: translate(46px, 46px); } }

#app { min-height: 100dvh; display: grid; }
.screen { width: min(100%, 560px); margin: 0 auto; padding: calc(var(--safe-t) + 12px) 16px calc(var(--safe-b) + 16px); min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- buttons ---------- */
.btn { --c: var(--yellow); --cd: #d9a100; background: var(--c); color: #2a1470; border-radius: 22px; padding: 14px 22px; min-height: 52px; font-size: 18px; font-weight: 900; letter-spacing: .02em; box-shadow: 0 6px 0 var(--cd), 0 12px 22px rgba(0,0,0,.28); transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--cd), 0 3px 8px rgba(0,0,0,.3); }
.btn.big { font-size: 28px; padding: 18px 30px; min-height: 72px; border-radius: 28px; animation: bob 2.4s ease-in-out infinite; }
.btn.alt { --c: var(--cyan); --cd: #1488b8; }
.btn.ghost { --c: rgba(255,255,255,.16); --cd: rgba(0,0,0,.25); color: #fff; }
.btn.small { font-size: 14px; min-height: 44px; padding: 8px 14px; }
.btn:disabled { filter: grayscale(.8); opacity: .6; animation: none; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.link { background: none; color: var(--ink-dim); text-decoration: underline; padding: 12px; min-height: 44px; font-size: 15px; }
.icon-btn { width: 46px; height: 46px; border-radius: 16px; background: rgba(255,255,255,.14); font-size: 18px; display: grid; place-items: center; }
.back { color: var(--ink-dim); text-decoration: none; background: none; font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- title ---------- */
.topline { display: flex; justify-content: space-between; align-items: center; }
.title { align-items: center; text-align: center; gap: 6px; }
.title .topline { width: 100%; }
.hero { position: relative; width: min(46vw, 210px); aspect-ratio: 1; margin: 4px auto 0; border-radius: 50%; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.28), rgba(255,255,255,.04) 70%); box-shadow: 0 0 0 5px rgba(255,255,255,.14); overflow: hidden; }
.logo { margin: 4px 0 0; line-height: .92; }
.logo small { display: block; margin-top: 8px; font-size: 15px; font-weight: 700; color: var(--ink-dim); letter-spacing: .01em; }
.art { position: relative; display: inline-block; }
.art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; opacity: 0; }
.art.has-img > img { opacity: 1; }
.art.has-img > :first-child { visibility: hidden; }
.logo-fb { display: inline-flex; flex-direction: column; font-size: clamp(54px, 17vw, 84px); font-weight: 900; font-style: normal; transform: rotate(-3deg); }
.logo-fb i { font-style: normal; color: var(--yellow); text-shadow: 0 5px 0 #b57a00, 0 10px 0 rgba(0,0,0,.25); -webkit-text-stroke: 3px #2a1470; paint-order: stroke fill; }
.logo-fb i:last-child { color: var(--pink); text-shadow: 0 5px 0 #a2175a, 0 10px 0 rgba(0,0,0,.25); margin-left: 24px; }
.who { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 22px 0 4px; }
.chip { background: rgba(255,255,255,.14); border-radius: 999px; padding: 8px 16px; min-height: 44px; font-size: 15px; font-weight: 800; }
.chip.on { background: var(--yellow); color: #2a1470; }
.chip.add { background: transparent; border: 2px dashed rgba(255,255,255,.4); }
.newp { display: flex; gap: 10px; align-items: end; justify-content: center; margin: 8px 0; }
.newp label { display: grid; gap: 4px; text-align: left; font-size: 13px; color: var(--ink-dim); }
.newp input { font: inherit; font-size: 18px; font-weight: 800; padding: 12px 14px; border-radius: 16px; border: 3px solid rgba(255,255,255,.25); background: rgba(0,0,0,.25); color: #fff; width: 190px; min-height: 52px; }
.menu { display: grid; gap: 14px; margin-top: auto; padding-top: 14px; width: 100%; }
.record { color: var(--ink-dim); font-size: 14px; margin: 10px 0 0; min-height: 20px; }

/* ---------- stage ---------- */
.stage { position: relative; padding-bottom: calc(var(--safe-b) + 8px); transition: background .6s; }
.stage[data-mode=rush]::before, .stage[data-tier]::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; transition: background .6s; }
.stage[data-tier="1"]::before { background: radial-gradient(100% 70% at 50% 100%, rgba(255,159,28,.35), transparent); }
.stage[data-tier="2"]::before { background: radial-gradient(100% 70% at 50% 100%, rgba(255,77,141,.4), transparent); }
.stage[data-tier="3"]::before { background: radial-gradient(100% 70% at 50% 100%, rgba(255,90,95,.5), transparent); }
.stage[data-tier="4"]::before { background: radial-gradient(100% 70% at 50% 100%, rgba(155,93,229,.55), transparent); }
.stage[data-tier="5"]::before { background: radial-gradient(100% 70% at 50% 100%, rgba(53,194,255,.5), transparent); }
.hud { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 8px; }
.hud-right { display: flex; gap: 8px; align-items: baseline; justify-content: flex-end; min-width: 46px; font-weight: 900; }
.hud-right .score { font-size: 26px; color: var(--yellow); text-shadow: 0 2px 0 rgba(0,0,0,.3); font-variant-numeric: tabular-nums; }
.hud-right .spd { font-size: 14px; background: var(--pink); padding: 3px 9px; border-radius: 999px; }
.tag { font-size: 13px; background: rgba(255,255,255,.16); padding: 5px 12px; border-radius: 999px; letter-spacing: .06em; text-transform: uppercase; }
.pips { display: flex; gap: 6px; justify-content: center; }
.pips i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.22); transition: transform .2s, background .2s; }
.pips i.done { background: var(--green); }
.pips i.now { background: var(--yellow); transform: scale(1.35); }
.lives { display: flex; gap: 4px; justify-content: center; font-size: 28px; line-height: 1; }
.lives i { font-style: normal; color: var(--red); text-shadow: 0 2px 0 rgba(0,0,0,.35); transition: transform .3s, opacity .3s, filter .3s; }
.lives i.lost { opacity: .25; filter: grayscale(1); transform: scale(.7) rotate(-14deg); }
.fusebar { height: 16px; border-radius: 10px; background: rgba(0,0,0,.3); margin: 10px 2px 6px; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,.35); opacity: .5; transition: opacity .2s; }
.fusebar.lit { opacity: 1; }
.fusebar i { display: block; height: 100%; transform-origin: left center; background: linear-gradient(90deg, var(--red), var(--orange) 40%, var(--yellow)); border-radius: 10px; transform: scaleX(0); }
.say { text-align: center; font-size: clamp(22px, 6.4vw, 30px); font-weight: 900; min-height: 40px; margin: 4px 0; text-shadow: 0 3px 0 rgba(0,0,0,.3); }
.say.pulse { animation: pop-say .28s ease-out; }
@keyframes pop-say { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.arena { position: relative; width: min(100%, 460px, 58dvh); aspect-ratio: 1; margin: auto; flex: none; display: grid; }
.arena > div { min-height: 0; }
.host { position: absolute; left: 6px; bottom: calc(var(--safe-b) + 4px); width: clamp(72px, 22vw, 112px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.3), rgba(255,255,255,.05) 70%); box-shadow: 0 0 0 4px rgba(255,255,255,.18); pointer-events: none; }
.stage.shake { animation: shake .4s; }
@keyframes shake { 20% { transform: translate(-7px, 3px) rotate(-.6deg); } 40% { transform: translate(7px, -3px) rotate(.6deg); } 60% { transform: translate(-5px, 2px); } 80% { transform: translate(4px, -2px); } }

/* splash + stamp */
.splash { position: absolute; inset: 0; z-index: 20; display: grid; place-content: center; text-align: center; padding: 20px; background: radial-gradient(circle, rgba(42,20,112,.5), rgba(42,20,112,.9)); gap: 10px; }
.splash b { font-size: clamp(46px, 15vw, 84px); line-height: .95; font-weight: 900; color: var(--yellow); -webkit-text-stroke: 3px #2a1470; paint-order: stroke fill; text-shadow: 0 6px 0 #b57a00, 0 12px 0 rgba(0,0,0,.25); transform: rotate(-3deg); }
.splash small { font-size: 18px; color: var(--ink); font-weight: 700; max-width: 22em; margin: 0 auto; }
.splash.in b { animation: slam .34s cubic-bezier(.2, 1.6, .4, 1) both; }
.splash.in small { animation: fade-up .4s .15s both; }
.splash.out { opacity: 0; transition: opacity .15s; }
@keyframes slam { from { transform: scale(2.6) rotate(8deg); opacity: 0; } to { transform: scale(1) rotate(-3deg); opacity: 1; } }
@keyframes fade-up { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.stamp { position: absolute; left: 50%; top: 42%; z-index: 15; transform: translate(-50%, -50%) rotate(-8deg) scale(.4); font-size: clamp(54px, 18vw, 96px); font-weight: 900; padding: 4px 22px; border-radius: 22px; border: 8px solid; opacity: 0; pointer-events: none; text-shadow: 0 4px 0 rgba(0,0,0,.25); background: rgba(255,255,255,.12); }
.stamp.ok { color: var(--green); border-color: var(--green); }
.stamp.no { color: var(--red); border-color: var(--red); }
.stamp.in { animation: stamp-in .5s cubic-bezier(.2, 1.7, .4, 1) forwards; }
@keyframes stamp-in { 0% { transform: translate(-50%, -50%) rotate(-20deg) scale(2.4); opacity: 0; } 60% { opacity: 1; } 100% { transform: translate(-50%, -50%) rotate(-8deg) scale(1); opacity: 1; } }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.confetti i { position: absolute; top: 55%; width: 10px; height: 16px; border-radius: 3px; animation: confetti 1.2s cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes confetti { to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }

/* art slots inside games */
.sym { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 22%; background: var(--sc); box-shadow: inset 0 -6px 0 rgba(0,0,0,.18), inset 0 4px 0 rgba(255,255,255,.35); }
.sym b { font-size: clamp(26px, 9vw, 48px); line-height: 1; font-weight: 400; filter: drop-shadow(0 2px 0 rgba(0,0,0,.2)); }
.art.big { width: clamp(90px, 28vw, 140px); aspect-ratio: 1; }
.art.pop { animation: pop-in .18s ease-out; }
.art { width: 100%; height: 100%; }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.pop-in { animation: pop-in .22s ease-out both; }
.hit { outline: 5px solid var(--green) !important; outline-offset: -2px; animation: hit .4s; }
.miss { outline: 5px solid var(--red) !important; outline-offset: -2px; animation: shakex .35s; }
@keyframes hit { 50% { transform: scale(1.1); } }
@keyframes shakex { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.shake { animation: shakex .3s; }

/* FLASH */
.g-flash { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 12px; align-content: center; padding: 6px; }
.card { perspective: 700px; aspect-ratio: 1; background: none; padding: 0; border-radius: 22px; }
.card-in { display: block; position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.3, 1.3, .5, 1); transform: rotateY(180deg); }
.card.up .card-in { transform: rotateY(0); }
.card .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 22px; overflow: hidden; display: block; }
.card .front { background: #fff8e1; padding: 8%; box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.card .back { transform: rotateY(180deg); background: repeating-linear-gradient(45deg, #ff4d8d 0 10px, #ff7aa9 10px 20px); box-shadow: 0 6px 0 #a2175a; display: grid; place-items: center; }
.card .back i { width: 40%; aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: inset 0 0 0 6px #ff4d8d; }
.card:active:not(:disabled) .card-in { transform: rotateY(180deg) scale(.94); }
.g-flashwrap { display: grid; grid-template-rows: 92px 1fr; align-content: center; }
.g-prompt { display: grid; place-items: center; pointer-events: none; }
.g-prompt .ask { display: block; width: 78px; height: 78px; background: #fff; border-radius: 22px; padding: 6px; box-shadow: 0 6px 0 rgba(0,0,0,.25), 0 0 0 5px var(--yellow); animation: bob 1.2s ease-in-out infinite; }
.g-prompt .art.big { width: 100%; }

/* ODD */
.g-odd { display: grid; grid-template-columns: repeat(var(--g), 1fr); gap: 10px; align-content: center; padding: 4px; }
.g-odd .cell { aspect-ratio: 1; border-radius: 22px; background: rgba(255,255,255,.12); box-shadow: inset 0 -5px 0 rgba(0,0,0,.2); display: grid; place-items: center; padding: 14%; }
.g-odd .cell:active:not(:disabled) { transform: scale(.92); }
.ring { width: 100%; height: 100%; }

/* SYMBOL */
.g-symbol { display: grid; grid-template-rows: auto 1fr auto auto; gap: 10px; justify-items: center; }
.g-symbol .key { display: flex; gap: 10px; background: rgba(0,0,0,.25); padding: 8px 12px; border-radius: 20px; }
.key-it { display: grid; justify-items: center; gap: 2px; width: clamp(48px, 14vw, 66px); }
.key-it .art { width: 100%; aspect-ratio: 1; height: auto; }
.key-it b { font-size: 22px; color: var(--yellow); }
.g-symbol .now { align-self: center; width: clamp(110px, 36vw, 170px); aspect-ratio: 1; background: #fff8e1; border-radius: 30px; padding: 12px; box-shadow: 0 8px 0 rgba(0,0,0,.25); }
.g-symbol .now .art { width: 100%; height: 100%; }
.dots { display: flex; gap: 6px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.25); }
.dots i.ok, .dots i.on { background: var(--green); }
.dots i.no { background: var(--red); }
.dots i.on { background: var(--yellow); transform: scale(1.3); }
.digits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; }
.digit { min-height: 64px; border-radius: 20px; font-size: 32px; font-weight: 900; background: var(--cyan); color: #2a1470; box-shadow: 0 6px 0 #1488b8; }
.digit:active { transform: translateY(5px); box-shadow: 0 1px 0 #1488b8; }

/* SIMON */
.g-simon { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 6px; }
.pad { position: relative; border-radius: 28px; padding: 0; box-shadow: 0 8px 0 rgba(0,0,0,.3); overflow: hidden; transition: transform .08s, filter .1s; }
.pad .art { position: absolute; inset: 0; }
.pad .pad-fill { position: absolute; inset: 0; }
.pad.red { background: #ff4d5e; } .pad.blue { background: #3b8df0; } .pad.green { background: #35bd72; } .pad.yellow { background: #ffd23f; }
.pad .art img { object-fit: cover; transform: scale(1.24); } /* crops the frame baked into the generated art */
.pad { filter: brightness(.86) saturate(.95); }
.pad.lit { filter: brightness(1.25) saturate(1.2); transform: scale(1.05); box-shadow: 0 0 40px 8px rgba(255,255,255,.65), 0 8px 0 rgba(0,0,0,.3); }
.pad:active:not(:disabled) { filter: brightness(1.2); transform: scale(.96); }
.pad:disabled { cursor: default; }

/* TRAIL */
.g-trail { position: relative; background: rgba(0,0,0,.2); border-radius: 26px; box-shadow: inset 0 0 0 3px rgba(255,255,255,.14); }
.trail-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.trail-line polyline { stroke: var(--yellow); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-width: 5px; opacity: .85; }
.dot { position: absolute; width: clamp(44px, 12.5vw, 60px); aspect-ratio: 1; margin: calc(clamp(44px, 12.5vw, 60px) / -2) 0 0 calc(clamp(44px, 12.5vw, 60px) / -2); border-radius: 50%; background: var(--pink); color: #fff; font-size: 24px; font-weight: 900; box-shadow: 0 5px 0 #a2175a; animation: pop-in .26s var(--d) both; }
.dot.got { background: var(--green); box-shadow: 0 5px 0 #1f8f44; opacity: .75; transform: scale(.85); }
.dot:active:not(:disabled) { transform: scale(.9); }

/* NAMES */
.g-names { display: grid; grid-template-rows: 1fr auto; gap: 12px; justify-items: center; align-items: center; }
.portrait { width: min(60%, 250px); aspect-ratio: 4/5; background: radial-gradient(circle at 50% 35%, #fff 0, #ffe9a8 60%, #ffd23f); border-radius: 36px; overflow: hidden; box-shadow: 0 8px 0 rgba(0,0,0,.25), 0 0 0 6px rgba(255,255,255,.35); animation: pop-in .35s cubic-bezier(.2, 1.5, .4, 1); }
.portrait .art, .face-fb { width: 100%; height: 100%; display: block; }
.nameplate { display: grid; justify-items: center; background: #fff; color: #2a1470; padding: 8px 34px 12px; border-radius: 20px; box-shadow: 0 6px 0 rgba(0,0,0,.25); transform: rotate(-2deg); animation: fade-up .4s .15s both; }
.nameplate small { font-size: 14px; color: #8a7fb0; letter-spacing: .08em; text-transform: uppercase; }
.nameplate b { font-size: 40px; line-height: 1; font-weight: 900; }
.g-names.learn .dots { grid-row: 3; }
.opts { display: grid; gap: 10px; width: 100%; }
.opt { min-height: 60px; border-radius: 20px; background: var(--yellow); color: #2a1470; font-size: 26px; font-weight: 900; box-shadow: 0 6px 0 #d9a100; }
.opt:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 #d9a100; }
.opt.hit { background: var(--green); animation: none; outline: none !important; }
.opts { padding: 0 6px; }
.opt.miss { background: var(--red); }

/* ---------- results ---------- */
.result { align-items: center; text-align: center; gap: 10px; }
.res-host { width: min(34vw, 150px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; position: relative; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.3), rgba(255,255,255,.05)); box-shadow: 0 0 0 5px rgba(255,255,255,.18); flex: none; }
.res-card { background: var(--panel); border-radius: 28px; padding: 16px 18px 18px; width: 100%; }
.res-card h2 { margin: 0; font-size: 34px; color: var(--yellow); text-shadow: 0 3px 0 rgba(0,0,0,.3); }
.kicker { margin: 0; color: var(--ink-dim); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.bigscore b { font-size: 64px; line-height: 1; display: block; color: #fff; text-shadow: 0 5px 0 var(--pink); animation: slam .5s both; }
.bigscore small { color: var(--ink-dim); font-size: 15px; }
.newbest { color: #2a1470; background: var(--yellow); border-radius: 999px; padding: 2px 10px; margin-left: 4px; animation: bob 1s infinite; display: inline-block; }
.facts { display: flex; justify-content: center; gap: 20px; margin: 10px 0; }
.facts div { display: grid; }
.facts b { font-size: 26px; } .facts small { color: var(--ink-dim); font-size: 13px; }
.bars { display: grid; gap: 7px; margin-top: 8px; }
.bar { display: grid; grid-template-columns: 112px 1fr 34px; gap: 8px; align-items: center; font-size: 14px; text-align: left; }
.bar div { height: 12px; border-radius: 8px; background: rgba(0,0,0,.3); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--cyan), var(--green)); border-radius: 8px; animation: grow .9s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes grow { from { width: 0; } }
.micro { font-size: 12.5px; color: var(--ink-dim); margin: 12px 0 0; font-weight: 600; line-height: 1.4; }

/* ---------- trends ---------- */
.trends h2 { margin: 6px 0; font-size: 30px; }
.over { background: var(--panel); border-radius: 22px; padding: 14px 16px; margin: 10px 0; border-left: 8px solid var(--cyan); }
.over p { margin: 4px 0 0; font-weight: 600; line-height: 1.45; }
.over.steady, .over.up { border-color: var(--green); }
.over.down { border-color: var(--orange); }
.over.watch { border-color: var(--red); }
.tgrid { display: grid; gap: 12px; }
.tcard { background: var(--panel); border-radius: 22px; padding: 12px 16px 14px; color: var(--cyan); }
.tcard.up { color: var(--green); } .tcard.down { color: var(--orange); }
.tcard header { display: flex; justify-content: space-between; align-items: baseline; color: #fff; }
.tcard h3 { margin: 0; font-size: 19px; }
.tcard header b { font-size: 26px; }
.tcard .blurb { margin: 0 0 4px; font-size: 13px; color: var(--ink-dim); font-weight: 600; }
.spark { width: 100%; height: 64px; display: block; }
.tcard .status { margin: 4px 0 0; font-size: 14px; color: #fff; font-weight: 700; }
.empty { color: var(--ink-dim); font-size: 14px; margin: 10px 0; }
.tfoot p, .disc { font-size: 13px; color: var(--ink-dim); font-weight: 600; line-height: 1.45; margin: 12px 2px; }
.disc { border-top: 1px solid rgba(255,255,255,.15); padding-top: 12px; }

/* ---------- challenge + family board ---------- */
.btn.alt.pink { --c: var(--pink); --cd: #a2175a; color: #fff; }
.btn.pinkb { --c: var(--pink); --cd: #a2175a; color: #fff; }
.chal { background: linear-gradient(135deg, var(--pink), var(--purple)); border-radius: 22px; padding: 12px 16px; margin: 10px 0 0; text-align: center; box-shadow: 0 5px 0 rgba(0,0,0,.25); animation: bob 2.4s ease-in-out infinite; }
.chal b { display: block; font-size: 18px; } .chal small { font-size: 13px; opacity: .9; }
.row .link { padding: 8px 12px; }
.res-card .post { margin: 6px 0 2px; min-height: 18px; font-size: 14px; color: var(--yellow); font-weight: 700; }
.res-card .post .link { color: var(--ink-dim); }
.board h2 { margin: 6px 0 0; font-size: 30px; }
.sub { color: var(--ink-dim); font-size: 14px; font-weight: 600; margin: 4px 0 10px; line-height: 1.4; }
.joinbox { background: var(--panel); border-radius: 22px; padding: 14px 16px; margin-bottom: 12px; display: grid; gap: 8px; }
.joinbox p { margin: 0; font-weight: 600; line-height: 1.4; }
.joinbox label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-dim); }
.joinbox input { font: inherit; font-size: 18px; font-weight: 800; padding: 12px 14px; border-radius: 16px; border: 3px solid rgba(255,255,255,.25); background: rgba(0,0,0,.25); color: #fff; min-height: 52px; width: 100%; }
.err { color: var(--bad, #ff8f84); min-height: 18px; font-size: 14px; }
.blist { display: grid; gap: 10px; }
.brow { display: grid; grid-template-columns: 30px 52px 1fr; grid-template-areas: "rk av main" "act act act"; gap: 6px 10px; align-items: center; background: var(--panel); border-radius: 22px; padding: 12px; }
.brow.me { box-shadow: 0 0 0 3px var(--cyan); }
.brow.lead { background: linear-gradient(135deg, rgba(255,210,63,.25), var(--panel)); }
.rk { grid-area: rk; font-size: 20px; font-weight: 900; text-align: center; color: var(--ink-dim); }
.bav { grid-area: av; position: relative; width: 52px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: rgba(255,255,255,.14); }
.bav .init { display: grid; place-items: center; height: 100%; font-size: 24px; font-weight: 900; }
.bmain { grid-area: main; min-width: 0; }
.bn { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bn b { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn span { font-size: 22px; font-weight: 900; color: var(--yellow); font-variant-numeric: tabular-nums; }
.bbar { height: 12px; border-radius: 8px; background: rgba(0,0,0,.3); overflow: hidden; margin: 5px 0 3px; }
.bbar i { display: block; height: 100%; width: var(--w); border-radius: 8px; background: linear-gradient(90deg, var(--cyan), var(--green)); animation: grow .9s cubic-bezier(.2, .9, .3, 1) both; }
.lead .bbar i { background: linear-gradient(90deg, var(--orange), var(--yellow)); }
.bmain small { font-size: 12.5px; color: var(--ink-dim); font-weight: 600; }
.bact { grid-area: act; display: flex; gap: 8px; justify-content: flex-end; }
.mini { background: var(--pink); color: #fff; border-radius: 14px; padding: 8px 14px; min-height: 44px; font-size: 14px; font-weight: 800; box-shadow: 0 4px 0 #a2175a; }
.mini.ghost { background: rgba(255,255,255,.16); box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.mini:active { transform: translateY(3px); box-shadow: none; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(15, 5, 50, .85); display: grid; place-items: center; padding: 20px; }
.sheet { background: #3a1c8c; border-radius: 30px; padding: 22px 20px; width: min(100%, 440px); display: grid; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 4px rgba(255,255,255,.15); }
.sheet h2 { margin: 0; text-align: center; font-size: 30px; color: var(--yellow); }
.how { margin: 0; padding-left: 22px; display: grid; gap: 10px; font-weight: 600; line-height: 1.45; }
.how b { color: var(--yellow); }

@media (max-height: 640px) { .hero, .res-host { display: none; } .arena { width: min(100%, 460px, 52dvh); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .bg::before, .bg::after { animation: none; }
}
