:root {
  --bg: #0A0B0E;
  --surface: #101216;
  --surface-2: #161922;
  --surface-3: #1C202B;
  --line: #242a36;
  --line-soft: #1a1e28;
  --text: #EDEFF3;
  --text-dim: #949cad;
  --text-faint: #5c6474;
  --brand: #4CC2FF;
  --brand-dim: #35a8e4;
  --brand-glow: rgba(76, 194, 255, 0.28);
  --good: #52c98a;
  --bad: #ff6b6b;
  --danger: #ff5c5c;

  --pos-C: #ff9f6b;
  --pos-LW: #7ddc7d;
  --pos-RW: #59b0ff;
  --pos-D: #c98bff;
  --pos-G: #f2c14e;

  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1240px;
  --gutter: 22px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Oswald", var(--font);
  --topbar-h: 61px;   /* the sticky table header parks just under the top bar */
  --table-gap: 14px;  /* breathing room between the nav and the table header */
}

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

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(76, 194, 255, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font-family: inherit; }
.mono { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.hint { color: var(--text-dim); font-size: 13px; margin: 6px 0; }

/* ---------- top bar ---------- */

.topbar {
  padding: 16px var(--gutter);
  border-bottom: 1px solid var(--line);
  /* Near-opaque: a translucent bar lets table rows ghost through as they
     scroll underneath, which reads as a rendering glitch on a dense board. */
  background: rgba(10, 11, 14, 0.97);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.bar-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
}
.page { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter) 80px; }

.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: 0.06em; color: var(--brand); }
.brand-sub { color: var(--text-faint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.16em; }

.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 12px; color: var(--text-faint); pointer-events: none; }
#search {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 9px 14px 9px 34px; font-size: 13px; width: 230px;
}
#search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
#search::placeholder { color: var(--text-faint); }
.logout-link { color: var(--text-dim); font-size: 13px; text-decoration: none; }
.logout-link:hover { color: var(--text); }

/* ---------- login ---------- */

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 14px;
}
.login-box h1 { font-family: var(--display); font-size: 30px; margin: 0; color: var(--brand); letter-spacing: 0.06em; }
.login-sub { margin: 0; color: var(--text-dim); font-size: 14px; }
.login-box input {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 14px;
}
.login-box input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.login-box button {
  background: var(--brand); border: none; color: #04202e; font-weight: 700;
  border-radius: var(--radius-sm); padding: 11px; font-size: 14px; cursor: pointer;
}
.login-box button:hover { background: var(--brand-dim); }

/* ---------- tabs ---------- */

.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 18px 0 6px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: transparent; border: 1px solid transparent; color: var(--text-dim);
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { color: #04202e; background: var(--brand); border-color: var(--brand); }
.tab-count { font-size: 11px; opacity: 0.7; font-variant-numeric: tabular-nums; }

/* ---------- legend ---------- */

.legend-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); }
.legend-item em { color: var(--text-faint); font-style: normal; }

.ghost-btn {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-dim);
  border-radius: 999px; padding: 7px 13px; font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.ghost-btn:hover { color: var(--text); border-color: var(--brand); }
.ghost-btn.danger:hover { color: var(--danger); border-color: var(--danger); }

.legend-editor {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 10px;
}
.legend-edit-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.legend-edit-row input[type="color"] { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.legend-edit-row input[type="text"] {
  flex: 1; min-width: 160px; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px;
}

/* ---------- toolbar ---------- */

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 10px 0 12px; }
.sort-group { display: flex; align-items: center; gap: 10px; }
.sort-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-faint); font-weight: 600; }
.sort-buttons { display: inline-flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; flex-wrap: wrap; }
.sort-btn { background: none; border: none; color: var(--text-dim); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; cursor: pointer; }
.sort-btn:hover { color: var(--text); }
.sort-btn.active { color: #fff; background: var(--surface-3); }
.toolbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 34px; height: 18px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); position: relative; transition: background 0.15s; }
.switch-thumb { position: absolute; top: 1px; left: 1px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-faint); transition: transform 0.15s; }
.switch input:checked + .switch-track { background: var(--brand); border-color: var(--brand); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); background: #fff; }
.switch-text { font-size: 13px; color: var(--text-dim); }

.edit-toggle { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 8px 18px; font-size: 13px; font-weight: 600; cursor: pointer; }
.edit-toggle:hover { border-color: var(--brand); }
.edit-toggle.on { background: var(--brand); border-color: var(--brand); color: #04202e; }

.filter-count { background: var(--brand); color: #04202e; border-radius: 999px; padding: 1px 6px; font-size: 11px; font-weight: 700; margin-left: 4px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 14px; }
.filter-chip { background: var(--surface-2); border: 1px solid var(--line); color: var(--text-dim); border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer; }
.filter-chip:hover { color: var(--text); border-color: var(--brand); }
.filter-chip.on { background: var(--brand); border-color: var(--brand); color: #04202e; font-weight: 600; }
.filter-chip.clear { color: var(--text-faint); }

.edit-hint { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; color: var(--text-dim); }
.edit-hint strong { color: var(--text); }

.recompute-note {
  background: rgba(76, 194, 255, 0.08); border: 1px solid rgba(76, 194, 255, 0.3);
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; color: var(--text-dim);
  margin-bottom: 12px;
}
.recompute-note strong { color: var(--brand); }

/* ---------- table ---------- */

/* The header follows you down the page, which needs the page itself to be the
 * scroller — any ancestor that scrolls would trap `position: sticky`. So the
 * table never scrolls sideways; narrow screens drop columns instead (see
 * COLUMNS_BY_SCREEN in app.js).
 *
 * The upward box-shadow paints the gap between the nav and the header in the
 * page colour, so rows don't show through as they pass underneath. */
/* Sticks in the band between the nav and the table header, hiding the rows
   that pass behind it. It also provides the gap's layout space. */
.sticky-mask {
  position: sticky; top: var(--topbar-h); z-index: 6;
  height: var(--table-gap); background: var(--bg);
}
.table-wrap {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: visible;
}
table { border-collapse: collapse; width: 100%; table-layout: auto; }
thead th {
  position: sticky; top: calc(var(--topbar-h) + var(--table-gap)); z-index: 5;
  background: var(--surface-2);
  box-shadow: inset 0 -1px 0 var(--line);
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-faint); font-weight: 700; padding: 11px 12px;
  white-space: nowrap;
}
thead th:first-child { border-top-left-radius: var(--radius); }
thead th:last-child { border-top-right-radius: var(--radius); }
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--text); background: var(--surface-3); }
thead th.sorted { color: var(--brand); }
.sort-arrow { font-size: 9px; }
td { padding: 10px 12px; font-size: 13.5px; white-space: nowrap; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.dragging { opacity: 0.5; background: var(--surface-3); }

.col-rk { font-variant-numeric: tabular-nums; color: var(--text-dim); width: 64px; }
.col-fp, .col-vorp, .col-pg, .col-adp, .col-diff, .col-gp, .col-g, .col-a, .col-pts,
.col-w, .col-svp, .col-gaa, .col-age { font-variant-numeric: tabular-nums; text-align: right; }
th.col-fp, th.col-vorp, th.col-pg, th.col-adp, th.col-diff, th.col-gp, th.col-g, th.col-a,
th.col-pts, th.col-w, th.col-svp, th.col-gaa, th.col-age { text-align: right; }
.strong { font-weight: 700; }
.col-vorp.pos { color: var(--good); }
.col-vorp.neg { color: var(--text-faint); }
.col-diff.pos { color: var(--good); }
.col-diff.neg { color: var(--bad); }
.col-drag { width: 28px; }
.drag-handle { cursor: grab; color: var(--text-faint); }
.drag-handle:active { cursor: grabbing; }

/* One line per player: the name leads, badges trail quietly behind it. */
.col-name { white-space: nowrap; min-width: 300px; }
.player-link { background: none; border: none; color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer; padding: 0; text-align: left; }
.player-link:hover { color: var(--brand); }

.tag-dot { width: 11px; height: 11px; border-radius: 3px; background: var(--surface-3); border: none; padding: 0; display: inline-block; vertical-align: middle; margin-right: 7px; }
.tag-dot.editable { cursor: pointer; box-shadow: 0 0 0 2px var(--line); }
.tag-dot.editable:hover { box-shadow: 0 0 0 2px var(--brand); }
.tag-dot.empty { background: var(--surface-3); }

.star { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 15px; padding: 0 4px; }
.star.on { color: #f2c14e; }

.delta { font-size: 10.5px; font-weight: 700; margin-left: 5px; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }

/* Badges are supporting detail, not headlines — no borders, muted until hover. */
.badges { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.badge {
  font-size: 9.5px; font-weight: 600; padding: 1px 6px; border-radius: 4px;
  letter-spacing: 0.02em; white-space: nowrap; opacity: 0.75; transition: opacity 0.12s;
}
tr:hover .badge { opacity: 1; }
.badge.good { background: rgba(82, 201, 138, 0.12); color: var(--good); }
.badge.bad { background: rgba(255, 107, 107, 0.1); color: var(--bad); }
.badge.more { background: transparent; color: var(--text-faint); cursor: default; }

/* On the player's card there's room to show everything, at full strength. */
.badge-row .badge { font-size: 10.5px; padding: 3px 9px; border-radius: 999px; opacity: 1; }
.badge-row .badge.good { border: 1px solid rgba(82, 201, 138, 0.3); }
.badge-row .badge.bad { border: 1px solid rgba(255, 107, 107, 0.28); }

.pos-chip { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; margin-right: 3px; background: var(--surface-3); }
.pos-C { color: var(--pos-C); } .pos-LW { color: var(--pos-LW); } .pos-RW { color: var(--pos-RW); }
.pos-D { color: var(--pos-D); } .pos-G { color: var(--pos-G); }

.note-count { background: none; border: none; color: var(--text-faint); font-size: 12px; cursor: pointer; }
.note-count:hover { color: var(--brand); }
.empty-note { text-align: center; color: var(--text-dim); padding: 44px 12px; font-size: 14px; }

/* ---------- tag menu ---------- */

.tag-menu {
  position: absolute; z-index: 60; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 5px; min-width: 210px; box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.tag-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: none; color: var(--text); padding: 8px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; text-align: left; }
.tag-menu-item:hover { background: var(--surface-3); }

/* ---------- modals ---------- */

.modal { position: fixed; inset: 0; background: rgba(4, 5, 8, 0.75); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50; overflow-y: auto; }
.modal-content { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; width: 100%; max-width: 1040px; position: relative; }
.modal-close { position: absolute; z-index: 3; top: 12px; right: 14px; background: none; border: none; color: var(--text-faint); font-size: 26px; line-height: 1; cursor: pointer; }
.modal-close:hover { color: var(--text); }
.snapshot > .modal-close { color: #c9d1e0; }
.modal-content h2 { margin: 0; font-family: var(--display); font-size: 26px; letter-spacing: 0.02em; }

.snap-head {
  margin: -26px -26px 20px; display: flex; flex-direction: column;
  border-radius: var(--radius) var(--radius) 0 0; position: relative; overflow: hidden;
  background: #0d1424; border-bottom: 1px solid var(--line); isolation: isolate;
}
/* NHL action shot on the right, fading into the navy on the left so the text
   always sits on a solid, readable ground. */
.snap-hero {
  position: absolute; inset: 0; z-index: -2;
  background-image: var(--hero, none); background-size: cover; background-position: 70% 22%;
  opacity: 0.55;
}
.snap-hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, #0d1424 0%, rgba(13, 20, 36, 0.94) 32%, rgba(13, 20, 36, 0.55) 62%, rgba(13, 20, 36, 0.35) 100%),
    linear-gradient(0deg, rgba(13, 20, 36, 0.9) 0%, rgba(13, 20, 36, 0) 45%);
}
/* Club crest, large and faint, on the right. */
.snap-head.has-crest::after {
  content: ""; position: absolute; right: 4%; top: 42%; transform: translateY(-50%); z-index: -1;
  width: 210px; height: 210px; background-image: var(--crest);
  background-size: contain; background-repeat: no-repeat; background-position: center;
  opacity: 0.16; pointer-events: none;
}
.snap-head-main { display: flex; gap: 28px; align-items: center; padding: 34px 30px 26px; }
.snap-photo {
  width: 132px; height: 132px; border-radius: 50%; object-fit: cover; object-position: top center;
  flex-shrink: 0; background: var(--surface-3);
  border: 4px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.08), 0 12px 30px rgba(0, 0, 0, 0.5);
}
.snap-eyebrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #c9d1e0;
}
.snap-eyebrow img { width: 20px; height: 20px; }
.eyebrow-pill {
  border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.07);
  border-radius: 6px; padding: 2px 7px; letter-spacing: 0.08em; color: #e3e8f1;
}
.modal-content h2.snap-name {
  font-family: var(--display); font-weight: 600; letter-spacing: 0.02em;
  font-size: clamp(34px, 5.4vw, 58px); line-height: 1.02; margin: 8px 0 12px; color: #fff;
}
.snap-bio {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: #aab3c5;
}
.snap-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.snap-pill {
  display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 8px 15px;
  font: 600 13px var(--font); color: #e8ecf3; text-decoration: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.22);
}
.snap-pill:hover { border-color: rgba(255, 255, 255, 0.5); }
.snap-pill.on { background: #fff; color: #0d1424; border-color: #fff; }
.snap-pill .tag-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dot, transparent); border: 1px solid rgba(255, 255, 255, 0.4); }
.snap-head .badge-row { margin-top: 12px; }
.snap-head .my-adj { margin-top: 10px; }

.snap-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); border-top: 1px solid rgba(255, 255, 255, 0.1); background: rgba(8, 12, 22, 0.55); }
.snap-strip:empty { display: none; }
.strip-cell { padding: 16px 22px; border-left: 1px solid rgba(255, 255, 255, 0.1); }
.strip-cell:first-child { border-left: none; }
.strip-value { font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.1; color: #fff; font-variant-numeric: tabular-nums; }
.strip-value small { font-family: var(--font); font-size: 13px; font-weight: 500; color: #aab3c5; margin-left: 4px; }
.strip-label { margin-top: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #8f99ad; }
.snap-headinfo { min-width: 0; }
.section-note { text-transform: none; letter-spacing: 0; color: var(--text-faint); font-weight: 400; margin-left: 6px; }
.season-cell { color: var(--text-dim); font-variant-numeric: tabular-nums; }
#snap-career-wrap { margin-top: 18px; }
#snap-career td, #snap-career th { text-align: right; }
#snap-career td:first-child, #snap-career th:first-child,
#snap-career td:nth-child(2), #snap-career th:nth-child(2) { text-align: left; }
.sub-sep { color: var(--text-faint); margin: 0 4px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-bottom: 22px; }
.stat-tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; }
.snap-range { margin: -8px 0 22px; }
.range-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.range-cell { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; }
.range-cell.low { border-left: 3px solid var(--bad); }
.range-cell.high { border-left: 3px solid var(--good); }
.range-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.range-value { font-family: var(--display); font-size: 20px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.range-value small { font-family: var(--font); font-size: 12px; color: var(--text-dim); font-weight: 600; }
.range-bar { position: relative; height: 8px; margin-top: 12px; background: var(--surface-3); border-radius: 999px; }
.range-span { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, var(--bad), var(--brand) 50%, var(--good)); opacity: 0.85; }
.range-mark { position: absolute; top: -4px; width: 3px; height: 16px; margin-left: -1.5px; background: var(--text); border-radius: 2px; }
.stat-tile.hero { border-color: var(--brand); background: rgba(76, 194, 255, 0.07); }
.tile-label { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.tile-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 3px; }

/* minmax(0, …) matters: a plain 1fr track can't shrink below its content's
   min-width, so the wide career table would blow out the left column and crush
   the notes. This lets the table scroll inside its own box instead. */
.snap-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.snap-col { min-width: 0; }
.section-head { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); font-weight: 700; margin: 4px 0 10px; }
.scrollbox { max-height: 300px; overflow-y: auto; }
#snap-news.scrollbox { max-height: 340px; }
.career-scroll { overflow-x: auto; }
.career-table { font-size: 12px; }
.career-table th { position: static; background: var(--surface-2); padding: 7px 9px; }
.career-table td { padding: 7px 9px; }

.breakdown { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.bd-row { display: grid; grid-template-columns: 96px 1fr 54px 38px; align-items: center; gap: 8px; font-size: 12px; }
.bd-label { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-bar { background: var(--surface-3); border-radius: 999px; height: 7px; overflow: hidden; }
.bd-fill { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bd-fill.neg { background: var(--bad); }
.bd-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bd-pct { text-align: right; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.z-head, .z-row { display: grid; grid-template-columns: 96px 1fr 64px 58px; align-items: center; gap: 8px; font-size: 12px; }
.z-head { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.z-head span:nth-child(n+3) { text-align: right; }
.z-bar { position: relative; height: 7px; background: var(--surface-3); border-radius: 999px; }
.z-bar::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--text-faint); }
.z-fill { position: absolute; top: 0; bottom: 0; background: var(--brand); border-radius: 999px; }
.z-fill.neg { background: var(--bad); }
.z-rec { text-align: right; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.z-note { margin-top: 6px; line-height: 1.5; }

/* ---------- the read ---------- */

.read-list { display: flex; flex-direction: column; gap: 9px; margin-bottom: 20px; }
.read-item { border-left: 2px solid var(--line); padding: 2px 0 2px 11px; }
.read-item.good { border-left-color: var(--good); }
.read-item.warn { border-left-color: var(--bad); }
.read-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.35; }
.read-item.good .read-title { color: var(--good); }
.read-item.warn .read-title { color: var(--bad); }
.read-text { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.45; }
.section-note a { color: var(--text-dim); }
.section-note a:hover { color: var(--brand); }

/* ---------- analysis / news ---------- */

.news-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.news-item { border-left: 2px solid var(--line); padding-left: 11px; }
.news-item:hover { border-left-color: var(--brand); }
.news-title { color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; display: block; line-height: 1.35; }
.news-title:hover { color: var(--brand); }
.news-title::after { content: " ↗"; color: var(--text-faint); font-size: 10px; }
.news-summary { color: var(--text-dim); font-size: 12.5px; margin: 5px 0 0; line-height: 1.45; }
.news-meta { color: var(--text-faint); font-size: 11px; margin-top: 5px; }

/* ---------- notes ---------- */

.comments-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; min-height: 60px; }
.comment { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.comment-meta { font-size: 11px; color: var(--text-faint); margin-bottom: 4px; }
.comment-text { font-size: 13px; white-space: pre-wrap; }
.comment-actions { display: flex; gap: 8px; margin-top: 6px; }
.comment-actions button { background: none; border: none; color: var(--text-faint); font-size: 11.5px; cursor: pointer; padding: 0; }
.comment-actions button:hover { color: var(--text); }
.comment-actions button.danger:hover { color: var(--danger); }
#comment-form textarea, .edit-box {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 11px; font-size: 13px; min-height: 110px;
  line-height: 1.5; resize: vertical;
}
#comment-form textarea:focus, .edit-box:focus { outline: none; border-color: var(--brand); }
.comment-form-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
#comment-form button { background: var(--brand); border: none; color: #04202e; font-weight: 700; border-radius: var(--radius-sm); padding: 9px 16px; font-size: 13px; cursor: pointer; }
.comment-error { color: var(--danger); font-size: 12px; }

/* ---------- settings panel ---------- */

.settings-panel { max-width: 1080px; }
.panel-title { margin-bottom: 4px; }
.panel-sub { color: var(--text-dim); font-size: 13px; margin: 0 0 18px; max-width: 620px; }

.preset-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); font-weight: 700; }
.field select, .field input, .mini-field input {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px;
}
.field select:focus, .field input:focus, .mini-field input:focus { outline: none; border-color: var(--brand); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.settings-block { display: flex; flex-direction: column; gap: 12px; }
.settings-block.wide { grid-column: 1 / -1; }
.settings-block h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); margin: 6px 0 0; font-weight: 700; }
.settings-block h3 small, .scoring-cols h4 small { text-transform: none; letter-spacing: 0; color: var(--text-faint); font-weight: 400; }
.scoring-cols h4 { font-size: 12px; color: var(--text-dim); margin: 0 0 8px; }

.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--text-dim); cursor: pointer; }
.check small { color: var(--text-faint); }
.check.small { font-size: 12px; }
.check input { margin-top: 2px; accent-color: var(--brand); }

.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.mini-field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--text-faint); font-weight: 600; }
.mini-field.wide span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-field input { width: 100%; }

.scoring-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; }
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }

/* ---------- draft tracker ---------- */

.ghost-btn.on { background: var(--brand); border-color: var(--brand); color: #04202e; font-weight: 600; }

.draft-bar {
  display: grid; grid-template-columns: minmax(200px, 1fr) minmax(180px, 1fr) auto;
  gap: 18px; align-items: center;
  background: linear-gradient(180deg, rgba(76,194,255,0.09), rgba(76,194,255,0.03));
  border: 1px solid rgba(76, 194, 255, 0.32); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 14px;
}
.clock-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); font-weight: 700; }
.clock-team { font-family: var(--display); font-size: 22px; letter-spacing: 0.02em; }
.clock-team.mine { color: var(--brand); }
.clock-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.clock-sub strong { color: var(--text); }

.needs-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.need-chip { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); }
.need-chip.done { color: var(--good); border-color: rgba(82, 201, 138, 0.4); font-weight: 600; }

.draft-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.field.inline { flex-direction: row; align-items: center; gap: 7px; }
.field.inline .field-label { white-space: nowrap; }

/* What the wait until your next pick is likely to cost. */
.draft-outlook { grid-column: 1 / -1; display: flex; gap: 28px; flex-wrap: wrap; padding-top: 12px; margin-top: 4px; border-top: 1px solid rgba(76, 194, 255, 0.18); }
.draft-outlook:empty { display: none; }
.outlook-col { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.outlook-head { font-size: 10px; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 700; }
.outlook-head.risk { color: var(--bad); }
.outlook-head.safe { color: var(--good); }
.outlook-player {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-dim);
  border-radius: 999px; padding: 4px 10px; font-size: 11.5px; cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 6px;
}
.outlook-player:hover { color: var(--text); border-color: var(--brand); }
.outlook-adp { color: var(--text-faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.outlook-note { color: var(--text-faint); font-size: 11.5px; }

/* Your own boost/bust, on the player's card. */
.my-adj { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.adj-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); font-weight: 700; }
.adj-buttons { display: inline-flex; gap: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.adj-btn {
  background: none; border: none; color: var(--text-faint); cursor: pointer;
  border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums; min-width: 26px;
}
.adj-btn:hover { color: var(--text); background: var(--surface-3); }
.adj-btn.on.up { background: var(--good); color: #052214; }
.adj-btn.on.down { background: var(--bad); color: #2a0808; }
.adj-btn.clear { font-weight: 500; }
.adj-btn.clear.on { background: var(--surface-3); color: var(--text); }

.col-draft { width: 64px; }
.draft-btn {
  background: var(--surface-3); border: 1px solid var(--line); color: var(--text-dim);
  border-radius: 6px; padding: 4px 9px; font-size: 11px; font-weight: 600; cursor: pointer;
}
.draft-btn:hover { background: var(--brand); border-color: var(--brand); color: #04202e; }
.undo-pick { background: none; border: 1px solid var(--line); color: var(--text-faint); border-radius: 6px; padding: 4px 8px; font-size: 11px; cursor: pointer; }
.undo-pick:hover { color: var(--danger); border-color: var(--danger); }

tbody tr.is-drafted { opacity: 0.4; }
tbody tr.is-drafted .player-link { text-decoration: line-through; }
tbody tr.fits-need td:first-child { box-shadow: inset 3px 0 0 var(--brand); }

.rosters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.roster-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; }
.roster-card.mine { border-color: var(--brand); background: rgba(76, 194, 255, 0.06); }
.roster-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 700; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.roster-total { color: var(--text-faint); font-variant-numeric: tabular-nums; font-weight: 600; }
.roster-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 7px; align-items: baseline; font-size: 12px; padding: 3px 0; }
.roster-pick { color: var(--text-faint); font-variant-numeric: tabular-nums; font-size: 10.5px; }
.roster-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-pos { color: var(--text-faint); font-size: 10px; }

@media (max-width: 900px) {
  .draft-bar { grid-template-columns: 1fr; }
  .draft-actions { justify-content: flex-start; }
}

/* ---------- scoring presets ---------- */

.scoring-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 8px; }
.preset-card {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 12px; display: flex; flex-direction: column; gap: 7px; align-items: flex-start;
}
.preset-card-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.preset-name { font-size: 13px; font-weight: 600; }
.preset-kind { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.07em; }
.preset-verified, .preset-unverified {
  font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; cursor: help;
}
.preset-verified { background: rgba(82, 201, 138, 0.14); color: var(--good); }
.preset-unverified { background: rgba(255, 107, 107, 0.1); color: var(--bad); }
.preset-source { font-size: 11px; color: var(--text-faint); text-decoration: none; line-height: 1.35; }
.preset-source:hover { color: var(--brand); }

/* ---------- watchlist ---------- */

.watchlist-mini {
  position: fixed; right: 18px; bottom: 18px; width: 250px; z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5); overflow: hidden;
}
.watch-mini-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.watch-mini-title { font-size: 12px; font-weight: 700; }
.watch-badge { background: var(--brand); color: #04202e; border-radius: 999px; padding: 1px 6px; font-size: 11px; }
.watch-open-btn { background: none; border: none; color: var(--text-faint); font-size: 12px; cursor: pointer; }
.watch-open-btn:hover { color: var(--text); }
.watch-mini-body { max-height: 240px; overflow-y: auto; padding: 8px 12px; }
.watchlist-mini.collapsed .watch-mini-body { display: none; }
.watch-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; }
.watch-meta { font-size: 11px; color: var(--text-faint); white-space: nowrap; }

/* ---------- responsive ---------- */

@media (max-width: 1099px) {
  /* Long names give way rather than pushing the table wider than the screen. */
  .col-name { min-width: 0; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
  td, thead th { padding: 10px 9px; }
}

@media (max-width: 900px) {
  .snap-cols, .settings-grid, .scoring-cols { grid-template-columns: 1fr; }
  #search { width: 160px; }
  .watchlist-mini { display: none; }
  .snap-head-main { flex-direction: column; align-items: flex-start; gap: 18px; padding: 28px 22px 22px; }
}

@media (max-width: 699px) {
  :root { --gutter: 14px; }
  /* Phones keep the name readable and let the numbers do the talking. */
  .col-name { min-width: 0; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; }
  .badges { display: none; }
  td, thead th { padding: 9px 8px; font-size: 12.5px; }
  .snap-photo { width: 96px; height: 96px; }
  .strip-cell { padding: 12px 16px; }
  .strip-value { font-size: 24px; }
  .draft-outlook { gap: 12px; }
  .outlook-col { align-items: flex-start; }
}

/* In-page confirm / prompt. Native dialogs are silently blocked in embedded
   browsers and after "prevent additional dialogs", so the board never uses them. */
.ask-modal { align-items: center; z-index: 80; }
.ask-card { max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.ask-card h2 { font-size: 20px; }
.ask-text { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.5; white-space: pre-line; }
.ask-text:empty { display: none; }
.ask-input { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); font: inherit; padding: 10px 12px; }
.ask-input:focus { outline: none; border-color: var(--brand); }
.ask-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ask-actions .danger-ok { background: var(--danger); border-color: var(--danger); color: #fff; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 16px; font-size: 14px; color: var(--text); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); max-width: calc(100vw - 32px); }
.toast.warn { border-color: var(--danger); }

/* ---------- guide page ---------- */
.help { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 40px; padding-top: 28px; }
.help-toc { position: sticky; top: calc(var(--topbar-h) + 20px); align-self: start; display: flex; flex-direction: column; gap: 2px; }
.help-toc a { color: var(--text-dim); text-decoration: none; font-size: 13px; padding: 6px 10px; border-radius: var(--radius-sm); }
.help-toc a:hover { color: var(--text); background: var(--surface-2); }
.help-body { max-width: 760px; line-height: 1.6; font-size: 15px; color: var(--text); }
.help-body h1 { font-family: var(--display); font-weight: 600; font-size: 34px; letter-spacing: 0.02em; margin: 0 0 8px; }
.help-lede { color: var(--text-dim); font-size: 16px; margin: 0 0 12px; }
.help-body section { padding-top: 26px; margin-top: 18px; border-top: 1px solid var(--line-soft); scroll-margin-top: calc(var(--topbar-h) + 10px); }
.help-body h2 { font-family: var(--display); font-weight: 600; font-size: 24px; letter-spacing: 0.02em; margin: 0 0 10px; }
.help-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin: 22px 0 8px; }
.help-body a { color: var(--brand); }
.help-body ul, .help-body ol { padding-left: 20px; }
.help-body li { margin: 4px 0; }
.help-list { margin: 0; }
.help-list dt { font-weight: 700; margin-top: 14px; }
.help-list dd { margin: 3px 0 0; color: var(--text-dim); }
.help-list dd strong, .help-body p strong, .help-body li strong { color: var(--text); }
.help-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; font-size: 14px; }
.help-table td { white-space: normal; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--text-dim); }
.help-table td:first-child { width: 210px; white-space: normal; }
.help-table .badge { display: inline-block; margin: 0 4px 4px 0; font-size: 11px; padding: 3px 9px; border-radius: 999px; }
.help-note { font-size: 13px; color: var(--text-faint); }
.help-box { margin-top: 18px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: calc(var(--topbar-h) + 10px); }
.help-box h4 { margin: 0 0 6px; font-size: 15px; }
.help-box p { color: var(--text-dim); margin: 10px 0 0; }
.help-steps { max-width: 320px; margin-top: 8px; }
.help-steps td, .help-table.help-steps td:first-child { width: auto; padding: 5px 10px; font-variant-numeric: tabular-nums; }
.tone { font-weight: 700; padding-left: 6px; border-left: 2px solid var(--line); }
.tone.good { color: var(--good); border-left-color: var(--good); }
.tone.warn { color: var(--bad); border-left-color: var(--bad); }
@media (max-width: 800px) {
  .help { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 16px; }
  .help-toc { position: static; flex-direction: row; flex-wrap: wrap; }
  .help-table td:first-child { width: 36%; }
  .help-body h1 { font-size: 28px; }
}

/* ---------- loading skeletons ---------- */
.skel {
  display: block; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 40%, var(--surface-2) 80%);
  background-size: 300% 100%; animation: skel-shimmer 1.4s ease-in-out infinite;
}
@keyframes skel-shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

.board-skeleton { padding-top: 4px; }
.skel-tabs { display: flex; gap: 8px; margin: 0 0 18px; }
.skel-pill { width: 64px; height: 30px; border-radius: 999px; }
.skel-table { border-top: 1px solid var(--line); }
.skel-row { display: grid; grid-template-columns: 28px 1fr 56px 56px 56px 72px; align-items: center; gap: 18px; padding: 14px 12px; border-bottom: 1px solid var(--line-soft); }
.skel-row .skel { height: 12px; }
.skel-num { width: 22px; }
.skel-cell { width: 100%; }
.skel-cell.wide { width: 100%; }
@media (max-width: 699px) {
  .skel-row { grid-template-columns: 22px 1fr 44px 52px; gap: 12px; }
  .skel-row .skel-cell:nth-of-type(n+4) { display: none; }
}

.skel-list { display: flex; flex-direction: column; gap: 14px; }
.skel-item { display: flex; flex-direction: column; gap: 7px; border-left: 2px solid var(--line); padding-left: 11px; }
.skel-line { height: 10px; }
.skel-line.title { height: 12px; }
