/* ================================================================
   Spin XI — styles
   ================================================================ */

:root {
  --ink: #0b1320;          /* header, hero, dark text */
  --ink-2: #172234;
  --ink-3: #24324a;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --line: #e3e8ef;
  --line-2: #d3dae4;
  --text: #0b1320;
  --muted: #5d6879;
  --faint: #8b95a5;
  --brand: #1fc16b;        /* pitch green */
  --brand-ink: #0b8a4a;
  --brand-soft: #e3f8ed;
  --lime: #c6f432;         /* highlight on dark */
  --gold: #ffc53d;         /* captain */
  --gold-ink: #8a5a00;
  --red: #e5484d;
  --red-soft: #fdecec;
  --amber-soft: #fff4d6;
  --pitch1: #2f9e55;
  --pitch2: #2a914d;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(11, 19, 32, 0.06);
  --shadow: 0 1px 2px rgba(11, 19, 32, 0.05), 0 6px 20px rgba(11, 19, 32, 0.06);
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 28px; height: 64px;
  background: var(--ink); color: #fff;
  position: sticky; top: 0; z-index: 20;
}
.brand { cursor: pointer; display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-logo { width: 38px; height: 38px; display: block; }
.brand-word {
  font-family: var(--display); font-weight: 800; font-size: 26px;
  letter-spacing: 0.5px; line-height: 1; text-transform: uppercase;
}
.brand-word em { font-style: normal; color: var(--lime); }
.brand-season {
  color: rgba(255, 255, 255, 0.55); font-size: 12px; font-weight: 500;
  border-left: 1px solid rgba(255, 255, 255, 0.18); padding-left: 10px; margin-left: 2px;
}
nav { display: flex; gap: 4px; margin-left: auto; }
.nav-tab {
  background: none; border: none; color: rgba(255, 255, 255, 0.72);
  font-size: 14px; font-weight: 600; padding: 9px 14px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.nav-tab svg { width: 16px; height: 16px; }
.nav-tab:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav-tab.sel { color: var(--ink); background: var(--lime); }

.comp-switch { display: flex; gap: 6px; }
.comp-pill {
  background: var(--ink-2); color: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--ink-3); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.comp-pill.sel { background: var(--lime); color: var(--ink); border-color: var(--lime); }

main { max-width: 1080px; margin: 0 auto; padding: 28px 20px 80px; }

h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.2px; }

/* ---------- buttons ---------- */
.big-btn {
  background: var(--brand); color: #fff;
  font-weight: 700; font-size: 16px;
  border: none; border-radius: 12px; padding: 14px 28px;
  cursor: pointer; letter-spacing: 0.1px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 6px 16px rgba(31, 193, 107, 0.28);
  transition: transform 0.1s, background 0.15s;
}
.big-btn:hover:not(:disabled) { background: var(--brand-ink); transform: translateY(-1px); }
.big-btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.big-btn.gold { background: var(--gold); color: var(--ink); box-shadow: 0 6px 16px rgba(255, 197, 61, 0.35); }
.big-btn.gold:hover:not(:disabled) { background: #ffb800; }
.big-btn.lime { background: var(--lime); color: var(--ink); box-shadow: none; }
.big-btn.lime:hover:not(:disabled) { background: #b4e81c; }

.nav-btn {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 10px;
  padding: 8px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.nav-btn:hover:not(:disabled) { border-color: var(--text); }
.nav-btn.sel { background: var(--ink); border-color: var(--ink); color: #fff; }
.text-btn {
  background: none; border: none; color: var(--muted);
  font-size: 13px; cursor: pointer; margin-top: 14px; text-decoration: underline;
}
.text-btn:hover { color: var(--red); }

/* ---------- images: photos, kits, badges ---------- */
.badge-img { width: 22px; height: 22px; object-fit: contain; flex: 0 0 auto; }
.photo {
  display: block; object-fit: cover; object-position: center top;
  background: linear-gradient(180deg, #e9eef4, #d9e1ea);
  border-radius: 50%;
}

/* ---------- home / hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(198, 244, 50, 0.16), transparent 60%),
    radial-gradient(500px 260px at 0% 100%, rgba(31, 193, 107, 0.22), transparent 60%),
    var(--ink);
  color: #fff; border-radius: 22px;
  padding: 34px 34px 28px; margin-bottom: 22px;
}
.hero::after {               /* faint centre-circle motif */
  content: ""; position: absolute; right: -90px; top: -90px;
  width: 320px; height: 320px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 60px rgba(255, 255, 255, 0.025);
  pointer-events: none;
}
.hero-art {
  position: absolute; right: 48px; top: 50%; width: 220px; height: 220px;
  transform: translateY(-50%) rotate(-12deg); opacity: 0.95; pointer-events: none;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.4));
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--lime); margin-bottom: 10px;
}
.hero-tag .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(198, 244, 50, 0.6); animation: live 1.6s infinite; }
.hero-tag.done { color: rgba(255, 255, 255, 0.6); }
@keyframes live { 70% { box-shadow: 0 0 0 8px rgba(198, 244, 50, 0); } 100% { box-shadow: 0 0 0 0 rgba(198, 244, 50, 0); } }
.hero h1 {
  font-family: var(--display); font-weight: 800; font-size: 52px; line-height: 0.95;
  text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 14px;
}
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 22px; color: rgba(255, 255, 255, 0.72); font-size: 14px; }
.hero-meta b { color: #fff; font-weight: 600; }
.countdown {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px; padding: 4px 12px; font-weight: 600; color: #fff; font-size: 13px;
}
.hero-sub { color: rgba(255, 255, 255, 0.7); margin-bottom: 18px; }
.live-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.respin-tip { margin-top: 12px; max-width: 460px; color: rgba(255, 255, 255, 0.72); font-size: 13px; position: relative; }
.respin-tip b { color: #fff; }
.entries-closed {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(229, 72, 77, 0.16); border: 1px solid rgba(229, 72, 77, 0.5);
  color: #ffb4b6; border-radius: 12px; padding: 12px 20px; font-weight: 600; font-size: 14px;
}

.fixtures-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 6px; margin-bottom: 26px; box-shadow: var(--shadow-sm);
}
.fixtures-card h3 { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; padding: 10px 14px 6px; }
.live-fixtures { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.lf-row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  padding: 9px 14px; font-size: 14px; border-radius: 10px;
}
.lf-row:hover { background: var(--surface-2); }
.lf-team { display: flex; align-items: center; gap: 8px; font-weight: 600; justify-content: flex-end; min-width: 0; }
.lf-team span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lf-team.away { justify-content: flex-start; }
.lf-mid { color: var(--muted); min-width: 84px; text-align: center; font-size: 12px; line-height: 1.2; }
.lf-mid b {
  display: inline-block; color: #fff; background: var(--ink); font-size: 14px;
  border-radius: 6px; padding: 3px 9px; font-variant-numeric: tabular-nums;
}

.season-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 30px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; box-shadow: var(--shadow-sm);
}
.stat-card .num { font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1; color: var(--text); }
.stat-card .lbl { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; margin-top: 4px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.history-empty {
  color: var(--muted); font-size: 14px; padding: 22px; text-align: center;
  background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius);
}
.history-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, transform 0.1s;
}
.history-row:hover { border-color: var(--line-2); transform: translateY(-1px); box-shadow: var(--shadow); }
.history-row.othercomp { opacity: 0.55; }
.history-gw { font-family: var(--display); font-weight: 800; font-size: 22px; min-width: 70px; text-transform: uppercase; }
.history-meta { color: var(--muted); font-size: 13px; flex: 1; min-width: 0; }
.history-meta .faces { display: flex; margin-top: 6px; }
.history-meta .faces .photo { width: 26px; height: 26px; border: 2px solid var(--surface); margin-right: -6px; }
.history-score { font-family: var(--display); font-size: 30px; font-weight: 800; min-width: 70px; text-align: right; line-height: 1; }
.history-score small { font-family: "Inter", sans-serif; font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 2px; }

/* ---------- setup ---------- */
.setup-step { font-size: 18px; margin: 4px 0 14px; }
.setup-step + .gw-grid, .setup-step + .formation-grid { margin-bottom: 26px; }
.gw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.gw-btn {
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 9px 4px; cursor: pointer; text-align: center;
}
.gw-btn .g { font-weight: 700; font-size: 15px; }
.gw-btn .d { font-size: 11px; color: var(--muted); }
.gw-btn:hover { border-color: var(--text); }
.gw-btn.sel { background: var(--ink); border-color: var(--ink); }
.gw-btn.sel .g, .gw-btn.sel .d { color: #fff; }

.formation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.form-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; cursor: pointer; text-align: center; box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, transform 0.1s;
}
.form-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.form-card.sel { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 193, 107, 0.25); }
.form-card .fname { font-family: var(--display); font-weight: 800; font-size: 22px; margin-bottom: 8px; }
.form-mini {
  position: relative; width: 100%; aspect-ratio: 3/3.4; border-radius: 8px;
  background: repeating-linear-gradient(0deg, var(--pitch1) 0 12.5%, var(--pitch2) 12.5% 25%);
}
.form-mini .dot {
  position: absolute; width: 12%; aspect-ratio: 1; border-radius: 50%;
  background: #fff; transform: translate(-50%, -50%); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.form-card.sel .form-mini .dot { background: var(--lime); }
.setup-actions { margin-top: 8px; text-align: center; }

/* ---------- pitch (game + team view) ---------- */
.game-layout { display: grid; grid-template-columns: minmax(360px, 540px) minmax(280px, 1fr); gap: 24px; align-items: start; justify-content: center; }
.game-status {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 12px; font-size: 14px; box-shadow: var(--shadow-sm);
  display: flex; justify-content: space-between; align-items: center;
}
.game-status b { font-weight: 700; }
.status-count { font-family: var(--display); font-weight: 800; font-size: 22px; }
.status-count small { font-family: "Inter", sans-serif; font-size: 12px; color: var(--muted); font-weight: 600; }

.pitch {
  position: relative; width: 100%; aspect-ratio: 68/86;
  border-radius: 18px; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.12), transparent 60%),
    repeating-linear-gradient(0deg, var(--pitch1) 0 10%, var(--pitch2) 10% 20%);
  box-shadow: var(--shadow);
}
.pitch::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.5)) 0 32%/100% 2px no-repeat,
    radial-gradient(circle at 50% 32.5%, transparent 8.4%, rgba(255,255,255,.5) 8.6%, rgba(255,255,255,.5) 9%, transparent 9.2%);
  pointer-events: none;
}
.pitch::after { content: ""; position: absolute; inset: 10px; border: 2px solid rgba(255,255,255,.5); border-radius: 6px; pointer-events: none; }
.pen-box { position: absolute; left: 22%; width: 56%; height: 15%; border: 2px solid rgba(255,255,255,.5); pointer-events: none; }
.pen-box.bottom { bottom: 10px; border-bottom: none; }
.six-box { position: absolute; left: 37%; width: 26%; height: 6%; border: 2px solid rgba(255,255,255,.5); pointer-events: none; }
.six-box.bottom { bottom: 10px; border-bottom: none; }

/* cards scale with the pitch: a line of --cols players always fits across */
.pitch { container-type: inline-size; }
.slot {
  position: absolute; transform: translate(-50%, -50%);
  width: min(88px, calc(88cqw / var(--cols, 5) - 4px));
  text-align: center; cursor: default; z-index: 2;
}
.slot .disc {
  position: relative;
  width: min(58px, 13.5cqw, 78%); aspect-ratio: 1; margin: 0 auto; border-radius: 50%;
  border: 2px dashed rgba(255,255,255,.8); background: rgba(0,0,0,.16);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: #fff; letter-spacing: 0.5px;
}
.pitch.five-lines .slot .disc { width: min(46px, 10cqw, 78%); }
.slot.filled .disc { border: 2px solid #fff; background: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.slot .disc .photo { width: 100%; height: 100%; }
.slot .disc .badge-img {
  position: absolute; right: -6px; bottom: -3px; width: 38%; height: 38%;
  background: #fff; border-radius: 50%; padding: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.slot .nameplate {
  margin-top: 5px; font-size: clamp(9px, 2.7cqw, 11px); font-weight: 700; color: var(--ink);
  background: #fff; border-radius: 6px 6px 0 0; padding: 3px 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.slot .nameplate:last-child { border-radius: 6px; }
.slot .ptsplate {
  font-size: clamp(10px, 3cqw, 12px); font-weight: 800; color: #fff; background: var(--ink);
  border-radius: 0 0 6px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 4px; font-variant-numeric: tabular-nums;
}
.slot .ptsplate.pend { font-weight: 600; font-size: clamp(9px, 2.5cqw, 10px); color: rgba(255,255,255,.75); background: var(--ink-3); }
.slot .ptsplate.cap { background: var(--gold); color: var(--ink); }
.slot .roleplate { margin-top: 3px; font-size: 10px; color: rgba(255,255,255,.9); font-weight: 700; letter-spacing: .5px; }
.slot .cap-badge {
  position: absolute; top: -5px; left: 10px; z-index: 3;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold); color: var(--ink);
  font-weight: 900; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.slot .avail-dot {
  position: absolute; top: -5px; right: 6px; z-index: 3;
  font-size: 9px; font-weight: 800; letter-spacing: .2px; line-height: 1;
  padding: 3px 5px; border-radius: 999px; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.3); cursor: help;
}
.slot .avail-dot.doubt { background: var(--gold); color: var(--ink); }
.slot .avail-dot.out { background: #e5484d; color: #fff; }
.slot.respin-select { cursor: pointer; }
.slot.respin-select:hover .disc { box-shadow: 0 0 0 6px rgba(229, 72, 77, 0.45); border-color: #e5484d; }
.slot.respin-out .disc {
  border-color: #e5484d;
  animation: respin-glow 1.1s ease-in-out infinite alternate;
}
@keyframes respin-glow {
  from { box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.7), 0 0 8px 2px rgba(229, 72, 77, 0.45); }
  to { box-shadow: 0 0 0 5px rgba(229, 72, 77, 0.9), 0 0 22px 8px rgba(229, 72, 77, 0.6); }
}
.slot.cap-select { cursor: pointer; }
.slot.cap-select:hover .disc { box-shadow: 0 0 0 6px rgba(255, 197, 61, 0.45); }
.slot.cap-select.cap-prompt .disc { animation: pulse 1s infinite; border-color: var(--gold); }
.slot.cap-select.cap-picked .disc { border-color: var(--gold); box-shadow: 0 0 0 5px rgba(255, 197, 61, 0.55); }
.slot.placeable .disc {
  border: 2px solid var(--lime); background: rgba(198, 244, 50, 0.25);
  animation: pulse 1s infinite; cursor: pointer;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25); }
  50% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.4); }
}
.cap-tag {
  display: inline-block; background: var(--gold); color: var(--ink);
  font-weight: 900; font-size: 10px; border-radius: 4px;
  padding: 1px 6px; margin-left: 6px; vertical-align: middle;
}

/* ---------- slot-machine reel ---------- */
.wheel-col { display: flex; flex-direction: column; align-items: center; position: sticky; top: 84px; }
.spinner {
  position: relative; width: 100%; height: 150px; overflow: hidden;
  background: var(--ink); border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), var(--shadow);
}
.spinner::before, .spinner::after {
  content: ""; position: absolute; left: 0; right: 0; height: 50px;
  z-index: 2; pointer-events: none;
}
.spinner::before { top: 0; background: linear-gradient(var(--ink), rgba(11,19,32,0)); }
.spinner::after { bottom: 0; background: linear-gradient(rgba(11,19,32,0), var(--ink)); }
.reel-band {
  position: absolute; top: 52px; height: 46px; left: 10px; right: 10px; z-index: 1;
  border-radius: 10px; background: rgba(255,255,255,.06);
  box-shadow: inset 0 0 0 2px var(--team-color, var(--lime));
  transition: box-shadow 0.2s;
  pointer-events: none;
}
.reel-strip { position: absolute; left: 0; right: 0; top: 6px; will-change: transform; }
.reel-row {
  height: 46px; display: flex; align-items: center; justify-content: center;
  gap: 10px; font-weight: 700; font-size: 18px; white-space: nowrap; color: #fff;
}
.reel-row.muted { color: rgba(255,255,255,.55); font-weight: 500; font-size: 15px; }
.reel-row .badge-img { width: 26px; height: 26px; }
.spinner.blur .reel-strip { filter: blur(1.4px); }
.spinner.landed .reel-row b { font-family: var(--display); font-size: 26px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; }
.spinner.landed .reel-row .badge-img { width: 32px; height: 32px; }
#spin-btn { margin-top: 12px; width: 100%; font-family: var(--display); font-size: 24px; font-weight: 800; letter-spacing: 2px; padding: 12px; }
#score-btn { margin-top: 10px; width: 100%; }
.wheel-result { margin-top: 12px; min-height: 28px; font-size: 14px; text-align: center; color: var(--muted); }
.wheel-result b { color: var(--text); }
.captain-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0 0 12px; padding: 10px 14px; border-radius: 12px;
  background: var(--amber-soft); color: var(--gold-ink); font-weight: 700; font-size: 15px;
  border: 1px solid #ffe08a;
}
.captain-banner .cap-tag { margin: 0; font-size: 12px; }

/* ---------- picker modal ---------- */
#modal-backdrop {
  position: fixed; inset: 0; background: rgba(11, 19, 32, 0.55);
  display: flex; align-items: center; justify-content: center; z-index: 50;
  backdrop-filter: blur(4px);
}
#picker-modal {
  background: var(--surface); border-radius: 20px;
  width: min(680px, 94vw); max-height: 86vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(11, 19, 32, 0.35); overflow: hidden;
}
.picker-head {
  padding: 18px 22px; display: flex; align-items: center; gap: 16px;
  background: var(--club, var(--ink)); color: var(--club-text, #fff);
}
.picker-head .crest { width: 58px; height: 58px; background: #fff; border-radius: 14px; padding: 7px; flex: 0 0 auto; display: flex; }
.picker-head .crest .badge-img { width: 100%; height: 100%; }
.picker-head .club { font-family: var(--display); font-size: 30px; font-weight: 800; text-transform: uppercase; line-height: 1; }
.picker-head .sub { font-size: 13px; opacity: 0.85; }
.picker-head .fixture-line { margin: 4px 0 2px; }
.picker-head .fixt { font-size: 13px; font-weight: 600; }
.picker-head .fixt.warn { background: rgba(0,0,0,.25); padding: 2px 8px; border-radius: 6px; }
.picker-body { overflow-y: auto; padding: 8px 14px 18px; }

.player-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 12px; margin-top: 4px;
  border: 1px solid transparent;
}
.player-row.pickable { cursor: pointer; }
.player-row.pickable:hover { border-color: var(--line-2); background: var(--surface-2); }
.player-row.dim { opacity: 0.42; }
.player-row .photo { width: 44px; height: 44px; flex: 0 0 auto; }
.player-main { flex: 1; min-width: 0; }
.player-name { font-weight: 700; font-size: 15px; }
.player-sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
.player-sub .dnp { color: var(--red); font-weight: 600; }
.avail {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; vertical-align: 2px;
  font-size: 10px; font-weight: 700; letter-spacing: .3px;
  border-radius: 999px; padding: 2px 8px;
}
.avail::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.avail.doubt { background: var(--amber-soft); color: var(--gold-ink); }
.avail.out { background: var(--red-soft); color: #b4232a; }
.player-news { font-size: 12px; margin-top: 2px; }
.player-news.doubt { color: var(--gold-ink); }
.player-news.out { color: #b4232a; }
.ppg { text-align: right; min-width: 54px; font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1; }
.ppg span { display: block; font-family: "Inter", sans-serif; font-size: 9px; font-weight: 600; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; margin-top: 2px; }
.pos-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  font-size: 10px; font-weight: 700; letter-spacing: .5px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; color: var(--muted);
}
.chip.fit { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.picker-empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.picker-empty .big-btn { margin-top: 16px; }
.keep-btn { display: block; width: calc(100% - 20px); margin: 10px 10px 6px; }
.picker-note { color: var(--muted); font-size: 12px; font-weight: 600; padding: 14px 10px 2px; text-transform: uppercase; letter-spacing: .6px; }

/* ---------- leaderboard ---------- */
.board-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; }
.board-head h2 { font-size: 28px; font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .3px; }
.board-name-row { display: flex; gap: 8px; align-items: center; }
#board-name, #gate-name {
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text);
  border-radius: 10px; padding: 8px 12px; font-size: 14px; width: 170px; font-family: inherit;
}
#board-name:focus, #gate-name:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 193, 107, 0.2); }
.board-nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.board-nav .nav-btn:disabled { opacity: 0.35; cursor: default; }
.board-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.board-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.board-row:last-child { border-bottom: none; }
.board-row:hover { background: var(--surface-2); }
.board-row.me { background: var(--brand-soft); }
.board-row.static { cursor: default; }
.board-rank {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: var(--muted); background: var(--surface-2);
}
.board-rank.r1 { background: #ffd54a; color: #5c4300; }
.board-rank.r2 { background: #dfe4ea; color: #3b4452; }
.board-rank.r3 { background: #f1c7a1; color: #6b3b13; }
.board-player { flex: 1; min-width: 0; }
.board-pname { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.board-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.board-faces { display: flex; align-items: center; }
.board-faces .photo { width: 30px; height: 30px; border: 2px solid var(--surface); margin-left: -8px; }
.board-row:hover .board-faces .photo { border-color: var(--surface-2); }
.board-faces .photo:first-child { margin-left: 0; }
.board-total { font-family: var(--display); font-size: 32px; font-weight: 800; text-align: right; min-width: 56px; line-height: 1; }
.board-total .board-live {
  display: block; font-family: "Inter", sans-serif; font-size: 10px; font-weight: 700; color: var(--brand-ink);
  text-transform: uppercase; letter-spacing: 1px; margin-top: 2px;
}
.submit-note { margin-top: 14px; font-size: 14px; color: var(--muted); }
.submit-note b { color: var(--text); }

/* ---------- team view (results) ---------- */
.results-head {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  margin-bottom: 18px;
}
.results-head .kicker { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.results-head .owner { font-family: var(--display); font-size: 34px; font-weight: 800; text-transform: uppercase; line-height: 1.05; }
.results-head .sub { color: var(--muted); margin-top: 4px; font-size: 14px; }
.results-head .formation-tag { color: var(--text); font-weight: 700; }
.results-head .total-box {
  background: var(--ink); color: #fff; border-radius: 16px; padding: 12px 22px; text-align: center;
}
.results-head .total { font-family: var(--display); font-size: 56px; font-weight: 800; line-height: 1; color: var(--lime); }
.results-head .total-lbl { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; opacity: .7; }
.results-layout { display: grid; grid-template-columns: minmax(340px, 520px) minmax(300px, 1fr); gap: 24px; align-items: start; }
.results-layout .pitch { max-width: 520px; }
.pending-note {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--gold-ink); background: var(--amber-soft); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600;
}
.result-row {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; margin-bottom: 6px;
}
.result-row .photo { width: 40px; height: 40px; flex: 0 0 auto; }
.result-main { flex: 1; min-width: 0; }
.result-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.result-name .badge-img { width: 16px; height: 16px; }
.result-role { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.break-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.bchip { font-size: 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; color: var(--muted); font-weight: 500; }
.bchip.pos { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.bchip.neg { background: var(--red-soft); border-color: transparent; color: #b4232a; }
.bchip.pend { background: var(--amber-soft); border-color: transparent; color: var(--gold-ink); }
.result-pts { font-family: var(--display); font-size: 28px; font-weight: 800; min-width: 40px; text-align: right; line-height: 1; }
.result-pts.pos { color: var(--brand-ink); }
.result-pts.neg { color: var(--red); }
.result-pts.zero { color: var(--faint); }
.results-actions { text-align: center; margin-top: 28px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- notices ---------- */
.closed-note {
  background: var(--red-soft); border: 1px solid #f6c3c4;
  color: #b4232a; border-radius: 12px; padding: 12px 16px;
  font-weight: 600; font-size: 14px; margin: 0 0 16px;
}

/* ---------- first-visit name gate ---------- */
.name-gate {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 34px 26px; text-align: center; margin: 20px auto; max-width: 460px; box-shadow: var(--shadow);
}
.name-gate img { width: 56px; height: 56px; margin-bottom: 12px; }
.name-gate h2 { font-size: 24px; margin-bottom: 6px; }
.name-gate p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.name-gate-row { display: flex; gap: 10px; justify-content: center; }
#gate-name { padding: 12px 14px; font-size: 16px; width: 200px; }

/* ---------- how to play ---------- */
.howto-title { font-family: var(--display); font-size: 32px; font-weight: 800; text-transform: uppercase; margin: 0 0 16px; }
.howto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.howto-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.howto-card h3 { font-size: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.howto-card h3 .n {
  width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--lime);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.howto-card ol { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.howto-card li { font-size: 14px; line-height: 1.55; color: #2b3443; }
.howto-sub { font-size: 18px; margin: 28px 0 10px; }
.score-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.score-table th, .score-table td {
  padding: 10px 16px; font-size: 14px; text-align: left;
  border-bottom: 1px solid var(--line);
}
.score-table tr:last-child td { border-bottom: none; }
.score-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; background: var(--surface-2); }
.score-table td:last-child, .score-table th:last-child {
  text-align: right; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.howto-note { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .game-layout, .results-layout { grid-template-columns: 1fr; }
  .wheel-col { order: -1; position: static; }
  .results-layout .pitch { margin: 0 auto; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 14px; gap: 10px; height: auto; min-height: 56px; flex-wrap: wrap; }
  .brand { padding: 9px 0; }
  .brand-season { display: none; }
  nav { margin-left: 0; width: 100%; overflow-x: auto; padding-bottom: 8px; order: 3; }
  .nav-tab { padding: 7px 12px; font-size: 13px; }
  main { padding: 18px 14px 60px; }
  .hero { padding: 24px 20px 22px; border-radius: 18px; }
  .hero h1 { font-size: 40px; }
  .hero-art { display: none; }
  .live-fixtures { grid-template-columns: 1fr; }
  .season-summary { gap: 8px; }
  .stat-card { padding: 12px 14px; }
  .stat-card .num { font-size: 30px; }
  .slot .disc { font-size: 10px; }
  .slot .nameplate { padding: 2px 3px; }
  .board-faces { display: none; }
  .results-head .owner { font-size: 28px; }
}
.results-head .submit-note { flex-basis: 100%; margin-top: 0; }

/* ---------- sign-in ---------- */
.nav-account { border: 1px solid rgba(255, 255, 255, 0.22); margin-left: 6px; }
.nav-account.in { border-color: transparent; }
#auth-backdrop {
  position: fixed; inset: 0; background: rgba(11, 19, 32, 0.55);
  display: flex; align-items: center; justify-content: center; z-index: 60;
  backdrop-filter: blur(4px); padding: 16px;
}
#auth-modal {
  background: var(--surface); border-radius: 20px;
  width: min(440px, 100%); padding: 32px 26px; text-align: center;
  box-shadow: 0 24px 80px rgba(11, 19, 32, 0.35);
}
.signin-panel img { width: 56px; height: 56px; margin-bottom: 12px; }
.signin-panel h2 { font-size: 24px; margin-bottom: 6px; }
.signin-panel p { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.signin-google {
  width: 100%; max-width: 320px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm);
}
.signin-google:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text); }
.signin-google svg { width: 20px; height: 20px; }
.signin-or {
  display: flex; align-items: center; gap: 10px; max-width: 320px; margin: 18px auto 12px;
  color: var(--faint); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
}
.signin-or::before, .signin-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.signin-email { display: flex; gap: 8px; justify-content: center; max-width: 320px; margin: 0 auto; }
.signin-email input {
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font-family: inherit;
  border-radius: 10px; padding: 10px 12px; font-size: 15px; flex: 1; min-width: 0;
}
.signin-email input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 193, 107, 0.2); }
.signin-email .nav-btn { white-space: nowrap; }
.signin-msg { min-height: 20px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.signin-msg.ok { color: var(--brand-ink); }
.signin-msg.err { color: var(--red); }
.signin-skip:hover { color: var(--text); }
.signin-account { font-size: 14px; color: var(--muted); margin-bottom: 18px; }

/* in-play gameweek: the player's live score */
.live-score { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; position: relative; }
.live-score .num { font-family: var(--display); font-weight: 800; font-size: 64px; line-height: 1; color: var(--lime); }
.live-score .lbl { color: rgba(255, 255, 255, 0.72); font-size: 15px; font-weight: 600; }
.live-faces { display: flex; margin-bottom: 20px; position: relative; }
.live-faces .photo { width: 34px; height: 34px; border: 2px solid var(--ink); margin-right: -8px; }
.big-btn.ghost { background: rgba(255, 255, 255, 0.08); color: #fff; border: 1px solid rgba(255, 255, 255, 0.25); box-shadow: none; }
.big-btn.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); }
