:root {
  --bg: #0f1720;
  --panel: #1a2532;
  --panel-2: #212f3f;
  --border: #2c3e50;
  --text: #e8edf2;
  --muted: #8fa2b3;
  --accent: #3ea6ff;
  --good: #3ecf8e;
  --bad: #ff5c5c;
  --warn: #f5b942;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

nav .brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
nav .links a { margin-left: 18px; color: var(--muted); }
nav .links a:hover { color: var(--text); }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

/* Same link set on every page (see base.html) so Home/Pricing/etc. are
   always reachable, regardless of which page a user lands on. */
footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 18px 24px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
}
footer a { color: var(--muted); font-size: 0.9rem; }
footer a:hover { color: var(--text); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 18px;
}

h1, h2, h3 { margin-top: 0; }
.muted { color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; }
tr:last-child td { border-bottom: none; }

.rank-1 { color: var(--warn); font-weight: 700; }

input[type=text], input[type=password], input[type=number], input[type=email],
input[type=datetime-local], select {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  width: 100%;
  margin-bottom: 12px;
}

label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 0.9rem; }

button, .btn {
  background: var(--accent);
  color: #06131f;
  border: none;
  padding: 9px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
}
button:hover, .btn:hover { opacity: 0.88; text-decoration: none; }
.btn-secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn-small { padding: 4px 10px; font-size: 0.85rem; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; }
.flash.success { background: rgba(62,207,142,0.15); border: 1px solid var(--good); color: var(--good); }
.flash.error { background: rgba(255,92,92,0.15); border: 1px solid var(--bad); color: var(--bad); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.badge.lock { color: var(--accent); border-color: var(--accent); }
.badge.margin { color: var(--accent); border-color: var(--accent); }

.tag-badge { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 10px; }
.tag-badge .tag-name { display: inline-flex; align-items: center; gap: 6px; }
.tag-badge .tag-desc { font-size: 0.7rem; font-style: italic; font-weight: 400; color: var(--muted); }

.game-row { border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 12px; background: var(--panel-2); }
.game-row.locked { opacity: 0.6; }
.game-meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 8px; }
.pick-options { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pick-options label { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--border); padding: 6px 12px; border-radius: 6px; cursor: pointer; width: auto; margin: 0; color: var(--text); }
.pick-options input[type=radio] { width: auto; margin: 0; }
.tag-row { display: flex; gap: 16px; flex-wrap: wrap; }
.tag-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.week-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.week-nav a, .week-nav span { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border); font-size: 0.85rem; }
.week-nav a.active, .week-nav span.active { background: var(--accent); color: #06131f; border-color: var(--accent); }

/* table-layout: fixed + matching % widths means every .rules-table on the
   page (Scoring Rules and Modifiers are separate <table> elements) lines
   up its value column at the same horizontal position, since they all
   split the same 100%-wide card the same way. */
.rules-table { width: 100%; table-layout: fixed; }
.rules-table td, .rules-table th { font-size: 0.9rem; }
.rules-table td:first-child { width: 65%; padding-right: 20px; }
.rules-table td:last-child { width: 35%; }
.disabled-note { color: var(--bad); font-size: 0.8rem; margin-top: 4px; }

.results-scroll { overflow-x: auto; }
.results-table { white-space: nowrap; }
.results-table th, .results-table td { padding: 6px 10px; }
.pick-cell { font-weight: 600; text-align: center; border-radius: 4px; }
.pick-cell.correct { background: rgba(62,207,142,0.15); color: var(--good); }
.pick-cell.incorrect { background: rgba(255,92,92,0.15); color: var(--bad); }
.pick-cell.na { color: var(--muted); font-weight: 400; background: none; }

/* Matchup/Winner stay pinned on the left while player columns scroll
   independently -- so you never lose track of which game a row is for
   while scrolling sideways through a wide room. Winner's left offset is
   set via a CSS var (see results.html script) computed from Matchup's
   *actual* rendered width -- a hardcoded px guess drifts out of sync
   with real content/font metrics and the two columns start overlapping. */
.col-pinned {
  position: sticky;
  background: var(--panel);
  z-index: 1;
}
.col-matchup.col-pinned { left: 0; }
.col-winner.col-pinned { left: var(--winner-col-left, 110px); box-shadow: 2px 0 0 var(--border); }

.results-total-row td { font-weight: 700; background: var(--panel-2); border-top: 2px solid var(--border); }
.results-total-row .col-pinned { background: var(--panel-2); }

/* Directly beneath the weekly total -- shares its bold/background treatment
   so both read as a summary block together, but drops the row's own top
   border (it isn't a new section) and mutes the color slightly since it's
   the secondary of the two figures. */
.results-cumulative-row td { border-top: none; color: var(--muted); }
.results-cumulative-row .col-pinned { color: var(--muted); }

.mobile-compare-picker { display: none; margin-bottom: 10px; }
.mobile-compare-picker label { display: inline; margin-right: 6px; color: var(--muted); font-size: 0.9rem; }
.mobile-compare-picker select { display: inline-block; width: auto; margin: 0; }

/* Below this width, a full multi-player grid doesn't fit -- the pinned
   Matchup/Winner columns alone eat most of a narrow screen, so showing
   even two player columns at once (You + a compare column) clips text.
   Show exactly one player column at a time (defaults to You), swapped via
   the "Viewing" picker, alongside the pinned Matchup/Winner columns. */
@media (max-width: 640px) {
  .mobile-compare-picker { display: block; }
  .results-table .player-col:not(.mobile-active) { display: none; }
}
