/* Turkey Bowl Sunday Picks League — the design bundle's tokens, verbatim.
   Light mode only. Mobile-first (390px design width). */

:root {
  /* Color */
  --primary: #8A3D10;          /* football leather */
  --primary-dark: #6E300C;     /* primary hover */
  --accent: #8E2043;           /* cranberry */
  --bg: #F7F1E6;               /* warm cream */
  --surface: #FFFFFF;
  --text: #241B12;             /* warm near-black */
  --muted: #6F655B;
  --line: #E4DACB;             /* borders, dividers */
  --input-border: #D8CDBB;
  --gold: #D99A2B;

  /* Semantic pick results — all >= 4.5:1 on --surface */
  --correct: #1A7A3C;  --correct-tint: #E2F1E6;
  --wrong:   #B3301C;  --wrong-tint:   #FBE7E1;
  --push:    #9A6700;  --push-tint:    #FCF0D6;
  --pending: #667085;  --pending-tint: #ECEEF3;

  --disabled-bg: #EFE9DD;
  --disabled-text: #A39A8E;

  /* Leaderboard row tints */
  --rank1: #FCF4DF;
  --rank2: #FDF8EB;
  --rank3: #FDFBF3;
  --zebra: #FBF8F1;

  /* Type */
  --display: 'Archivo Black', system-ui, sans-serif;
  --body: 'Libre Franklin', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;

  /* Spacing (4px base) */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px;

  /* Radius */
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px;
  --radius-card: 12px; --radius-pill: 999px;

  /* Shadow — one level only */
  --shadow: 0 1px 2px rgba(36, 27, 18, 0.05), 0 4px 14px rgba(36, 27, 18, 0.08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }
a:hover { color: var(--accent); }

h1, h2, h3 { margin: 0; }

/* ---------- Type scale ---------- */
.display { font-family: var(--display); font-size: 32px; line-height: 1.15; }
.title   { font-family: var(--display); font-size: 22px; line-height: 1.2; }
.heading { font-weight: 700; font-size: 17px; line-height: 1.3; }
.small   { font-size: 14px; line-height: 1.45; }
.caption {
  font-size: 12px; font-weight: 600; line-height: 1.33;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
}
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.note { font-size: 13px; color: var(--muted); }

/* ---------- Nav ---------- */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px 0;
}
.nav-inner {
  max-width: 1140px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 6px;
}
.nav-brand { display: flex; align-items: center; gap: var(--space-2); }
.nav-brand svg { width: 26px; height: 26px; flex: none; }
.nav-brand .wordmark {
  font-family: var(--display); font-size: 15px; color: var(--text); text-decoration: none;
}
.nav-links {
  display: flex; gap: 18px; overflow-x: auto;
  font-size: 13px; font-weight: 600;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  padding: 6px 0; color: var(--muted); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a[aria-current="page"] {
  color: var(--primary); border-bottom-color: var(--primary);
}
.nav-meta { margin-left: auto; display: none; align-items: center; gap: var(--space-3); }

/* ---------- Page shell ---------- */
.wrap {
  max-width: 420px; margin: 0 auto;
  padding: var(--space-4) var(--space-4) var(--space-7);
  display: flex; flex-direction: column; gap: var(--space-3);
}
.wrap-wide { max-width: 1140px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 14px;
  display: flex; flex-direction: column; gap: var(--space-2);
}
.card-own { border: 2px solid var(--primary); }
.card-flat { padding: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  font-size: 12px; font-weight: 800; line-height: 1.2;
  text-transform: uppercase; letter-spacing: 0.08em;
  border-radius: var(--radius-pill); padding: 7px 12px;
}
.badge-week { color: var(--primary); border: 2px solid var(--primary); padding: 5px 12px; }
.badge-deadline { color: #FFFFFF; background: var(--accent); }
.badge-event { color: #FFFFFF; background: var(--primary); }
.badge-muted { color: var(--pending); background: var(--pending-tint); }
.badge-locked { color: var(--disabled-text); background: var(--disabled-bg); }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--body); font-size: 16px; font-weight: 700;
  height: 48px; min-height: 44px; padding: 0 24px;
  border-radius: var(--radius-md); border: none;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary { background: var(--primary); color: #FFFFFF; }
.btn-primary:hover { background: var(--primary-dark); color: #FFFFFF; }
.btn-secondary {
  background: var(--surface); color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-secondary:hover { background: var(--bg); color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[disabled]:hover {
  background: var(--disabled-bg); color: var(--disabled-text);
  border: none; cursor: not-allowed; transform: none;
}
.btn-block { width: 100%; }
.btn-compact { padding: 0 18px; flex: none; }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.input {
  font-family: var(--body); font-size: 16px; color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-md);
  height: 48px; padding: 0 14px;
  outline: none; width: 100%; min-width: 0;
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(138, 61, 16, 0.22);
}
.input-row { display: flex; gap: var(--space-2); }

/* ---------- Flash messages ---------- */
.flash {
  border-radius: var(--radius-card); padding: 10px 14px;
  font-size: 14px; font-weight: 600;
  background: var(--correct-tint); color: var(--correct);
}
.flash-error { background: var(--wrong-tint); color: var(--wrong); }

/* ---------- Login ---------- */
.login-shell {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding: var(--space-6) var(--space-5);
  max-width: 420px; margin: 0 auto;
}
.login-brand {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin-bottom: var(--space-6);
}
.login-brand .mark { width: 96px; height: 96px; }
.login-brand .name {
  font-family: var(--display); font-size: 26px; line-height: 1.15; text-align: center;
}
.login-brand .sub {
  font-size: 12px; font-weight: 800; letter-spacing: 0.2em; color: var(--accent);
}
.login-form { display: flex; flex-direction: column; gap: var(--space-4); }

/* ---------- Game cards & pick chips ---------- */
.game { gap: var(--space-2); }
.game-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.game-matchup { font-size: 15px; font-weight: 700; }
.game-time { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }

.chip {
  font-family: var(--body); font-weight: 800; font-size: 16px;
  min-height: 48px; padding: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--surface); color: var(--text);
  border: 2px solid var(--input-border); border-radius: var(--radius-md);
  cursor: pointer; text-align: center; width: 100%;
}
.chip:hover { border-color: var(--primary); }
.chip-disabled, .chip-disabled:hover {
  background: var(--disabled-bg); color: var(--disabled-text);
  border-color: var(--disabled-bg); cursor: not-allowed;
}
/* The radio itself is hidden; the label is the chip. */
.chip-input { position: absolute; opacity: 0; pointer-events: none; }
.chip-input:checked + .chip {
  background: var(--primary); color: #FFFFFF; border-color: var(--primary);
}
.chip-input:focus-visible + .chip {
  box-shadow: 0 0 0 3px rgba(138, 61, 16, 0.22);
}
.chip-input:checked + .chip .chip-check { display: inline; }
.chip-check { display: none; }

.chip-static {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; min-height: 44px;
  padding: 10px 14px; border-radius: var(--radius-md);
  background: var(--bg); color: var(--text); border: 2px solid var(--line);
}
.chip-correct { background: var(--correct-tint); color: var(--correct); border-color: var(--correct-tint); }
.chip-wrong   { background: var(--wrong-tint);   color: var(--wrong);   border-color: var(--wrong-tint); }
.chip-push    { background: var(--push-tint);    color: var(--push);    border-color: var(--push-tint); }
.chip-pending { background: var(--bg);           color: var(--text);    border-color: var(--line); }
.chip-default {
  font-style: italic; font-weight: 600;
  background: var(--surface); color: var(--muted);
  border: 2px dashed var(--muted);
}
.chip-locked { background: var(--disabled-bg); color: var(--disabled-text); border-color: var(--disabled-bg); }

/* ---------- Countdown & pick bar ---------- */
.countdown { padding: 10px 14px; }
.countdown .label { font-size: 14px; font-weight: 600; color: var(--muted); }
.countdown .clock {
  font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--accent);
}
.pickbar {
  position: sticky; bottom: 0; margin-top: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  box-shadow: var(--shadow);
}
.pickbar .count { font-size: 15px; font-weight: 800; }
.pickbar .hint { font-size: 13px; color: var(--muted); }
.pickbar .btn { height: 48px; padding: 0 20px; }

/* ---------- Tables ---------- */
.table-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); overflow: hidden;
}
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
thead tr { background: var(--bg); }
th {
  text-align: left; padding: 10px 12px;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 12px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: none; }
.num { text-align: right; }
.num-mono { text-align: right; font-family: var(--mono); font-size: 14px; }
.rank { font-weight: 800; }
.player { font-weight: 700; }
.pts { text-align: right; font-weight: 800; }
.you { font-size: 12px; font-weight: 600; color: var(--accent); }
.row-1 { background: var(--rank1); }
.row-2 { background: var(--rank2); }
.row-3 { background: var(--rank3); }
.row-zebra { background: var(--zebra); }
.player-defaults { font-style: italic; color: var(--muted); }
.player-defaults .count { font-size: 12px; font-weight: 600; }

/* ---------- All Picks grid ---------- */
.grid-table { min-width: 560px; font-size: 13px; }
.grid-table th, .grid-table td { padding: 8px 10px; }
.grid-table th.sticky-col, .grid-table td.sticky-col {
  position: sticky; left: 0; background: var(--surface); z-index: 1;
}
.grid-table thead th.sticky-col { background: var(--bg); }
.grid-table tr.row-zebra td.sticky-col { background: var(--zebra); }
.grid-table th.live { color: var(--accent); }
.cell-picks {
  font-family: var(--mono); font-size: 12px; line-height: 1.8; white-space: nowrap;
}
.cell-picks span { display: block; }
.cell-hidden { font-size: 12px; font-style: italic; color: var(--pending); white-space: nowrap; }
.col-pts { display: none; }

.r-correct { color: var(--correct); font-weight: 700; }
.r-wrong   { color: var(--wrong);   font-weight: 700; }
.r-push    { color: var(--push);    font-weight: 700; }
.r-pending { color: var(--pending); font-weight: 700; }
.is-default {
  font-style: italic;
  border: 1.5px dashed currentColor; border-radius: 5px;
  padding: 0 4px;
}
.legend {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 12px; font-weight: 600;
}
.legend .is-default { border: none; padding: 0; color: var(--muted); }

/* ---------- Admin roster ---------- */
.roster { font-size: 14px; }
.roster th, .roster td { padding: 10px 12px; vertical-align: top; }
.roster .note { font-size: 12px; margin-top: 2px; }

.btn-remove {
  font-family: var(--body); font-size: 13px; font-weight: 700;
  color: var(--wrong); background: var(--surface);
  border: 1.5px solid var(--wrong); border-radius: var(--radius-sm);
  min-height: 44px; padding: 0 12px; cursor: pointer; white-space: nowrap;
}
.btn-remove:hover { background: var(--wrong-tint); }
.btn-remove:active { transform: translateY(1px); }

/* ---------- Quote card (Da Coach) ---------- */
.quote-card { flex-direction: row; align-items: center; gap: var(--space-3); padding: 10px 14px; }
.quote-card .avatar {
  width: 48px; height: 48px; flex: none;
  border-radius: var(--radius-pill); object-fit: cover; object-position: 50% 8%;
  border: 2px solid var(--gold);
}
.quote-card .quote {
  font-size: 14px; line-height: 1.4; font-style: italic; color: var(--muted);
}
.quote-card .quote cite { font-style: normal; font-weight: 600; }

/* ---------- Stakes ---------- */
.stake-line { font-size: 14px; line-height: 1.5; }
.stake-line b { font-weight: 600; color: var(--muted); }
.stake-name { font-size: 15px; font-weight: 800; }
.stake-empty { font-size: 14px; color: var(--muted); font-style: italic; }

/* ---------- Rules list ---------- */
.rules {
  margin: 0; padding-left: 20px;
  font-size: 14px; line-height: 1.6;
  display: flex; flex-direction: column; gap: var(--space-1);
}

/* ---------- Desktop (All Picks gets the 1140px layout) ---------- */
@media (min-width: 900px) {
  .nav { padding: 12px 28px; }
  .nav-inner { flex-direction: row; align-items: center; gap: 28px; }
  .nav-brand svg { width: 28px; height: 28px; }
  .nav-brand .wordmark { font-size: 16px; }
  .nav-links { gap: 24px; font-size: 14px; }
  .nav-links a { padding: 0 0 2px; }
  .nav-meta { display: flex; }

  .wrap-wide { padding: var(--space-5) 28px var(--space-7); }
  .wrap-wide .title { font-size: 24px; }
  .wrap-wide .grid-table { min-width: 0; font-size: 14px; }
  .wrap-wide .grid-table th, .wrap-wide .grid-table td { padding: 12px 16px; }
  .wrap-wide .grid-table .cell-picks { font-size: 13px; line-height: 1.9; }
  .wrap-wide .grid-table .cell-hidden { font-size: 13px; }
  .wrap-wide .grid-table th.sticky-col, .wrap-wide .grid-table td.sticky-col { position: static; }
  .wrap-wide .col-pts { display: table-cell; }
  .wrap-wide .table-scroll { overflow-x: visible; }
  .legend { gap: 16px; font-size: 13px; }
}
