/* ==========================================================================
   Rookie League "armory" theme: dark brushed steel, riveted plates,
   emerald green accents, pops of gold and red.
   ========================================================================== */

:root {
  --bg: #0c0f11;
  --bg-2: #13171a;
  --surface: #1b2024;            /* steel plate */
  --surface-2: #232a2f;          /* raised steel */
  --surface-3: #2c343a;
  --border: #363f46;
  --line: rgb(255 255 255 / 7%);
  --stitch: #4b555d;             /* edges, rivet rims */
  --text: #e9ebec;
  --muted: #98a2a9;
  --accent: #1f6b3a;             /* emerald */
  --accent-strong: #134a27;
  --accent-bright: #3fa566;
  --accent-soft: rgb(31 107 58 / 22%);
  --on-accent: #f4ecd2;
  --gold: #d4af37;
  --gold-bright: #f0d27a;
  --gold-deep: #8f7322;
  --brass: var(--gold);
  --rust: #b3202a;               /* red pop */
  --rust-strong: #861720;
  --on-rust: #fff5f0;
  --wood-1: #0f1316;             /* dark steel (was wood) */
  --wood-2: #1d2328;
  --on-wood: #ece6d3;
  --danger: #e5484f;
  --danger-soft: rgb(229 72 79 / 15%);
  --warn: #e7c65a;
  --warn-soft: rgb(212 175 55 / 14%);
  --live: #ff4d57;
  --radius: 6px;
  --bevel: inset 0 1px 0 rgb(255 255 255 / 9%), inset 0 -1px 0 rgb(0 0 0 / 55%);
  --shadow: var(--bevel), 0 1px 0 rgb(0 0 0 / 60%), 0 10px 26px -12px rgb(0 0 0 / 85%);
  --brushed: repeating-linear-gradient(90deg, rgb(255 255 255 / 1.6%) 0 1px, transparent 1px 3px),
             repeating-linear-gradient(90deg, rgb(0 0 0 / 12%) 0 1px, transparent 1px 7px);
  --steel: linear-gradient(180deg, #232a2f 0%, #1b2024 45%, #171b1f 100%);
  --steel-raised: linear-gradient(180deg, #313a41 0%, #262d33 55%, #1f2529 100%);
  --pos-qb: #c2413a;
  --pos-rb: #34874a;
  --pos-wr: #347bab;
  --pos-te: #c38c2b;
  --pos-k: #82599f;
  --pos-def: #5f686e;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-head: "Oswald", "Arial Narrow", "Segoe UI", sans-serif;
  --font-brand: "Cinzel", "Trajan Pro", Georgia, serif;
  color-scheme: dark;
}

/* ------------------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  color: var(--text);
  font: 16px/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  background-image:
    var(--brushed),
    radial-gradient(ellipse at 50% -10%, #1d2429 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: var(--gold); text-decoration: none; font-weight: 600; }
a:hover { color: var(--gold-bright); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .6rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
h1 { font-family: var(--font-brand); font-size: 2rem; font-weight: 700; letter-spacing: .06em; color: var(--gold);
  text-shadow: 0 1px 0 #000, 0 0 18px rgb(212 175 55 / 18%); }
h2 { font-size: 1.15rem; color: var(--text); }
h3 { font-size: .98rem; color: var(--gold-bright); letter-spacing: .08em; }
p { margin: 0 0 .75rem; }
code { font-size: .85em; background: var(--surface-3); padding: .05rem .3rem; border-radius: 3px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.num { font-variant-numeric: tabular-nums; font-family: var(--font-head); letter-spacing: .02em; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 1.1rem; }
.grid-2 { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
.spacer { flex: 1; }
::selection { background: rgb(212 175 55 / 35%); }

/* ------------------------------------------------------------ top bar: a steel header plate with gold trim */
.topbar {
  position: sticky; top: 0; z-index: 20; color: var(--on-wood);
  background: var(--brushed), linear-gradient(180deg, #262e34, #13171a);
  border-bottom: 2px solid var(--gold);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 10%), 0 1px 0 var(--gold-deep), 0 6px 18px rgb(0 0 0 / 55%);
}
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: .55rem 16px; display: flex; align-items: center; gap: 1.1rem; }
.brand { color: var(--gold); font-family: var(--font-brand); font-weight: 700; font-size: 1.2rem; letter-spacing: .08em; display: flex; align-items: center; gap: .6rem; white-space: nowrap; text-shadow: 0 1px 0 #000; }
.brand:hover { text-decoration: none; color: var(--gold-bright); }
.brand-mark { width: 32px; height: 32px; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 70%)); }
.topbar .nav-link { color: var(--on-wood); opacity: .82; font-family: var(--font-head); text-transform: uppercase; letter-spacing: .1em; font-weight: 500; font-size: .9rem; white-space: nowrap; }
.topbar .nav-link:hover { opacity: 1; text-decoration: none; color: var(--gold); }
.topbar .user { color: var(--muted); font-size: .9rem; }
.page { max-width: 1200px; margin: 0 auto; padding: 1.5rem 16px 4rem; }

/* ------------------------------------------------------------ tabs: a machined rail */
.tabs {
  display: flex; gap: .2rem; overflow-x: auto; scrollbar-width: none; margin: 0 0 1.5rem; padding: .3rem;
  background: var(--brushed), var(--steel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--bevel);
}
.tabs a { padding: .5rem .95rem; color: var(--muted); white-space: nowrap; font-family: var(--font-head); text-transform: uppercase; letter-spacing: .1em; font-weight: 500; font-size: .92rem; border-radius: 4px; }
.tabs a:hover { color: var(--text); text-decoration: none; background: rgb(255 255 255 / 5%); }
.tabs a.active { color: var(--gold-bright); background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 14%), inset 0 -2px 0 var(--gold), 0 2px 8px rgb(0 0 0 / 50%); }

/* ------------------------------------------------------------ cards: riveted steel plates */
.card {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem 1.3rem; color: var(--text);
  background: var(--brushed), var(--steel); box-shadow: var(--shadow);
}
.card::after {
  content: ""; position: absolute; inset: 7px; pointer-events: none; border-radius: 2px;
  background:
    radial-gradient(circle at 3px 3px, #8a949b 0 1px, #4b555d 1.6px, #20262a 2.6px, transparent 3.2px) top left / 7px 7px no-repeat,
    radial-gradient(circle at 3px 3px, #8a949b 0 1px, #4b555d 1.6px, #20262a 2.6px, transparent 3.2px) top right / 7px 7px no-repeat,
    radial-gradient(circle at 3px 3px, #8a949b 0 1px, #4b555d 1.6px, #20262a 2.6px, transparent 3.2px) bottom left / 7px 7px no-repeat,
    radial-gradient(circle at 3px 3px, #8a949b 0 1px, #4b555d 1.6px, #20262a 2.6px, transparent 3.2px) bottom right / 7px 7px no-repeat;
  opacity: .9;
}
.card > * { position: relative; z-index: 1; }
.card.tight { padding: 0; overflow: hidden; }
.card.tight::after { display: none; }
.card-head { display: flex; align-items: center; gap: .6rem; justify-content: space-between; margin-bottom: .85rem; padding-bottom: .55rem;
  border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgb(0 0 0 / 40%); }
.card-head h2, .card-head h3 { margin: 0; }
.card-head h2::before { content: ""; display: inline-block; width: 4px; height: .95em; margin-right: .5rem; vertical-align: -1px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep)); border-radius: 1px; }
details.card > summary { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .06em; cursor: pointer; color: var(--gold-bright); }

/* ------------------------------------------------------------ buttons: machined keys */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; cursor: pointer;
  border: 1px solid #0b0d0f; background: var(--steel-raised); color: var(--text);
  padding: .42rem .95rem; border-radius: 5px; min-height: 38px;
  font: 500 .88rem/1 var(--font-head); text-transform: uppercase; letter-spacing: .1em; text-decoration: none;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%), inset 0 -1px 0 rgb(0 0 0 / 40%), 0 2px 4px rgb(0 0 0 / 50%);
}
.btn:hover:not(:disabled) { filter: brightness(1.15); text-decoration: none; color: var(--text); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 2px 4px rgb(0 0 0 / 55%); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, #2a8a4c 0%, var(--accent) 50%, var(--accent-strong) 100%);
  border-color: var(--gold-deep); color: var(--gold-bright);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 20%), inset 0 -1px 0 rgb(0 0 0 / 45%), 0 0 0 1px rgb(212 175 55 / 25%), 0 3px 8px rgb(0 0 0 / 55%);
}
.btn.primary:hover:not(:disabled) { color: #fff3c4; filter: brightness(1.12); }
.btn.danger { color: var(--danger); background: transparent; border-color: rgb(229 72 79 / 45%); box-shadow: none; }
.btn.danger:hover:not(:disabled) { background: var(--danger-soft); color: #ff8a8f; }
.btn.sm { padding: .22rem .6rem; min-height: 30px; font-size: .76rem; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.topbar .btn.ghost { color: var(--on-wood); }
.topbar .btn.ghost:hover { background: rgb(255 255 255 / 7%); color: var(--gold); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; font-weight: 600; min-width: 0; }
.linkish:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------ forms: recessed wells */
label.field { display: grid; gap: .3rem; font: 500 .78rem var(--font-head); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
input, select, textarea {
  font: 1rem var(--font-body); color: var(--text); background: #0f1316;
  border: 1px solid #2f373d; border-radius: 5px; padding: .42rem .6rem; min-height: 38px; width: 100%;
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 65%), 0 1px 0 rgb(255 255 255 / 5%);
}
select option { background: #1b2024; color: var(--text); }
input::placeholder { color: #6b757c; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .linkish:focus-visible, .chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
input[type="checkbox"] { width: auto; min-height: 0; accent-color: var(--accent-bright); box-shadow: none; }
textarea { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85rem; min-height: 360px; }
.form { display: grid; gap: .85rem; }
.inline-form { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; }
.inline-form > * { flex: 1 1 140px; }
.inline-form > .btn { flex: 0 0 auto; }

/* ------------------------------------------------------------ tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .52rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
  font: 500 .74rem var(--font-head); text-transform: uppercase; letter-spacing: .12em; color: var(--gold-bright);
  background: linear-gradient(180deg, #1e5b35, var(--accent-strong)); border-bottom: 1px solid var(--gold-deep);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 10%);
}
tbody tr:nth-child(even) td { background: rgb(255 255 255 / 2%); }
tbody tr:hover td { background: rgb(31 107 58 / 16%); }
tr:last-child td { border-bottom: 0; }
td.right, th.right { text-align: right; }
.table-wrap { overflow-x: auto; }

/* ------------------------------------------------------------ badges */
.pos {
  display: inline-block; min-width: 2.7rem; text-align: center; color: #fff; background: var(--pos-def);
  font: 600 .72rem/1 var(--font-head); letter-spacing: .08em; padding: .28rem .35rem; border-radius: 3px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%), inset 0 -1px 0 rgb(0 0 0 / 35%), 0 1px 2px rgb(0 0 0 / 50%);
  text-shadow: 0 1px 0 rgb(0 0 0 / 40%);
}
.pos.QB { background: var(--pos-qb); } .pos.RB { background: var(--pos-rb); } .pos.WR { background: var(--pos-wr); }
.pos.TE { background: var(--pos-te); } .pos.K { background: var(--pos-k); } .pos.DEF { background: var(--pos-def); }
.badge { display: inline-block; font: 500 .7rem/1.2 var(--font-head); padding: .2rem .55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .1em; background: var(--surface-3); color: var(--muted); border: 1px solid var(--border); }
.badge.live { color: var(--live); border: 1px solid currentColor; background: rgb(255 77 87 / 8%); }
.badge.live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: .3rem; vertical-align: 1px; animation: pulse 1.4s infinite; box-shadow: 0 0 6px currentColor; }
.badge.final { color: var(--text); }
.badge.accent { background: linear-gradient(180deg, var(--accent), var(--accent-strong)); color: var(--gold-bright); border: 1px solid var(--gold-deep); }
.badge.tag { background: linear-gradient(180deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep)); color: #221806; border: 1px solid var(--gold-deep); text-transform: none; letter-spacing: .02em; font-weight: 600; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: rgb(212 175 55 / 40%); }
.injury { color: var(--danger); font: 600 .75rem var(--font-head); letter-spacing: .05em; margin-left: .3rem; }
@keyframes pulse { 50% { opacity: .3; } }

/* ------------------------------------------------------------ player label: team logo + name */
.plabel { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; max-width: 100%; vertical-align: middle; }
.plabel .name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlogo { width: 24px; height: 24px; object-fit: contain; flex: none; filter: drop-shadow(0 1px 1px rgb(0 0 0 / 80%)); }
.tlogo.fa { display: inline-grid; place-items: center; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border); font: 600 .55rem var(--font-head); color: var(--muted); }

/* ------------------------------------------------------------ notices, toasts, spinner */
.notice { padding: .7rem .9rem; border-radius: 5px; background: var(--warn-soft); color: var(--warn); font-size: .95rem; border-left: 3px solid currentColor; }
.notice.error { background: var(--danger-soft); color: #ff8a8f; }
.notice.ok { background: var(--accent-soft); color: #8fd7a8; }
.notice ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.toasts { position: fixed; bottom: 16px; right: 16px; left: 16px; display: grid; justify-items: end; gap: .5rem; z-index: 60; pointer-events: none; }
.toast { pointer-events: auto; max-width: 420px; background: var(--brushed), var(--steel-raised); color: var(--text); padding: .7rem 1rem; border-radius: 5px;
  box-shadow: var(--shadow); font-size: .95rem; border: 1px solid var(--border); border-left: 3px solid var(--gold); }
.toast.error { background: linear-gradient(180deg, #a31d26, #7d141b); color: #fff; border-left-color: #fff; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ auth */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-hero { text-align: center; margin-bottom: 1.2rem; }
.auth-hero img { filter: drop-shadow(0 6px 18px rgb(0 0 0 / 70%)); }
.auth-hero h1 { font-size: 2.1rem; margin-top: .7rem; text-transform: none; }

/* ------------------------------------------------------------ leagues */
.league-card { display: grid; gap: .3rem; color: inherit; font-weight: 400; }
.league-card:hover { text-decoration: none; border-color: var(--gold-deep); color: inherit; }
.league-card strong { font-family: var(--font-brand); letter-spacing: .06em; font-size: 1.15rem; font-weight: 700; color: var(--gold); }
.league-header { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; }
.league-header h1 { margin: 0; }

/* ------------------------------------------------------------ matchups: scoreboard */
.matchup { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .75rem; cursor: pointer; width: 100%; font: inherit; color: inherit; text-align: left; }
.matchup .side { display: grid; gap: .15rem; min-width: 0; }
.matchup .side.away { text-align: right; }
.matchup .team-name { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matchup .score { font: 600 2.1rem/1 var(--font-head); font-variant-numeric: tabular-nums; color: var(--text); }
.matchup .score.lead { color: var(--gold); text-shadow: 0 0 14px rgb(212 175 55 / 30%); }
.matchup .mid { display: grid; justify-items: center; gap: .25rem; }
.starters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; margin-top: 1rem; }
.starters > div { min-width: 0; }
.starter-row { display: flex; align-items: center; gap: .5rem; padding: .38rem 0; border-bottom: 1px solid var(--line); }
.starter-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-tag { font: 600 .72rem var(--font-head); letter-spacing: .08em; color: var(--muted); width: 4.2rem; flex: none; }
:root[data-layout="mobile"] .starters { grid-template-columns: 1fr; }
:root[data-layout="mobile"] .matchup .score { font-size: 1.5rem; }

/* ------------------------------------------------------------ lineup */
.seat { display: grid; grid-template-columns: 5.2rem 1fr 3.8rem 4.2rem; gap: .6rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.seat:last-child { border-bottom: 0; }
.seat .slot-label { font: 600 .82rem var(--font-head); letter-spacing: .1em; color: var(--gold); }
.seat .pts { text-align: right; font-weight: 700; }
.seat .proj, .proj { text-align: right; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.seat-head { display: grid; grid-template-columns: 5.2rem 1fr 3.8rem 4.2rem; gap: .6rem; font: 500 .7rem var(--font-head); color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.seat-head span:nth-child(n+3) { text-align: right; }
.lock { font-size: .75rem; color: var(--muted); }
.rule-check { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; border-radius: 5px; margin-bottom: .8rem; font-weight: 600; }
.rule-check.ok { background: var(--accent-soft); color: #8fd7a8; border: 1px solid rgb(63 165 102 / 35%); }
.rule-check.bad { background: var(--danger-soft); color: #ff8a8f; border: 1px solid rgb(229 72 79 / 40%); }

/* ------------------------------------------------------------ draft */
.clock {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; color: var(--on-wood); border-radius: var(--radius);
  padding: .95rem 1.25rem; margin-bottom: 1rem; border: 1px solid var(--gold-deep);
  background: var(--brushed), linear-gradient(180deg, #262e34, #121619);
  box-shadow: var(--bevel), 0 0 0 1px rgb(212 175 55 / 15%), 0 8px 20px -8px #000;
}
.clock.mine { background: var(--brushed), linear-gradient(180deg, #b72630, #7a121a); color: #fff; border-color: #ff6b73; box-shadow: 0 0 22px rgb(229 72 79 / 35%), var(--bevel); }
.clock .timer { font: 600 2.4rem/1 var(--font-head); font-variant-numeric: tabular-nums; min-width: 4.8rem; color: var(--gold-bright); }
.clock.mine .timer { color: #fff; }
.clock .who { font: 600 1.15rem var(--font-head); text-transform: uppercase; letter-spacing: .06em; }
.clock .sub { opacity: .85; font-size: .9rem; }
.board-wrap { overflow: auto; max-height: 440px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--brushed), var(--steel); margin-bottom: 1rem; box-shadow: var(--shadow); }
.board { border-collapse: separate; border-spacing: 3px; min-width: 100%; }
.board th { position: sticky; top: 0; z-index: 1; font-size: .74rem; letter-spacing: .06em; padding: .45rem; text-align: center; min-width: 118px; border: 0; }
.board th:first-child { min-width: 2rem; width: 2rem; }
.board th.me { background: linear-gradient(180deg, #b72630, #7a121a); color: #fff; }
.board td { padding: 0; border: 0; background: transparent !important; }
.board .rnd { font: 600 .75rem var(--font-head); color: var(--gold); text-align: center; width: 2rem; }
.cell { height: 52px; border-radius: 4px; background: linear-gradient(180deg, #262d33, #1c2226); padding: .3rem .45rem; font-size: .78rem; line-height: 1.2; display: grid; align-content: center; border-left: 4px solid transparent; box-shadow: var(--bevel); }
.cell .pn { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 128px; display: flex; align-items: center; gap: .3rem; }
.cell .pn img { width: 16px; height: 16px; object-fit: contain; flex: none; }
.cell .meta { color: var(--muted); font-size: .7rem; }
.cell.QB { border-left-color: var(--pos-qb); } .cell.RB { border-left-color: var(--pos-rb); } .cell.WR { border-left-color: var(--pos-wr); }
.cell.TE { border-left-color: var(--pos-te); } .cell.K { border-left-color: var(--pos-k); } .cell.DEF { border-left-color: var(--pos-def); }
.cell.current { outline: 2px solid var(--gold); background: linear-gradient(180deg, #3a3217, #231e0e); box-shadow: 0 0 14px rgb(212 175 55 / 35%); }
.cell.empty-cell { color: #5f696f; }
.draft-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 1.1rem; }
@media (max-width: 860px) { .draft-cols { grid-template-columns: 1fr; } }
:root[data-layout="mobile"] .draft-cols { grid-template-columns: 1fr; }
.scroll-list { max-height: 520px; overflow-y: auto; }
.queue-item { display: flex; gap: .45rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.queue-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ settings */
.pos-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .65rem; }
.pos-editor label { display: grid; gap: .25rem; font: 600 .82rem var(--font-head); letter-spacing: .08em; color: var(--gold-bright); }
.pos-editor .hint { font: 400 .75rem var(--font-body); color: var(--muted); letter-spacing: 0; }
.code { font: 600 1.2rem var(--font-head); letter-spacing: .22em; color: var(--gold); background: #0f1316; padding: .25rem .75rem; border-radius: 4px; border: 1px solid var(--gold-deep); box-shadow: inset 0 2px 4px rgb(0 0 0 / 60%); }
.score-group { border-top: 1px solid var(--line); box-shadow: inset 0 1px 0 rgb(0 0 0 / 40%); padding-top: .95rem; margin-top: .95rem; }
.score-group:first-of-type { border-top: 0; box-shadow: none; margin-top: 0; padding-top: 0; }
.score-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .6rem .9rem; }
.score-field { display: grid; grid-template-columns: 1fr 5.5rem; align-items: center; gap: .5rem; font-size: .95rem; }
.score-field .help { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); margin-top: -.35rem; }
.chip-row { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip { font: 500 .76rem var(--font-head); text-transform: uppercase; letter-spacing: .09em; padding: .32rem .75rem; border-radius: 999px; border: 1px solid var(--border); background: var(--steel-raised); cursor: pointer; color: var(--text); box-shadow: var(--bevel); }
.chip.on { background: linear-gradient(180deg, var(--accent), var(--accent-strong)); color: var(--gold-bright); border-color: var(--gold-deep); }
.rows-table td { padding: .3rem .35rem; border: 0; background: transparent !important; }
.rows-table input, .rows-table select { min-height: 34px; padding: .3rem .45rem; }

/* ------------------------------------------------------------ player profile */
.modal-back { position: fixed; inset: 0; background: rgb(3 5 6 / 78%); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--brushed), var(--steel); border: 1px solid var(--gold-deep); border-radius: 8px;
  box-shadow: 0 0 0 1px rgb(212 175 55 / 20%), 0 24px 60px #000; }
.pcard-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); border-bottom: 2px solid var(--gold); }
.pcard-photo { position: relative; aspect-ratio: 4 / 3; background: repeating-linear-gradient(45deg, #1b2024 0 12px, #161a1d 12px 24px); display: grid; place-items: center; overflow: hidden; }
.pcard-photo img.photo { width: 100%; height: 100%; object-fit: cover; }
.pcard-photo img.photo.headshot { object-fit: contain; object-position: bottom; background: radial-gradient(circle at 50% 75%, #33403a, #151a1d 70%); }
.pcard-photo img.logo-fallback { width: 55%; height: 55%; object-fit: contain; opacity: .9; filter: drop-shadow(0 4px 12px #000); }
.pcard-id { padding: 1.1rem 1.25rem; display: grid; align-content: center; gap: .55rem; color: var(--on-wood);
  background: var(--brushed), linear-gradient(160deg, #1f6b3a 0%, #123f24 55%, #0d2c19 100%); box-shadow: inset 1px 0 0 rgb(212 175 55 / 30%); }
.pcard-id h2 { margin: 0; font-family: var(--font-brand); font-size: 1.7rem; letter-spacing: .05em; color: var(--gold-bright); text-transform: none; text-shadow: 0 2px 0 #000; }
.pcard-id .teamline { display: flex; align-items: center; gap: .6rem; font-family: var(--font-head); text-transform: uppercase; letter-spacing: .08em; }
.pcard-id .teamline img { width: 44px; height: 44px; object-fit: contain; }
.pcard-body { padding: 1.1rem 1.3rem 1.3rem; display: grid; gap: 1rem; }
.close-x { position: sticky; top: 0; float: right; margin: 8px 8px -46px 0; z-index: 3; }
.pcard-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; }
.fact { background: #12161a; border: 1px solid var(--border); border-radius: 4px; padding: .45rem .65rem; box-shadow: inset 0 2px 4px rgb(0 0 0 / 50%); }
.fact .k { font: 500 .66rem var(--font-head); text-transform: uppercase; letter-spacing: .12em; color: var(--gold); }
.fact .v { font-weight: 600; }
.socials { display: flex; gap: .5rem; flex-wrap: wrap; }
.credit { font-size: .78rem; color: var(--muted); }
.week-table td, .week-table th { padding: .38rem .6rem; }
.week-table tr.current td { background: rgb(212 175 55 / 14%) !important; font-weight: 700; color: var(--gold-bright); }
.week-table tr.bye td { color: var(--muted); font-style: italic; }
.suggest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.suggest-grid button { padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; cursor: pointer; background: var(--surface-3); aspect-ratio: 1; }
.suggest-grid button:hover { border-color: var(--gold); }
.suggest-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
:root[data-layout="mobile"] .pcard-top { grid-template-columns: 1fr; }

/* ------------------------------------------------------------ social log */
.post { display: grid; grid-template-columns: auto 1fr; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post .when { font-size: .78rem; color: var(--muted); }

/* ------------------------------------------------------------ value scores and trades */
.vbadge { display: inline-grid; place-items: center; min-width: 2.3rem; height: 1.6rem; padding: 0 .35rem; border-radius: 4px;
  font: 600 .85rem var(--font-head); letter-spacing: .03em; border: 1px solid transparent; flex: none; }
.vbadge.tiered { box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%), inset 0 -1px 0 rgb(0 0 0 / 30%), 0 1px 3px rgb(0 0 0 / 60%); }
.vbadge.untiered { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.vbar { height: 12px; border-radius: 6px; background: #0f1316; border: 1px solid #2f373d; overflow: hidden; flex: 1; box-shadow: inset 0 2px 3px rgb(0 0 0 / 60%); }
.vfill { height: 100%; border-radius: 6px; box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%); }
.vfill.rust { background: linear-gradient(90deg, #7a121a, var(--rust), #e5484f); }
.vfill.forest { background: linear-gradient(90deg, var(--accent-strong), var(--accent), var(--accent-bright)); }
.vfill.brass { background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-bright)); }
.value-bars { display: grid; gap: .5rem; }
.vrow { display: grid; grid-template-columns: minmax(120px, 30%) 1fr 3rem; gap: .6rem; align-items: center; }
.vrow .vlabel { font: 500 .85rem var(--font-head); text-transform: uppercase; letter-spacing: .06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vrow strong { text-align: right; color: var(--gold-bright); }
.value-meter { margin-top: .4rem; display: grid; gap: .3rem; max-width: 260px; }
.value-meter .vm-top { display: flex; align-items: baseline; gap: .4rem; font-family: var(--font-head); text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.value-meter .vm-top strong { font-size: 2rem; line-height: 1; color: var(--gold); text-shadow: 0 1px 0 #000; }
.value-meter .vm-sub { font-size: .78rem; opacity: .85; }
.offer .queue-item .name { flex: 1; }

/* ------------------------------------------------------------ scrollbars */
* { scrollbar-color: #3a444b #111518; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #111518; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #3d474e, #2a3237); border-radius: 6px; border: 2px solid #111518; }

/* ------------------------------------------------------------ small screens (see "mobile layout" at the end) */
:root[data-layout="mobile"] .seat, :root[data-layout="mobile"] .seat-head { grid-template-columns: 2.8rem minmax(0, 1fr) 2.9rem 3.1rem; gap: .35rem; }
:root[data-layout="mobile"] .hide-sm { display: none; }
:root[data-layout="mobile"] th, :root[data-layout="mobile"] td { padding: .45rem .5rem; }
:root[data-layout="mobile"] .score-field { grid-template-columns: 1fr 4.8rem; }

/* the value on the green nameplate reads in gold (the tier color still shows in the bar) */
.pcard-id .value-meter .vm-top strong { color: var(--gold-bright) !important; text-shadow: 0 2px 0 #000, 0 0 14px rgb(212 175 55 / 35%); }
.pcard-id .value-meter .vbar { background: rgb(0 0 0 / 45%); border-color: rgb(0 0 0 / 50%); }

/* ------------------------------------------------------------ team sheet: roster + lineup in one table */
.team-page { max-width: 1160px; margin: 0 auto; }
.team-sheet .sheet td { padding: .45rem .6rem; }
.team-sheet .sheet th { padding: .5rem .6rem; }
.sheet .slot-cell { font: 600 .82rem var(--font-head); letter-spacing: .1em; color: var(--gold); width: 4.2rem; }
.sheet .slot-cell.bn { color: var(--muted); }
.sheet tr.section td { background: linear-gradient(180deg, #20272c, #181d21) !important; color: var(--gold-bright);
  font: 600 .74rem var(--font-head); text-transform: uppercase; letter-spacing: .16em; padding: .35rem .7rem; border-bottom: 1px solid var(--gold-deep); }
.sheet tr.selected td { background: rgb(212 175 55 / 14%) !important; }
.sheet tr.target td { background: rgb(63 165 102 / 14%) !important; cursor: pointer; }
.sheet tr.target td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.sheet tr.target:hover td { background: rgb(63 165 102 / 26%) !important; }
.sheet .nowrap { white-space: nowrap; }
.wx { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .5rem; border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--border); white-space: nowrap; }
.wx b { font: 600 .72rem var(--font-head); text-transform: uppercase; letter-spacing: .08em; }
.wx.ideal { border-color: rgb(63 165 102 / 55%); } .wx.ideal b { color: #8fd7a8; }
.wx.rainy, .wx.stormy { border-color: rgb(80 140 220 / 55%); } .wx.rainy b, .wx.stormy b { color: #8fb9ee; }
.wx.snowy b, .wx.cold b { color: #bfe2ff; }
.wx.hot { border-color: rgb(229 72 79 / 55%); } .wx.hot b { color: #ff8a8f; }
.wx.windy b { color: #d9dfe3; }
.wx.indoors b { color: var(--gold-bright); }
.team-extras { margin-top: .2rem; }

/* ==========================================================================
   Mobile layout: on when <html data-layout="mobile"> (phones automatically,
   or anyone who picks "Mobile" in the menu). Thumb-sized controls, a bottom
   tab bar, stacked rows instead of wide tables, full-screen player cards.
   ========================================================================== */
:root[data-layout="mobile"] { --nav-h: 62px; --topbar-h: 54px; }
.icon { display: block; flex: none; }
.icon-btn { min-height: 40px; min-width: 40px; padding: 0 .5rem; }

[data-layout="mobile"] body { background-attachment: scroll; }
[data-layout="mobile"] .page { max-width: 560px; padding: 1rem 12px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 1.5rem); }
[data-layout="mobile"] .topbar-inner { max-width: 560px; gap: .5rem; padding: calc(.4rem + env(safe-area-inset-top, 0px)) 12px .4rem; }
[data-layout="mobile"] .brand { font-size: 1rem; }
[data-layout="mobile"] .brand-mark { width: 28px; height: 28px; }
[data-layout="mobile"] h1 { font-size: 1.35rem; }
[data-layout="mobile"] h2 { font-size: 1.05rem; }
[data-layout="mobile"] .league-header { margin-bottom: .8rem; gap: .1rem .6rem; }
[data-layout="mobile"] .league-header .muted { font-size: .85rem; }
[data-layout="mobile"] .stack, [data-layout="mobile"] .grid-2 { gap: .8rem; }
[data-layout="mobile"] .grid-2 { grid-template-columns: minmax(0, 1fr); }
[data-layout="mobile"] .card { padding: .95rem .9rem; }
[data-layout="mobile"] .card.tight { padding: 0; }
[data-layout="mobile"] .btn { min-height: 42px; }
[data-layout="mobile"] .btn.sm { min-height: 36px; padding: .25rem .7rem; font-size: .78rem; }
[data-layout="mobile"] .chip { padding: .45rem .85rem; }
/* 16px text stops iPhones from zooming in when a field is tapped */
[data-layout="mobile"] input, [data-layout="mobile"] select { min-height: 42px; font-size: 16px; }
[data-layout="mobile"] .toasts { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px); left: 12px; right: 12px; justify-items: stretch; }
[data-layout="mobile"] .toast { max-width: none; }

/* bottom tab bar */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: 560px; margin: 0 auto;
  display: flex; justify-content: space-around; gap: 2px; padding: .3rem 4px calc(.3rem + env(safe-area-inset-bottom, 0px));
  background: var(--brushed), linear-gradient(180deg, #1f262b, #101316);
  border-top: 2px solid var(--gold); box-shadow: 0 -6px 18px rgb(0 0 0 / 55%), inset 0 1px 0 var(--gold-deep);
}
.bottom-nav > a, .bottom-nav > button {
  flex: 1; max-width: 110px; min-height: 50px; display: grid; justify-items: center; align-content: center; gap: 3px; padding: .3rem 0 .2rem;
  color: var(--muted); background: none; border: 0; border-radius: 6px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  font: 500 .64rem var(--font-head); text-transform: uppercase; letter-spacing: .08em;
}
.bottom-nav > a:hover { text-decoration: none; color: var(--text); }
.bottom-nav > .active { color: var(--gold-bright); background: linear-gradient(180deg, rgb(31 107 58 / 60%), rgb(19 74 39 / 25%)); box-shadow: inset 0 -2px 0 var(--gold); }

/* slide-up sheets (menu, "More") */
.sheet-back { position: fixed; inset: 0; z-index: 55; display: flex; align-items: flex-end; justify-content: center; background: rgb(3 5 6 / 70%); animation: fade .15s; }
.sheet-panel {
  width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto; padding: .5rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  background: var(--brushed), var(--steel); border: 1px solid var(--gold-deep); border-bottom: 0; border-radius: 14px 14px 0 0;
  box-shadow: 0 -12px 40px #000; animation: rise .2s ease-out;
}
.sheet-grip { width: 42px; height: 4px; border-radius: 2px; background: var(--stitch); margin: .2rem auto .7rem; }
.sheet-list { display: grid; gap: .4rem; }
.sheet-item {
  display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 48px; padding: .6rem .8rem; cursor: pointer; text-align: left;
  border-radius: 6px; border: 1px solid var(--border); background: var(--steel-raised); color: var(--text); box-shadow: var(--bevel);
  font: 500 .95rem var(--font-head); text-transform: uppercase; letter-spacing: .08em;
}
.sheet-item:hover { text-decoration: none; color: var(--gold-bright); }
.sheet-item.active { color: var(--gold-bright); border-color: var(--gold-deep); background: linear-gradient(180deg, var(--accent), var(--accent-strong)); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet-back, .sheet-panel { animation: none; } }

/* stacked player rows (team sheet, players list) */
.m-sheet, .m-list { display: grid; }
.m-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; gap: .55rem; align-items: center; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
.m-list .m-row { grid-template-columns: minmax(0, 1fr) auto; }
.m-row:last-child { border-bottom: 0; }
.m-row.tappable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.m-row.tappable:active { background: rgb(255 255 255 / 5%); }
.m-row.selected { background: rgb(212 175 55 / 15%); box-shadow: inset 3px 0 0 var(--gold); }
.m-row.target { background: rgb(63 165 102 / 17%); box-shadow: inset 3px 0 0 var(--accent-bright); }
.m-slot { font: 600 .8rem var(--font-head); letter-spacing: .08em; color: var(--gold); }
.m-slot.bn { color: var(--muted); }
.m-main { min-width: 0; display: grid; gap: .28rem; }
.m-line1 { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.m-line1 .plabel { flex: 0 1 auto; min-width: 0; }
.m-line1 .pos { min-width: 2.3rem; }
.m-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.m-tags .badge { font-size: .62rem; }
.m-line2 { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .65rem; font-size: .8rem; color: var(--muted); }
.m-line2 strong { color: var(--text); }
.m-line2 .wx { padding: .05rem .45rem; font-size: .75rem; }
.m-nums { display: grid; justify-items: end; gap: .2rem; text-align: right; }
.m-nums strong { font-size: 1.05rem; }
.m-nums .proj { font-size: .75rem; }
.m-section { padding: .35rem .8rem; color: var(--gold-bright); border-bottom: 1px solid var(--gold-deep);
  background: linear-gradient(180deg, #20272c, #181d21); font: 600 .72rem var(--font-head); text-transform: uppercase; letter-spacing: .16em; }
.m-search { flex-wrap: nowrap; }
.m-search input { flex: 1 1 auto; width: auto; min-width: 0; }
.m-search .btn { flex: none; }

/* floating lineup action bar, above the tab bar */
.m-actionbar {
  position: fixed; left: 8px; right: 8px; bottom: calc(var(--nav-h, 0px) + env(safe-area-inset-bottom, 0px) + 8px); z-index: 25;
  max-width: 544px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .6rem .7rem;
  border-radius: 8px; border: 1px solid var(--gold-deep); background: var(--brushed), linear-gradient(180deg, #2a3238, #181d21);
  box-shadow: 0 8px 24px rgb(0 0 0 / 75%); animation: rise .15s ease-out;
}
.m-actionbar .grow { flex: 1 1 100%; }
.m-actionbar-spacer { height: 96px; }

/* player card fills the screen */
[data-layout="mobile"] .modal-back { display: block; padding: 0; }
[data-layout="mobile"] .modal { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
[data-layout="mobile"] .close-x { margin-top: calc(8px + env(safe-area-inset-top, 0px)); }
[data-layout="mobile"] .pcard-photo { aspect-ratio: 16 / 10; }
[data-layout="mobile"] .pcard-id h2 { font-size: 1.4rem; }
[data-layout="mobile"] .pcard-body { padding: 1rem .9rem 1.4rem; }

/* draft room: the clock stays in view while you scroll the player list */
[data-layout="mobile"] .clock { position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); z-index: 12; padding: .7rem .9rem; gap: .7rem; }
[data-layout="mobile"] .clock .timer { font-size: 1.7rem; min-width: 3.6rem; }
[data-layout="mobile"] .clock .who { font-size: 1rem; }
[data-layout="mobile"] .board-wrap { max-height: 300px; }
[data-layout="mobile"] .board th { min-width: 96px; }
[data-layout="mobile"] .cell .pn { max-width: 100px; }
[data-layout="mobile"] .scroll-list { max-height: 60vh; }
[data-layout="mobile"] .scroll-list .queue-item { flex-wrap: wrap; row-gap: .35rem; }
/* line 1: number, position, name, value · line 2: projection and buttons */
[data-layout="mobile"] .scroll-list .queue-item .name { flex: 1 1 calc(100% - 9rem); }
[data-layout="mobile"] .scroll-list .queue-item > .proj { flex: 1 1 auto; text-align: left; margin-left: 2.45rem; }

/* trade offers: buttons drop below the description */
.offer-row { grid-template-columns: 1fr auto; }
[data-layout="mobile"] .offer-row { grid-template-columns: minmax(0, 1fr); }
[data-layout="mobile"] .card-head { flex-wrap: wrap; }
[data-layout="mobile"] .modal { overflow-x: hidden; }
[data-layout="mobile"] .pcard-top { grid-template-columns: minmax(0, 1fr); }
[data-layout="mobile"] .team-extras .queue-item { flex-wrap: wrap; row-gap: .35rem; }
[data-layout="mobile"] p { overflow-wrap: anywhere; }

/* login on phones: start near the top so the form stays above the keyboard, smaller crest */
[data-layout="mobile"] .auth-wrap { place-items: start center;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
[data-layout="mobile"] .auth-hero { margin-bottom: .9rem; }
[data-layout="mobile"] .auth-hero .auth-logo { width: 116px; height: 116px; }
[data-layout="mobile"] .auth-hero h1 { font-size: 1.6rem; margin-top: .5rem; }
[data-layout="mobile"] .auth-hero p { margin: 0; }
[data-layout="mobile"] .auth-card .btn.primary { min-height: 48px; font-size: .95rem; }

/* ------------------------------------------------------------ value breakdown: this season / future / specialty */
.vparts { display: grid; gap: .7rem; padding: .9rem 1rem; border-radius: 6px; border: 1px solid var(--border);
  background: #12161a; box-shadow: inset 0 2px 4px rgb(0 0 0 / 50%); }
.vpart { display: grid; gap: .3rem; }
.vpart.muted-part { opacity: .6; }
.vp-head { display: flex; align-items: baseline; justify-content: space-between; }
.vp-label { font: 500 .78rem var(--font-head); text-transform: uppercase; letter-spacing: .12em; color: var(--gold); }
.vp-head strong { font-size: 1.25rem; color: var(--text); }
.vpart .vbar { flex: none; }
.vp-note { font-size: .8rem; color: var(--muted); }
.vp-sum { font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .55rem; }
.vp-sum strong { color: var(--gold-bright); }
.miniparts { display: inline-grid; gap: 2px; width: 44px; vertical-align: middle; flex: none; }
.mp-row { display: block; height: 4px; border-radius: 2px; background: #0b0e10; overflow: hidden; box-shadow: inset 0 1px 1px rgb(0 0 0 / 70%); }
.mp-row i { display: block; height: 100%; border-radius: 2px; }
.mp-row i.s { background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright)); }
.mp-row i.f { background: linear-gradient(90deg, var(--accent-strong), var(--accent-bright)); }
.mp-row i.x { background: linear-gradient(90deg, #7a121a, #e5484f); }
.parts-legend { display: inline-flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: center; }
.parts-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.parts-legend i { display: inline-block; width: 16px; height: 4px; border-radius: 2px; }
.parts-legend i.s { background: var(--gold); } .parts-legend i.f { background: var(--accent-bright); } .parts-legend i.x { background: #e5484f; }

/* the math behind each value bar */
.vp-more > summary { cursor: pointer; font-size: .78rem; color: var(--gold); width: fit-content; margin-top: .1rem; }
.vp-more[open] > summary { margin-bottom: .45rem; }
.vmath { display: grid; gap: .45rem; font-size: .84rem; color: var(--text); padding: .6rem .7rem; border-radius: 5px;
  background: rgb(255 255 255 / 3%); border: 1px solid var(--line); }
.vmath p { margin: 0; color: #c9cfd3; }
.vmath b { color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.mtable { width: 100%; font-size: .8rem; font-variant-numeric: tabular-nums; }
.mtable th { padding: .3rem .45rem; font-size: .66rem; }
.mtable td { padding: .28rem .45rem; }
.mtable tr.hl td { background: rgb(212 175 55 / 12%) !important; color: var(--gold-bright); }
.mtable td.down { color: #ff8a8f; } .mtable td.up { color: #8fd7a8; }

/* ------------------------------------------------------------ team photos */
.team-avatar { display: inline-grid; place-items: center; flex: none; border-radius: 10px; object-fit: cover;
  border: 2px solid var(--gold-deep); background: #0f1316; box-shadow: 0 0 0 1px rgb(0 0 0 / 60%), 0 3px 10px rgb(0 0 0 / 55%); }
.team-avatar.mono { font-family: var(--font-brand); font-weight: 700; letter-spacing: .04em; color: var(--gold-bright);
  background: var(--brushed), linear-gradient(160deg, #1f6b3a, #0d2c19); text-shadow: 0 1px 0 #000; }
.team-head { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.team-head-main { display: grid; gap: .35rem; min-width: 0; }
label.btn { position: relative; }
.side-team { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.side-team.away { flex-direction: row-reverse; }

/* ------------------------------------------------------------ team evaluation */
.team-main { display: grid; gap: 1.1rem; }
.team-main > * { min-width: 0; }
.eval-grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.eval-room { display: grid; gap: .35rem; align-content: start; padding: .75rem .85rem; border-radius: 6px; border: 1px solid var(--border);
  background: #12161a; box-shadow: inset 0 2px 4px rgb(0 0 0 / 45%); }
.eval-top { display: flex; align-items: center; justify-content: space-between; }
.eval-rank { font: 600 1.35rem/1 var(--font-head); letter-spacing: .03em; }
.eval-rank small { font-size: .7rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.eval-rank.top { color: #8fd7a8; } .eval-rank.mid { color: var(--gold-bright); } .eval-rank.low { color: #ff8a8f; }
.eval-sub { font-size: .8rem; color: var(--muted); }
.eval-sub b { color: var(--text); }
.eval-line { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; font-size: .92rem; }
.eval-emoji { width: 1.3rem; text-align: center; flex: none; }
.eval-note { font-size: .78rem; color: #b5bdc2; }
.eval-who { font-size: .74rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .35rem; }
/* expanded on a wide screen: the evaluator sits beside the roster; collapsed it's a bar above it */
@media (min-width: 1380px) {
  [data-layout="desktop"] .team-page { max-width: 1500px; }
  [data-layout="desktop"] .team-main.eval-open { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  [data-layout="desktop"] .eval-open .team-eval-col { grid-column: 2; grid-row: 1; position: sticky; top: 70px; }
  [data-layout="desktop"] .eval-open .team-sheet-col { grid-column: 1; grid-row: 1; }
  [data-layout="desktop"] .eval-open .eval-grid { grid-template-columns: 1fr; }
  [data-layout="desktop"] .eval-open .eb-rooms { display: none; }
}
[data-layout="mobile"] .eval-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
[data-layout="mobile"] .eval-room { padding: .6rem .6rem; }
[data-layout="mobile"] .eval-rank { font-size: 1.15rem; }
[data-layout="mobile"] .eval-who { display: none; }
[data-layout="mobile"] .side-team { flex-direction: column; align-items: flex-start; gap: .3rem; }
[data-layout="mobile"] .side-team.away { flex-direction: column; align-items: flex-end; }
[data-layout="mobile"] .eval-note { display: none; }
[data-layout="mobile"] .eval-sub { font-size: .72rem; }
[data-layout="mobile"] .eval-line { font-size: .84rem; gap: .1rem .35rem; }
[data-layout="mobile"] .eval-line .small { font-size: .74rem; }
[data-layout="mobile"] .team-eval > p.small { display: none; }
[data-layout="mobile"] .team-head { gap: .6rem .8rem; }
[data-layout="mobile"] .team-head .team-avatar { width: 52px !important; height: 52px !important; }

/* ------------------------------------------------------------ evaluator bar (collapsed) and team strength */
.eval-bar { display: flex; align-items: center; gap: .9rem; width: 100%; padding: .6rem 1rem; cursor: pointer; text-align: left;
  background: none; border: 0; color: inherit; font: inherit; -webkit-tap-highlight-color: transparent; }
.eval-bar:hover { background: rgb(255 255 255 / 3%); }
.team-eval:not(.collapsed) .eval-bar { border-bottom: 1px solid var(--line); }
.eb-title { font: 600 .95rem var(--font-head); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.eb-rooms { display: flex; flex-wrap: wrap; gap: .3rem .9rem; flex: 1; min-width: 0; }
.eb-room { display: inline-flex; align-items: center; gap: .35rem; }
.eb-room .eval-rank { font-size: 1rem; }
.eb-emo { font-size: .85rem; letter-spacing: .05em; }
.eb-strength { display: inline-flex; align-items: baseline; gap: .5rem; margin-left: auto; white-space: nowrap; }
.eb-label { font: 500 .72rem var(--font-head); text-transform: uppercase; letter-spacing: .12em; color: var(--gold); }
.eval-rank.big { font-size: 1.9rem; }
.eb-chevron { color: var(--gold); font-size: .9rem; }
.eval-body { display: grid; gap: .8rem; padding: .9rem 1rem 1rem; }
.strength-box { display: grid; gap: .45rem; padding: .8rem .9rem; border-radius: 6px; border: 1px solid var(--gold-deep);
  background: var(--brushed), linear-gradient(160deg, #1f6b3a 0%, #123f24 60%, #0d2c19 100%); box-shadow: inset 0 1px 0 rgb(255 255 255 / 8%); }
.sb-top { display: flex; align-items: center; justify-content: space-between; }
.sb-score b { font: 600 1.3rem var(--font-head); color: var(--gold-bright); }
.sb-groups { display: flex; flex-wrap: wrap; gap: .35rem .8rem; font-size: .85rem; }
.sb-group { display: inline-flex; align-items: center; gap: .3rem; }
.sb-group b.up { color: #8fd7a8; } .sb-group b.down { color: #ff8a8f; }
.strength-box .muted { color: #b9c9bd; }
[data-layout="mobile"] .eval-bar { flex-wrap: wrap; gap: .45rem .7rem; padding: .6rem .8rem; }
[data-layout="mobile"] .eb-rooms { order: 3; flex-basis: 100%; gap: .3rem .7rem; }
[data-layout="mobile"] .eb-emo { display: none; }
[data-layout="mobile"] .eval-rank.big { font-size: 1.5rem; }
[data-layout="mobile"] .eval-body { padding: .7rem .7rem .8rem; }
