/* SquadJury, "Dnevni meč": a sunny Saturday matchday. Light and clean, a bright pitch,
   and one accent, the referee's yellow card, used sparingly. Dark theme follows the phone. */

@font-face { font-family: 'Archivo'; font-weight: 400 900; font-stretch: 62% 125%; font-display: swap; src: url('/fonts/archivo-latin-var.woff2') format('woff2'); }

:root {
  /* palette: change it here and the whole app follows */
  --bg: #f6f6f3;
  --card: #ffffff;
  --ink: #111418;
  --ink-2: #5e6670;
  --ink-3: #7a828c;
  --line: #e4e5e1;
  --line-2: #d4d6d0;
  --soft: #eeefeb;
  --yellow: #ffd400;
  --on-yellow: #111418;
  --red: #c2281b;
  --green: #1e9e4a;
  --gold: #a87c00;
  --silver: #77808a;
  --bronze: #b4652e;

  /* the pitch stays the same in both themes */
  --grass-1: #3da35d;
  --grass-2: #359452;
  --bench: #eef1ec;
  --plate: #ffffff;
  --plate-ink: #111418;
  --fix: #dde3da;
  --fix-ink: #3b444c;

  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);

  --top: 56px;
  --nav-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1215;
    --card: #171b20;
    --ink: #f2f3f1;
    --ink-2: #a3abb5;
    --ink-3: #8a929c;
    --line: #2a3038;
    --line-2: #3a414b;
    --soft: #1f252b;
    --red: #ff6b5e;
    --green: #4cc777;
    --gold: #ffd400;
    --silver: #c7cdd3;
    --bronze: #e0915a;
    --bench: #1f252b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + var(--safe-b));
}
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--ink); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 12px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; font-weight: 800; }

/* ============================================================ header and menu */

.topbar {
  position: sticky; top: 0; z-index: 30; height: calc(var(--top) + var(--safe-t)); padding: var(--safe-t) 16px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; min-width: 0; }
.brand img { height: 24px; width: auto; }
.clock { border: 0; background: none; padding: 8px 0 8px 8px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.clock b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.clock.hot, .clock.hot b { color: var(--red); }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--card); border-top: 1px solid var(--line);
}
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-2); text-decoration: none; font-size: 11px; font-weight: 600; }
.tab svg { width: 22px; height: 22px; }
.tab[aria-current='page'] { color: var(--ink); font-weight: 800; }
.tab[aria-current='page'] svg { stroke-width: 2.4; }
.tab[aria-current='page']::before { content: ''; position: absolute; top: -1px; left: 50%; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--yellow); transform: translateX(-50%); }
.tab .badge { position: absolute; top: 6px; left: calc(50% + 7px); padding: 1px 5px; border-radius: 999px; background: var(--yellow); color: var(--on-yellow); font-size: 10px; font-weight: 800; line-height: 1.4; box-shadow: 0 0 0 2px var(--card); }

/* ============================================================ page */

main { display: block; max-width: 600px; margin: 0 auto; padding: 16px 16px 24px; outline: none; }
.title { font-size: 28px; font-weight: 800; line-height: 1.1; }
.sub { color: var(--ink-2); margin: 6px 0 0; }
.page-head { margin-bottom: 16px; }
.section-h { font-size: 13px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); margin: 26px 0 8px; }
.note { padding: 10px 12px; border-radius: var(--r); background: var(--soft); color: var(--ink); font-size: 14px; margin: 10px 0; }
.prose { max-width: 66ch; }
.prose h2 { font-size: 20px; margin: 24px 0 6px; }
.prose p, .prose li { color: var(--ink-2); }
.prose strong { color: var(--ink); }
.footer { display: none; }
.empty { text-align: center; padding: 32px 12px; }
.empty h2 { font-size: 22px; margin-bottom: 6px; }
.empty p { color: var(--ink-2); margin: 0 auto 18px; max-width: 34ch; }
.empty .ycard { margin: 0 auto 16px; }
.skeleton { background: var(--soft); border-radius: var(--r); animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.55; } }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 140px; }

/* the yellow card, the one recurring mark */
.ycard { display: block; width: 36px; height: 48px; border-radius: 6px; background: var(--yellow); transform: rotate(8deg); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); }

/* ============================================================ controls */

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border: 0; border-radius: var(--r);
  background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow);
  font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; transition: transform 0.12s;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-go { background: var(--ink); color: var(--bg); box-shadow: none; }
.btn-ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-danger { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn.loading { color: transparent; }
.btn.loading::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--bg); border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; padding: 8px; color: var(--ink-2); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--ink-2); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn[aria-pressed='true'] { background: var(--soft); color: var(--ink); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); font-size: 11px; font-weight: 700; line-height: 1.5; white-space: nowrap; vertical-align: 2px; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: 14px; }
.field input { height: 48px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--card); font-size: 16px; }
.field input:focus { border-color: var(--ink); outline: none; }
.field .hint { font-size: 13px; color: var(--ink-2); }
.field .err { font-size: 13px; color: var(--red); }

.list { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.list > li + li { border-top: 1px solid var(--line); }
.list a, .list .item { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 8px 14px; border: 0; background: none; color: var(--ink); text-decoration: none; text-align: left; }
.list small { color: var(--ink-2); font-size: 13px; }
.list .num { font-size: 20px; }

.switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 54px; padding: 8px 14px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; cursor: pointer; transition: background 0.2s; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); transition: transform 0.2s var(--ease); }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(18px); }

/* ============================================================ the pitch */

.squad {
  container-type: inline-size;
  position: relative; display: flex; flex-direction: column; gap: 6px; width: 100%; aspect-ratio: 0.78;
}
.pitch {
  position: relative; flex: 1 1 auto; min-height: 0; border-radius: 8px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-around; padding: 2.4cqi 0.6cqi 2.4cqi;
  background: repeating-linear-gradient(180deg, var(--grass-1) 0 10%, var(--grass-2) 10% 20%);
}
.pitch .lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pitch .lines * { fill: none; stroke: rgba(255, 255, 255, 0.85); stroke-width: 2; vector-effect: non-scaling-stroke; }
.pitch .circle { position: absolute; left: 50%; top: 50%; width: 22cqi; aspect-ratio: 1; border: 2px solid rgba(255, 255, 255, 0.85); border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.pitch .line { position: relative; display: flex; justify-content: center; gap: 0.6cqi; }
.bench { flex: none; position: relative; display: flex; flex-direction: column; padding: 1.6cqi 1cqi 1.8cqi; border-radius: 8px; background: var(--bench); }
.bench .bl { font-size: clamp(10px, 2.8cqi, 12px); font-weight: 700; color: var(--ink-2); margin: 0 0 0.6cqi 1.6cqi; }
.bench .brow { display: flex; justify-content: center; gap: 0.6cqi; }

.pl { position: relative; width: 19.4cqi; display: flex; flex-direction: column; align-items: center; }
.pl .shirt { position: relative; width: clamp(28px, 11.6cqi, 60px); aspect-ratio: 64 / 56; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.22)); }
.bench .pl .shirt { width: clamp(24px, 9.6cqi, 50px); }
.pl .shirt svg { width: 100%; height: 100%; }
.pl .armband {
  position: absolute; top: -0.8cqi; right: -2.2cqi; width: clamp(15px, 4.6cqi, 22px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; font-size: clamp(9px, 2.8cqi, 13px); font-weight: 800; font-stretch: 90%; line-height: 1;
}
.pl .armband.c { background: var(--yellow); color: var(--on-yellow); box-shadow: 0 0 0 1.5px #fff; }
.pl .armband.v { background: #fff; color: #111418; box-shadow: inset 0 0 0 1.5px #111418, 0 0 0 1.5px #fff; }
.pl .name {
  display: block; max-width: 100%; margin-top: 1px; padding: 0.7cqi 1.3cqi 0.4cqi; border-radius: 4px 4px 0 0;
  background: var(--plate); color: var(--plate-ink); font-size: clamp(11px, 3.3cqi, 15px); font-weight: 700; font-stretch: 88%; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em;
}
.pl .name.long { font-stretch: 66%; letter-spacing: -0.02em; padding-left: 0.5cqi; padding-right: 0.5cqi; }
.pl .fix {
  display: block; padding: 0.4cqi 1.3cqi 0.7cqi; border-radius: 0 0 4px 4px; max-width: 100%; overflow: hidden; white-space: nowrap;
  background: var(--fix); color: var(--fix-ink); font-size: clamp(9.5px, 2.6cqi, 12px); font-weight: 600; font-stretch: 90%; line-height: 1.1;
}
.pl.missing .shirt { opacity: 0.45; }
.pl.missing .name { background: var(--red); color: #fff; }
.pl .plus { position: absolute; inset: 0; display: grid; place-items: center; font-size: 7cqi; font-weight: 800; color: #fff; }
.pl button.pick { all: unset; display: contents; cursor: pointer; }
.pl button.pick:focus-visible .name { outline: 3px solid var(--yellow); }

.shot { border-radius: 8px; overflow: hidden; background: var(--soft); }
.shot img { width: 100%; height: auto; }

/* ============================================================ squad card */

.jcard { position: relative; display: flex; flex-direction: column; padding: 8px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
.jcard-head { display: flex; align-items: center; gap: 8px; padding: 2px 2px 8px 4px; flex: none; min-width: 0; }
.who { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.who b { font-size: 17px; font-weight: 800; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.02em; }
.who b { display: flex; align-items: center; min-width: 0; }
.who b .tag, .list .tag { margin-left: 6px; vertical-align: middle; line-height: 1.3; font-size: 10.5px; flex: none; }
.who span { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who a { color: var(--ink-2); }
.head-right { display: flex; align-items: center; gap: 2px; flex: none; }

/* ============================================================ judge */

/* Fit mode: the Judge screen fills the phone between the header and the menu, nothing scrolls. */
main.fit { height: calc(100dvh - var(--top) - var(--safe-t) - var(--nav-h) - var(--safe-b)); overflow: hidden; padding: 8px 12px 10px; }
main.fit > .view, .home { height: 100%; }
.judge { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.mine { display: flex; align-items: center; gap: 8px; min-height: 28px; margin: 0 4px 6px; font-size: 13px; color: var(--ink-2); text-decoration: none; flex: none; white-space: nowrap; overflow: hidden; }
.mine b { color: var(--ink); font-size: 15px; font-weight: 800; }
.mine .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.6; flex: none; }
.mine .go { margin-left: auto; color: var(--ink); font-weight: 700; text-decoration: underline 2px var(--yellow); text-underline-offset: 4px; }

.deck { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.deck .jcard { flex: 1 1 auto; min-height: 0; width: 100%; touch-action: pan-y; will-change: transform; }
.deck .squad-box { flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; container-type: size; }
/* The pitch fills the card, but never gets wider than its height allows (short screens, desktop). */
.deck .squad { aspect-ratio: auto; height: 100%; width: min(100%, 100cqh * 0.8); }
.deck .shot { flex: 1; overflow: auto; }
.jcard.enter { animation: enter 0.22s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateX(24px); } }
.jcard.leave { transition: transform 0.22s ease-in, opacity 0.22s ease-in; transform: translateX(-110%); opacity: 0; }
.jcard.drag { transition: none; }
.jcard.spring { transition: transform 0.3s var(--ease); }
.jcard .skip-hint { position: absolute; top: 46%; right: 16px; z-index: 6; padding: 6px 12px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 800; letter-spacing: 0.06em; opacity: 0; pointer-events: none; }

/* the verdict: a big yellow card lands on the squad for a moment */
.moment {
  position: absolute; left: 50%; top: 46%; z-index: 5; width: 140px; height: 186px; border-radius: 14px; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--yellow); color: var(--on-yellow); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%) rotate(-8deg); animation: show-card 0.2s var(--ease) both;
}
.moment small { font-size: 13px; font-weight: 800; letter-spacing: 0.16em; }
.moment strong { font-size: 96px; font-weight: 900; font-stretch: 90%; line-height: 0.95; }
@keyframes show-card { from { opacity: 0; transform: translate(-50%, -40%) rotate(4deg) scale(0.8); } }
.jcard.judged .jcard-head, .jcard.judged .squad-box { opacity: 0.35; transition: opacity 0.15s; }
.verdict-line { position: absolute; left: 0; right: 0; bottom: 10%; z-index: 6; text-align: center; font-weight: 700; font-size: 14px; }
.verdict-line span { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }

.controls { flex: none; padding-top: 10px; }
.vscale { display: flex; justify-content: space-between; margin: 0 2px 6px; font-size: 12px; color: var(--ink-2); }
.vscale b { color: var(--ink); font-weight: 700; }
.first-hint { margin: 0 2px 6px; font-size: 13px; color: var(--ink); font-weight: 600; }
.verdicts { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.vbtn {
  height: clamp(44px, 6.4dvh, 54px); padding: 0; border: 0; border-radius: 8px;
  background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow);
  font-size: clamp(17px, 5vw, 21px); font-weight: 800; font-stretch: 95%; font-variant-numeric: tabular-nums;
  transition: transform 0.15s var(--ease), background 0.15s;
}
.vbtn:active { transform: scale(0.94); }
.vbtn.chosen { background: var(--yellow); color: var(--on-yellow); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); transform: rotate(-6deg) scale(1.06); }
@media (hover: hover) { .vbtn:hover { background: var(--soft); } .vbtn.chosen:hover { background: var(--yellow); } }
.judge-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.judge-hint { color: var(--ink-2); font-size: 13px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.judge-hint .link-btn { color: var(--ink); font-weight: 700; }
.skip { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border: 0; border-radius: 8px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow); font-weight: 700; font-size: 14px; flex: none; }

@media (max-height: 700px) {
  main.fit { padding-top: 6px; }
  .judge .mine:not(.need) { display: none; }
  .vscale { display: none; }
  .controls { padding-top: 8px; }
  .judge-actions { margin-top: 6px; }
  .skip { height: 36px; }
}

.aside-board h2 { font-size: 18px; margin-bottom: 10px; }

/* ============================================================ leaderboard */

.lb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.updated { color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.lb-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px 2px; scrollbar-width: none; }
.lb-tabs::-webkit-scrollbar { display: none; }
.lb-tabs .tablist { display: flex; gap: 6px; flex: none; }
.lb-tab { flex: none; height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-2); font-weight: 700; font-size: 14px; }
.lb-tab[aria-selected='true'] { background: var(--ink); color: var(--bg); box-shadow: none; }
.gw-pick { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 14px; border: 0; border-radius: 999px; background: var(--yellow); color: var(--on-yellow); font-weight: 800; font-size: 14px; }
.gw-pick svg { width: 12px; height: 8px; }
.gw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; margin-bottom: 4px; }
.gw-tile { height: 52px; border: 0; border-radius: 10px; background: var(--soft); color: var(--ink); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px var(--line); }
.gw-tile::before { content: 'GW'; display: block; font-size: 10px; font-weight: 700; color: var(--ink-2); letter-spacing: 0.06em; }
.gw-tile[aria-current] { background: var(--ink); color: var(--bg); box-shadow: none; }
.gw-tile[aria-current]::before { color: var(--bg); opacity: 0.7; }
@media (hover: hover) { .gw-tile:hover { box-shadow: inset 0 0 0 2px var(--ink); } }
.board { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.board li + li { border-top: 1px solid var(--line); }
.board a, .board .r { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 58px; padding: 8px 14px 8px 10px; color: var(--ink); text-decoration: none; }
.board .pos { font-size: 17px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.board .p1 .pos { color: var(--gold); } .board .p2 .pos { color: var(--silver); } .board .p3 .pos { color: var(--bronze); }
.board .who b { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.board .who span { font-size: 12.5px; }
.board .score { text-align: right; line-height: 1.1; }
.board .score .num { font-size: 22px; display: block; }
.board .score small { color: var(--ink-2); font-size: 11px; }
.board .me a, .board .me .r { box-shadow: inset 4px 0 0 var(--yellow); background: color-mix(in srgb, var(--yellow) 9%, var(--card)); }
.board.pending { margin-top: 8px; }
.board.pending .pos { color: var(--ink-3); }
.board-sub { font-size: 13px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); margin: 22px 0 8px; }
.more { display: block; margin: 12px auto 0; }
.lb-how { margin: 10px 4px 0; font-size: 12.5px; color: var(--ink-2); }
.lb-how a { color: var(--ink-2); }
.stickyme { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 8px); z-index: 25; padding: 0 12px; }
.stickyme a { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 8px; max-width: 576px; margin: 0 auto; min-height: 52px; padding: 6px 14px 6px 10px; border-radius: var(--r); background: var(--card); box-shadow: inset 4px 0 0 var(--yellow), inset 0 0 0 1px var(--line-2), 0 6px 18px rgba(0, 0, 0, 0.12); color: var(--ink); text-decoration: none; font-weight: 700; }
.stickyme .pos { text-align: center; font-weight: 800; }
.stickyme .num { font-size: 20px; }

/* ============================================================ post */

main.fit-post:has(.post-entry) { height: calc(100dvh - var(--top) - var(--safe-t) - var(--nav-h) - var(--safe-b)); overflow: hidden; }
main.fit-post:has(.post-entry) > .view { height: 100%; }
.post-entry { height: 100%; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.post-entry .page-head { margin: 0; }
.post-entry .example { flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; }
.post-entry .example img { height: 100%; max-height: 360px; width: auto; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line), 0 6px 20px rgba(0, 0, 0, 0.1); background: var(--card); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: s; flex: none; }
.steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; counter-increment: s; }
.steps li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: var(--on-yellow); font-size: 12px; font-weight: 800; }
.post-entry .btn-block { flex: none; min-height: 54px; font-size: 16px; }
.drop-hint { margin: -6px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-2); flex: none; }
.post-entry.dropping { outline: 2px dashed var(--ink); outline-offset: 6px; border-radius: 12px; }
@media (max-height: 700px) { .post-entry { gap: 10px; } .post-entry .sub { display: none; } .drop-hint { display: none; } }

.reading { display: grid; gap: 14px; }
.reading .preview { height: min(46dvh, 380px); display: flex; justify-content: center; }
.reading .preview img { height: 100%; width: auto; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.progress { height: 8px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--ink); border-radius: inherit; transition: width 0.3s var(--ease); }
.status { text-align: center; font-weight: 600; margin: 0; }
.status small { display: block; color: var(--ink-2); font-weight: 400; margin-top: 2px; }

.confirm { display: grid; gap: 12px; }
.recog { display: flex; align-items: baseline; gap: 10px; }
.recog .num { font-size: 40px; line-height: 1; }
.recog b { font-size: 17px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.check svg { width: 14px; height: 14px; }
.check.ok { color: var(--green); }
.check:not(.ok) { color: var(--red); }

.done { text-align: center; display: grid; gap: 14px; justify-items: center; }
.done h1 { font-size: 26px; }
.done .square { width: min(100%, 340px); aspect-ratio: 1; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line), 0 6px 20px rgba(0, 0, 0, 0.1); background: var(--soft); object-fit: cover; }
.done .row { width: 100%; max-width: 420px; }

.player-search { max-height: 50dvh; overflow: auto; margin-top: 8px; }
.player-search button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.player-search .mini-shirt { width: 28px; flex: none; }
.player-search .grow { flex: 1; min-width: 0; }
.player-search small { color: var(--ink-2); }

/* ============================================================ my squad */

.scoreboard { display: flex; align-items: center; gap: 18px; padding: 16px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 12px; }
.scoreboard .ycard { width: 22px; height: 30px; flex: none; margin-right: -8px; }
.scoreboard .big { font-size: 64px; font-weight: 900; font-stretch: 90%; line-height: 0.9; font-variant-numeric: tabular-nums; }
.scoreboard .big.none { color: var(--ink-3); }
.scoreboard .meta { display: grid; gap: 2px; font-size: 14px; color: var(--ink-2); }
.scoreboard .meta b { color: var(--ink); font-size: 18px; }
.chart { padding: 14px 16px 12px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 12px; }
.chart h2 { font-size: 14px; font-weight: 700; color: var(--ink-2); margin-bottom: 10px; }
.hist { display: grid; grid-template-columns: repeat(10, 1fr); align-items: end; gap: 6px; height: 90px; }
.hist i { display: block; border-radius: 3px 3px 0 0; background: var(--line-2); min-height: 3px; }
.hist i.top { background: var(--yellow); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.hist-x { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-top: 4px; text-align: center; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.share-row .btn-go { grid-column: 1 / -1; }

/* ============================================================ me */

.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.profile-head .ycard { width: 30px; height: 40px; flex: none; }
.profile-head h1 { font-size: 26px; line-height: 1.1; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.stat { padding: 12px 10px; text-align: center; display: grid; gap: 2px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .num { font-size: 24px; }
.stat span:last-child { font-size: 12px; color: var(--ink-2); }
.gw-group { margin-top: 8px; }
.gw-group summary { display: flex; justify-content: space-between; align-items: center; min-height: 50px; padding: 0 14px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; list-style: none; font-weight: 700; }
.gw-group summary::-webkit-details-marker { display: none; }
.gw-group summary small { color: var(--ink-2); font-weight: 400; }
.gw-group[open] summary { border-radius: var(--r) var(--r) 0 0; }
.gw-group[open] .list { border-radius: 0 0 var(--r) var(--r); margin-top: -1px; }
.show-all { display: block; text-align: center; padding: 12px; font-weight: 700; text-decoration: underline 2px var(--yellow); text-underline-offset: 4px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; }
.pager .pages { display: flex; gap: 4px; }
.pager .pages a, .pager .pages span { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; text-decoration: none; font-weight: 700; color: var(--ink-2); }
.pager .pages [aria-current] { background: var(--ink); color: var(--bg); }
.vscore { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.about-links { display: block; }
.fan-note { color: var(--ink-2); font-size: 12px; text-align: center; margin-top: 16px; }

/* ============================================================ sheet, toast, overlays */

.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(10, 12, 14, 0.45); animation: fade 0.2s both; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 88dvh; overflow: auto;
  padding: 10px 16px calc(20px + var(--safe-b)); border-radius: 16px 16px 0 0; background: var(--card);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18); animation: rise 0.22s var(--ease) both;
}
.sheet.closing { animation: sink 0.18s ease-in forwards; }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes sink { to { transform: translateY(100%); } }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 14px; }
.sheet h2 { font-size: 22px; margin-bottom: 6px; }
.sheet p { color: var(--ink-2); margin: 0 0 16px; }
@media (min-width: 640px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 440px; transform: translate(-50%, -50%); border-radius: 16px; animation: pop 0.18s var(--ease) both; }
  .sheet.closing { animation: fade-out 0.15s forwards; }
  @keyframes pop { from { opacity: 0; transform: translate(-50%, -47%); } }
  @keyframes fade-out { to { opacity: 0; } }
  .sheet .grab { display: none; }
}
.gsi { min-height: 48px; display: flex; justify-content: center; }
.or { text-align: center; color: var(--ink-2); font-size: 13px; margin: 12px 0; }
.big-time { font-size: 34px; font-weight: 800; margin: 2px 0; font-variant-numeric: tabular-nums; }

.toasts { position: fixed; left: 0; right: 0; top: calc(var(--top) + var(--safe-t) + 8px); z-index: 70; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 14px; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 10px 14px; border-radius: var(--r); background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); animation: toast-in 0.2s var(--ease) both; }
.toast .ti { display: none; }
.toast.bad { background: var(--red); color: #fff; }
.toast.out { animation: toast-out 0.2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }
.offline { position: fixed; top: calc(var(--top) + var(--safe-t)); left: 0; right: 0; z-index: 29; padding: 6px; text-align: center; background: var(--red); color: #fff; font-size: 13px; font-weight: 700; }

/* ============================================================ desktop */

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .topbar { padding-left: max(24px, calc(50% - 560px)); padding-right: max(24px, calc(50% - 560px)); }
  .tabs { position: fixed; top: var(--safe-t); bottom: auto; left: 50%; right: auto; transform: translateX(-50%); height: var(--top); padding: 0; display: flex; gap: 4px; align-items: center; background: none; border: 0; z-index: 31; }
  .tab { flex-direction: row; gap: 6px; height: 38px; padding: 0 12px; border-radius: 8px; font-size: 14px; }
  .tab svg { width: 18px; height: 18px; }
  .tab[aria-current='page'] { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
  .tab .badge { position: static; }
  main { max-width: 1120px; padding: 24px; }
  main > .view > :not(.home) { max-width: 600px; margin-left: auto; margin-right: auto; }
  main.fit { height: calc(100dvh - var(--top) - var(--safe-t)); padding: 16px 24px; }
  main.fit-post:has(.post-entry) { height: calc(100dvh - var(--top) - var(--safe-t)); }
  .home { display: grid; grid-template-columns: minmax(0, 520px) 360px; justify-content: center; gap: 32px; }
  .stickyme { bottom: 16px; }
  .footer { display: block; padding: 24px 0 16px; color: var(--ink-2); font-size: 12px; text-align: center; }
  .footer nav { display: flex; gap: 16px; justify-content: center; margin-bottom: 6px; }
  .footer a { color: var(--ink-2); }
}
@media (max-width: 899px) { .home aside { display: none; } }

/* landscape phones: pitch on the left, verdicts on the right */
@media (max-height: 520px) and (orientation: landscape) {
  .judge { display: grid; grid-template-columns: 1fr minmax(260px, 42%); grid-template-rows: auto 1fr; gap: 6px 12px; }
  .judge .mine { grid-column: 1 / -1; }
  .judge .deck { grid-row: 2; }
  .judge .controls { grid-row: 2; align-self: end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0ms !important; transition-duration: 0.001ms !important; }
}

/* ============================================================ first visit intro */
.intro {
  position: fixed; inset: 0; z-index: 60; background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; padding: calc(14px + var(--safe-t)) 20px calc(18px + var(--safe-b));
  animation: fade 0.2s ease-out both;
}
.intro.closing { animation: fade 0.2s ease-in reverse both; }
.in-top { display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.in-top img { display: block; height: 26px; width: auto; }
.in-skip { background: none; border: 0; font: inherit; font-weight: 600; color: var(--ink-2); padding: 10px 4px; cursor: pointer; }
.in-slide { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 440px; width: 100%; margin: 0 auto; min-height: 0; }
.in-stage {
  position: relative; height: min(46vh, 330px); min-height: 230px; border-radius: 18px; background: var(--card);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line); overflow: hidden; margin-bottom: 22px;
}
.in-title { font-size: clamp(26px, 7.4vw, 34px); font-weight: 900; font-stretch: 92%; letter-spacing: -0.02em; line-height: 1.02; margin: 0 0 10px; animation: in-up 0.35s var(--ease) both; }
.in-text { color: var(--ink-2); font-size: 17px; line-height: 1.45; margin: 0; animation: in-up 0.35s 0.06s var(--ease) both; }
.in-bottom { max-width: 440px; width: 100%; margin: 0 auto; }
.in-dots { display: flex; gap: 6px; justify-content: center; margin: 14px 0 16px; }
.in-dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--line-2); transition: width 0.25s var(--ease), background 0.25s; }
.in-dots i.on { width: 22px; background: var(--yellow); }
.in-actions { display: flex; gap: 10px; }
.in-actions .btn { flex: 1; min-height: 52px; font-size: 17px; }
@keyframes in-up { from { opacity: 0; transform: translateY(12px); } }

/* the yellow card, same as the verdict card in Judge */
.in-card {
  position: absolute; left: 50%; top: 44%; width: 104px; height: 136px; border-radius: 12px; background: var(--yellow); color: #111418;
  display: flex; flex-direction: column; align-items: center; justify-content: center; transform: translate(-50%, -50%) rotate(-8deg);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}
.in-card small { font-size: 11px; font-weight: 800; letter-spacing: 0.16em; }
.in-card b { font-size: 50px; font-weight: 900; font-stretch: 90%; line-height: 1; }
@keyframes in-drop {
  0% { opacity: 0; transform: translate(-50%, -120%) rotate(6deg) scale(0.9); }
  70% { opacity: 1; transform: translate(-50%, -48%) rotate(-10deg) scale(1.02); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); }
}

/* 1: the posts everyone sees before a deadline */
.in-posts { position: absolute; inset: 0; padding: 20px 18px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.in-post {
  display: flex; align-items: center; gap: 10px; background: var(--bg); border-radius: 14px; padding: 10px 12px; font-weight: 600; font-size: 15px;
  box-shadow: inset 0 0 0 1px var(--line); animation: in-up 0.4s var(--d) var(--ease) both;
}
.in-post { width: 74%; }
.in-post:nth-child(2) { margin-left: 16px; }
.in-post i { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--bg); font-style: normal; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.in-post:nth-child(2) i { background: var(--yellow); color: #111418; }
.in-post:nth-child(3) i { background: var(--grass-1); color: #111418; }
.in-stamp { top: 50%; left: 84%; width: 84px; height: 110px; animation: in-drop 0.45s 1.1s var(--ease) both; }

/* 2: judge */
.in-judge { position: absolute; inset: 0; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.in-pitch {
  flex: 1; border-radius: 10px; display: flex; flex-direction: column; justify-content: space-around; padding: 6px 0;
  background: repeating-linear-gradient(180deg, var(--grass-1) 0 12.5%, var(--grass-2) 12.5% 25%);
}
.in-line { display: flex; justify-content: space-evenly; }
.in-shirt { width: 30px; animation: in-pop 0.3s var(--d) var(--ease) both; }
.in-shirt svg { display: block; width: 100%; height: auto; }
@keyframes in-pop { from { opacity: 0; transform: scale(0.6); } }
.in-vrow { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.in-vrow span {
  height: 34px; border-radius: 8px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); display: grid; place-items: center;
  font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums;
}
.in-vrow .in-pick { animation: in-pick 0.2s 1.35s var(--ease) both; }
@keyframes in-pick { to { background: var(--yellow); color: #111418; box-shadow: none; transform: translateY(-2px) rotate(-4deg); } }
.in-finger {
  position: absolute; width: 38px; height: 38px; border-radius: 50%; background: rgba(17, 20, 24, 0.22); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
  left: 72.5%; bottom: 10px; margin-left: -19px; animation: in-finger 1.6s 0.5s var(--ease) both;
}
@keyframes in-finger {
  0% { opacity: 0; transform: translate(40px, 40px); }
  20% { opacity: 1; }
  55% { transform: translate(0, 0) scale(1); }
  62% { transform: scale(0.86); }
  70% { transform: scale(1); opacity: 1; }
  100% { opacity: 0; transform: scale(1); }
}
.in-verdict { top: 40%; animation: in-drop 0.45s 1.45s var(--ease) both; }

/* 3: post a screenshot */
.in-post-shot { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 16px; }
.in-phone {
  position: relative; width: 132px; height: 100%; max-height: 270px; border-radius: 22px; background: #111418; padding: 8px; display: flex; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line-2);
  animation: in-up 0.4s var(--ease) both;
}
.in-phone .in-pitch { border-radius: 14px; }
.in-phone .in-shirt { width: 20px; }
.in-scan {
  position: absolute; left: 8px; right: 8px; top: 8px; height: 3px; background: var(--yellow); box-shadow: 0 0 0 1px rgba(17, 20, 24, 0.2);
  animation: in-scan 1.2s 0.5s cubic-bezier(0.4, 0, 0.6, 1) both;
}
@keyframes in-scan { 0% { opacity: 1; top: 8px; } 92% { opacity: 1; top: calc(100% - 11px); } 100% { opacity: 0; top: calc(100% - 11px); } }
.in-found { display: flex; flex-direction: column; animation: in-pop 0.35s 1.75s var(--ease) both; }
.in-found b { font-size: 46px; font-weight: 900; font-stretch: 90%; letter-spacing: -0.03em; line-height: 1; }
.in-found span { font-weight: 700; color: var(--ink-2); margin-top: 4px; }
.in-found::before { content: ''; width: 34px; height: 8px; border-radius: 4px; background: var(--yellow); margin-bottom: 10px; }

/* 4: leaderboard climb */
.in-board { position: absolute; inset: 0; padding: 18px 14px; }
.in-row {
  position: absolute; left: 14px; right: 14px; height: 52px; top: calc(18px + var(--r) * 58px); display: grid; grid-template-columns: 34px 1fr auto;
  align-items: center; padding: 0 14px 0 6px; border-radius: 12px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 700; animation: in-shift 0.6s 1.1s var(--ease) both;
}
@keyframes in-shift { to { transform: translateY(58px); } }
.in-row .pos { text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; position: relative; }
.in-row .sc { font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; position: relative; }
.in-row.me {
  --r: 3; z-index: 2; background: var(--card); box-shadow: inset 4px 0 0 var(--yellow), 0 6px 18px rgba(0, 0, 0, 0.12);
  animation: in-climb 0.6s 1.1s var(--ease) both;
}
@keyframes in-climb { from { transform: translateY(0); } to { transform: translateY(-174px); } }
.in-row i { font-style: normal; display: block; }
.in-row i + i { position: absolute; inset: 0; opacity: 0; animation: in-in 0.2s 1.4s both; }
.in-row i:first-child { animation: in-out 0.2s 1.4s both; }
@keyframes in-out { to { opacity: 0; } }
@keyframes in-in { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .intro *, .intro { animation-duration: 0.01ms !important; animation-delay: 0s !important; }
  .in-finger { display: none; }
}
.in-stamp b { font-size: 38px; }
