/* ============================================================================
   TOP FLIGHT — the all-time First Division annual & sticker album
   Identity: floodlit-night football programme x Panini sticker album x Ceefax.
   Default theme = "Floodlit" (dark). Alt theme = "Programme" (light newsprint).
   ============================================================================ */

/* ---- tokens -------------------------------------------------------------- */
:root {
  --paper:    #0a120c;          /* night pitch */
  --paper-2:  #101c14;          /* raised panel */
  --paper-3:  #16261b;
  --ink:      #f4eedd;          /* programme cream */
  --ink-dim:  #9aa79a;
  --ink-mute: #6b7a6e;
  --line:     rgba(244,238,221,.12);
  --line-2:   rgba(244,238,221,.07);

  --turf:     #2fae5b;
  --turf-glow:#46e483;
  --gold:     #e7b53c;
  --gold-hi:  #ffd96b;
  --red:      #ec5a52;
  --blue:     #58a6e8;

  /* role accents */
  --gk:  #f0b429;
  --def: #5b9bf0;
  --mid: #46e483;
  --fwd: #ec5a52;

  --shadow: 0 18px 40px -16px rgba(0,0,0,.7), 0 2px 0 rgba(0,0,0,.4);
  --radius: 14px;

  --font-display: "Bricolage Grotesque", "Arial Black", sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;

  --maxw: 1080px;
}

[data-theme="light"] {
  --paper:    #efe6d0;
  --paper-2:  #f8f1df;
  --paper-3:  #fbf6ea;
  --ink:      #19140c;
  --ink-dim:  #5f5a4c;
  --ink-mute: #8c8675;
  --line:     rgba(25,20,12,.16);
  --line-2:   rgba(25,20,12,.08);
  --turf:     #16894a;
  --turf-glow:#1aa959;
  --gold:     #b9821a;
  --gold-hi:  #d99e22;
  --shadow: 0 16px 34px -18px rgba(40,30,10,.5), 0 1px 0 rgba(255,255,255,.6) inset;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  overflow-x: clip;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* atmosphere: floodlight glow + faint pitch geometry + print grain */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(70,228,131,.16), transparent 55%),
    radial-gradient(80% 60% at 12% 8%, rgba(231,181,60,.10), transparent 60%),
    radial-gradient(90% 70% at 90% 0%, rgba(88,166,232,.08), transparent 60%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---- typography helpers -------------------------------------------------- */
.display { font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; line-height: .95; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.kicker {
  font-family: var(--font-mono); font-weight: 600; text-transform: uppercase;
  letter-spacing: .22em; font-size: .66rem; color: var(--gold);
}
.muted { color: var(--ink-dim); }

a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ---- shell --------------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 14px; padding: 11px 18px; max-width: var(--maxw); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .crest {
  width: 30px; height: 34px; flex: none;
  background: linear-gradient(160deg, var(--gold-hi), var(--gold));
  clip-path: polygon(50% 0, 100% 16%, 100% 64%, 50% 100%, 0 64%, 0 16%);
  display: grid; place-items: center; color: #1a1206; font-weight: 800; font-family: var(--font-display);
  box-shadow: 0 3px 0 rgba(0,0,0,.35);
}
.brand .crest span { transform: translateY(-1px); }
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: 1.18rem; letter-spacing: -.02em; }
.wordmark b { color: var(--gold); }
.tagline { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-mute); margin-top: 1px; }

.topbar-spacer { flex: 1; }
.pill {
  font-family: var(--font-mono); font-weight: 700; font-size: .72rem; letter-spacing: .04em;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper-2); color: var(--ink); white-space: nowrap;
}
.pill b { color: var(--gold); }
.iconbtn {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: 9px; border: 1px solid var(--line); background: var(--paper-2); color: var(--ink);
  transition: .15s; font-size: 15px;
}
.iconbtn:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-1px); }

/* ---- buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px; justify-content: center;
  border: 1px solid var(--line); background: var(--paper-2); color: var(--ink);
  padding: 11px 18px; border-radius: 11px; font-weight: 700; font-size: .92rem;
  transition: .15s; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); border-color: var(--gold); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-gold {
  background: linear-gradient(168deg, var(--gold-hi), var(--gold));
  color: #1a1206; border: none; box-shadow: 0 5px 0 color-mix(in srgb, var(--gold) 55%, #000);
  font-family: var(--font-display); font-weight: 800; letter-spacing: .01em;
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 7px 0 color-mix(in srgb, var(--gold) 55%, #000); }
.btn-gold:active { transform: translateY(2px); box-shadow: 0 2px 0 color-mix(in srgb, var(--gold) 55%, #000); }
.btn-big { padding: 15px 30px; font-size: 1.12rem; }
.btn-ghost { background: transparent; }

/* ============================================================================
   INTRO
   ============================================================================ */
.intro { padding: 40px 0 60px; }
.intro-hero { text-align: center; padding: 26px 0 10px; position: relative; }
.intro-hero .superkick { font-family: var(--font-mono); letter-spacing: .35em; text-transform: uppercase; font-size: .72rem; color: var(--gold); }
.intro-hero h1 {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -.03em;
  font-size: clamp(3rem, 13vw, 7rem); margin: .12em 0 .1em; line-height: .86;
  text-shadow: 0 2px 0 rgba(0,0,0,.3);
}
.intro-hero h1 em { font-style: normal; color: var(--gold);
  -webkit-text-stroke: 0; text-shadow: 0 0 32px rgba(231,181,60,.5); }
.intro-sub { font-size: 1.05rem; color: var(--ink-dim); max-width: 540px; margin: 0 auto; }

.intro-cta { display: flex; gap: 12px; justify-content: center; margin: 26px 0 8px; flex-wrap: wrap; }

.facts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.fact {
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2);
  padding: 12px 16px; text-align: center; min-width: 116px;
}
.fact .n { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; color: var(--gold); line-height: 1; }
.fact .l { font-family: var(--font-mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); margin-top: 5px; }

/* ============================================================================
   DRAFT
   ============================================================================ */
.draft { padding: 18px 0 90px; display: grid; gap: 18px; grid-template-columns: 1fr; }

.panel {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-h h3 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1rem; letter-spacing: -.01em; }
.panel-b { padding: 14px 16px; }

/* the SPIN packet */
.spin { position: relative; overflow: hidden; }
.spin-stage { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; padding: 16px; }
.reel {
  border-radius: 12px; border: 1px solid var(--line); background: var(--paper-3);
  padding: 14px 12px; text-align: center; position: relative; overflow: hidden; min-height: 116px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
}
.reel .reel-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; width: 100%; }
.reel .reel-k { font-family: var(--font-mono); font-size: .56rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-mute); }
.reel .crestbig {
  width: 46px; height: 52px; border-radius: 8px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: #fff;
  background: var(--club, var(--turf)); box-shadow: 0 4px 12px rgba(0,0,0,.4);
  border: 2px solid rgba(255,255,255,.2);
}
.reel .reel-v { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; line-height: 1; }
.reel .reel-v.era { color: var(--gold); font-size: 1.9rem; }
.reel.spinning .reel-inner { animation: reelspin .5s linear infinite; }
@keyframes reelspin { 0%{ transform: translateY(0); opacity:1 } 50%{ transform: translateY(-8px); opacity:.4 } 100%{ transform: translateY(0); opacity:1 } }
.reel-x { align-self: center; font-family: var(--font-display); color: var(--ink-mute); font-size: 1.3rem; }

.spin-actions { display: flex; gap: 10px; padding: 0 16px 16px; align-items: center; flex-wrap: wrap; }
.spin-hint { font-size: .82rem; color: var(--ink-dim); flex: 1; min-width: 160px; }
.reroll { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-dim); }
.reroll b { color: var(--gold); }

.locked-pair { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag {
  font-family: var(--font-mono); font-weight: 600; font-size: .74rem; padding: 4px 9px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--paper-3);
}
.tag.club { color: #fff; background: var(--club, var(--paper-3)); border-color: transparent; }
.tag.era { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }

/* pool ledger */
.ledger-tools { display: flex; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.search {
  flex: 1; min-width: 120px; background: var(--paper-3); border: 1px solid var(--line); color: var(--ink);
  border-radius: 8px; padding: 8px 11px; font-family: var(--font-body); font-size: .86rem;
}
.search::placeholder { color: var(--ink-mute); }
.seg { display: flex; gap: 3px; background: var(--paper-3); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.seg button {
  border: none; background: transparent; color: var(--ink-dim); padding: 5px 10px; border-radius: 6px;
  font-family: var(--font-mono); font-size: .68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.seg button.on { background: var(--paper); color: var(--gold); }

.pool { max-height: 420px; overflow-y: auto; }
.poolrow {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 9px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .12s;
}
.poolrow:hover { background: var(--paper-3); }
.poolrow .av {
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none;
  font-family: var(--font-display); font-weight: 800; font-size: .8rem; color: #fff; background: var(--club, var(--turf));
}
.poolrow .nm { font-weight: 700; font-size: .92rem; display: flex; align-items: center; gap: 7px; }
.poolrow .meta { font-family: var(--font-mono); font-size: .68rem; color: var(--ink-dim); margin-top: 1px; }
.poolrow .statline { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-dim); text-align: right; white-space: nowrap; }
.poolrow .statline b { color: var(--ink); }
.rolebadge {
  font-family: var(--font-mono); font-size: .56rem; font-weight: 700; letter-spacing: .08em;
  padding: 2px 5px; border-radius: 4px; color: #0a120c;
}
.rb-GK { background: var(--gk); } .rb-DEF { background: var(--def); }
.rb-MID { background: var(--mid); } .rb-FWD { background: var(--fwd); }
.pool-empty { padding: 34px 16px; text-align: center; color: var(--ink-mute); font-family: var(--font-mono); font-size: .82rem; }

/* team sheet + formation */
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.formation-pick { display: flex; gap: 5px; flex-wrap: wrap; }
.formation-pick button {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  border: 1px solid var(--line); background: var(--paper-3); color: var(--ink-dim);
  padding: 5px 9px; border-radius: 7px;
}
.formation-pick button.on { background: var(--turf); color: #06140b; border-color: transparent; }
.formation-pick button:disabled { opacity: .35; }

.pitch {
  position: relative; padding: 18px 10px; border-radius: 12px; margin: 12px;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 38px, transparent 38px 76px),
    radial-gradient(120% 80% at 50% 0%, rgba(70,228,131,.12), transparent 60%),
    var(--paper-3);
  border: 1px solid var(--line); overflow: hidden;
}
.pitch::before { /* center circle + halfway line */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(circle at 50% 50%, transparent 52px, rgba(255,255,255,.08) 53px, rgba(255,255,255,.08) 54px, transparent 55px),
    linear-gradient(0deg, transparent calc(50% - 1px), rgba(255,255,255,.08) 50%, transparent calc(50% + 1px));
}
.line { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 9px 0; position: relative; }

.slot {
  width: 84px; min-height: 96px; border-radius: 10px; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-align: center; transition: .15s; padding: 6px 4px;
}
.slot.empty {
  border: 1.5px dashed var(--line); background: rgba(255,255,255,.02); color: var(--ink-mute);
  cursor: default;
}
.slot.empty.eligible { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); cursor: pointer; }
.slot.empty.placing { animation: slotpulse 1s ease-in-out infinite; }
@keyframes slotpulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 28%, transparent); } }
.slot .slot-role { font-family: var(--font-mono); font-size: .56rem; letter-spacing: .12em; }

.sticker {
  width: 84px; min-height: 96px; border-radius: 10px; position: relative; overflow: hidden;
  background: linear-gradient(168deg, var(--paper-2), var(--paper-3));
  border: 1px solid var(--line); box-shadow: 0 6px 14px -8px rgba(0,0,0,.6); cursor: pointer;
  display: flex; flex-direction: column; transition: transform .15s;
}
.sticker:hover { transform: translateY(-3px) rotate(-1deg); }
.sticker .band { height: 26px; background: var(--club, var(--turf)); display: grid; place-items: center; position: relative; }
.sticker .band .ab { font-family: var(--font-mono); font-weight: 700; font-size: .62rem; color: #fff; letter-spacing: .08em; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.sticker .face { padding: 6px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; justify-content: center; }
.sticker .pos { position: absolute; top: 4px; left: 4px; font-family: var(--font-mono); font-size: .5rem; font-weight: 700; padding: 1px 4px; border-radius: 3px; color: #0a120c; }
.sticker .nm { font-weight: 800; font-size: .72rem; line-height: 1.05; }
.sticker .er { font-family: var(--font-mono); font-size: .56rem; color: var(--ink-dim); }
.sticker .foil { position: absolute; top: 0; right: 0; width: 0; height: 0; border-style: solid; border-width: 0 18px 18px 0; border-color: transparent var(--gold-hi) transparent transparent; }
.sticker.legend::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay; opacity: .5;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.5) 45%, transparent 60%), linear-gradient(60deg, #ff5e9c33, #5be3ff33, #ffe45e33);
}

.placing-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 12px; padding: 8px 12px; border-radius: 9px; font-size: .84rem;
  background: color-mix(in srgb, var(--gold) 16%, var(--paper-2)); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
}
.needs { display: flex; gap: 7px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); align-items: center; }
.needs .nl { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); }
.need {
  font-family: var(--font-mono); font-size: .68rem; font-weight: 700; padding: 3px 8px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--ink-dim);
}
.sheet-foot { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: center; }

/* ============================================================================
   RESULT
   ============================================================================ */
.result { padding: 24px 0 90px; }
.result-top { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: center; }
@media (max-width: 720px){ .result-top { grid-template-columns: 1fr; justify-items: center; text-align: center; } }

.stamp {
  position: relative; aspect-ratio: 1; width: 220px; border-radius: 18px;
  display: grid; place-items: center; color: #1a1206;
  background: radial-gradient(120% 120% at 30% 20%, var(--gold-hi), var(--gold) 60%, color-mix(in srgb, var(--gold) 70%, #000));
  box-shadow: 0 22px 50px -18px rgba(231,181,60,.5), inset 0 2px 10px rgba(255,255,255,.4);
  transform: rotate(-4deg); animation: stampdrop .6s cubic-bezier(.2,1.5,.4,1) both;
  overflow: hidden;
}
.stamp.tier-bad { background: radial-gradient(120% 120% at 30% 20%, #6e7a6e, #3c463c 70%); color: #f4eedd; box-shadow: 0 22px 50px -22px rgba(0,0,0,.6); }
@keyframes stampdrop { 0%{ transform: scale(2.4) rotate(14deg); opacity: 0 } 60%{ opacity:1 } 100%{ transform: rotate(-4deg) scale(1) } }
.stamp::after { content:""; position:absolute; inset:0; mix-blend-mode: overlay; opacity:.4; background: linear-gradient(120deg, transparent 35%, rgba(255,255,255,.7) 48%, transparent 62%); animation: sheen 2.6s ease-in-out infinite; }
@keyframes sheen { 0%,100%{ transform: translateX(-30%) } 50%{ transform: translateX(30%) } }
.stamp .g { font-family: var(--font-display); font-weight: 800; font-size: clamp(3rem,9vw,4.4rem); line-height: .8; }
.stamp .seal { position: absolute; bottom: 12px; font-family: var(--font-mono); font-size: .56rem; letter-spacing: .2em; text-transform: uppercase; opacity: .8; }

.result-head .honour { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem,7vw,3.2rem); letter-spacing: -.02em; line-height: .95; }
.result-head .flavour { color: var(--ink-dim); font-size: 1.05rem; margin-top: 6px; }
.result-record { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.rstat { border: 1px solid var(--line); background: var(--paper-2); border-radius: 10px; padding: 8px 14px; text-align: center; }
.rstat .v { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; line-height: 1; }
.rstat .k { font-family: var(--font-mono); font-size: .56rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); margin-top: 4px; }
.rstat.win .v { color: var(--turf-glow); } .rstat.gold .v { color: var(--gold); }

/* teletext panels */
.tele {
  background: #05100a; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  font-family: var(--font-mono); margin-top: 22px;
}
[data-theme="light"] .tele { background: #0a1c12; color: #eafff0; }
.tele-h { background: var(--gold); color: #1a1206; padding: 7px 14px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .7rem; display: flex; justify-content: space-between; }
.tele-b { padding: 10px 6px; }
.trow { display: grid; grid-template-columns: 26px 1fr 30px 30px 30px 34px 40px; gap: 4px; padding: 3px 10px; font-size: .76rem; align-items: center; color: #cfe8d6; }
.trow.head { color: var(--gold); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; }
.trow.you { background: rgba(231,181,60,.14); color: var(--gold-hi); border-radius: 5px; font-weight: 700; }
.trow .pos { color: #7fd6a0; } .trow.you .pos { color: var(--gold-hi); }
.trow .nm { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .num { text-align: right; }
.trow . qual { font-size: .56rem; }
.zone-ucl { box-shadow: inset 3px 0 0 var(--turf-glow); }
.zone-rel { box-shadow: inset 3px 0 0 var(--red); }

.runrow { display: flex; gap: 3px; flex-wrap: wrap; padding: 4px 12px 12px; }
.runrow .m { width: 17px; height: 17px; border-radius: 4px; font-family: var(--font-mono); font-size: .56rem; font-weight: 700; display: grid; place-items: center; color: #06140b; }
.m.W { background: var(--turf-glow); } .m.D { background: #c9b15a; color:#1a1206; } .m.L { background: var(--red); color:#fff; }

/* result lineup table */
.lineup-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .82rem; }
.lineup-table th { font-family: var(--font-mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.lineup-table th:first-child, .lineup-table td:first-child { text-align: left; }
.lineup-table td { padding: 8px; border-bottom: 1px solid var(--line-2); font-family: var(--font-mono); text-align: right; }
.lineup-table td.nm { font-family: var(--font-body); font-weight: 700; }
.lineup-table tfoot td, .lineup-table tr.tot td { font-weight: 800; color: var(--gold); border-top: 1px solid var(--line); }

.result-cta { display: flex; gap: 12px; margin: 22px 0; flex-wrap: wrap; }

/* ============================================================================
   MODALS
   ============================================================================ */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); z-index: 100; display: grid; place-items: center; padding: 18px; }
.modal {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 16px; max-width: 540px; width: 100%;
  max-height: 86vh; overflow-y: auto; box-shadow: var(--shadow); animation: modalin .25s ease both;
}
@keyframes modalin { from { transform: translateY(16px) scale(.98); opacity: 0; } }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper-2); }
.modal-h h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; }
.modal-b { padding: 18px 20px; }
.modal-b h4 { font-family: var(--font-display); margin: 18px 0 6px; font-size: 1rem; color: var(--gold); }
.modal-b p, .modal-b li { color: var(--ink-dim); font-size: .92rem; }
.modal-b ol, .modal-b ul { padding-left: 20px; }
.how-step { display: flex; gap: 12px; margin: 12px 0; }
.how-step .num { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--gold); flex: none; width: 30px; }

/* ============================================================================
   COLLECTION
   ============================================================================ */
.collection { padding: 24px 0 90px; }
.col-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.col-tiers { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.col-tier { flex: 1; min-width: 130px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); padding: 12px 16px; }
.col-tier .ct-n { font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; line-height: 1; }
.col-tier .ct-l { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute); margin-top: 5px; }
.col-tier.champ { border-color: color-mix(in srgb, var(--gold) 35%, var(--line)); }
.col-tier.champ .ct-n { color: var(--gold); }
.col-tier.inv { border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.col-tier.inv .ct-n { color: var(--gold-hi); }
.col-tier.imm {
  background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 22%, var(--paper-2)), var(--paper-2));
  border-color: var(--gold); box-shadow: 0 0 22px -6px color-mix(in srgb, var(--gold) 55%, transparent);
}
.col-tier.imm .ct-n { color: var(--gold-hi); }
.gchip {
  flex: none; font-family: var(--font-mono); font-weight: 700; font-size: .58rem; padding: 2px 5px;
  border-radius: 5px; border: 1px solid var(--line); color: var(--ink-dim); background: var(--paper-3);
}
.gchip.champ { color: #1a1206; background: var(--gold); border-color: transparent; }
.gchip.inv { color: #1a1206; background: linear-gradient(135deg, var(--gold-hi), var(--gold)); border-color: transparent; }
.gchip.imm {
  color: #1a1206; background: linear-gradient(135deg, #fff2c4, var(--gold-hi) 55%, var(--gold));
  border-color: transparent; box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 45%, transparent), 0 0 12px -2px var(--gold-hi);
}
.col-prog { height: 8px; border-radius: 5px; background: var(--paper-2); border: 1px solid var(--line); overflow: hidden; margin: 14px 0 4px; }
.col-prog-fill { height: 100%; background: linear-gradient(90deg, var(--turf), var(--gold)); transition: width .4s; }
.col-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 8px; }
.col-card {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--paper-2); opacity: .5; transition: .15s; position: relative;
}
.col-card.caught { opacity: 1; border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.col-av { width: 32px; height: 32px; flex: none; border-radius: 8px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: .76rem; background: var(--club); color: var(--on); filter: grayscale(.6); }
.col-card.caught .col-av { filter: none; }
.col-meta { min-width: 0; flex: 1; }
.col-nm { font-weight: 700; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-sub { font-size: .62rem; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-tick { color: var(--gold); font-weight: 800; flex: none; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 10px; z-index: 200;
  font-weight: 700; font-size: .88rem; box-shadow: var(--shadow); animation: toastin .2s ease both;
}
@keyframes toastin { from { transform: translate(-50%, 12px); opacity: 0; } }

/* utility */
.flex { display: flex; } .between { justify-content: space-between; } .center { align-items: center; }
.gap { gap: 10px; } .wrapf { flex-wrap: wrap; }
[x-cloak] { display: none !important; }

/* ---- responsive ---------------------------------------------------------- */
@media (min-width: 900px) {
  .draft { grid-template-columns: 1.05fr .95fr; align-items: start; }
  .draft .col-left { display: grid; gap: 18px; }
  .draft .col-right { position: sticky; top: 70px; }
}
@media (max-width: 560px) {
  .tagline { display: none; }
  .slot, .sticker { width: 70px; min-height: 86px; }
  .pill.long { display: none; }
  .trow { grid-template-columns: 22px 1fr 26px 26px 26px 30px 34px; font-size: .68rem; }
  .topbar-inner { padding: 10px 12px; gap: 9px; }
  .brand { gap: 7px; }
  .brand .crest { width: 26px; height: 30px; }
  .wordmark { font-size: 1rem; }
  .iconbtn { width: 31px; height: 31px; font-size: 14px; }
  .pill { padding: 5px 8px; font-size: .68rem; }
  .wrap { padding: 0 12px; }
}
/* overflow backstop on the main scroll containers (§6) */
.topbar, .topbar-inner, main { overflow-x: clip; }
