/* Touchline GM (forked from Gridiron GM's look): app-store style sports management UI. Phone first, widens to a side rail on desktop. */
:root {
  --bg: #06100c; --bg2: #0b1a14; --card: #111a31; --card2: #17223f; --card3: #1e2b4d;
  --line: rgba(255, 255, 255, 0.08); --line2: rgba(255, 255, 255, 0.14);
  --text: #eef2ff; --muted: #8e9abb; --dim: #5d6a8c;
  --accent: #3b82f6; --accent2: #93c5fd; --team1: #1e3a8a; --team2: #3b82f6;
  --good: #34d399; --bad: #f87171; --warn: #fbbf24; --gold: #fcd34d; --blue: #60a5fa; --purple: #c084fc;
  --radius: 16px; --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body { display: flex; flex-direction: column; overflow: hidden; overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
#app { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }

/* ── Buttons ── */
.btn { min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--card3); color: var(--text);
  font-size: 0.95rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.08s ease, filter 0.15s ease, background 0.15s; user-select: none; -webkit-tap-highlight-color: transparent; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; transform: none; }
.btn:focus-visible, .chip:focus-visible, .tab:focus-visible, .row:focus-visible, .team-tile:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; }
.btn.primary { background: linear-gradient(180deg, var(--accent2) -60%, var(--accent) 100%); color: var(--accent-ink, #fff); box-shadow: 0 6px 18px -6px var(--accent); text-shadow: 0 1px 1px rgba(0,0,0,.35); }
.btn.big { min-height: 56px; font-size: 1.1rem; border-radius: 14px; padding: 0 24px; }
.btn.good { background: #10b981; color: #04261a; }
.btn.danger { background: #3a1a22; color: #fecaca; }
.btn.ghost { background: transparent; border: 1px solid var(--line2); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 0.85rem; border-radius: 10px; }
.btn.wide { width: 100%; }
.icon-btn { min-width: 44px; min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--text); font-size: 1.2rem; cursor: pointer; }
.icon-btn:hover { background: var(--card2); }

/* ── Title screen ── */
.title-screen { flex: 1; min-height: 0; overflow-y: auto; position: relative; display: flex; flex-direction: column; align-items: center; padding: 28px 16px 32px; gap: 22px;
  background: radial-gradient(ellipse at 50% -10%, #1f6b3f 0%, transparent 60%), repeating-linear-gradient(90deg, #0b1f13 0 60px, #0e2617 60px 120px); }
.title-screen::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,11,22,.15), rgba(7,11,22,.92) 70%); pointer-events: none; }
.title-screen > * { position: relative; }
.logo { text-align: center; margin-top: 4vh; }
.logo-ball { width: 78px; height: 78px; margin: 0 auto 12px; border-radius: 50%; position: relative; overflow: hidden;
  background: radial-gradient(circle at 34% 30%, #ffffff 0 30%, #e5e7eb 60%, #9ca3af 100%);
  box-shadow: 0 12px 30px rgba(0,0,0,.5), inset -6px -8px 14px rgba(0,0,0,.25); animation: ballFloat 4s ease-in-out infinite; }
/* A centre pentagon and five edge patches: enough to read as a football */
.logo-ball::before { content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 29px; margin: -15px 0 0 -15px; background: #111827;
  clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); }
.logo-ball::after { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% -6%, #111827 0 13px, transparent 14px), radial-gradient(circle at 104% 38%, #111827 0 13px, transparent 14px),
    radial-gradient(circle at 84% 104%, #111827 0 13px, transparent 14px), radial-gradient(circle at 16% 104%, #111827 0 13px, transparent 14px),
    radial-gradient(circle at -4% 38%, #111827 0 13px, transparent 14px); }
@keyframes ballFloat { 0%, 100% { transform: rotate(-8deg) translateY(0); } 50% { transform: rotate(8deg) translateY(-8px); } }
.logo-word { font-size: clamp(2.4rem, 9vw, 4rem); font-weight: 900; font-style: italic; letter-spacing: -0.03em; line-height: 0.95; text-transform: uppercase;
  background: linear-gradient(180deg, #fff 30%, #a7e3bd); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 rgba(0,0,0,.4)); }
.logo-word span { background: linear-gradient(180deg, #fde68a, #f59e0b); -webkit-background-clip: text; background-clip: text; }
.logo-sub { color: var(--muted); margin-top: 8px; font-size: 0.95rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; }
.menu { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 12px; }
.slot { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: rgba(17,26,49,.88); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; text-align: left; width: 100%; min-height: 64px; backdrop-filter: blur(6px); }
.slot:hover { border-color: var(--line2); background: rgba(23,34,63,.95); }
.slot .meta { flex: 1; min-width: 0; }
.slot .meta b { display: block; font-size: 1rem; }
.slot .meta small { color: var(--muted); font-size: 0.82rem; }
.slot.empty { justify-content: center; color: var(--muted); border-style: dashed; }
.title-foot { color: var(--dim); font-size: 0.78rem; text-align: center; max-width: 420px; }

/* ── Team picker ── */
.picker { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px 32px; }
.picker-head { max-width: 1000px; margin: 0 auto 14px; display: flex; align-items: center; gap: 10px; }
.picker-head h2 { margin: 0; font-size: 1.4rem; font-style: italic; font-weight: 900; text-transform: uppercase; }
.team-grid { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.team-tile { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 12px 12px; cursor: pointer; text-align: left;
  background: linear-gradient(150deg, var(--c1) 0%, color-mix(in srgb, var(--c1) 40%, #070b16) 100%); min-height: 112px; display: flex; flex-direction: column; gap: 6px; }
.team-tile::after { content: attr(data-abbr); position: absolute; right: -6px; bottom: -14px; font-size: 3.4rem; font-weight: 900; font-style: italic; opacity: 0.12; }
.team-tile:hover { border-color: var(--c2); transform: translateY(-2px); }
.team-tile .city { font-size: 0.75rem; color: rgba(255,255,255,.75); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.team-tile .nick { font-size: 1.1rem; font-weight: 900; font-style: italic; text-transform: uppercase; line-height: 1; }
.team-tile .diff { margin-top: auto; font-size: 0.75rem; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.div-filter { max-width: 1000px; margin: 0 auto 12px; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }

/* ── Badges ── */
.badge { --s: 40px; width: var(--s); height: var(--s); flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-style: italic;
  font-size: calc(var(--s) * 0.32); letter-spacing: -0.02em; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c1) 70%, #fff), var(--c1) 60%); box-shadow: 0 0 0 3px var(--c2), 0 4px 12px rgba(0,0,0,.4); }
.badge.lg { --s: 64px; }
.badge.xl { --s: 92px; }
.badge.sm { --s: 28px; box-shadow: 0 0 0 2px var(--c2); }
.ovr { min-width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; font-size: 1.05rem; flex: none; font-variant-numeric: tabular-nums;
  background: var(--ovr-bg); color: var(--ovr-fg); }
.ovr.sm { min-width: 32px; height: 28px; font-size: 0.85rem; border-radius: 8px; }
.ovr.lg { min-width: 64px; height: 64px; font-size: 1.8rem; border-radius: 16px; }
.o-elite { --ovr-bg: linear-gradient(160deg, #fde68a, #d97706); --ovr-fg: #3b1d00; }
.o-great { --ovr-bg: linear-gradient(160deg, #6ee7b7, #059669); --ovr-fg: #022c1e; }
.o-good { --ovr-bg: linear-gradient(160deg, #7dd3fc, #2563eb); --ovr-fg: #04122e; }
.o-ok { --ovr-bg: #334155; --ovr-fg: #e2e8f0; }
.o-poor { --ovr-bg: #3f1d24; --ovr-fg: #fecaca; }
.pot { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.pot-Franchise { background: rgba(192,132,252,.18); color: #e9d5ff; }
.pot-Star { background: rgba(252,211,77,.16); color: #fde68a; }
.pot-Starter { background: rgba(96,165,250,.16); color: #bfdbfe; }
.pot-Backup { background: rgba(148,163,184,.14); color: #cbd5e1; }
.pot-Bust { background: rgba(248,113,113,.12); color: #fca5a5; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--card3); color: var(--muted); white-space: nowrap; }
.tag.good { background: rgba(52,211,153,.14); color: #a7f3d0; }
.tag.bad { background: rgba(248,113,113,.14); color: #fecaca; }
.tag.gold { background: rgba(252,211,77,.16); color: #fde68a; }
.tag.blue { background: rgba(96,165,250,.16); color: #bfdbfe; }

/* ── Shell ── */
.shell { flex: 1; min-height: 0; display: grid; grid-template-rows: auto 1fr auto; grid-template-areas: "bar" "view" "tabs"; }
.appbar { grid-area: bar; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, color-mix(in srgb, var(--team1) 55%, var(--bg)) 0%, var(--bg2) 70%); }
.appbar .t { flex: 1; min-width: 0; }
.appbar .t b { display: block; font-size: 1.02rem; font-weight: 900; font-style: italic; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .t small { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.phase-pill { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; background: var(--accent); color: #fff; margin-left: 6px; vertical-align: 1px; }
.view { grid-area: view; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 16px 16px 28px; }
.view-inner { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.tabs { grid-area: tabs; display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(12,19,36,.97); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { border: 0; background: transparent; color: var(--dim); min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 0.72rem; font-weight: 700; cursor: pointer; position: relative; }
.tab .ic { font-size: 1.3rem; filter: grayscale(1) opacity(.7); transition: transform .15s; }
.tab.on { color: var(--text); }
.tab.on .ic { filter: none; transform: translateY(-1px) scale(1.08); }
.tab.on::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.tab .dot { position: absolute; top: 9px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--bg2); }
@media (min-width: 900px) {
  .shell { grid-template-columns: 96px 1fr; grid-template-rows: auto 1fr; grid-template-areas: "bar bar" "tabs view"; }
  .tabs { grid-template-columns: 1fr; grid-auto-rows: 78px; align-content: start; border-top: 0; border-right: 1px solid var(--line); padding-top: 10px; }
  .tab.on::before { top: 20%; bottom: 20%; left: 0; right: auto; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  .view { padding: 22px 28px 40px; }
}

/* ── Cards ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h3 { margin: 0 0 12px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card h3 .r { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 600; }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid2 .span2 { grid-column: span 2; } }
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 20px; border: 1px solid var(--line2);
  background: radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--team2) 45%, transparent), transparent 55%), linear-gradient(140deg, color-mix(in srgb, var(--team1) 85%, #000) 0%, #0b1224 85%); box-shadow: var(--shadow); }
.hero::after { content: attr(data-abbr); position: absolute; right: -10px; bottom: -36px; font-size: 9rem; font-weight: 900; font-style: italic; opacity: 0.07; pointer-events: none; }
.hero-top { display: flex; align-items: center; gap: 14px; }
.hero-top .t { flex: 1; min-width: 0; }
.hero-top .t small { color: rgba(255,255,255,.7); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; }
.hero-top .t b { display: block; font-size: clamp(1.15rem, 5.4vw, 1.6rem); overflow-wrap: anywhere; font-weight: 900; font-style: italic; text-transform: uppercase; line-height: 1.05; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.hero-stats div { background: rgba(0,0,0,.25); border-radius: 12px; padding: 10px; text-align: center; }
.hero-stats b { display: block; font-size: 1.35rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.hero-stats small { color: rgba(255,255,255,.65); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.hero .btn.primary { position: relative; z-index: 1; }
.ring { --p: 70; width: 74px; height: 74px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent2) calc(var(--p) * 1%), rgba(255,255,255,.1) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #0d1530; }
.ring span { position: relative; text-align: center; line-height: 1; }
.ring b { display: block; font-size: 1.5rem; font-weight: 900; }
.ring small { font-size: .62rem; color: var(--muted); font-weight: 800; letter-spacing: .08em; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 30px 1fr 56px; align-items: center; gap: 10px; font-size: 0.85rem; }
.bar-row b { font-weight: 800; color: var(--muted); }
.bar-row .num { white-space: nowrap; text-align: right; font-weight: 800; }
.bar-row .num small { font-weight: 600; }
.bar { height: 10px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .6s ease; }
.bar i.weak { background: linear-gradient(90deg, #b91c1c, #f87171); }
.bar i.strong { background: linear-gradient(90deg, #059669, #6ee7b7); }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; min-height: 44px; }
.li:last-child { border-bottom: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .grow small { display: block; color: var(--muted); font-size: .78rem; }
.muted { color: var(--muted); }
.empty-note { color: var(--muted); font-size: .9rem; padding: 6px 0; }
.delta-up { color: var(--good); font-weight: 800; }
.delta-down { color: var(--bad); font-weight: 800; }
.tip { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); font-size: .88rem; line-height: 1.45; }
.tip .ic { font-size: 1.3rem; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 6px 0 -2px; }
.section-title h2 { margin: 0; font-size: 1.3rem; font-weight: 900; font-style: italic; text-transform: uppercase; }
.section-title .r { margin-left: auto; }

/* ── Chips / filters ── */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 38px; min-width: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); color: var(--muted); font-weight: 800; font-size: .85rem; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); }
select.sel { min-height: 40px; border-radius: 10px; background: var(--card); color: var(--text); border: 1px solid var(--line2); padding: 0 10px; font: inherit; font-weight: 700; font-size: .85rem; }

/* ── Roster rows ── */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; text-align: left; width: 100%; min-height: 60px; }
.row:hover { border-color: var(--line2); background: var(--card2); }
.row .who { flex: 1; min-width: 0; }
.row .who b { display: block; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .who small { color: var(--muted); font-size: .8rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.row .side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: .78rem; color: var(--muted); }
.row.prot { border-color: rgba(252,211,77,.35); }
.row.dim { opacity: .55; }
.pos-head { font-size: .78rem; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin: 10px 2px 0; display: flex; gap: 8px; }

/* ── Modal / sheet ── */
.overlay { position: fixed; inset: 0; z-index: 3000; background: rgba(3,6,14,.72); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .18s ease; backdrop-filter: blur(3px); }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--bg2); border: 1px solid var(--line2); border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); animation: slideUp .25s cubic-bezier(.2,.9,.3,1.1); }
.sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line2); margin: -6px auto 12px; }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 22px; max-height: 88vh; } .sheet::before { display: none; } }
.sheet.wide { max-width: 760px; }
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sheet-head .t { flex: 1; min-width: 0; }
.sheet-head .t b { display: block; font-size: 1.25rem; font-weight: 900; }
.sheet-head .t small { color: var(--muted); }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); padding: 12px 0 calc(18px + env(safe-area-inset-bottom)); margin-bottom: calc(-18px - env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--bg2) 30%); }
.sheet-actions .btn { flex: 1; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } }
.attr { display: grid; grid-template-columns: 1fr 2fr 30px; gap: 10px; align-items: center; font-size: .82rem; margin: 6px 0; }
.attr span { color: var(--muted); text-transform: capitalize; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.stat-grid div { background: var(--card); border-radius: 12px; padding: 10px; text-align: center; }
.stat-grid b { display: block; font-size: 1.15rem; font-weight: 900; }
.stat-grid small { color: var(--muted); font-size: .72rem; font-weight: 700; }
svg.chart { width: 100%; height: auto; display: block; }

/* ── Toasts ── */
#toast-root { position: fixed; left: 0; right: 0; top: 64px; z-index: 4000; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; max-width: 420px; width: 100%; background: #1c2949; border: 1px solid var(--line2); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; font-size: .9rem; animation: slideUp .25s ease; }
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } }
.toast { animation-name: slideDown; }
.toast.bad { border-color: rgba(248,113,113,.5); }
.toast.ach { background: linear-gradient(90deg, #3b2a05, #1c2949); border-color: rgba(252,211,77,.5); }
.toast .ic { font-size: 1.4rem; }

/* ── Season sim ── */
.sim { position: fixed; inset: 0; z-index: 2500; background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--team1) 60%, #000), var(--bg) 70%); display: flex; flex-direction: column; animation: fadeIn .3s; }
.sim-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sim-head .t { flex: 1; }
.sim-head .t b { display: block; font-size: 1.1rem; font-weight: 900; font-style: italic; text-transform: uppercase; }
.sim-head .t small { color: var(--muted); font-weight: 700; }
.sim-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
.sim-inner { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.scoreboard { border-radius: 20px; padding: 18px; background: linear-gradient(180deg, #0f172a, #050913); border: 1px solid var(--line2); box-shadow: inset 0 0 40px rgba(0,0,0,.6), var(--shadow); }
.sb-week { text-align: center; color: var(--warn); font-weight: 900; letter-spacing: .14em; font-size: .78rem; text-transform: uppercase; margin-bottom: 12px; }
.sb-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.sb-team { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.sb-team small { font-weight: 800; font-size: .8rem; color: var(--muted); text-transform: uppercase; }
.sb-score { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: clamp(2.2rem, 10vw, 3.4rem); font-weight: 900; color: #fde68a; text-shadow: 0 0 18px rgba(253,230,138,.45); min-width: 2.2ch; text-align: center; font-variant-numeric: tabular-nums; }
.sb-vs { color: var(--dim); font-weight: 900; }
.sb-status { text-align: center; margin-top: 12px; font-weight: 800; min-height: 1.4em; }
.record-big { text-align: center; font-size: 2.6rem; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.record-big small { display: block; font-size: .78rem; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; font-weight: 800; }
.weeks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.wk { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 10px; background: var(--card); font-size: .8rem; animation: popIn .3s ease; border-left: 4px solid var(--dim); }
.wk.w { border-left-color: var(--good); }
.wk.l { border-left-color: var(--bad); }
.wk.d { border-left-color: var(--warn); }
.wk.d .res { color: var(--warn); }
.wk .res { font-weight: 900; width: 14px; }
.wk.w .res { color: var(--good); }
.wk.l .res { color: var(--bad); }
.wk .sc { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); }
@keyframes popIn { from { transform: scale(.9); opacity: 0; } }
.bracket { display: flex; flex-direction: column; gap: 12px; }
.br-round h4 { margin: 0 0 8px; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.br-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.br-game { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; font-size: .84rem; animation: popIn .35s ease; }
.br-game.mine { border-color: var(--accent2); box-shadow: 0 0 0 1px var(--accent2) inset; }
.br-line { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.br-line .sc { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.br-line.lose { opacity: .5; }
.result-banner { text-align: center; padding: 26px 16px; border-radius: 22px; position: relative; overflow: hidden; border: 1px solid var(--line2);
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--team2) 50%, transparent), transparent 65%), var(--card); animation: popIn .5s ease; }
.result-banner .big-ic { font-size: 4.5rem; display: inline-block; animation: trophy 1.4s ease-in-out infinite; }
@keyframes trophy { 50% { transform: translateY(-6px) rotate(-4deg); } }
.result-banner h2 { margin: 6px 0 4px; font-size: clamp(1.6rem, 6vw, 2.4rem); font-weight: 900; font-style: italic; text-transform: uppercase; }
.result-banner p { margin: 0; color: var(--muted); }
.result-banner.champ { background: radial-gradient(circle at 50% 0%, rgba(252,211,77,.4), transparent 65%), #1a1606; border-color: rgba(252,211,77,.5); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 2600; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ── Offseason stepper ── */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.step { border: 0; border-radius: 12px; background: var(--card); color: var(--muted); padding: 8px 4px; font-size: .74rem; font-weight: 800; cursor: pointer; min-height: 52px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.step .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--card3); font-size: .75rem; }
.step.on { background: var(--card3); color: var(--text); box-shadow: 0 0 0 2px var(--accent) inset; }
.step.on .n, .step.done .n { background: var(--accent); color: #fff; }
.offer { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.offer.blockbuster { background: linear-gradient(140deg, #2a1d05, var(--card) 60%); border-color: rgba(252,211,77,.4); }
.offer .top { display: flex; align-items: center; gap: 12px; }
.offer .top .grow { flex: 1; min-width: 0; }
.offer .btns { display: flex; gap: 8px; }
.offer .btns .btn { flex: 1; }
.offer.done { opacity: .6; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); cursor: pointer; min-height: 60px; }
.check-row input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.check-row.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.check-row .grow { flex: 1; min-width: 0; }
.check-row .grow small { display: block; color: var(--muted); font-size: .8rem; }
.choice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.choice { min-height: 52px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card); font-weight: 900; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .95rem; }
.choice small { font-size: .68rem; color: var(--muted); font-weight: 700; }
.choice.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); }
.choice.on small { color: rgba(255,255,255,.8); }
.tier-grid { grid-template-columns: repeat(3, 1fr); }

/* ── Draft ── */
.clock { border-radius: 20px; padding: 16px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--line2); background: linear-gradient(130deg, color-mix(in srgb, var(--oc1) 70%, #000), #0b1224 80%); position: relative; overflow: hidden; }
.clock.mine { box-shadow: 0 0 0 2px var(--gold) inset, 0 0 30px -8px var(--gold); }
.clock .t { flex: 1; min-width: 0; }
.clock .t small { display: block; color: rgba(255,255,255,.7); font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.clock .t b { display: block; font-size: clamp(1rem, 4.6vw, 1.25rem); font-weight: 900; font-style: italic; text-transform: uppercase; }
.clock .pick-no { text-align: center; }
.clock .pick-no b { display: block; font-size: 2rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.clock .pick-no small { font-size: .68rem; color: rgba(255,255,255,.7); font-weight: 800; letter-spacing: .1em; }
.on-clock { display: inline-block; white-space: nowrap; margin-top: 4px; background: var(--gold); color: #3b2a05; font-weight: 900; font-size: .72rem; padding: 3px 9px; border-radius: 999px; letter-spacing: .08em; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.mypicks { display: flex; gap: 6px; flex-wrap: wrap; }
.mypicks .tag { font-variant-numeric: tabular-nums; }
.prospects { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .prospects { grid-template-columns: repeat(3, 1fr); } }
.prospect { border-radius: 18px; padding: 14px; background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line2); display: flex; flex-direction: column; gap: 10px; }
.prospect .lbl { font-size: .7rem; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); }
.prospect .top { display: flex; align-items: center; gap: 12px; }
.prospect .top .grow { flex: 1; min-width: 0; }
.prospect .top b { display: block; font-size: 1.05rem; }
.prospect .top small { color: var(--muted); font-size: .8rem; }
.prospect .facts { display: flex; gap: 6px; flex-wrap: wrap; }
.feed { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.feed-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--card); font-size: .86rem; animation: popIn .25s ease; }
.feed-item .no { width: 36px; color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; }
.feed-item.mine { background: color-mix(in srgb, var(--accent) 20%, var(--card)); }
.reveal { text-align: center; padding: 8px 0; }
.reveal .announce { color: var(--muted); font-weight: 700; font-size: .9rem; }
.reveal h2 { margin: 6px 0; font-size: 1.8rem; font-weight: 900; font-style: italic; text-transform: uppercase; }
.reveal .ovrs { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 16px 0; }
.reveal .ovrs small { display: block; color: var(--muted); font-size: .7rem; font-weight: 800; margin-top: 6px; text-transform: uppercase; }
.flip { animation: flip .7s ease; }
@keyframes flip { 0% { transform: rotateY(90deg); } 100% { transform: rotateY(0); } }

/* ── History ── */
.trophies { display: flex; gap: 10px; flex-wrap: wrap; }
.trophy { width: 84px; padding: 10px 6px; border-radius: 14px; text-align: center; background: linear-gradient(180deg, #3b2a05, #1a1606); border: 1px solid rgba(252,211,77,.4); }
.trophy span { font-size: 2rem; display: block; }
.trophy b { font-size: .85rem; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ach { padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.ach .ic { font-size: 1.6rem; }
.ach b { display: block; font-size: .88rem; }
.ach small { color: var(--muted); font-size: .76rem; line-height: 1.3; display: block; }
.ach.locked { opacity: .45; }
.ach.locked .ic { filter: grayscale(1); }
.season-row { display: grid; grid-template-columns: 56px 64px 1fr auto; gap: 10px; align-items: center; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); cursor: pointer; width: 100%; text-align: left; min-height: 56px; }
.season-row:hover { background: var(--card2); }
.season-row .yr { font-weight: 900; font-size: 1.05rem; }
.season-row .rec { font-weight: 900; font-variant-numeric: tabular-nums; }

/* ── Tutorial ── */
.tut { text-align: center; }
.tut .big { font-size: 3.4rem; display: block; margin: 6px 0; }
.tut h2 { margin: 4px 0 8px; font-size: 1.4rem; font-weight: 900; }
.tut p { color: var(--muted); line-height: 1.5; margin: 0 auto; max-width: 420px; }
.dots { display: flex; justify-content: center; gap: 6px; margin: 16px 0 4px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); }
.dots i.on { background: var(--accent2); width: 22px; border-radius: 4px; }
.kbd-hint { color: var(--dim); font-size: .76rem; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
}

/* ── Football additions: pitch view, league table, positions ── */
.formations { margin-bottom: 12px; flex-wrap: wrap; overflow: visible; }
.formations .chip small { opacity: .7; font-weight: 600; }
.pitch { position: relative; border-radius: 16px; padding: 14px 6px; display: flex; flex-direction: column; gap: 12px; overflow: hidden;
  background: repeating-linear-gradient(180deg, #1c7a3e 0 44px, #1a7039 44px 88px); border: 2px solid rgba(255,255,255,.35); }
.pitch-lines { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 0, transparent 0 52px, rgba(255,255,255,.35) 53px 55px, transparent 56px),
    linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)) 50% 100% / 46% 2px no-repeat; }
.pitch-lines::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: 0; height: 15%; border: 2px solid rgba(255,255,255,.35); border-bottom: 0; }
.pitch-row { position: relative; display: flex; justify-content: space-evenly; gap: 4px; }
.pslot { flex: 0 1 86px; min-width: 0; min-height: 58px; border: 0; border-radius: 12px; padding: 4px 2px; background: rgba(6,16,12,.72); color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px; box-shadow: 0 3px 8px rgba(0,0,0,.3); }
.pslot:hover:not(:disabled) { background: rgba(6,16,12,.9); outline: 2px solid var(--accent2); }
.pslot:disabled { cursor: default; }
.pslot.oop { outline: 2px dashed var(--bad); }
.pslot .pr { font-weight: 900; font-size: .95rem; border-radius: 8px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.pslot .pr.hi { background: #10b981; color: #04261a; }
.pslot .pr.mid { background: #fbbf24; color: #3a2a02; }
.pslot .pr.lo { background: #f87171; color: #3b0a0a; }
.pslot .pn { font-size: .74rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pslot .pp { font-size: .64rem; color: rgba(255,255,255,.7); font-weight: 800; letter-spacing: .06em; }
.poslist { font-weight: 800; color: var(--text); }
.posline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.posbadge { padding: 3px 9px; border-radius: 999px; font-weight: 800; font-size: .8rem; background: var(--card3); border: 1px solid var(--line2); }
.posbadge.main { background: var(--accent); color: var(--accent-ink, #fff); border-color: transparent; }
.tbl { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; font-size: .84rem; }
.tbl-row { display: grid; grid-template-columns: 28px 1fr 30px 38px 36px; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; background: var(--card); border-left: 3px solid transparent; }
.tbl-row > span, .tbl-row > b { text-align: right; }
.tbl-row .club { display: flex; align-items: center; gap: 8px; min-width: 0; text-align: left; }
.tbl-row .club span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-row > span:first-child { text-align: center; color: var(--muted); }
.tbl-head { background: transparent; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }
.tbl-head > span:nth-child(2) { text-align: left; }
.tbl-row.champ { border-left-color: var(--gold); }
.tbl-row.cup { border-left-color: var(--blue); }
.tbl-row.low { border-left-color: var(--bad); }
.tbl-row.mine { background: var(--card3); box-shadow: 0 0 0 1px var(--accent2) inset; font-weight: 800; }
.tbl-gap { text-align: center; color: var(--dim); line-height: 1; }
.cup-title { margin: 6px 0 0; font-size: 1rem; }

/* ── Compact layout (2026-10-31): tighter cards everywhere; on wide screens tabs split into columns and long lists
   (squad, big board, seasons) scroll inside their own pane so each tab fits on one screen. ── */
.view-inner { max-width: 1440px; gap: 10px; }
.card { padding: 12px 14px; }
.card h3 { margin-bottom: 8px; }
.grid2 { gap: 10px; }
.rows { gap: 4px; }
.row { min-height: 46px; padding: 5px 10px; gap: 10px; border-radius: 12px; }
.row .who b { font-size: .92rem; }
.row .who small { margin-top: 1px; }
.li { padding: 5px 0; min-height: 36px; }
.tip { padding: 8px 12px; font-size: .84rem; }
.pos-head { margin-top: 6px; }
.hero { padding: 14px 16px; }
.hero-stats { margin: 12px 0; }
.hero-stats div { padding: 6px; }
.hero-stats b { font-size: 1.15rem; }
.offer { padding: 10px 12px; gap: 8px; }
.offer.inline { flex-direction: row; align-items: center; flex-wrap: wrap; }
.offer.inline .top { flex: 1 1 260px; min-width: 0; }
.offer.inline .btns { flex: 0 0 auto; }
.prospect { padding: 10px 12px; gap: 6px; }
.clock { padding: 10px 14px; }
.clock .pick-no b { font-size: 1.6rem; }
.feed { max-height: 240px; }
.feed-item { padding: 5px 10px; }
.ach { padding: 8px 10px; }
.ach .ic { font-size: 1.3rem; }
.season-row { padding: 8px 12px; min-height: 46px; }
.stat-grid b { font-size: 1.05rem; white-space: nowrap; }
.stat-grid div { padding: 8px 4px; }
/* Filter chips wrap instead of scrolling sideways: the hidden scrollbar meant mouse users could not reach the
   positions past CM on the big board */
.chips { flex-wrap: wrap; overflow: visible; gap: 6px; }
.chips .chip { min-height: 34px; padding: 0 11px; }
.split { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.split > .col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.form-strip { display: grid; grid-template-columns: repeat(19, 1fr); gap: 3px; margin-top: 8px; }
.form-strip .fs { aspect-ratio: 1; max-height: 22px; display: grid; place-items: center; border-radius: 4px; font-size: .6rem; font-weight: 900; color: rgba(0,0,0,.7); cursor: default; }
.form-strip .fs.w { background: var(--good); }
.form-strip .fs.d { background: var(--warn); }
.form-strip .fs.l { background: var(--bad); }
@media (min-width: 1100px) {
  .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .squad-split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .draft-split { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .draft-split .prospects { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { display: grid; grid-template-columns: minmax(330px, 1fr) minmax(0, 1.1fr) auto; align-items: center; gap: 16px; }
  .hero .hero-top .t b { font-size: 1.35rem; overflow-wrap: normal; }
  .hero .hero-stats { margin: 0; }
  .hero > p { grid-column: 1 / -1; margin: 0 !important; text-align: left !important; }
  .hero-slim { display: block; }
  .clock { padding: 6px 14px; }
  .clock .badge.lg { --s: 44px; font-size: .8rem; }
  .clock .t b { font-size: 1.1rem; }
  .feed { max-height: 170px; }
  .prospect .btn.big, .prospect .btn { min-height: 40px; }
  .stepper .step { flex-direction: row; justify-content: center; min-height: 40px; gap: 8px; font-size: .82rem; }
  .ach-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
  .hero-slim > p { margin-top: 6px !important; }
}
/* Panes only cap their height when the window is tall enough for a fixed layout to make sense */
@media (min-width: 1100px) and (min-height: 600px) {
  .pane { max-height: calc(100dvh - 260px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
  .squad-split .pane { max-height: calc(100dvh - 300px); }
  .draft-split .pane { max-height: max(220px, calc(100dvh - 590px)); }
  .draft-split .feed { max-height: 132px; }
  .pane-md { max-height: 250px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
  .pane-sm { max-height: 172px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
}

/* ── Wage budget (2026-10-31) ── */
.hero-stats { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 420px) { .hero-stats { grid-template-columns: repeat(2, 1fr); } }
.wagebar { position: relative; height: 12px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.wagebar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.wagebar i.extra { background: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 4px, rgba(255,255,255,.18) 4px 8px); border-radius: 0; }
.wagebar i.extra.over { background: var(--bad); }
.row .side b.wage { color: var(--text); font-variant-numeric: tabular-nums; font-size: .82rem; }
.check-row.dim { opacity: .5; }
.check-row small { display: block; }
