/* Shuttlepals
   Layout: a painted meadow sky sits behind everything; the app floats on rounded paper cards,
   one hash-routed view at a time, with a sticky top bar (desktop) or a bottom tab bar (phone).
   Day is a watercolour afternoon; Dusk is a lantern-lit evening. Rank art escalates by tier. */

:root {
  color-scheme: light;
  --bg: #FBF1E3;
  --paper: #FFFAF3;
  --paper-2: #FBEEDD;
  --paper-3: #F3E2CC;
  --ink: #4A2E1F;
  --ink-2: #7A5A47;
  --ink-3: #A98B77;
  --line: rgba(91, 58, 38, .14);
  --choc: #5B3A26;
  --caramel: #AD744C;
  --caramel-2: #C98D62;
  --cream: #F2D8BE;
  --honey: #F3C77A;
  --accent: #AD744C;
  --accent-ink: #FFF6EA;
  --btn-shadow: #7A4C2E;
  --sky-top: #B5DBF4;
  --sky-mid: #DCEBF3;
  --sky-bot: #FBE6CF;
  --sun: #FFD98A;
  --sun-glow: rgba(255, 217, 138, .8);
  --hill-1: #CBE3B3;
  --hill-2: #A9D194;
  --hill-3: #86B978;
  --grass: #6FA862;
  --blossom: #F7B6C6;
  --lavender: #D9CCF2;
  --mint: #BFE9D4;
  --sky: #BFE3F5;
  --meadow: #B9DDA6;
  --good: #3F8F5F;
  --warn: #C98A1E;
  --bad: #C9584D;
  --info: #4F82C9;
  --good-bg: rgba(78, 159, 109, .16);
  --warn-bg: rgba(217, 154, 43, .18);
  --bad-bg: rgba(212, 101, 90, .16);
  --info-bg: rgba(90, 143, 214, .16);
  --shadow: 0 14px 34px -14px rgba(91, 58, 38, .35), 0 2px 6px rgba(91, 58, 38, .08);
  --shadow-sm: 0 6px 16px -8px rgba(91, 58, 38, .35);
  --glass: rgba(255, 250, 243, .82);
  --court: #5BA572;
  --court-2: #4F9565;
  --court-line: #FFFDF6;
  --lamp: 0;
  --r-xl: 32px;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 10px;
  --font-display: 'Baloo Bhaijaan 2', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-script: 'Oleo Script', 'Baloo Bhaijaan 2', cursive;
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1B2134; --paper: #272E45; --paper-2: #313A55; --paper-3: #3B4664;
    --ink: #F6EBDB; --ink-2: #D2C3AE; --ink-3: #9B8E7E; --line: rgba(246, 235, 219, .14);
    --choc: #F2D8BE; --caramel: #E0A472; --caramel-2: #F0BD8E; --cream: #F6E3CC; --honey: #FFD98A;
    --accent: #E0A472; --accent-ink: #2A1A10; --btn-shadow: #8E5F3A;
    --sky-top: #0F1530; --sky-mid: #283257; --sky-bot: #4A4370; --sun: #FFF1C9; --sun-glow: rgba(255, 241, 201, .5);
    --hill-1: #2E4A4E; --hill-2: #253D3F; --hill-3: #1C3031; --grass: #2F5047;
    --blossom: #D98BA3; --lavender: #8F7FC8; --mint: #6FB29A; --sky: #5E7FB5; --meadow: #5F9A6E;
    --good: #6BC08A; --warn: #F0B454; --bad: #F08578; --info: #86AEF0;
    --good-bg: rgba(107, 192, 138, .18); --warn-bg: rgba(240, 180, 84, .18); --bad-bg: rgba(240, 133, 120, .18); --info-bg: rgba(134, 174, 240, .18);
    --shadow: 0 18px 40px -16px rgba(0, 0, 0, .65), 0 2px 6px rgba(0, 0, 0, .3); --shadow-sm: 0 6px 16px -8px rgba(0, 0, 0, .6);
    --glass: rgba(39, 46, 69, .84); --court: #3E7F58; --court-2: #35704D; --court-line: #F6EBDB; --lamp: 1;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1B2134; --paper: #272E45; --paper-2: #313A55; --paper-3: #3B4664;
  --ink: #F6EBDB; --ink-2: #D2C3AE; --ink-3: #9B8E7E; --line: rgba(246, 235, 219, .14);
  --choc: #F2D8BE; --caramel: #E0A472; --caramel-2: #F0BD8E; --cream: #F6E3CC; --honey: #FFD98A;
  --accent: #E0A472; --accent-ink: #2A1A10; --btn-shadow: #8E5F3A;
  --sky-top: #0F1530; --sky-mid: #283257; --sky-bot: #4A4370; --sun: #FFF1C9; --sun-glow: rgba(255, 241, 201, .5);
  --hill-1: #2E4A4E; --hill-2: #253D3F; --hill-3: #1C3031; --grass: #2F5047;
  --blossom: #D98BA3; --lavender: #8F7FC8; --mint: #6FB29A; --sky: #5E7FB5; --meadow: #5F9A6E;
  --good: #6BC08A; --warn: #F0B454; --bad: #F08578; --info: #86AEF0;
  --good-bg: rgba(107, 192, 138, .18); --warn-bg: rgba(240, 180, 84, .18); --bad-bg: rgba(240, 133, 120, .18); --info-bg: rgba(134, 174, 240, .18);
  --shadow: 0 18px 40px -16px rgba(0, 0, 0, .65), 0 2px 6px rgba(0, 0, 0, .3); --shadow-sm: 0 6px 16px -8px rgba(0, 0, 0, .6);
  --glass: rgba(39, 46, 69, .84); --court: #3E7F58; --court-2: #35704D; --court-line: #F6EBDB; --lamp: 1;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden; min-height: 100%;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 40; background: var(--sky-top); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font: 800 .72rem/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }
.tiny { font-size: .78rem; }
.center { text-align: center; }
:focus-visible { outline: 3px solid var(--honey); outline-offset: 3px; border-radius: 12px; }
[hidden] { display: none !important; }
svg { display: block; }
.icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.filled { fill: currentColor; stroke: none; }

/* ---------- scene ---------- */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 52%, var(--sky-bot) 100%); transition: background 1.2s ease; }
.sun { position: absolute; top: 7vh; right: 10vw; width: clamp(80px, 16vmin, 170px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 42% 40%, #FFFBEA 0%, var(--sun) 62%, rgba(255, 217, 138, 0) 64%); filter: drop-shadow(0 0 34px var(--sun-glow)); animation: breathe 7s ease-in-out infinite; transition: background 1s ease, filter 1s ease; }
.sun::after { content: ""; position: absolute; inset: 10%; border-radius: 50%; background: radial-gradient(circle at 70% 30%, rgba(255,255,255,.85), transparent 45%); opacity: var(--lamp); transition: opacity 1s; }
.hills { position: absolute; left: 0; right: 0; bottom: 0; height: 38vh; min-height: 220px; }
.hills svg { width: 100%; height: 100%; }
.lamp { position: absolute; right: clamp(16px, 8vw, 120px); bottom: 9vh; width: 46px; height: 150px; }
.lamp .post { position: absolute; left: 20px; bottom: 0; width: 6px; height: 120px; background: var(--ink); border-radius: 3px; opacity: .8; }
.lamp .head { position: absolute; left: 7px; top: 14px; width: 32px; height: 28px; background: var(--ink); border-radius: 8px 8px 4px 4px; opacity: .85; }
.lamp .light { position: absolute; left: 11px; top: 20px; width: 24px; height: 20px; border-radius: 6px; background: var(--honey); box-shadow: 0 0 40px 14px rgba(255, 217, 138, .55), 0 0 120px 40px rgba(255, 200, 120, .25); opacity: var(--lamp); transition: opacity 1s; animation: lampflicker 5s ease-in-out infinite; }
.lamp .light::after { content: ""; position: absolute; left: -40px; top: 18px; width: 100px; height: 160px; background: radial-gradient(ellipse at top, rgba(255, 215, 140, .35), transparent 70%); clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); }
.tufts { position: absolute; left: 0; right: 0; bottom: 0; height: 30vh; }
.tuft { position: absolute; bottom: 0; width: 42px; height: 48px; transform-origin: 50% 100%; animation: sway 4.5s ease-in-out infinite; }
.tuft svg { width: 100%; height: 100%; }
.tuft path { fill: var(--grass); }
#ambient, #overlay { position: fixed; inset: 0; pointer-events: none; }
#ambient { z-index: 1; }
#overlay { z-index: 90; }
.vignette { position: fixed; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(74, 46, 31, .12) 100%); }

/* ---------- app shell ---------- */
.app { position: relative; z-index: 3; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; display: flex; align-items: center; gap: 14px; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--glass); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1.5px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .logo-mark { width: 40px; height: 40px; flex: none; background: var(--choc); -webkit-mask: url(logo-mark.png) center / contain no-repeat; mask: url(logo-mark.png) center / contain no-repeat; transition: transform .4s var(--ease-pop); }
.brand:hover .logo-mark { transform: rotate(-8deg) scale(1.08); }
.brand .wordmark { font: 700 1.55rem/1 var(--font-script); color: var(--choc); letter-spacing: .01em; }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.tab { position: relative; border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font: 800 .95rem var(--font-display); color: var(--ink-2); cursor: pointer; transition: color .2s, background .25s, transform .25s var(--ease-pop); }
.tab:hover { background: var(--paper-2); color: var(--ink); transform: translateY(-1px); }
.tab[aria-current="page"] { color: var(--accent-ink); background: var(--accent); box-shadow: 0 3px 0 var(--btn-shadow); }
.topbar .spacer { flex: 1; }
.iconbtn { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--paper); display: grid; place-items: center; cursor: pointer; color: var(--ink); transition: transform .3s var(--ease-pop), background .25s; box-shadow: var(--shadow-sm); }
.iconbtn:hover { transform: translateY(-2px) rotate(-6deg); background: var(--paper-2); }
.iconbtn:active { transform: scale(.92); }
.iconbtn .icon { width: 20px; height: 20px; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun-ic { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn .sun-ic { display: none; } :root:not([data-theme="light"]) .theme-btn .moon { display: block; } }
.me-btn { padding: 0; overflow: visible; border: 0; background: transparent; box-shadow: none; }
.main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding-block: 22px 120px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.view { display: grid; gap: 22px; }
.view.enter { animation: view-in .55s var(--ease-out) both; }
.view.enter > * { animation: rise-in .6s var(--ease-out) both; }
.view.enter > *:nth-child(2) { animation-delay: .06s; }
.view.enter > *:nth-child(3) { animation-delay: .12s; }
.view.enter > *:nth-child(4) { animation-delay: .18s; }
.view.enter > *:nth-child(5) { animation-delay: .24s; }
.view.enter > *:nth-child(n+6) { animation-delay: .3s; }
.view.leave { animation: view-out .22s ease-in both; }
.tabbar { display: none; }

/* ---------- cards & surfaces ---------- */
.card { position: relative; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px; }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .5; mix-blend-mode: multiply; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .45 0 0 0 0 .35 0 0 0 .12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .card::before { mix-blend-mode: soft-light; opacity: .35; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card::before { mix-blend-mode: soft-light; opacity: .35; } }
.card > * { position: relative; }
.card.soft { background: var(--paper-2); box-shadow: none; }
.card.tight { padding: 14px 16px; }
.card.lift { transition: transform .35s var(--ease-pop), box-shadow .35s; }
.card.lift:hover { transform: translateY(-4px); box-shadow: 0 22px 44px -16px rgba(91, 58, 38, .4), 0 2px 6px rgba(91, 58, 38, .08); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.divider { height: 1.5px; background: var(--line); margin: 6px 0; border: 0; }

/* ---------- buttons ---------- */
.btn { --sh: var(--btn-shadow); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em; border: 0; border-radius: 999px; padding: .72em 1.35em; font: 800 1rem/1.2 var(--font-display); color: var(--ink); background: var(--paper-2); box-shadow: 0 4px 0 var(--line), 0 10px 18px -10px rgba(0, 0, 0, .25); cursor: pointer; transition: transform .15s var(--ease-pop), box-shadow .15s, background .2s, filter .2s; white-space: nowrap; user-select: none; -webkit-tap-highlight-color: transparent; }
.btn:hover { transform: translateY(-2px); filter: brightness(1.03); }
.btn:active { transform: translateY(3px) scale(.98); box-shadow: 0 1px 0 var(--line), 0 4px 8px -6px rgba(0, 0, 0, .2); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { color: var(--accent-ink); background: linear-gradient(180deg, var(--caramel-2) 0%, var(--caramel) 55%, color-mix(in srgb, var(--caramel) 80%, #000) 100%); box-shadow: 0 4px 0 var(--sh), 0 12px 22px -10px rgba(91, 58, 38, .55); text-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.btn-primary::before { content: ""; position: absolute; left: 10%; right: 10%; top: 8%; height: 34%; border-radius: 999px; background: linear-gradient(180deg, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0)); pointer-events: none; }
.btn-primary:active { box-shadow: 0 1px 0 var(--sh), 0 4px 8px -6px rgba(0, 0, 0, .3); }
.btn-good { color: #fff; background: linear-gradient(180deg, #74C690, var(--good) 60%, #2F7A4D); --sh: #245C3A; box-shadow: 0 4px 0 var(--sh), 0 12px 22px -10px rgba(0, 0, 0, .35); }
.btn-bad { color: #fff; background: linear-gradient(180deg, #F08A7E, var(--bad) 60%, #A33F36); --sh: #7D2E27; box-shadow: 0 4px 0 var(--sh), 0 12px 22px -10px rgba(0, 0, 0, .35); }
.btn-ghost { background: transparent; box-shadow: none; border: 1.5px solid var(--line); }
.btn-ghost:active { box-shadow: none; }
.btn-lg { font-size: 1.15rem; padding: .85em 1.6em; }
.btn-sm { font-size: .85rem; padding: .5em 1em; }
.btn-xl { font-size: 1.35rem; padding: .9em 1.9em; border-radius: 999px; }
.btn .icon { width: 1.1em; height: 1.1em; }
.btn.shine::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%); background-size: 250% 100%; animation: sheen 2.6s linear infinite; pointer-events: none; }
.btn-hold { overflow: hidden; }
.btn-hold .fill { position: absolute; inset: 0; width: 0%; background: rgba(255, 255, 255, .28); transition: none; pointer-events: none; }
.chip { display: inline-flex; align-items: center; gap: .4em; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink-2); border-radius: 999px; padding: .38em .9em; font: 700 .86rem var(--font-body); cursor: pointer; transition: all .25s var(--ease-pop); -webkit-tap-highlight-color: transparent; }
.chip:hover { transform: translateY(-1px); background: var(--paper-2); }
.chip[aria-pressed="true"], .chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .icon { width: 1em; height: 1em; }
.pill { display: inline-flex; align-items: center; gap: .35em; border-radius: 999px; padding: .22em .7em; font: 800 .74rem/1.3 var(--font-display); letter-spacing: .02em; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.live { background: var(--bad-bg); color: var(--bad); }
.pill .dot { width: .55em; height: .55em; border-radius: 50%; background: currentColor; }
.pill.live .dot { animation: pulse-dot 1.4s ease-in-out infinite; }
.seg { position: relative; display: inline-flex; gap: 2px; padding: 4px; background: var(--paper-3); border-radius: 999px; }
.seg button { position: relative; z-index: 1; border: 0; background: transparent; padding: .5em 1.05em; border-radius: 999px; font: 800 .92rem var(--font-display); color: var(--ink-2); cursor: pointer; transition: color .25s; -webkit-tap-highlight-color: transparent; }
.seg button[aria-pressed="true"] { color: var(--ink); }
.seg .ind { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: var(--paper); box-shadow: var(--shadow-sm); transition: transform .45s var(--ease-pop), width .45s var(--ease-pop); }
.fab { position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 25; display: inline-flex; align-items: center; gap: .5em; padding: .9em 1.4em .9em 1.1em; border: 0; border-radius: 999px; font: 800 1.05rem var(--font-display); color: var(--accent-ink); background: linear-gradient(180deg, var(--caramel-2), var(--caramel)); box-shadow: 0 5px 0 var(--btn-shadow), 0 18px 30px -12px rgba(0, 0, 0, .45); cursor: pointer; transition: transform .25s var(--ease-pop); }
.fab:hover { transform: translateY(-3px) scale(1.03); }
.fab:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--btn-shadow); }
.fab .icon { width: 1.3em; height: 1.3em; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field label { font: 800 .8rem var(--font-display); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.input, select, textarea { width: 100%; border: 1.5px solid var(--line); background: var(--paper-2); color: var(--ink); border-radius: 14px; padding: .7em .9em; font: 600 1rem var(--font-body); transition: border-color .2s, box-shadow .2s; }
.input:focus, select:focus, textarea:focus { outline: none; border-color: var(--caramel); box-shadow: 0 0 0 4px rgba(173, 116, 76, .18); }
textarea { resize: vertical; min-height: 72px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.tile { position: relative; display: grid; gap: 6px; justify-items: start; text-align: left; border: 2px solid var(--line); background: var(--paper); border-radius: var(--r-md); padding: 14px; cursor: pointer; transition: transform .3s var(--ease-pop), border-color .2s, background .2s; }
.tile:hover { transform: translateY(-3px); }
.tile[aria-pressed="true"] { border-color: var(--caramel); background: var(--paper-2); box-shadow: 0 0 0 4px rgba(173, 116, 76, .15); }
.tile[aria-pressed="true"]::after { content: ""; position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%; background: var(--caramel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/70% no-repeat; animation: pop-in .35s var(--ease-pop); }
.tile .t-title { font: 800 1rem var(--font-display); }
.tile .t-sub { font-size: .82rem; color: var(--ink-2); }
.tile .qicon { width: 30px; height: 30px; color: var(--caramel); }
.tile.venue { padding-top: 54px; overflow: hidden; }
.tile.venue .swatch { position: absolute; inset: 0 0 auto 0; height: 44px; background: var(--tint); }
.tile.venue .swatch::after { content: ""; position: absolute; left: -10%; right: -10%; bottom: -16px; height: 30px; border-radius: 50%; background: var(--paper); }
.tile.venue[aria-pressed="true"] .swatch::after { background: var(--paper-2); }
/* venues: two rows of three named courts, then Custom on its own row; names only, no descriptions */
.tiles.venues { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tiles.venues .tile.venue { padding: 64px 10px 12px; min-width: 0; }
.tiles.venues .tile.venue .t-title { font-size: .92rem; line-height: 1.2; overflow-wrap: anywhere; }
.tiles.venues .tile.custom { grid-column: 1 / -1; }
.tiles.venues .tile.custom .swatch { background: repeating-linear-gradient(135deg, var(--cream) 0 10px, var(--paper-2) 10px 20px); }
.tiles.venues .tile.custom .swatch::before { content: "+"; position: absolute; left: 12px; top: 4px; font: 800 1.7rem/1 var(--font-display); color: var(--caramel); }
@media (max-width: 380px) { .tiles.venues .tile.venue .t-title { font-size: .82rem; } .tiles.venues .tile.venue { padding: 60px 8px 10px; } }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; }
.switch .track { position: relative; width: 48px; height: 28px; border-radius: 999px; background: var(--paper-3); border: 1.5px solid var(--line); transition: background .25s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: var(--paper); box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: transform .35s var(--ease-pop), background .25s; }
.switch[aria-checked="true"] .track { background: var(--good); }
.switch[aria-checked="true"] .track::after { transform: translateX(20px); background: #fff; }

/* ---------- avatars & rank rings ---------- */

/* ---------- rank emblems ---------- */
.emblem { --s: 44px; position: relative; width: var(--s); height: var(--s); display: inline-grid; place-items: center; flex: none; }
.emblem svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .18)); }
.emblem.t-D svg { animation: em-breathe 4s ease-in-out infinite; }
.emblem.t-C svg, .emblem.t-B svg, .emblem.t-A svg, .emblem.t-S svg { animation: em-breathe 3s ease-in-out infinite; }
.emblem.t-B svg { filter: drop-shadow(0 0 6px var(--em-a)) drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); }
.emblem.t-A svg { filter: drop-shadow(0 0 9px var(--em-a)) drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); animation: em-breathe 2.6s ease-in-out infinite, em-glow 2.6s ease-in-out infinite; }
.emblem.t-S svg { filter: drop-shadow(0 0 12px var(--em-a)) drop-shadow(0 0 24px var(--em-b)); animation: em-breathe 2.4s ease-in-out infinite, hue 6s linear infinite; }
.emblem.t-A::before, .emblem.t-S::before { content: ""; position: absolute; inset: -14%; border-radius: 50%; border: 1.5px dashed var(--em-a); opacity: .65; animation: spin 14s linear infinite; }
.emblem .tw { position: absolute; width: 18%; height: 18%; background: radial-gradient(circle, #fff 30%, rgba(255, 255, 255, 0) 70%); border-radius: 50%; animation: twinkle 2.4s ease-in-out infinite; pointer-events: none; }
.emblem .tw:nth-of-type(1) { left: 2%; top: 14%; } .emblem .tw:nth-of-type(2) { right: 0; top: 38%; animation-delay: -.8s; } .emblem .tw:nth-of-type(3) { left: 26%; bottom: -2%; animation-delay: -1.6s; } .emblem .tw:nth-of-type(4) { right: 18%; top: 2%; animation-delay: -1.2s; animation-duration: 3.2s; }
.emblem .pips { position: absolute; bottom: -9%; left: 50%; transform: translateX(-50%); display: flex; gap: 7%; }
.emblem .pips b { width: calc(var(--s) * .11); height: calc(var(--s) * .11); border-radius: 50%; background: var(--em-a); box-shadow: 0 0 0 1.5px var(--paper), 0 1px 2px rgba(0, 0, 0, .3); }
.emblem.xs { --s: 22px; } .emblem.sm { --s: 30px; } .emblem.lg { --s: 72px; } .emblem.xl { --s: 120px; } .emblem.xxl { --s: 180px; }
.emblem.xs .pips, .emblem.sm .pips { display: none; }
.rank-chip { display: inline-flex; align-items: center; gap: .45em; border-radius: 999px; padding: .25em .75em .25em .35em; background: linear-gradient(135deg, var(--em-a), var(--em-b)); color: var(--em-ink); font: 800 .82rem/1.2 var(--font-display); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35), 0 2px 6px rgba(0, 0, 0, .15); white-space: nowrap; }
.rank-chip .emblem { --s: 22px; }
.rank-chip .emblem .pips { display: none; }

/* ---------- nameplates ---------- */

/* ---------- courts ---------- */
.court { --cw: 100%; position: relative; width: var(--cw); aspect-ratio: 150 / 77; border-radius: 16px; overflow: hidden; background: var(--court); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12), var(--shadow-sm); }
.court .floor { position: absolute; inset: 0; width: 100%; height: 100%; }
.court .side { position: absolute; top: 0; bottom: 0; width: 46%; display: grid; align-content: center; justify-items: center; gap: 6%; padding: 4%; }
.court .side.a { left: 2%; } .court .side.b { right: 2%; }
.court .slot { display: grid; justify-items: center; width: 100%; }
.court .state { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 10px; color: #fff; background: rgba(40, 60, 50, .45); backdrop-filter: blur(2px); }
.court .state.soon { background: rgba(60, 80, 120, .55); }
.court .state.closed { background: rgba(60, 50, 45, .62); }
.court .state .big { font: 800 1.5rem var(--font-display); line-height: 1.1; text-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.court .state .sub { font: 700 .82rem var(--font-body); opacity: .95; }
.court .badge-n { position: absolute; left: 10px; top: 8px; z-index: 2; font: 800 .8rem var(--font-display); color: #fff; background: rgba(0, 0, 0, .32); border-radius: 999px; padding: .15em .7em; }
.court .vs { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; font: 800 .8rem var(--font-display); color: #fff; background: rgba(0, 0, 0, .3); border-radius: 999px; padding: .1em .6em; letter-spacing: .1em; }
.court-card { padding: 14px; display: grid; gap: 10px; }
.court-card .cc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.court-card .cc-title { font: 800 1.1rem var(--font-display); }
.court-card .cc-time { font: 700 .82rem var(--font-body); color: var(--ink-2); }
.court-card.is-calling { animation: calling 1.2s ease-in-out 4; }
.court-card .cc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .85rem; color: var(--ink-2); }
.courts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.timeline { display: grid; grid-template-columns: 72px 1fr; column-gap: 10px; row-gap: 8px; align-items: center; }
.timeline .tl-label { font: 800 .85rem var(--font-display); color: var(--ink-2); }
.timeline .tl-track { position: relative; height: 26px; border-radius: 8px; background: var(--paper-3); overflow: visible; }
.timeline .tl-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; background: linear-gradient(180deg, var(--hill-2), var(--hill-3)); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35); transform-origin: left; animation: grow-x .8s var(--ease-out) both; }
.timeline .tl-bar.closed { background: repeating-linear-gradient(135deg, var(--ink-3) 0 6px, var(--paper-3) 6px 12px); opacity: .55; }
.timeline .tl-bar.busy { background: linear-gradient(180deg, var(--caramel-2), var(--caramel)); }
.timeline .tl-now { position: absolute; top: -8px; bottom: -8px; width: 2px; background: var(--bad); border-radius: 2px; z-index: 2; }
.timeline .tl-now::before { content: "now"; position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font: 800 .6rem var(--font-display); color: var(--bad); letter-spacing: .08em; text-transform: uppercase; }
.timeline .tl-axis { grid-column: 2; position: relative; height: 18px; }
.timeline .tl-axis span { position: absolute; top: 0; transform: translateX(-50%); font: 700 .72rem var(--font-body); color: var(--ink-3); }
.tl-editor { display: grid; gap: 8px; }
.tl-row { display: grid; grid-template-columns: 64px 1fr 1fr auto; gap: 8px; align-items: center; }
.tl-row .input { padding: .45em .6em; }

/* ---------- queue ---------- */
.unit { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--paper); transition: transform .35s var(--ease-pop), box-shadow .35s, border-color .3s; }
.unit.lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.unit.next { border-color: var(--honey); box-shadow: 0 0 0 4px rgba(243, 199, 122, .25), var(--shadow-sm); background: linear-gradient(180deg, var(--paper), var(--paper-2)); }
.unit.mine { border-color: var(--caramel); }
.unit .pos { font: 800 1.3rem var(--font-display); color: var(--ink-3); text-align: center; }
.unit.next .pos { color: var(--warn); }
.unit .u-body { display: grid; gap: 6px; min-width: 0; }
.unit .u-players { display: flex; flex-wrap: wrap; gap: 6px; }
.unit .u-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); }
.unit .u-right { display: grid; justify-items: end; gap: 4px; text-align: right; }
.unit .u-wait { font: 800 1rem var(--font-display); }
.unit .u-wait small { font: 700 .72rem var(--font-body); color: var(--ink-3); display: block; }
.link-chip { display: inline-flex; align-items: center; gap: .3em; font: 800 .72rem var(--font-display); color: var(--caramel); }
.you-card { overflow: hidden; }
.you-card .yc-big { font: 800 clamp(1.4rem, 3vw, 2rem) var(--font-display); }
.mode-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.pal-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pal { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 2px solid var(--line); background: var(--paper); cursor: pointer; font: 800 .9rem var(--font-display); transition: all .3s var(--ease-pop); }
.pal:hover { transform: translateY(-2px); }
.pal[aria-pressed="true"] { border-color: var(--caramel); background: var(--paper-2); box-shadow: 0 0 0 4px rgba(173, 116, 76, .15); }
.pal.dim { opacity: .45; pointer-events: none; }
.fair-meter { display: grid; gap: 6px; }
.meter { height: 12px; border-radius: 999px; background: var(--paper-3); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12); }
.meter > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--good), #9BD7A8); transform-origin: left; animation: grow-x .9s var(--ease-out) both; }
.meter.rank > i { background: linear-gradient(90deg, var(--em-b), var(--em-a)); }
.live-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; }
.live-head .lh-title { display: grid; line-height: 1.1; }
.live-head .lh-title b { font: 800 1.15rem var(--font-display); }
.live-head .clock { font: 800 1.25rem var(--font-display); font-variant-numeric: tabular-nums; }
.live-head .seg { margin-left: auto; }
.speed { display: inline-flex; gap: 2px; align-items: center; }
.speed button { border: 0; background: var(--paper-3); color: var(--ink-2); font: 800 .72rem var(--font-display); padding: .3em .6em; border-radius: 8px; cursor: pointer; }
.speed button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.feed { display: grid; gap: 6px; max-height: 260px; overflow: auto; padding-right: 4px; }
.feed .f { display: grid; grid-template-columns: 58px 1fr; gap: 8px; font-size: .85rem; align-items: baseline; }
.feed .f time { font: 800 .75rem var(--font-display); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.feed .f.rank { color: var(--warn); font-weight: 800; }
.why { font-size: .85rem; color: var(--ink-2); border-left: 3px solid var(--honey); padding-left: 10px; }
.mini-courts { display: grid; gap: 10px; }

/* ---------- score sheet ---------- */
.score-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; }
.score-grid .team { display: grid; gap: 10px; justify-items: center; }
.score-grid .team .np-stack { justify-items: center; }
.score-grid .vs-lbl { align-self: center; font: 800 1.2rem var(--font-display); color: var(--ink-3); padding-top: 80px; }
.drum { position: relative; width: 100%; max-width: 150px; height: 168px; margin: 0 auto; border-radius: 20px; background: var(--paper-2); box-shadow: inset 0 2px 8px rgba(0, 0, 0, .12); overflow: hidden; }
.drum .lens { position: absolute; left: 6px; right: 6px; top: 56px; height: 56px; border-radius: 14px; background: var(--paper); box-shadow: 0 0 0 2px var(--honey), var(--shadow-sm); pointer-events: none; }
.drum .list { position: absolute; inset: 0; overflow-y: auto; scroll-snap-type: y mandatory; padding: 56px 0; scrollbar-width: none; -webkit-mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent); mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent); }
.drum .list::-webkit-scrollbar { display: none; }
.drum .d { height: 56px; scroll-snap-align: center; display: grid; place-items: center; font: 800 2rem var(--font-display); color: var(--ink-3); transition: transform .2s, color .2s; font-variant-numeric: tabular-nums; }
.drum .d.cur { color: var(--ink); transform: scale(1.25); }
.drum-btns { display: flex; justify-content: center; gap: 8px; }
.score-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.status-line { text-align: center; font-weight: 700; }
.status-line.friendly { color: var(--warn); }
.status-line.rated { color: var(--good); }

/* ---------- sheets, toasts, takeover ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: end center; background: rgba(40, 28, 20, .3); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade-in .25s ease both; padding: 0; }
.sheet-wrap.closing { animation: fade-out .22s ease both; }
.sheet { position: relative; width: 100%; max-width: 640px; max-height: calc(100vh - 24px - env(safe-area-inset-top, 0px)); overflow: auto; background: var(--paper); border-radius: 28px 28px 0 0; padding: 14px 20px calc(28px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .5); animation: sheet-in .5s var(--ease-out) both; }
.sheet.wide { max-width: 860px; }
.sheet-wrap.closing .sheet { animation: sheet-out .22s ease-in both; }
.sheet .grab { width: 44px; height: 5px; border-radius: 999px; background: var(--line); margin: 0 auto 12px; }
.sheet .sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sheet .sheet-head h2 { font-size: 1.5rem; }
.sheet-body { display: grid; gap: 16px; }
.toasts { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; width: min(94vw, 480px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; background: var(--ink); color: var(--paper); box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .6); font-weight: 700; animation: toast-in .5s var(--ease-pop) both; pointer-events: auto; }
.toast.out { animation: toast-out .3s ease-in both; }
.toast .icon { width: 22px; height: 22px; color: var(--honey); }
.toast.good .icon { color: #9BD7A8; } .toast.bad .icon { color: #F0A49A; }
.toast .t-sub { display: block; font-weight: 600; font-size: .85rem; opacity: .8; }
.takeover { position: fixed; inset: 0; z-index: 65; background: radial-gradient(ellipse at center, rgba(91, 58, 38, .55), rgba(30, 20, 15, .9)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fade-in .3s ease both; color: #FFF6EA; text-align: center; }
.takeover.closing { animation: fade-out .3s ease both; }
.takeover .stamp { font: 800 clamp(2.2rem, 8vw, 4.6rem)/1 var(--font-display); letter-spacing: .02em; color: #FFF1C9; text-shadow: 0 4px 0 rgba(0, 0, 0, .25), 0 0 40px rgba(255, 217, 138, .6); animation: stamp .7s var(--ease-pop) both; transform-origin: center; }
.takeover .court-no { font: 800 clamp(1.2rem, 3.5vw, 1.8rem) var(--font-display); color: #F7B6C6; animation: rise-in .6s .25s var(--ease-out) both; }
.takeover .vs-badge { color: #FFD98A; animation: fade-in .4s .5s ease both; }
.takeover .vs-badge > span { display: inline-block; animation: pop-in .5s .6s var(--ease-pop) both; }
.takeover .fair { animation: rise-in .6s .8s var(--ease-out) both; }
.takeover .fair .pill { font-size: .9rem; background: rgba(255, 255, 255, .14); color: #FFF6EA; }
.takeover .btn { animation: rise-in .6s 1s var(--ease-out) both; }
.result-card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; background: var(--paper-2); }
.result-card .rc-name { font: 800 1rem var(--font-display); }
.result-card .rc-bpr { font: 800 1.35rem var(--font-display); font-variant-numeric: tabular-nums; }
.result-card .delta { font: 800 1rem var(--font-display); border-radius: 999px; padding: .2em .7em; }
.result-card .delta.up { background: var(--good-bg); color: var(--good); } .result-card .delta.down { background: var(--bad-bg); color: var(--bad); } .result-card .delta.flat { background: var(--paper-3); color: var(--ink-3); }
.result-card.me { outline: 2px solid var(--caramel); }
.rankup { display: grid; justify-items: center; gap: 8px; padding: 14px; border-radius: 20px; background: radial-gradient(ellipse at top, var(--warn-bg), transparent 70%); animation: pop-in .6s var(--ease-pop) both; text-align: center; }
.rankup .emblem { animation: stamp .8s var(--ease-pop) both; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; align-items: center; padding: 22px 28px; overflow: hidden; }
.hero .hero-copy { min-width: 0; }
.hero .wordmark-big { font: 700 clamp(2.4rem, 11vw, 5.4rem)/1 var(--font-script); color: var(--choc); text-shadow: 0 3px 0 var(--cream), 0 8px 18px rgba(91, 58, 38, .18); margin-left: -2px; }
.hero .tagline { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: var(--ink-2); max-width: 46ch; margin-top: 10px; }
.hero .hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero .pal-wrap { display: grid; place-items: center; }
.pal { }
.mascot-wrap { position: relative; display: grid; place-items: center; width: min(100%, 380px); padding-bottom: 14px; }
.mascot-wrap picture { display: block; width: 100%; position: relative; z-index: 1; }
.hero .mascot { display: block; width: 100%; height: auto; filter: drop-shadow(0 14px 18px rgba(91, 58, 38, .22)); animation: bob 4.2s ease-in-out infinite; cursor: pointer; transition: transform .3s var(--ease-pop); -webkit-user-select: none; user-select: none; }
.hero .mascot:hover { transform: scale(1.04) rotate(-3deg); }
.mascot-shadow { position: absolute; left: 50%; bottom: 0; width: 72%; height: 7%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse at center, rgba(74, 46, 31, .38) 0%, rgba(74, 46, 31, .18) 45%, transparent 72%); animation: shadow-bob 4.2s ease-in-out infinite; transform-origin: center; }
@keyframes shadow-bob { 0%, 100% { transform: translateX(-50%) scaleX(1); opacity: .9; } 50% { transform: translateX(-50%) scaleX(.78); opacity: .55; } }
.live-card { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; background: linear-gradient(135deg, var(--paper) 0%, var(--paper-2) 100%); }
.live-card .lc-stats { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 10px; }
.stat { display: grid; line-height: 1; gap: 4px; }
.stat b { font: 800 1.6rem var(--font-display); font-variant-numeric: tabular-nums; }
.stat span { font: 700 .74rem var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.event-strip { display: grid; gap: 12px; }
.leader { display: grid; gap: 8px; }
.leader .lr { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; }
.leader .lr .n { font: 800 1rem var(--font-display); color: var(--ink-3); }

/* ---------- events ---------- */
.ev-card { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 14px; align-items: start; overflow: hidden; }
.ev-card .ev-date { display: grid; justify-items: center; align-content: center; gap: 2px; height: 96px; border-radius: 18px; background: var(--tint, var(--paper-2)); color: var(--ink); position: relative; overflow: hidden; }
.ev-card .ev-date b { font: 800 2.2rem/1 var(--font-display); } .ev-card .ev-date span { font: 800 .78rem var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.ev-card .ev-date .qicon { width: 26px; height: 26px; color: var(--ink); opacity: .85; }
.ev-card .ev-body { display: grid; gap: 8px; min-width: 0; }
.ev-card .ev-title { font: 800 1.25rem var(--font-display); }
.ev-card .ev-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: .88rem; color: var(--ink-2); }
.ev-card .ev-meta span { display: inline-flex; align-items: center; gap: .35em; }
.ev-card .ev-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ev-card.just-added { animation: pop-in .7s var(--ease-pop) both; }
.rsvp { display: inline-flex; gap: 4px; padding: 4px; background: var(--paper-3); border-radius: 999px; }
.rsvp button { border: 0; background: transparent; border-radius: 999px; padding: .4em .9em; font: 800 .82rem var(--font-display); color: var(--ink-2); cursor: pointer; transition: all .3s var(--ease-pop); }
.rsvp button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); transform: scale(1.04); }
.rsvp button[aria-pressed="true"].yes { color: var(--good); } .rsvp button[aria-pressed="true"].no { color: var(--bad); }
.kind-badge { display: inline-flex; align-items: center; gap: .4em; font: 800 .72rem var(--font-display); letter-spacing: .1em; text-transform: uppercase; padding: .3em .7em; border-radius: 999px; }
.kind-badge.social { background: var(--meadow); color: #22452B; } .kind-badge.quest { background: var(--lavender); color: #3B2A6E; }
.steps { display: flex; gap: 6px; align-items: center; }
.steps i { height: 6px; flex: 1; border-radius: 999px; background: var(--paper-3); overflow: hidden; }
.steps i::after { content: ""; display: block; height: 100%; width: 0; background: var(--caramel); transition: width .5s var(--ease-out); }
.steps i.done::after { width: 100%; }

/* ---------- profile ---------- */
.profile-hero .ph-name { font: 800 clamp(1.8rem, 4vw, 2.6rem)/1 var(--font-display); }
.bpr-hero { display: grid; gap: 4px; }
.bpr-hero .b { font: 800 clamp(2.6rem, 7vw, 4rem)/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.stats-row .st { padding: 12px; border-radius: 16px; background: var(--paper-2); display: grid; gap: 2px; }
.stats-row .st b { font: 800 1.4rem var(--font-display); font-variant-numeric: tabular-nums; }
.stats-row .st span { font: 700 .72rem var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: auto; overflow: visible; }
.chart-wrap .ctip { position: absolute; pointer-events: none; transform: translate(-50%, -110%); background: var(--ink); color: var(--paper); border-radius: 10px; padding: 6px 10px; font: 700 .78rem var(--font-body); white-space: nowrap; opacity: 0; transition: opacity .15s; box-shadow: var(--shadow-sm); }
.chart-wrap .ctip.show { opacity: 1; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--ink-3); font: 700 11px var(--font-body); }
.chart .band { fill: var(--em-a); opacity: .09; }
.chart .band-lbl { fill: var(--ink-3); font: 800 10px var(--font-display); letter-spacing: .06em; text-transform: uppercase; }
.chart .area { fill: url(#chart-fill); }
.chart .line { fill: none; stroke: var(--caramel); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw 1.6s var(--ease-out) forwards; }
.chart .dot { fill: var(--paper); stroke: var(--caramel); stroke-width: 2; }
.chart .dot.win { stroke: var(--good); } .chart .dot.loss { stroke: var(--bad); }
.chart .end { fill: var(--caramel); stroke: var(--paper); stroke-width: 3; animation: pop-in .6s 1.2s var(--ease-pop) both; }
.chart .hover { fill: transparent; }
.history { display: grid; gap: 8px; }
.hist { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--paper-2); }
.hist .h-date { font: 800 .78rem var(--font-display); color: var(--ink-3); line-height: 1.1; }
.hist .h-who { display: grid; gap: 2px; font-size: .88rem; min-width: 0; }
.hist .h-who b { font: 800 .95rem var(--font-display); }
.hist .h-score { font: 800 1.1rem var(--font-display); font-variant-numeric: tabular-nums; }
.hist .delta { font: 800 .85rem var(--font-display); border-radius: 999px; padding: .2em .7em; min-width: 52px; text-align: center; }
.hist .delta.up { background: var(--good-bg); color: var(--good); } .hist .delta.down { background: var(--bad-bg); color: var(--bad); } .hist .delta.flat { background: var(--paper-3); color: var(--ink-3); }
.photo-btn { position: relative; overflow: hidden; }
.photo-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- ranks ---------- */
.ladder { position: relative; display: grid; gap: 14px; padding: 10px 0; }
.ladder::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 6px; margin-left: -3px; border-radius: 999px; background: repeating-linear-gradient(180deg, var(--caramel-2) 0 14px, transparent 14px 26px); opacity: .5; }
.rung { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 14px 16px; width: 100%; }
.rung .r-grade { font: 800 .78rem var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.rung .r-name { font: 800 1.3rem var(--font-display); }
.rung .r-range { font: 700 .78rem var(--font-body); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rung .r-desc { font-size: .9rem; color: var(--ink-2); margin-top: 4px; }
.rung.me { border-color: var(--caramel); box-shadow: 0 0 0 4px rgba(173, 116, 76, .18), var(--shadow); }
.rung.me::after { content: "you are here"; position: absolute; top: -12px; right: 16px; font: 800 .68rem var(--font-display); letter-spacing: .1em; text-transform: uppercase; background: var(--caramel); color: var(--accent-ink); padding: .25em .7em; border-radius: 999px; }
.rank-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.rank-table th, .rank-table td { text-align: left; padding: 10px 12px; border-bottom: 1.5px solid var(--line); vertical-align: top; }
.rank-table th { font: 800 .74rem var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.rank-table td.nm { font: 800 1rem var(--font-display); white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.gallery { display: flex; gap: 14px; overflow-x: auto; padding: 10px 6px 16px; scroll-snap-type: x proximity; }
.gallery > * { scroll-snap-align: start; flex: none; }
.how-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.how-cards .hc { padding: 14px; border-radius: 16px; background: var(--paper-2); display: grid; gap: 6px; }
.how-cards .hc b { font: 800 1.05rem var(--font-display); }
.how-cards .hc .big { font: 800 1.6rem var(--font-display); color: var(--caramel); }

/* ---------- placement ---------- */
.pl-layout { display: grid; grid-template-columns: 1.3fr .7fr; gap: 20px; align-items: start; }
.opts { display: grid; gap: 8px; }
.opt { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; text-align: left; border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; background: var(--paper); cursor: pointer; transition: all .3s var(--ease-pop); }
.opt:hover { transform: translateX(4px); }
.opt[aria-pressed="true"] { border-color: var(--caramel); background: var(--paper-2); }
.opt .o-t { font: 800 1rem var(--font-display); } .opt .o-s { font-size: .82rem; color: var(--ink-2); }
.opt .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.opt[aria-pressed="true"] .tick { background: var(--caramel); border-color: var(--caramel); color: #fff; animation: pop-in .35s var(--ease-pop); }
.opt .tick .icon { width: 14px; height: 14px; stroke-width: 3.5; }
.estimate { position: sticky; top: 84px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.estimate .emblem.blur svg { filter: blur(7px) saturate(.7); animation: none; }
.estimate .emblem.blur { animation: breathe 3s ease-in-out infinite; }
.estimate .band { font: 800 1.4rem var(--font-display); }
.placing-tag { font: 800 .8rem var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.pl-games { display: grid; gap: 6px; width: 100%; }
.pl-games .pg { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--paper-2); font-size: .88rem; animation: rise-in .5s var(--ease-out) both; }
.pl-games .pg .w { font: 800 .8rem var(--font-display); border-radius: 999px; padding: .15em .6em; }
.pl-games .pg .w.win { background: var(--good-bg); color: var(--good); } .pl-games .pg .w.loss { background: var(--bad-bg); color: var(--bad); }

/* ---------- how it works ---------- */
.acc { border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--paper); }
.acc + .acc { margin-top: 8px; }
.acc summary { list-style: none; cursor: pointer; padding: 14px 16px; font: 800 1rem var(--font-display); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary .icon { transition: transform .35s var(--ease-pop); color: var(--ink-3); }
.acc[open] summary .icon { transform: rotate(180deg); }
.acc .acc-body { padding: 0 16px 16px; color: var(--ink-2); font-size: .92rem; animation: rise-in .4s var(--ease-out) both; }
.formula { font: 800 1.1rem var(--font-display); padding: 12px 14px; border-radius: 14px; background: var(--paper-2); overflow-x: auto; }
.scorecard { display: grid; gap: 6px; font-size: .9rem; }
.scorecard .sc { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--paper-2); }
.scorecard .sc b { font-variant-numeric: tabular-nums; }
.spec { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: .9rem; }
.spec dt { font: 800 .8rem var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.spec dd { margin: 0; color: var(--ink-2); }

/* ---------- TV mode ---------- */
.tv { position: fixed; inset: 0; z-index: 35; overflow: auto; background: radial-gradient(ellipse at 50% 0%, #2D3657 0%, #161A2B 60%, #0F1220 100%); color: #F6EBDB; padding: calc(18px + env(safe-area-inset-top, 0px)) max(22px, env(safe-area-inset-right, 0px)) calc(22px + env(safe-area-inset-bottom, 0px)) max(22px, env(safe-area-inset-left, 0px)); display: grid; grid-template-rows: auto 1fr auto; gap: 18px; font-size: clamp(14px, 1.3vw, 22px); animation: fade-in .4s ease both; }
.tv .tv-head { display: flex; align-items: center; gap: 1em; flex-wrap: wrap; }
.tv .tv-head .wordmark { font: 700 2.2em/1 var(--font-script); color: #F6EBDB; }
.tv .tv-head .venue { font: 800 1.1em var(--font-display); color: #D2C3AE; }
.tv .tv-head .clock { margin-left: auto; font: 800 2em var(--font-display); font-variant-numeric: tabular-nums; color: #FFE9B0; }
.tv .tv-courts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 1.2em; align-content: start; }
.tv .tv-court { display: grid; gap: .6em; }
.tv .tv-court .t { display: flex; justify-content: space-between; align-items: baseline; font: 800 1.3em var(--font-display); }
.tv .tv-court .t small { font: 700 .7em var(--font-body); color: #D2C3AE; }
.tv .court .state .big { font-size: 1.6em; }
.tv .tv-foot { display: grid; grid-template-columns: 1fr auto; gap: 1.2em; align-items: center; }
.tv .next { display: grid; gap: .5em; }
.tv .next .lbl { font: 800 .8em var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: #FFE9B0; }
.tv .next .row { gap: .7em; }
.tv .banner { position: fixed; left: 50%; top: 14%; transform: translateX(-50%); z-index: 2; display: grid; justify-items: center; gap: .3em; padding: 1em 2em; border-radius: 1.4em; background: linear-gradient(135deg, rgba(224, 164, 114, .96), rgba(173, 116, 76, .96)); color: #FFF6EA; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7), 0 0 0 4px rgba(255, 241, 201, .35); text-align: center; animation: banner-in .7s var(--ease-pop) both; max-width: min(92vw, 900px); overflow: hidden; }
.tv .banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .5) 50%, transparent 60%); background-size: 250% 100%; animation: sheen 2.2s ease-in-out infinite; pointer-events: none; }
.tv .banner .b1 { font: 800 .9em var(--font-display); letter-spacing: .16em; text-transform: uppercase; }
.tv .banner .b2 { font: 800 2.4em/1.05 var(--font-display); text-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
.tv .banner .b3 { font: 700 1em var(--font-body); opacity: .95; }
.tv .banner.out { animation: fade-out .4s ease both; }
.tv .exit { position: fixed; right: max(14px, env(safe-area-inset-right, 0px)); top: calc(14px + env(safe-area-inset-top, 0px)); z-index: 3; display: flex; gap: 8px; }
.tv .exit .iconbtn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #F6EBDB; box-shadow: none; }
.tv .join-hint { font: 700 .95em var(--font-body); color: #D2C3AE; }
body.tv-on .topbar, body.tv-on .tabbar, body.tv-on .fab { display: none; }

/* ---------- phone / tablet ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero .tagline { margin-inline: auto; }
  .hero .hero-cta { justify-content: center; }
  .mascot-wrap { width: min(60vw, 240px); }
  .pl-layout { grid-template-columns: 1fr; }
  .estimate { position: static; }
  .live-card { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .nav { display: none; }
  .topbar .wordmark { font-size: 1.4rem; }
  .main { padding-block: 16px 110px; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 8px max(10px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)); background: var(--glass); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-top: 1.5px solid var(--line); }
  .tabbar button { border: 0; background: transparent; display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border-radius: 14px; font: 800 .68rem var(--font-display); color: var(--ink-3); cursor: pointer; transition: color .2s, transform .3s var(--ease-pop); }
  .tabbar button .icon { width: 22px; height: 22px; }
  .tabbar button[aria-current="page"] { color: var(--caramel); transform: translateY(-3px); }
  .tabbar button[aria-current="page"] .icon { filter: drop-shadow(0 4px 6px rgba(173, 116, 76, .45)); }
  .fab { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .toasts { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
  .ev-card { grid-template-columns: 76px 1fr; }
  .ev-card .ev-date { height: 76px; } .ev-card .ev-date b { font-size: 1.8rem; }
  .score-grid { grid-template-columns: 1fr 1fr; }
  .score-grid .vs-lbl { display: none; }
  .rung.me::after { right: 10px; }
  .hist { grid-template-columns: 56px 1fr auto; }
  .hist .delta { grid-column: 2 / -1; justify-self: start; }
  .spec { grid-template-columns: 1fr; }
  .tl-row { grid-template-columns: 52px 1fr 1fr auto; }
}
@media (min-width: 881px) {
  .ladder .rung { width: calc(50% - 20px); }
  .ladder .rung:nth-child(odd) { justify-self: start; }
  .ladder .rung:nth-child(even) { justify-self: end; }
}

/* ---------- motion ---------- */
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-14px) rotate(1.5deg); } }
@keyframes sway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
@keyframes wave { 0%, 100% { transform: rotate(0); } 40% { transform: rotate(-18deg); } 60% { transform: rotate(-10deg); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
@keyframes lampflicker { 0%, 100% { opacity: var(--lamp); } 50% { opacity: calc(var(--lamp) * .82); } 52% { opacity: var(--lamp); } }
@keyframes pulse-dot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.6); opacity: .55; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes orbit { from { transform: rotate(0) translateX(calc(var(--s) / 2)) rotate(0); } to { transform: rotate(360deg) translateX(calc(var(--s) / 2)) rotate(-360deg); } }
@keyframes glowpulse { 0%, 100% { opacity: .35; transform: scale(1); } 50% { opacity: .75; transform: scale(1.08); } }
@keyframes sheen { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
@keyframes aurora { 0% { background-position: 0% 0; } 100% { background-position: 300% 0; } }
@keyframes hue { to { filter: drop-shadow(0 0 12px var(--em-a)) drop-shadow(0 0 24px var(--em-b)) hue-rotate(360deg); } }
@keyframes em-breathe { 0%, 100% { transform: scale(1) translateY(0); } 50% { transform: scale(1.05) translateY(-2%); } }
@keyframes em-glow { 0%, 100% { opacity: 1; } 50% { opacity: .85; } }
@keyframes twinkle { 0%, 100% { transform: scale(.3); opacity: 0; } 50% { transform: scale(1); opacity: 1; } }
@keyframes np-glow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }
@keyframes np-spark { 0%, 100% { transform: scale(0); opacity: 0; } 50% { transform: scale(1.4); opacity: 1; } }
@keyframes view-in { from { opacity: .8; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes view-out { to { opacity: 0; transform: translateY(-8px) scale(.99); } }
@keyframes rise-in { from { opacity: .7; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { 0% { opacity: 0; transform: scale(.6); } 60% { opacity: 1; transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes stamp { 0% { opacity: 0; transform: scale(2.4) rotate(-10deg); } 55% { opacity: 1; transform: scale(.94) rotate(-3deg); } 100% { transform: scale(1) rotate(-2deg); } }
@keyframes slide-in-l { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: none; } }
@keyframes slide-in-r { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheet-out { to { transform: translateY(40px); opacity: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(30px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.95); } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes calling { 0%, 100% { box-shadow: var(--shadow); } 50% { box-shadow: 0 0 0 6px rgba(243, 199, 122, .55), var(--shadow); } }
@keyframes banner-in { 0% { opacity: 0; transform: translate(-50%, -40px) scale(.8); } 60% { opacity: 1; transform: translate(-50%, 6px) scale(1.03); } 100% { transform: translate(-50%, 0) scale(1); } }
@keyframes reveal-theme { from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 50%)); } to { clip-path: circle(160% at var(--vt-x, 50%) var(--vt-y, 50%)); } }
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: reveal-theme .9s var(--ease-out) both; }

@media (min-width: 901px) { .sheet-wrap { place-items: center; padding: 20px; } .sheet { border-radius: 28px; max-height: calc(100vh - 40px); } .sheet .grab { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .12s !important; scroll-behavior: auto !important; }
  .chart .line { stroke-dashoffset: 0; }
  .view.enter > * { animation: none; }
}
:root.calm *, :root.calm *::before, :root.calm *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .12s !important; }
:root.calm .chart .line { stroke-dashoffset: 0; }

/* ---------- late additions ---------- */
.view.tv-view, .view.tv-view > * { animation: none !important; transform: none !important; }
@media (max-width: 430px) {
  .topbar { gap: 8px; }
  .topbar .iconbtn { width: 38px; height: 38px; }
  .topbar .wordmark { font-size: 1.2rem; }
  .brand .logo-mark { width: 34px; height: 34px; }
  .live-head { padding: 10px 12px; gap: 8px; }
  .live-head .seg { margin-left: 0; }
}
.timeline .tl-now.quiet::before { display: none; }
.grid-play { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 22px; align-items: start; }
@media (max-width: 900px) { .grid-play { grid-template-columns: 1fr; } }
.view.enter-fast { animation: view-in .2s ease-out both; }
.view.enter-fast > * { animation: none; }
.view { grid-template-columns: minmax(0, 1fr); }

/* ---------- rank plates (art/np): base image + animated pieces on a canvas, the name in the title box ---------- */
.court .side { gap: 4%; padding: 3% 2%; }
.view > *, .grid-2 > *, .grid-3 > *, .grid-play > *, .pl-layout > *, .courts-grid > * { min-width: 0; }
.gallery, .table-wrap { max-width: 100%; }

/* ---------- identity: pal cards and the profile ID block ---------- */
.tv .pal-card { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); }
.ph-rank-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ph-bpr { font: 800 1.35rem/1 var(--font-display); }
.ph-bpr b { font-size: 1.9rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.mini-id { display: grid; justify-items: center; gap: 10px; }
.mini-id .avatar { margin-bottom: -14px; }

/* ---------- identity v3: the unified nameplate (.np2) and the ring-art avatar ----------
   Cell 600 x 240; the artwork box is 562 x 182 (the element). Zones are set by plates.js from the manifest; the numbers
   here are the same geometry so the plate is right before the art mounts. Every plate and ring animates; spectacle
   climbs with the grade (the art carries most of it, CSS adds the aura behind B+ plates and the name shine on A+). */
.np2 { --pw: 400px; position: relative; display: inline-block; width: 100%; max-width: var(--pw); aspect-ratio: 600 / 224; vertical-align: middle; flex: none; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .28)); container-type: inline-size; }
.np2.sm { --pw: 330px; } .np2.lg { --pw: 490px; } .np2.xl { --pw: 580px; } .np2.fit { --pw: none; max-width: none; }
.np2 .plate-cell { position: absolute; inset: 0; }
.np2 .art-still, .np2 .art-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.np2.art-live .art-still { visibility: hidden; }
.np2 .np2-face { position: absolute; left: 9.67%; top: 22.32%; width: 20.67%; height: 55.36%; border-radius: 50%; overflow: hidden; background: var(--face-bg, hsl(var(--hue) 70% 86%)); z-index: 2; box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .18); }
.np2 .np2-face svg, .np2 .np2-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np2 .np2-name, .np2 .np2-sub, .np2 .np2-coin { position: absolute; z-index: 2; display: grid; place-items: center; white-space: nowrap; pointer-events: none; line-height: 1; }
.np2 .np2-name { left: 34.33%; top: 28.57%; width: 42.67%; height: 25.89%; font: 800 7cqw/1 var(--font-display); color: var(--plate-ink, #fff3e0); letter-spacing: .01em; text-shadow: 0 1px 0 var(--plate-stroke, #1c0d06), 0 -1px 0 var(--plate-stroke, #1c0d06), 1px 0 0 var(--plate-stroke, #1c0d06), -1px 0 0 var(--plate-stroke, #1c0d06), 1px 1px 0 var(--plate-stroke, #1c0d06), -1px -1px 0 var(--plate-stroke, #1c0d06), 1px -1px 0 var(--plate-stroke, #1c0d06), -1px 1px 0 var(--plate-stroke, #1c0d06), 0 3px 6px rgba(0, 0, 0, .55); }
.np2 .np2-sub { left: 34.33%; top: 55.36%; width: 42.67%; height: 15.18%; font: 800 3.4cqw/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: #efe2cf; text-shadow: 0 1px 0 rgba(0, 0, 0, .75), 0 0 4px rgba(0, 0, 0, .55); }
.np2 .np2-coin { left: 79.83%; top: 30.8%; width: 14.33%; height: 38.39%; font: 800 5.6cqw/1 var(--font-display); color: var(--plate-ink, #fff3e0); letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-shadow: 0 1px 0 var(--plate-stroke, #1c0d06), 0 -1px 0 var(--plate-stroke, #1c0d06), 1px 0 0 var(--plate-stroke, #1c0d06), -1px 0 0 var(--plate-stroke, #1c0d06), 0 2px 5px rgba(0, 0, 0, .5); }
.np2.placing .art-still, .np2.placing .art-cv { filter: grayscale(1) brightness(.85); }
/* the name shine on A grade and Elite: a light sweeps through the letters */
.np2.t-A .np2-name::after, .np2.t-S .np2-name::after { content: attr(data-text); position: absolute; inset: 0; display: grid; place-items: center; color: transparent; text-shadow: none; background: linear-gradient(104deg, transparent 38%, rgba(255, 255, 255, .9) 50%, transparent 62%) no-repeat; background-size: 240% 100%; background-position: 130% 0; -webkit-background-clip: text; background-clip: text; animation: name-shine 4.2s ease-in-out infinite; }
.np2.t-S .np2-name::after { animation-duration: 3.2s; background-image: linear-gradient(104deg, transparent 36%, rgba(166, 236, 255, .95) 46%, rgba(255, 255, 255, 1) 50%, rgba(247, 182, 255, .95) 54%, transparent 64%); }
@keyframes name-shine { 0% { background-position: 130% 0; } 55%, 100% { background-position: -130% 0; } }
.np-stack { display: grid; gap: 8px; justify-items: start; width: 100%; }
.row > .np2 { flex: 1 1 260px; width: auto; }
.court .side .slot .np2 { width: 100%; }
.court .slot.landing .np2 { opacity: 0; transform: scale(.6); }
.court .slot .np2 { transition: opacity .25s, transform .4s var(--ease-pop); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }
.court .side { width: 47.5%; gap: 1.5%; padding: 1% .5%; }
.court .side.a { left: 1%; } .court .side.b { right: 1%; }
.takeover .vs-row .np-stack > * { animation: slide-in-l .6s .35s var(--ease-pop) both; }
.takeover .vs-row .np-stack.right > * { animation-name: slide-in-r; }
.takeover .vs-row .np-stack > *:nth-child(2) { animation-delay: .48s; }
.tv .tv-courts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); }
.tv .next .np2 { --pw: 17em; }
.gallery .np2 { flex: none; width: min(100%, 490px); }
.unit .u-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 8px 12px; }
.unit .u-players .np2 { max-width: 100%; }
.plate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px 14px; align-items: center; }
.profile-hero .ph-id .np2 { --pw: 100%; width: 100%; max-width: 560px; }
.profile-hero .ph-progress { width: 100%; max-width: 560px; }
.mini-id .np2 { --pw: 100%; width: 100%; max-width: 460px; }
.score-grid .team .np-stack { width: 100%; justify-items: stretch; }
.score-grid .team .np-stack .np2 { --pw: 100%; width: 100%; }
.fx-clone .np2-name { text-overflow: clip; }
.fx-clone .np2-name::before, .fx-clone .np2-name::after { display: none; }

/* leaderboard rows: position, the plate filling the row, games at the end (under the plate on narrow screens) */
.leader { display: grid; gap: 10px; }
.leader .lr { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.leader .lr .n { font: 800 1.1rem var(--font-display); color: var(--ink-3); text-align: center; }
.leader .lr .np2 { --pw: 100%; width: 100%; }
@media (max-width: 560px) {
  .leader .lr { grid-template-columns: 22px minmax(0, 1fr); gap: 2px 10px; }
  .leader .lr .lr-games { grid-column: 2; justify-self: end; margin-top: -2px; }
}

.avatar { --s: 48px; position: relative; width: var(--s); height: var(--s); flex: none; display: inline-block; vertical-align: middle; }
.avatar .ring-art { position: absolute; inset: 0; pointer-events: none; }
.avatar .ring-art .art-still, .avatar .ring-art .art-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.avatar .ring-art.art-live .art-still { visibility: hidden; }
.avatar .face { position: absolute; left: 18.89%; top: 18.89%; width: 62.22%; height: 62.22%; border-radius: 50%; overflow: hidden; background: var(--face-bg, hsl(var(--hue) 70% 86%)); box-shadow: inset 0 -4px 10px rgba(0, 0, 0, .1); z-index: 1; }
.avatar .face svg, .avatar .face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xl { --s: 200px; } .avatar.lg { --s: 120px; } .avatar.md { --s: 74px; } .avatar.sm { --s: 50px; } .avatar.xs { --s: 40px; }
.avatar.placing .ring-art { filter: grayscale(1) brightness(.85); }
.avatars .avatar { margin-left: -16px; }
.avatars .avatar:first-child { margin-left: 0; }
.me-btn .avatar { --s: 54px; margin: -5px; }
.result-card .avatar { --s: 78px; margin: -6px; }
@media (prefers-reduced-motion: reduce) { .np2::before, .np2 .np2-name::after { animation: none !important; } }
/* narrow screens: the queue unit gives its plates the whole width; the wait time moves under the players */
@media (max-width: 560px) {
  .unit { grid-template-columns: 28px minmax(0, 1fr); gap: 8px 10px; padding: 12px; }
  .unit .u-right { grid-column: 2; display: flex; align-items: baseline; gap: 6px; justify-items: start; text-align: left; }
  .unit .u-wait small { display: inline; margin-left: 5px; }
  .unit .u-players { grid-template-columns: 1fr; }
}
.leader { gap: 14px; }
.np2[data-pid], .avatar[data-pid] { cursor: pointer; }
.np2[data-pid]:hover { filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .34)) brightness(1.04); }

/* ---------- v6: animated name and number, per rank ----------
   plates.js sets --ink-a/-b/-c (the rank's ink colours), --tx-speed (seconds), --tx-glow (0..1) and the classes tx-sweep /
   tx-num from the manifest. ::before paints the flowing ink through the letters, ::after the light sweep; both repeat the
   text (data-text) in the same box, clipped to the glyphs. The base text keeps its outline. */
.np2 .np2-name::before, .np2 .np2-name::after, .np2 .np2-coin::before { content: none; position: absolute; inset: 0; display: grid; place-items: center; color: transparent; text-shadow: none; -webkit-background-clip: text; background-clip: text; pointer-events: none; white-space: nowrap; }
.np2.tx-flow .np2-name::before { content: attr(data-text); background-image: linear-gradient(100deg, var(--ink-a, var(--plate-ink, #fff)) 0%, var(--ink-b, var(--ink-a, #fff)) 30%, var(--ink-c, var(--ink-a, #fff)) 50%, var(--ink-b, var(--ink-a, #fff)) 70%, var(--ink-a, var(--plate-ink, #fff)) 100%); background-size: 300% 100%; animation: ink-flow var(--tx-speed, 6s) linear infinite; }
.np2.tx-sweep .np2-name::after { content: attr(data-text); background-image: linear-gradient(104deg, transparent 38%, rgba(255, 255, 255, .9) 50%, transparent 62%); background-repeat: no-repeat; background-size: 240% 100%; background-position: 130% 0; animation: name-shine calc(var(--tx-speed, 6s) * 1.3) ease-in-out infinite; }
.np2.tx-glow .np2-name { animation: name-glow calc(var(--tx-speed, 6s) * .7) ease-in-out infinite alternate; }
.np2.tx-num .np2-coin::before { content: attr(data-text); background-image: linear-gradient(100deg, var(--ink-a, #fff) 0%, var(--ink-b, #fff) 50%, var(--ink-a, #fff) 100%); background-size: 300% 100%; animation: ink-flow var(--tx-speed, 6s) linear infinite; }
.np2.tx-num .np2-coin { animation: coin-breathe calc(var(--tx-speed, 6s) * .8) ease-in-out infinite alternate; }
@keyframes ink-flow { from { background-position: 0% 0; } to { background-position: 200% 0; } }
@keyframes name-shine { 0% { background-position: 130% 0; } 55%, 100% { background-position: -130% 0; } }
@keyframes name-glow { from { filter: drop-shadow(0 0 1px rgba(255, 255, 255, .1)); } to { filter: drop-shadow(0 0 calc(2px + 8px * var(--tx-glow, .3)) color-mix(in oklab, var(--ink-b, var(--em-a)) 75%, white)); } }
@keyframes coin-breathe { from { transform: scale(1); } to { transform: scale(1.05); } }
.np2.placing .np2-name::before, .np2.placing .np2-name::after, .np2.placing .np2-coin::before { content: none; }
.np2.placing .np2-name, .np2.placing .np2-coin { animation: none; }
@media (prefers-reduced-motion: reduce) { .np2 .np2-name::before, .np2 .np2-name::after, .np2 .np2-coin::before, .np2 .np2-name, .np2 .np2-coin { animation: none !important; } }
html.calm .np2 .np2-name::before, html.calm .np2 .np2-name::after, html.calm .np2 .np2-coin::before, html.calm .np2 .np2-name, html.calm .np2 .np2-coin { animation: none !important; }

/* ---------- device audit fixes: tablets and landscape phones use the tab bar (the top nav needs 900 px); the TV board never
   grows wider than its screen (the foot plate used to stretch the grid column) ---------- */
.tv > * { min-width: 0; }
.tv .tv-foot { grid-template-columns: minmax(0, 1fr) auto; }
.tv .next .np2 { --pw: min(17em, 100%); }
.tv .tv-head .clock { font-size: clamp(1.3em, 5vw, 2em); }
@media (max-width: 600px) { .tv .tv-foot { grid-template-columns: 1fr; } .tv { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); } }
/* leaderboard rows adapt to the card, not the screen: in a narrow card the games count moves under the plate so the plate keeps its rank line */
.leader { container-type: inline-size; }
@container (max-width: 440px) {
  .leader .lr { grid-template-columns: 22px minmax(0, 1fr); gap: 2px 10px; }
  .leader .lr .lr-games { grid-column: 2; justify-self: end; margin-top: -2px; }
}
.sheet-wrap { overflow: hidden; }
/* audit fixes: long buttons wrap on narrow phones, the court editor rows stack, the VS badge hugs its text, the mini profile ring sits just above its plate */
.btn, .btn-lg { max-width: 100%; }
.you-card .row > .btn { white-space: normal; text-align: center; }
.mini-id .avatar { margin-bottom: -8px; }
.sheet-body > * { min-width: 0; }
.tl-row .input { min-width: 0; width: 100%; }
@media (max-width: 560px) {
  .tl-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px 8px; }
  .tl-row > b { grid-column: 1 / -1; }
  .tl-row .input { font-size: .9rem; padding: .4em .4em; }
}
/* toasts stay under the Match Found overlay and the sheets, so they never cover a nameplate someone is reading */
.toasts { z-index: 58; }
/* ---------- Match Found fills the screen on every device ----------
   The overlay is a column: heading, the two sides, the fairness line, the button. The sides row takes whatever height is
   left and is a size container, so the plates size themselves from it (100cqh) and never push the button off the screen.
   Portrait stacks the four plates; landscape and desktop face the two sides across the VS; short screens compact the
   heading and drop the reason line. Nothing scrolls. */
.takeover { --tk-pad: 14px; --tk-gap: 12px; --tk-sgap: 8px; --tk-vs: 2rem; --tk-ph: calc((100cqh - var(--tk-vs) - 2 * var(--tk-gap) - 2 * var(--tk-sgap)) / 4); display: flex; flex-direction: column; overflow: hidden; padding: calc(var(--tk-pad) + env(safe-area-inset-top, 0px)) calc(var(--tk-pad) + env(safe-area-inset-right, 0px)) calc(var(--tk-pad) + env(safe-area-inset-bottom, 0px)) calc(var(--tk-pad) + env(safe-area-inset-left, 0px)); }
.takeover .tk { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 1100px; margin: 0 auto; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: var(--tk-gap); justify-items: stretch; align-content: stretch; }
.takeover .tk-head { display: grid; gap: 4px; justify-items: center; min-width: 0; }
.takeover .stamp { max-width: 100%; }
.takeover .vs-row { container-type: size; display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; gap: var(--tk-gap); align-content: center; justify-items: center; width: 100%; min-height: 0; }
.takeover .vs-row .np-stack { display: grid; gap: var(--tk-sgap); justify-items: center; width: 100%; }
.takeover .vs-row .np2 { width: min(100%, var(--pw), calc(var(--tk-ph) * 600 / 224)); max-width: none; }
.takeover .vs-badge { display: flex; align-items: center; gap: 12px; width: min(100%, 420px); height: var(--tk-vs); font: 800 1.25rem/1 var(--font-display); letter-spacing: .06em; justify-self: center; }
.takeover .vs-badge::before, .takeover .vs-badge::after { content: ""; flex: 1 1 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(255, 217, 138, .6)); }
.takeover .vs-badge::after { background: linear-gradient(90deg, rgba(255, 217, 138, .6), transparent); }
.takeover .fair { display: grid; gap: 6px; justify-items: center; min-width: 0; }
.takeover .fair .pill { white-space: normal; text-align: center; max-width: 100%; }
.takeover .fair .small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: min(100%, 62ch); }
.takeover .btn { justify-self: center; }
/* landscape phones, tablets on their side, desktops: the two sides face each other across the VS */
@media (min-aspect-ratio: 1/1) and (min-width: 440px) {
  .takeover { --tk-ph: calc((100cqh - var(--tk-sgap)) / 2); }
  .takeover .vs-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; }
  .takeover .vs-row .np-stack { justify-items: end; }
  .takeover .vs-row .np-stack.right { justify-items: start; }
  .takeover .vs-badge { width: auto; height: auto; font-size: 2rem; padding: 0 4px; }
  .takeover .vs-badge::before, .takeover .vs-badge::after { display: none; }
}
/* when height is tight the fairness pill stays and the reason line goes: portrait phones and tablets under 760px,
   side-by-side screens under 520px; short screens also compact the heading and the button */
@media (max-height: 760px) and (max-aspect-ratio: 1/1), (max-height: 760px) and (max-width: 439px), (max-height: 520px) { .takeover .fair .small { display: none; } }
@media (max-height: 560px) {
  .takeover { --tk-pad: 10px; --tk-gap: 8px; --tk-sgap: 6px; --tk-vs: 1.6rem; }
  .takeover .tk-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 2px 16px; }
  .takeover .stamp { font-size: clamp(1.4rem, 6.5vh, 2.6rem); }
  .takeover .court-no { font-size: clamp(.95rem, 4vh, 1.3rem); }
  .takeover .vs-badge { font-size: 1.05rem; }
  .takeover .btn-xl { font-size: 1.05rem; padding: .66em 1.5em; }
}
/* browsers without container units fall back to a viewport estimate and may scroll */
@supports not (height: 1cqh) { .takeover { overflow-y: auto; --tk-ph: calc((100vh - 320px) / 4); } }
/* ---------- profile: the hero wears the player's rank (its painted panel as background, its rim as frame) ----------
   One picture only (the nameplate), everything left-justified, the BPR block on the right. The art comes from
   art/np/build_cards.py: cards/<rank>_panel.webp (600x224, background-size cover) and cards/<rank>_frame.png (a 240 px
   9-slice tile, 17 css px of frame). Text uses the rank's ink and stroke so it reads on every panel. */
.rank-card { --frame-w: 17px; border: var(--frame-w) solid transparent; border-image: var(--card-frame) 34 / var(--frame-w) round; border-radius: 20px; background: var(--card-panel) center / cover no-repeat, #1a1c22; color: var(--hero-ink, #fff6ea); text-shadow: 0 1px 2px var(--hero-stroke, rgba(0, 0, 0, .6)); box-shadow: var(--shadow); padding: 18px 20px; }
.rank-card::before { display: none; }
.rank-card .muted, .rank-card .small, .rank-card .tiny, .rank-card .eyebrow { color: var(--hero-ink, #fff6ea); }
.rank-card .eyebrow { opacity: .9; }
.rank-card .tiny, .rank-card .small { opacity: .85; }
.rank-card .stats-row .st { background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.rank-card .stats-row .st span { color: var(--hero-ink, #fff6ea); opacity: .75; }
.rank-card .meter { background: rgba(0, 0, 0, .35); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4); }
.rank-card .fair-meter .muted { opacity: .8; }
.rank-card .btn { text-shadow: none; }
.rank-card .btn-ghost { background: rgba(255, 255, 255, .14); color: var(--hero-ink, #fff6ea); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35); }
.rank-card .btn-ghost:hover { background: rgba(255, 255, 255, .22); }
.rank-card .np2, .rank-card .avatar { text-shadow: none; }
.profile-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); gap: 22px 28px; align-items: center; text-align: left; }
.profile-hero .ph-id { display: grid; gap: 12px; justify-items: start; min-width: 0; }
.profile-hero .ph-id .np2 { --pw: 100%; width: 100%; max-width: 580px; }
.profile-hero .ph-progress { width: 100%; max-width: 580px; }
.profile-hero .ph-meta { gap: 10px 12px; }
.profile-hero .ph-bpr { display: grid; gap: 6px; align-content: start; min-width: 0; padding: 14px 16px; border-radius: 18px; background: rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.profile-hero .ph-bpr .bpr-hero .b { font-size: clamp(2.4rem, 6vw, 3.4rem); }
.profile-hero .ph-bpr .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.profile-hero .ph-bpr .row.small b { font: 800 1rem var(--font-display); }
@media (max-width: 900px) { .profile-hero { grid-template-columns: 1fr; } .profile-hero .ph-bpr { width: 100%; } }
@media (max-width: 430px) { .rank-card { padding: 14px 12px; } .profile-hero .ph-bpr .stats-row { gap: 8px; } }
/* premade faces sit a touch inside their circle so ears never get cut; uploaded photos fill it */
.np2 .np2-face img.pm, .avatar .face img.pm, .fc img { width: 90%; height: 90%; margin: 5%; object-fit: contain; }
/* the look sheet: a simple character creator */
.look .look-preview { display: grid; justify-items: center; }
.look .look-preview .np2 { --pw: 100%; max-width: 490px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(0, 0, 0, .08); background: var(--sw); cursor: pointer; transition: transform .2s var(--ease-pop), box-shadow .2s; }
.sw:hover { transform: translateY(-2px) scale(1.06); }
.sw[aria-pressed="true"] { border-color: var(--caramel); box-shadow: 0 0 0 3px rgba(173, 116, 76, .25); transform: scale(1.1); }
.face-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 10px; }
.fc { position: relative; aspect-ratio: 1; border-radius: 50%; border: 3px solid transparent; background: var(--face-bg, var(--paper-2)); padding: 0; overflow: hidden; cursor: pointer; box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .12); transition: transform .2s var(--ease-pop), border-color .2s; }
.fc img { display: block; }
.fc:hover { transform: translateY(-2px) scale(1.05); }
.fc[aria-pressed="true"] { border-color: var(--caramel); box-shadow: 0 0 0 3px rgba(173, 116, 76, .25), inset 0 -4px 8px rgba(0, 0, 0, .12); }
.look .look-foot { gap: 10px; }
/* ---------- popovers: a small card beside what was tapped (mini profile, name edit) instead of a sheet over everything ---------- */
.pop-wrap { position: fixed; inset: 0; z-index: 61; background: rgba(40, 28, 20, .12); animation: fade-in .18s ease both; }
.pop { position: absolute; width: max-content; max-width: min(380px, calc(100vw - 20px)); background: var(--paper); border: 1.5px solid var(--line); border-radius: 20px; box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .5), 0 4px 12px rgba(0, 0, 0, .12); padding: 14px; animation: pop-in .32s var(--ease-pop) both; transform-origin: var(--ax, 50%) 0; }
.pop.above { transform-origin: var(--ax, 50%) 100%; }
.pop::before { content: ""; position: absolute; left: var(--ax, 50%); top: -8px; width: 14px; height: 14px; background: var(--paper); border-left: 1.5px solid var(--line); border-top: 1.5px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.pop.above::before { top: auto; bottom: -8px; border: 0; border-right: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); }
.pop.mini { width: min(380px, calc(100vw - 20px)); }
.pop .mini-pop { display: grid; gap: 10px; }
.pop .mini-pop .np2 { --pw: 100%; width: 100%; max-width: none; }
.pop .stats-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pop .stats-row.four .st { padding: 8px 6px; text-align: center; justify-items: center; border-radius: 12px; }
.pop .stats-row.four .st b { font-size: 1.05rem; }
.pop .stats-row.four .st span { font-size: .62rem; }
.pop.name { width: min(320px, calc(100vw - 20px)); }
.pop .pop-body { display: grid; gap: 8px; }
.initials { display: grid; place-items: center; width: 100%; height: 100%; font: 800 2.4em/1 var(--font-display); color: rgba(0, 0, 0, .45); }
/* onboarding */
.join-preview { display: grid; justify-items: center; margin-bottom: 14px; }
.join-preview .np2 { --pw: 100%; width: 100%; max-width: 490px; }
.pal-row { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
.pal-name { font: 800 .7rem var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.swatches .sw { width: 32px; height: 32px; }
.face-grid.compact { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; }
.join-modes { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.rank-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr)); gap: 8px; margin-top: 12px; }
.rp { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 14px; background: var(--paper); cursor: pointer; text-align: left; transition: transform .2s var(--ease-pop), border-color .2s, box-shadow .2s; }
.rp:hover { transform: translateY(-2px); }
.rp[aria-pressed="true"] { border-color: var(--em-a); box-shadow: 0 0 0 3px rgba(173, 116, 76, .18); background: var(--paper-2); }
.rp .emblem { --s: 36px; }
.rp .rp-t { display: grid; line-height: 1.15; min-width: 0; }
.rp .rp-t b { font: 800 .95rem var(--font-display); }
.rp .rp-t span { font-size: .72rem; color: var(--ink-3); }
@media (max-width: 480px) { .pal-row { grid-template-columns: 1fr; gap: 4px; } .rank-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* ---------- release polish ---------- */
.hist { content-visibility: auto; contain-intrinsic-size: auto 72px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.signup .grid-2.tight { gap: 10px; }
.signup .status-line { margin-top: 2px; }
.signup .done-mark { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--good-bg); color: var(--good); }
.signup .done-mark .icon { width: 28px; height: 28px; }
