/* HEX REGS shared styles.
   Visual language borrows from Madden's own league lobby: team-colored bars, condensed italic type, hard edges. */

:root {
  --bg: #0a0b10;
  --bg-2: #0f1117;
  --panel: #13151c;
  --panel-2: #1a1d26;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.16);
  --text: #f2f3f5;
  --muted: #a3a8b5;
  --dim: #6c7282;
  --red: #d61f2c;
  --red-dark: #a3121d;
  --blue: #3d6bff;
  --gold: #e8b931;
  --win: #3fbf5f;
  --loss: #e0404a;
  --radius: 4px;
  --max: 1240px;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted-note { color: var(--dim); font-size: 14px; margin: 0; }
code { background: var(--panel-2); padding: 2px 6px; border-radius: 3px; font-size: 13px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,11,16,.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-style: italic; font-size: 26px; letter-spacing: .02em; text-transform: uppercase; }
.brand img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 2px; margin-left: auto; }
.nav-links a {
  padding: 6px 12px; font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); border-bottom-color: var(--red); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border: 0; border-radius: var(--radius);
  font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .04em; text-transform: uppercase;
  transition: background .15s;
}
.btn svg { width: 15px; height: 15px; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); }
.btn-red:disabled { opacity: .5; cursor: default; }
.btn-ghost { background: transparent; border: 1px solid var(--line-2); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,.06); }
.btn-sm { padding: 6px 12px; font-size: 15px; }
.btn-danger { background: transparent; border: 1px solid rgba(224,64,74,.45); color: var(--loss); }
.btn-danger:hover { background: rgba(224,64,74,.1); }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: rgba(0,0,0,.3);
}
.icon-btn:hover { background: rgba(255,255,255,.1); }
.icon-btn svg { width: 18px; height: 18px; }
.clear { border: 0; background: transparent; color: var(--blue); font-weight: 700; font-size: 14px; padding: 0 4px; }

/* ---------- Section headings ---------- */
section { padding: 72px 0 0; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.sec-head h2, .page-head h1 {
  display: flex; align-items: center; gap: 12px; margin: 0;
  font-family: var(--display); font-weight: 800; font-style: italic; text-transform: uppercase;
  font-size: clamp(30px, 3.6vw, 42px); line-height: 1; letter-spacing: .01em;
}
.sec-head h2::before, .page-head h1::before {
  content: ""; width: 10px; height: .8em; background: var(--red); transform: skewX(-14deg); flex: none;
}
.sec-head .link { font-family: var(--display); font-weight: 700; font-size: 17px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.sec-head .link:hover { color: var(--text); }
.sec-head .link svg { width: 15px; height: 15px; }

/* ---------- Hero ---------- */
.banner { position: relative; width: 100%; max-width: 1680px; margin: 0 auto; aspect-ratio: 2048 / 683; background: #050608; }
.banner picture { display: block; width: 100%; height: 100%; }
.banner img { width: 100%; height: 100%; object-fit: cover; }
.ticker { background: var(--red); color: #fff; }
.ticker .wrap { display: flex; align-items: stretch; overflow-x: auto; scrollbar-width: none; }
.ticker .wrap::-webkit-scrollbar { display: none; }
.tick {
  display: flex; align-items: baseline; gap: 8px; padding: 12px 22px; white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,.22);
  font-family: var(--display); font-weight: 700; font-style: italic; text-transform: uppercase; letter-spacing: .03em; font-size: 16px;
}
.tick:first-child { padding-left: 0; }
.tick:last-child { border-right: 0; }
.tick b { font-size: 24px; font-weight: 800; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 24px 40px; padding: 30px 0 0; flex-wrap: wrap; }
.intro p { margin: 0; max-width: 640px; color: var(--muted); font-size: 18px; }
.intro p strong { color: var(--text); font-weight: 600; }
.intro .ctas { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Team logo + player face ---------- */
.logo {
  --size: 34px;
  width: var(--size); height: var(--size); flex: none; border-radius: 50%;
  display: inline-grid; place-items: center; overflow: hidden;
  background: #0d0f15; box-shadow: inset 0 0 0 2px var(--tc);
}
.logo img { width: 76%; height: 76%; object-fit: contain; }
.logo.nologo { background: var(--tc); box-shadow: none; }
.logo.nologo::after { content: attr(data-fallback); color: var(--ti); font-weight: 800; font-size: calc(var(--size) * .36); }
.logo.sm { --size: 24px; }
.logo.lg { --size: 52px; }
.logo.xl { --size: 88px; }

.face { --size: 34px; display: inline-block; vertical-align: middle; position: relative; width: var(--size); height: var(--size); flex: none; border-radius: 50%; background: var(--tc); box-shadow: 0 0 0 2px var(--tc); }
.face > img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.face .logo.badge { --size: 46%; position: absolute; right: -10%; bottom: -8%; box-shadow: 0 0 0 2px var(--bg), inset 0 0 0 1px var(--tc); }
.face.sm { --size: 26px; }
.face.lg { --size: 56px; }
.face.xl { --size: 96px; }

/* ---------- Latest episode ---------- */
.latest { display: grid; grid-template-columns: 1.65fr 1fr; gap: 20px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.feature .media { position: relative; display: block; aspect-ratio: 16/9; background: #000; }
.feature .media img { width: 100%; height: 100%; object-fit: cover; }
.play-big { position: absolute; left: 18px; bottom: 18px; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--red); border-radius: var(--radius); font-family: var(--display); font-weight: 800; font-style: italic; font-size: 18px; text-transform: uppercase; letter-spacing: .03em; }
.play-big svg { width: 14px; height: 14px; }
.feature .media:hover .play-big { background: var(--red-dark); }
.feature .info { padding: 18px 20px 20px; }
.feature h3 { margin: 10px 0 14px; font-size: clamp(19px, 2vw, 23px); line-height: 1.25; font-weight: 700; }
.byline { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.byline span { color: var(--dim); font-weight: 500; font-size: 14px; }
.upnext { display: flex; flex-direction: column; gap: 4px; }
.upnext h4, .label {
  margin: 0 0 6px; font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim);
}
.mini { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; padding: 8px; border-radius: var(--radius); }
.mini:hover { background: var(--panel); }
.mini img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 3px; background: var(--panel-2); }
.mini .t { font-size: 15px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini .m { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- Tags ---------- */
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 3px;
  font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .05em; text-transform: uppercase;
  background: rgba(255,255,255,.08); color: var(--muted);
}
.tag.new { background: var(--red); color: #fff; }
.tag.week { background: #fff; color: #0a0b10; }
.tag.PS { color: #9db8ff; background: rgba(0,112,209,.2); }
.tag.Xbox { color: #8ee08e; background: rgba(16,124,16,.22); }
.tag.yt { color: #ff9a9a; background: rgba(255,0,0,.16); }

/* ---------- Episode toolbar + grid ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 22px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.seg button {
  border: 0; background: transparent; padding: 8px 14px; color: var(--muted); white-space: nowrap;
  font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: .04em; text-transform: uppercase;
}
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.seg button:not([aria-pressed="true"]):hover { color: var(--text); background: rgba(255,255,255,.05); }
.field { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); }
.field svg { width: 16px; height: 16px; color: var(--dim); flex: none; }
.field input, .field select { background: transparent; border: 0; color: var(--text); font: inherit; font-size: 15px; font-weight: 500; outline: none; height: 100%; }
.field select { cursor: pointer; }
.field select option { background: var(--panel); }
.search { flex: 1 1 220px; }
.search input { width: 100%; }
.count { margin-left: auto; font-size: 14px; color: var(--dim); white-space: nowrap; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px 18px; }
.card { display: flex; flex-direction: column; }
.card .th { position: relative; aspect-ratio: 16/9; overflow: hidden; border-radius: var(--radius); background: var(--panel-2); border-bottom: 3px solid var(--tc); }
.card .th img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .th img { transform: scale(1.04); }
.card .th .meta { position: absolute; top: 8px; left: 8px; }
.card .t { margin: 12px 0 10px; font-weight: 600; font-size: 16px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card:hover .t { color: #fff; text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; }
.card .by { display: flex; align-items: center; gap: 10px; margin-top: auto; font-size: 14px; }
.card .by b { display: block; font-weight: 700; line-height: 1.2; }
.card .by small { display: block; color: var(--dim); font-size: 13px; }
.card .by .date { margin-left: auto; color: var(--dim); font-size: 13px; white-space: nowrap; }
.empty { grid-column: 1 / -1; text-align: center; padding: 50px 20px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ---------- Creator cards ---------- */
.creators { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.creator {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  padding: 22px 14px 16px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--tc); border-radius: var(--radius);
}
.creator:hover { background: var(--panel-2); }
.creator h3 { margin: 4px 0 0; font-family: var(--display); font-weight: 800; font-style: italic; font-size: 22px; line-height: 1; text-transform: uppercase; letter-spacing: .01em; }
.creator .team { font-size: 14px; color: var(--muted); }
.creator .eps { font-size: 13px; color: var(--dim); }

/* ---------- Team bars (league lobby) ---------- */
.lobby { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px 18px; }
.division h3 {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.conf { display: inline-block; padding: 1px 6px; border-radius: 3px; font-family: var(--display); font-weight: 800; font-style: italic; font-size: 13px; color: #fff; letter-spacing: .04em; }
.conf.AFC { background: #c8102e; }
.conf.NFC { background: #013369; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar {
  position: relative; display: grid; grid-template-columns: 54px 1fr auto; align-items: center;
  height: 50px; width: 100%; padding: 0 14px 0 0; border: 0; border-radius: 3px; overflow: hidden; text-align: left;
  color: var(--ti); background: linear-gradient(90deg, var(--tc) 0%, color-mix(in srgb, var(--tc) 62%, #07080c) 100%);
}
.bar .crest { height: 100%; display: grid; place-items: center; background: rgba(0,0,0,.22); }
.bar .crest img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 0 1px rgba(255,255,255,.85)) drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.bar .crest.nologo::after { content: attr(data-fallback); font-weight: 800; }
.bar .who { display: flex; align-items: center; gap: 10px; min-width: 0; padding-left: 12px; }
.bar .who img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.bar .name { font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.bar .rec { font-family: var(--display); font-weight: 800; font-style: italic; font-size: 22px; padding-left: 10px; }
.bar:hover { filter: brightness(1.12); }
.bar.dim { opacity: .25; }
.ranked { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; }
.ranked .row { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 6px; }
.ranked .rk { font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--dim); text-align: right; }

/* ---------- Standings tables ---------- */
.standings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.st-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.st-card h3 {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line);
  font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
table.st { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
table.st th { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); text-align: right; padding: 9px 10px; }
table.st th:first-child, table.st td:first-child { text-align: left; padding-left: 16px; }
table.st td { padding: 9px 10px; text-align: right; border-top: 1px solid var(--line); color: var(--muted); }
table.st td:last-child, table.st th:last-child { padding-right: 16px; }
table.st tr.click { cursor: pointer; }
table.st tr.click:hover td { background: rgba(255,255,255,.03); }
table.st td.rk { width: 28px; color: var(--dim); font-weight: 700; padding-right: 0; }
table.st td.who { text-align: left; }
.tm { display: flex; align-items: center; gap: 10px; min-width: 0; text-align: left; }
.tm > span:last-child { min-width: 0; }
.tm b { display: block; color: var(--text); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm small { display: block; font-size: 13px; color: var(--dim); }
td.rec { color: var(--text) !important; font-weight: 700; }
.leaders { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

/* ---------- Season tracker ---------- */
.tracker { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.tracker-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; color: var(--muted); }
.weeks { display: grid; grid-template-columns: repeat(18, 1fr) repeat(4, 1.7fr); gap: 4px; }
.wk {
  height: 44px; border: 0; padding: 0; border-radius: 2px; display: grid; place-items: center;
  background: var(--panel-2); color: var(--dim);
  font-family: var(--display); font-weight: 700; font-size: 16px; text-transform: uppercase;
}
.wk.done { background: #2b3550; color: #fff; }
.wk.now { background: var(--red); color: #fff; }
.wk.post { font-size: 13px; letter-spacing: .02em; }
.wk.sb { color: var(--gold); background: #2a2412; font-style: italic; }
button.wk:hover { filter: brightness(1.25); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 14px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Page header + tabs (players/admin) ---------- */
.page-head { padding: 44px 0 0; }
.page-head h1 { font-size: clamp(40px, 5.5vw, 64px); }
.page-head p { color: var(--muted); margin: 12px 0 0; max-width: 620px; font-size: 17px; }
.demo-note {
  display: inline-block; margin: 16px 0 0; padding: 8px 12px; border-radius: var(--radius); font-size: 14px;
  color: #f3d58a; background: rgba(232,185,49,.08); border: 1px solid rgba(232,185,49,.25);
}
.tabs { display: flex; gap: 0; margin: 28px 0 22px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button {
  border: 0; background: none; padding: 10px 18px; margin-bottom: -1px; white-space: nowrap;
  font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .04em; text-transform: uppercase; color: var(--dim);
  border-bottom: 3px solid transparent;
}
.tabs [aria-selected="true"] { color: var(--text); border-bottom-color: var(--red); }
.tabs button:hover { color: var(--text); }

/* ---------- Player drawer ---------- */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(3,4,8,.8); }
dialog.drawer {
  margin: 0 0 0 auto; padding: 0; height: 100dvh; max-height: 100dvh; width: min(500px, 100vw);
  border: 0; border-left: 1px solid var(--line-2); background: var(--bg-2); overflow-y: auto;
}
.drawer-head { position: relative; padding: 24px 24px 22px; background: linear-gradient(120deg, var(--tc) 0%, color-mix(in srgb, var(--tc) 35%, var(--bg-2)) 70%); color: var(--ti); }
.drawer-head .close { position: absolute; top: 14px; right: 14px; color: #fff; }
.drawer-head h2 { margin: 14px 0 4px; padding-right: 40px; font-family: var(--display); font-weight: 800; font-style: italic; font-size: 38px; line-height: 1; text-transform: uppercase; overflow-wrap: anywhere; }
.drawer-head .team { font-weight: 600; opacity: .85; }
.drawer-id { display: flex; align-items: center; gap: 16px; }
.drawer-id > div { min-width: 0; }
.drawer-took { margin-top: 12px; font-size: 14px; }
.drawer-tags { margin-top: 16px; }
.drawer-tags:empty { display: none; }
.drawer-head .tag { background: rgba(0,0,0,.35); color: #fff; }
.drawer-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.drawer-stats div { padding: 14px 8px; text-align: center; border-right: 1px solid var(--line); }
.drawer-stats div:last-child { border-right: 0; }
.drawer-stats b { display: block; font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.1; }
.drawer-stats span { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.drawer-body { padding: 22px 24px 40px; }
.drawer-body .blk { padding-bottom: 24px; }
.empty-box { text-align: center; padding: 50px 20px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.ep-list { display: flex; flex-direction: column; gap: 6px; }
.ep { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; padding: 6px; border-radius: 3px; }
.ep:hover { background: var(--panel); }
.ep img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 3px; }
.ep b { font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep span { font-size: 13px; color: var(--dim); }

/* ---------- Admin forms ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.panel h3 { margin: 0 0 14px; font-family: var(--display); font-weight: 700; font-size: 22px; text-transform: uppercase; letter-spacing: .02em; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.fld input, .fld select, input.inline, select.inline {
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); border-radius: var(--radius);
  padding: 9px 11px; font: inherit; font-size: 15px; min-width: 0;
}
.fld input:focus, .fld select:focus, input.inline:focus, select.inline:focus { outline: none; border-color: var(--blue); }
.grow { flex: 1 1 220px; }
table.edit { width: 100%; border-collapse: collapse; font-size: 15px; }
table.edit th { text-align: left; font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); padding: 8px; }
table.edit td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
table.edit input.inline, table.edit select.inline { width: 100%; padding: 7px 9px; }
tr.dirty td { background: rgba(61,107,255,.08); }
.table-scroll { overflow-x: auto; }
.rec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 28px; }
.rec-grid table.edit td:first-child { width: 100%; }
.stepper { white-space: nowrap; }
.stepper span { font-family: var(--display); font-weight: 700; color: var(--dim); margin-right: 6px; }
.stepper button { width: 28px; height: 32px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font-weight: 700; }
.stepper button:first-of-type { border-radius: var(--radius) 0 0 var(--radius); }
.stepper button:last-of-type { border-radius: 0 var(--radius) var(--radius) 0; }
.stepper button:hover { background: #262a36; }
table.edit .stepper input.inline { width: 44px; height: 32px; padding: 0; border-radius: 0; border-left: 0; border-right: 0; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.center-card { max-width: 460px; margin: 64px auto; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  padding: 10px 18px; border-radius: var(--radius); background: var(--text); color: var(--bg); font-weight: 700;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--loss); color: #fff; }

/* ---------- Footer ---------- */
footer { margin-top: 96px; border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--dim); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer b { color: var(--text); font-family: var(--display); font-style: italic; font-size: 18px; text-transform: uppercase; }
footer a:hover { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .lobby { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .latest, .standings, .leaders, .rec-grid { grid-template-columns: 1fr; }
  .weeks { grid-template-columns: repeat(11, 1fr); }
  .wk.post { grid-column: span 2; }
  .wk.sb { grid-column: span 3; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  /* Phones: the tabs drop to their own swipeable row under the logo. */
  html { scroll-padding-top: 112px; }
  .nav .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 4px 16px; }
  .nav .btn { margin-left: auto; }
  .nav-links { order: 3; width: calc(100% + 32px); margin: 0 -16px; padding: 0 10px; gap: 0; overflow-x: auto; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { flex: none; padding: 10px 12px 9px; font-size: 16px; border-bottom-width: 3px; }
  section { padding-top: 56px; }
  .tick { padding: 10px 16px; font-size: 14px; }
  .tick b { font-size: 20px; }
  .intro p { font-size: 16px; }
  .lobby, .ranked { grid-template-columns: 1fr; }
  .seg { max-width: 100%; overflow-x: auto; }
  .field.sel { flex: 1 1 140px; }
  .field.sel select { width: 100%; }
  .count { width: 100%; margin: 0; }
  .mini { grid-template-columns: 120px 1fr; }
  .weeks { grid-template-columns: repeat(6, 1fr); }
  .wk.post { grid-column: span 3; }
  .wk.sb { grid-column: span 6; }
  table.st .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Admin: dialogs and help ---------- */
dialog.form-dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); }
.page-head p .clear { font-size: inherit; padding: 0; }
.help p { margin: 0 0 10px; color: var(--muted); }
.help p:last-child { margin-bottom: 0; }
.help ol, .help ul { margin: 0 0 10px; padding-left: 22px; color: var(--muted); line-height: 1.7; }
.help ul ul { margin: 4px 0; }
.help b { color: var(--text); }

/* ---------- Fan poll ---------- */
.poll { display: flex; flex-direction: column; gap: 16px; }
.poll-note { margin: 14px 0; color: var(--muted); }
.poll-vote summary { list-style: none; cursor: pointer; }
.poll-vote summary::-webkit-details-marker { display: none; }
.poll-vote .chev { width: 16px; height: 16px; transition: transform .2s; }
.poll-vote[open] .chev { transform: rotate(180deg); }
.poll-note b { color: var(--text); }
.poll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.poll-tile {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 10px; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--tc); border-radius: var(--radius);
}
.poll-tile > span:last-child { min-width: 0; line-height: 1.2; }
.poll-tile b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poll-tile small { display: block; font-size: 12px; color: var(--dim); }
.poll-tile:not(:disabled):hover { background: var(--panel-2); }
.poll-tile.picked { background: color-mix(in srgb, var(--tc) 32%, var(--panel)); border-color: var(--tc); }
.poll-tile.picked small { color: var(--text); }
.poll-tile:disabled { cursor: default; }
.poll-list { list-style: none; margin: 0; padding: 6px 16px 16px; columns: 2; column-gap: 32px; }
.poll-list > li { break-inside: avoid; }
.poll-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 4px 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.poll-row:first-child, .poll-row:nth-child(5) { border-top: 0; }
@media (max-width: 720px) { .poll-row:nth-child(5) { border-top: 1px solid var(--line); } }
.poll-row .rk { font-family: var(--display); font-weight: 800; color: var(--dim); }
.poll-pct { font-family: var(--display); font-weight: 800; font-size: 20px; }
.poll-bar { grid-column: 2 / 4; height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.poll-bar i { display: block; height: 100%; background: var(--tc); border-radius: 3px; }
@media (max-width: 720px) { .poll-list { columns: 1; } .poll-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Player bio ---------- */
.bio { margin: 0; color: var(--text); line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.fld textarea { background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); border-radius: var(--radius); padding: 10px 12px; font: inherit; font-size: 15px; resize: vertical; min-height: 80px; }
.fld textarea:focus { outline: none; border-color: var(--blue); }

/* ---------- Note to the commissioner ---------- */
.note-link { font-size: inherit; padding: 0; }
footer .wrap { align-items: center; }
footer .footer-note { margin-left: 8px; }
@media (max-width: 720px) { footer .footer-note { margin: 10px 0 0; } }
.note-about { margin: 0 0 12px; padding: 8px 12px; border-radius: var(--radius); background: var(--panel-2); color: var(--muted); font-size: 14px; }
.note-about b { color: var(--text); }
.note-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tabs .badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--red); color: #fff; font-size: 13px; line-height: 20px; text-align: center; font-style: normal; vertical-align: 2px; }
.notes { display: flex; flex-direction: column; gap: 10px; }
.note { padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: var(--radius); background: var(--bg-2); }
.note.done { border-left-color: var(--line-2); opacity: .75; }
.note-msg { margin: 10px 0 12px; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.55; }

/* ---------- Player profile page ---------- */
.face.xxl { --size: 128px; box-shadow: 0 0 0 4px rgba(255,255,255,.9), 0 10px 30px rgba(0,0,0,.45); background: #0d0f15; }
.logo.xxl { --size: 128px; box-shadow: 0 0 0 4px rgba(255,255,255,.9), inset 0 0 0 3px var(--tc), 0 10px 30px rgba(0,0,0,.45); }
.face.xxl .logo.badge { --size: 34%; right: -2%; bottom: -2%; box-shadow: 0 0 0 4px #0d0f15, inset 0 0 0 1px var(--tc); }
.ph {
  position: relative; overflow: hidden; color: #fff;
  background:
    repeating-linear-gradient(115deg, rgba(255,255,255,.035) 0 2px, transparent 2px 14px),
    linear-gradient(105deg, color-mix(in srgb, var(--tc) 92%, #000) 0%, color-mix(in srgb, var(--tc) 62%, #07080c) 48%, color-mix(in srgb, var(--tc) 22%, #07080c) 100%);
}
section.ph { padding-top: 0; }
.pnote { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; margin-top: 48px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--muted); }
.pnote .btn svg { width: 15px; height: 15px; }
.ph-mark { position: absolute; right: -40px; top: 50%; width: 420px; height: 420px; transform: translateY(-56%) rotate(-8deg); object-fit: contain; opacity: .14; filter: grayscale(.2); pointer-events: none; }
.ph-inner { position: relative; padding-top: 16px; padding-bottom: 24px; }
.ph-back { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.75); }
.ph-back:hover { color: #fff; }
.ph-back svg { width: 15px; height: 15px; }
.ph-main { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; margin-top: 16px; }
.ph-team { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.85); }
.ph-team i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .6; }
.ph-id h1 { margin: 4px 0 6px; font-family: var(--display); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: clamp(40px, 5.2vw, 72px); line-height: .92; letter-spacing: .005em; overflow-wrap: anywhere; text-shadow: 0 4px 24px rgba(0,0,0,.35); }
.ph-took { display: block; font-size: 14px; color: rgba(255,255,255,.75); margin-bottom: 4px; }
.ph-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ph-actions .btn svg { width: 17px; height: 17px; }
.ph-ghost { background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.28); color: #fff; }
.ph-ghost:hover { background: rgba(0,0,0,.45); }
.ph-record { text-align: right; padding-left: 28px; border-left: 2px solid rgba(255,255,255,.18); }
.ph-record b { display: block; font-family: var(--display); font-weight: 800; font-style: italic; font-size: clamp(48px, 5vw, 76px); line-height: .9; letter-spacing: .01em; }
.ph-record span { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.75); }
.ph-stats { position: relative; background: rgba(0,0,0,.38); border-top: 1px solid rgba(255,255,255,.1); }
.ph-stats .wrap { display: grid; grid-template-columns: repeat(5, 1fr); }
.ph-stats div { padding: 10px 8px; text-align: center; border-right: 1px solid rgba(255,255,255,.1); }
.ph-stats div:last-child { border-right: 0; }
.ph-stats b { display: block; font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.1; }
.ph-stats span { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.pbody { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; padding-top: 36px; align-items: start; }
.pgrid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
/* Latest episode: a full-width feature row, picture left and title right. */
.card.lead { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 8px 24px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.card.lead .th { grid-row: 1 / span 2; }
.card.lead .t { margin: 0; font-size: 22px; line-height: 1.25; -webkit-line-clamp: 3; align-self: end; }
.card.lead .by { margin-top: 0; align-self: start; }
.pside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }
.pcard { display: block; padding: 18px 18px 16px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--tc, var(--red)); border-radius: var(--radius); }
.pcard h3 { margin: 0 0 12px; font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pcard-flush { padding: 18px 0 4px; }
.pcard-flush h3 { padding: 0 18px; }
.pcard-flush table.st td { padding-top: 8px; padding-bottom: 8px; }
.pcard .bio { font-size: 16px; }
.pinfo { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: 15px; }
.pinfo dt { color: var(--dim); font-weight: 600; }
.pinfo dd { margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.pcard-poll p { margin: 0 0 10px; color: var(--muted); }
.pcard-poll p b { color: var(--text); font-family: var(--display); font-size: 26px; font-weight: 800; margin-right: 4px; }
.pcard-poll:hover { background: var(--panel-2); }
.pcard-poll .link { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: .04em; color: var(--text); }
.pcard-poll .link svg { width: 15px; height: 15px; }
table.st tr.me td { background: color-mix(in srgb, var(--tc, var(--red)) 18%, transparent); }
table.st tr.me td:first-child { box-shadow: inset 3px 0 0 var(--tc, var(--red)); }
.footer-note svg { width: 15px; height: 15px; }
@media (max-width: 1000px) {
  .pbody { grid-template-columns: 1fr; }
  .pside { position: static; }
}
.ph-tags { display: none; }
.m-only { display: none !important; }
@media (max-width: 720px) {
  /* Phones: compact header, picture beside the name, record in the stats row. */
  .d-only { display: none !important; }
  .m-only { display: revert !important; }
  .ph-stats div.m-only { display: block !important; }
  .ph-inner { padding-top: 12px; padding-bottom: 14px; }
  .ph-mark { width: 220px; height: 220px; right: -60px; top: 42%; opacity: .12; }
  .ph-main { grid-template-columns: auto minmax(0, 1fr); gap: 14px; margin-top: 10px; align-items: center; }
  .face.xxl, .logo.xxl { --size: 72px; box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 6px 18px rgba(0,0,0,.4); }
  .ph-team { font-size: 12px; gap: 6px; }
  .ph-team .logo { display: none; }
  .ph-id h1 { font-size: 34px; margin: 2px 0 2px; }
  .ph-tags { display: block; font-size: 13px; color: rgba(255,255,255,.8); }
  .ph-took { font-size: 12px; margin: 2px 0 0; }
  .ph-actions { gap: 8px; margin-top: 10px; }
  .ph-actions .btn { padding: 6px 12px; font-size: 14px; }
  .ph-actions .btn svg { width: 14px; height: 14px; }
  .ph-record { display: none; }
  .ph-stats .wrap { grid-template-columns: repeat(5, 1fr); padding: 0; }
  .ph-stats div { padding: 8px 2px; }
  .ph-stats b { font-size: 18px; }
  .ph-stats span { font-size: 10px; letter-spacing: .06em; white-space: nowrap; }
  .pbody { padding-top: 24px; gap: 24px; }
  .pcard-info { display: none; }
  .card.lead { grid-template-columns: 1fr; }
  .card.lead .th { grid-row: auto; }
  .card.lead .t { font-size: 18px; margin-top: 4px; }
}
.drawer-profile { display: flex; justify-content: center; width: 100%; margin-top: 18px; padding: 10px 14px; color: #fff; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.25); }
.drawer-profile:hover { background: rgba(0,0,0,.5); }
.drawer-profile svg { width: 14px; height: 14px; }

/* ---------- Admin: records and tiebreakers ---------- */
.rec-div + .rec-div { margin-top: 22px; }
.rec-row { display: grid; grid-template-columns: 190px 372px 248px 248px; justify-content: start; align-items: center; gap: 8px 22px; padding: 8px 0; border-top: 1px solid var(--line); }
.rec-row.dirty { background: rgba(61,107,255,.08); }
.rec-head { border-top: 0; padding: 0 0 4px; font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.rec-name { min-width: 0; }
.rec-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-group { display: inline-flex; align-items: center; gap: 10px; }
.rec-group em { display: none; font-style: normal; font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); min-width: 84px; }
.rec-group .stepper input.inline { width: 40px; height: 32px; padding: 0; border-radius: 0; border-left: 0; border-right: 0; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.tie-group + .tie-group { margin-top: 18px; }
.tie-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tie-list li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); cursor: grab; }
.tie-list li.dragging { opacity: .5; border-color: var(--blue); }
.tie-list .tm small { display: inline; margin-left: 10px; }
.tie-handle { color: var(--dim); letter-spacing: -3px; user-select: none; }
.tie-moves { margin-left: auto; display: flex; gap: 6px; }
.tie-moves .icon-btn { width: 30px; height: 30px; font-size: 11px; }
@media (max-width: 720px) {

  .tie-list .tm small { display: block; margin-left: 0; }
}
@media (max-width: 1180px) {
  .rec-row { grid-template-columns: 1fr; gap: 6px; }
  .rec-head { display: none; }
  .rec-group em { display: inline-block; }
}

/* ---------- Schedule (admin) ---------- */
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }
.vs-at { font-family: var(--display); font-weight: 700; font-size: 15px; text-transform: uppercase; color: var(--dim); padding-bottom: 10px; }
.sched-admin { display: flex; flex-direction: column; gap: 8px; }
.sched-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 10px 14px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.sched-row .vs-at { padding: 0; }
.sched-pick { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; text-align: left; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); }
.sched-pick:hover { background: var(--panel-2); }
.sched-pick > span { min-width: 0; line-height: 1.2; }
.sched-pick b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-pick small { display: block; color: var(--dim); font-size: 12px; }
.sched-pick em { margin-left: auto; font-style: normal; font-family: var(--display); font-weight: 800; color: #fff; background: var(--win); padding: 2px 8px; border-radius: 3px; }
.sched-pick.won { border-color: var(--win); background: color-mix(in srgb, var(--win) 14%, var(--panel)); }
.sched-row.played .sched-pick:not(.won) { opacity: .6; }
.sched-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sched-actions .on { background: var(--gold); color: #111; border-color: var(--gold); }
@media (max-width: 900px) {
  .sched-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .sched-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- Schedule (public) ---------- */
.sched-weeks { margin-top: 28px; }
.sg-sum { margin: 0 0 14px; }
.sched-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.sg { display: grid; grid-template-columns: 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sg-side { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-width: 0; }
.sg-side:hover { background: var(--panel-2); }
.sg-name { min-width: 0; line-height: 1.2; }
.sg-name b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-name small { display: block; font-size: 12px; color: var(--dim); }
.sg-side.lose .sg-name b { color: var(--muted); }
.sg-side.lose { opacity: .75; }
.sg-w, .sg-l, .sg-t { margin-left: auto; font-style: normal; font-family: var(--display); font-weight: 800; font-size: 15px; padding: 2px 8px; border-radius: 3px; color: #fff; }
.sg-w { background: var(--win); }
.sg-l { background: var(--loss); }
.sg-t { background: var(--gold); color: #111; }
.sg-mid { display: flex; align-items: center; gap: 10px; padding: 0 16px; font-family: var(--display); font-weight: 700; font-size: 13px; text-transform: uppercase; color: var(--dim); }
.sg-mid::before, .sg-mid::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sg-foot { padding: 7px 16px; border-top: 1px solid var(--line); font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.sg.final .sg-foot { color: var(--text); }
.sg-more { display: grid; place-items: center; min-height: 120px; color: var(--muted); font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.sg-more:hover { background: var(--panel-2); color: var(--text); }
.psched { list-style: none; margin: 0; padding: 0; }
.psched li { display: flex; align-items: center; gap: 10px; padding: 8px 18px; border-top: 1px solid var(--line); }
.psched .psw { width: 40px; flex: none; font-family: var(--display); font-weight: 700; color: var(--dim); text-transform: uppercase; }
.psched .tm { min-width: 0; font-size: 14px; }
.psched .tm b { display: inline; }
.psched small { margin-left: auto; color: var(--dim); font-size: 12px; white-space: nowrap; }
@media (max-width: 720px) { .sched-grid { grid-template-columns: 1fr; } }

/* ---------- Week chips (schedule) ---------- */
.week-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { border: 1px solid var(--line-2); background: transparent; color: var(--muted); padding: 5px 12px; border-radius: var(--radius); font-family: var(--display); font-weight: 700; font-size: 16px; text-transform: uppercase; }
.chip:hover { color: var(--text); background: rgba(255,255,255,.05); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- Team picker (admin) ---------- */
.fld > span:first-child { display: block; }
.tpick { position: relative; min-width: 240px; }
.tpick-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 6px 12px; text-align: left; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--text); }
.tpick-btn:hover, .tpick-btn[aria-expanded="true"] { border-color: var(--blue); }
.tpick-btn > span { min-width: 0; line-height: 1.2; }
.tpick-btn b { display: block; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpick-btn small { display: block; font-size: 12px; color: var(--dim); font-weight: 500; }
.tpick-btn > svg { width: 16px; height: 16px; margin-left: auto; flex: none; color: var(--dim); }
.tpick-ph { color: var(--dim); font-weight: 500; }
.tpick-pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0; min-width: 300px; padding: 10px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 18px 40px rgba(0,0,0,.55); }
.tpick-pop .field { height: 38px; margin-bottom: 8px; }
.tpick-list { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; }
.tpick-group { padding: 10px 8px 4px; font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.tpick-opt { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--radius); cursor: pointer; }
.tpick-opt > span { min-width: 0; line-height: 1.2; }
.tpick-opt b { display: block; font-size: 14px; }
.tpick-opt small { display: block; font-size: 12px; color: var(--dim); }
.tpick-opt em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; color: var(--gold); white-space: nowrap; }
.tpick-opt.busy { opacity: .6; }
.tpick-opt:hover, .tpick-opt.active { background: var(--panel-2); }
.tpick-opt.active { box-shadow: inset 3px 0 0 var(--blue); }

/* ---------- Schedule list: one container, a row per game ---------- */
.sched-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sl-head { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; background: linear-gradient(90deg, #191c26, var(--panel)); border-bottom: 1px solid var(--line); }
.sl-head::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red); }
.sl-head b { font-family: var(--display); font-weight: 800; font-style: italic; font-size: 24px; text-transform: uppercase; letter-spacing: .01em; }
.sl-head span { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sr {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr); align-items: stretch;
  border-top: 1px solid rgba(255,255,255,.05);
  background: linear-gradient(90deg, color-mix(in srgb, var(--ac) 26%, transparent) 0%, transparent 34%, transparent 66%, color-mix(in srgb, var(--hc) 26%, transparent) 100%);
  transition: background-color .15s;
}
.sl-head + .sr { border-top: 0; }
.sr::before, .sr::after { content: ""; position: absolute; top: 0; bottom: 0; width: 4px; }
.sr::before { left: 0; background: var(--ac); }
.sr::after { right: 0; background: var(--hc); }
.sr:hover { background-color: rgba(255,255,255,.035); }
.sr-side { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px 22px; }
.sr-side.right { justify-content: flex-end; text-align: right; }
.sr-link { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sr-side.right .sr-link { flex-direction: row; }
.sr-side .face, .sr-side .logo { --size: 44px; }
.sr-vid { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 3px; background: var(--red); color: #fff; font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; }
.sr-vid:hover { background: var(--red-dark); }
.sr-vid svg { width: 11px; height: 11px; }

.sr-name { min-width: 0; line-height: 1.15; }
.sr-name b { display: block; font-family: var(--display); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-name small { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.sr-side.right .sr-name small { justify-content: flex-end; }
.sr-name small > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sr-rec { flex: none; font-style: normal; font-family: var(--display); font-weight: 700; font-size: 13px; padding: 0 7px; line-height: 19px; border-radius: 3px; background: rgba(0,0,0,.35); color: var(--text); }
.sr-link:hover .sr-name b { color: #fff; text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.sr-side.lose .sr-link, .sr-side.lose .sr-res { opacity: .45; }
.sr-side.win .sr-name b { color: #fff; }
.sr-res { flex: none; font-style: normal; font-family: var(--display); font-weight: 800; font-size: 15px; width: 26px; line-height: 26px; text-align: center; border-radius: 3px; color: #fff; }
.sr-res.sg-w { background: var(--win); } .sr-res.sg-l { background: var(--loss); } .sr-res.sg-t { background: var(--gold); color: #111; }
.sr-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 10px 0; }
.sr-at { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #0b0d13; border: 1px solid var(--line-2); font-family: var(--display); font-weight: 800; font-size: 16px; color: var(--muted); }
.sr-mid b { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.sr.final .sr-mid b { color: var(--text); }
.sr.final .sr-at { background: var(--text); color: var(--bg); border-color: var(--text); }
.sr-div { font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 1px 7px; border-radius: 3px; background: rgba(214,31,44,.16); color: #ff8a93; }
.sl-more { display: block; padding: 13px 20px; border-top: 1px solid var(--line); text-align: center; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sl-more:hover { color: var(--text); background: var(--panel-2); }
@media (max-width: 720px) {
  .sr { grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr); }
  .sr-side { gap: 8px; padding: 12px 10px; }
  .sr-link { gap: 8px; }
  .sr-side { flex-wrap: wrap; row-gap: 6px; }
  .sr-link { flex: 1 1 100%; }
  .sr-side.right .sr-link { justify-content: flex-end; }
  .sr-vid { order: 3; margin-left: 38px; padding: 3px 8px; font-size: 11px; gap: 4px; }
  .sr-side.right .sr-vid { margin-left: auto; margin-right: 38px; }
  .sr-vid svg { width: 9px; height: 9px; }
  .sr-side .face, .sr-side .logo { --size: 30px; }
  .sr-side .face .logo.badge { display: none; }
  .sr-name b { font-size: 16px; }
  .sr-name small { font-size: 11px; gap: 5px; }
  .sr-name small > span { display: none; }
  .sr-rec { font-size: 12px; line-height: 17px; }
  .sr-res { display: none; }
  .sr-side.win .sr-rec { background: var(--win); color: #fff; }
  .sr-side.lose .sr-rec { background: var(--loss); color: #fff; }
  .sr-name b { overflow: hidden; text-overflow: clip; }
  .sr-at { width: 26px; height: 26px; font-size: 13px; }
  .sr-mid b { font-size: 9px; letter-spacing: .06em; }
  .sr-div { font-size: 9px; padding: 0 4px; }
}

/* ---------- Spoiler mode ---------- */
.spoil-toggle { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; margin-left: 4px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.spoil-toggle:hover { color: var(--text); background: rgba(255,255,255,.06); }
.spoil-toggle[aria-pressed="false"] { color: var(--gold); border-color: rgba(232,185,49,.45); }
.spoil-toggle svg { width: 17px; height: 17px; }
html[data-spoilers="hide"] .sp:not(.revealed .sp):not(.revealed) {
  filter: blur(6px); cursor: pointer; user-select: none; transition: filter .15s; }
html[data-spoilers="hide"] .sp:not(.revealed .sp):not(.revealed):hover { filter: blur(4px); }
/* Results blurred, so don't give them away by fading the loser or brightening the winner. */
html[data-spoilers="hide"] .sr:not(.revealed) .sr-side.lose .sr-link,
html[data-spoilers="hide"] .sr:not(.revealed) .sr-side.lose .sr-res { opacity: 1; }
html[data-spoilers="hide"] .sr:not(.revealed) .sr-side.win .sr-name b { color: inherit; }
html[data-spoilers="hide"] .sr:not(.revealed) .sr-side .sr-rec { background: rgba(0,0,0,.35); color: var(--text); }
html[data-spoilers="hide"] .sr.final:not(.revealed) .sr-at { background: #0b0d13; color: var(--muted); border-color: var(--line-2); }
/* W/L badges: same neutral grey on both sides so the blur can't leak the result by color. */
html[data-spoilers="hide"] .sr:not(.revealed) .sr-res,
html[data-spoilers="hide"] .psched li:not(.revealed) em.sp { background: #4a5163 !important; color: transparent !important; }
html[data-spoilers="hide"] .sp-block:not(.revealed) { position: relative; cursor: pointer; min-height: 64px; }
html[data-spoilers="hide"] .sp-block:not(.revealed) > * { filter: blur(9px); pointer-events: none; user-select: none; }
html[data-spoilers="hide"] .sp-block:not(.revealed)::after {
  content: "Spoilers hidden \00B7  Tap to show"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; white-space: nowrap;
  padding: 9px 16px; border-radius: var(--radius); background: rgba(10,11,16,.88); border: 1px solid var(--line-2); box-shadow: 0 10px 24px rgba(0,0,0,.5);
  font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
html[data-spoilers="hide"] .sp-block[data-sp="record"]:not(.revealed)::after, html[data-spoilers="hide"] .sp-block[data-sp="stats"]:not(.revealed)::after { content: "Record hidden \00B7  Tap to show"; font-size: 13px; padding: 6px 12px; }
html[data-spoilers="hide"] .ph-record.sp-block:not(.revealed)::after { content: "Tap to show record"; }
html[data-spoilers="hide"] #panel-standings.sp-block:not(.revealed) { min-height: 320px; }
html[data-spoilers="hide"] #panel-standings.sp-block:not(.revealed)::after { top: 160px; }
@media (max-width: 720px) {
  .spoil-toggle { padding: 0 9px; margin-left: auto; }
  .spoil-toggle span { display: none; }
  .nav .spoil-toggle + .btn { margin-left: 8px; }
}
