/* ---- Design tokens — "1st Down Fantasy" ----
   Palette, straight from the brand mark: true-black field (#0A0C08), a two-step green (a bright
   turf-line lime for anything live/positive/interactive, a deeper pitch green for brand chrome),
   white for primary text, and a single penalty-flag red-orange as the only non-brand color,
   reserved for negative stats. No amber, no blue — everything else in the UI is a shade of green.
   Type: Anton (condensed, ultra-bold display — matches "DOWN"'s letterforms) for headlines and
   section markers, Inter for body/UI text, Space Mono for stat figures (reads like scoreboard
   digits). Signature: a stadium-light glow (soft green radial wash) behind the hero headline,
   paired with the real brand mark in the header — every section heading also carries a small
   skewed accent tick echoing the wordmark's own slant, so the motif repeats with a purpose
   (marking "this is a heading") rather than as one-off decoration.
*/
:root {
  --bg: #0A0C08;
  --bg-raised: #141810;
  --bg-sunken: #000000;
  --green-bright: #8FE142;
  --green: #4C9A2A;
  --green-deep: #1E3813;
  --chalk: #F3F5EE;
  --chalk-dim: #8B9180;
  --hairline: #242A1B;
  --danger: #E15A3E;
  --radius: 5px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  /* Faint diagonal turf-line texture — barely-there field atmosphere, not a pattern you consciously notice. */
  background-image: repeating-linear-gradient(135deg, rgba(143,225,66,0.028) 0px, rgba(143,225,66,0.028) 1px, transparent 1px, transparent 64px);
  color: var(--chalk);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Anton', 'Inter', sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0 0 8px;
}

/* Every section heading carries the same skewed accent tick as the wordmark's "1st" — a
   structural marker (this is a heading), not one-off decoration, repeated consistently. */
h3 {
  position: relative;
  padding-left: 15px;
}
h3::before {
  content: "";
  position: absolute;
  left: 0; top: 3px; bottom: 3px;
  width: 4px;
  background: linear-gradient(180deg, var(--green-bright), var(--green));
  transform: skewX(-14deg);
}

.hidden { display: none !important; }

/* ---- Top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 24px;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--hairline);
  position: relative;
  z-index: 2;
  /* Soft stadium-light bleed under the header, standing in for a hard divider line. */
  box-shadow: 0 10px 26px -14px rgba(143,225,66,0.45);
}
.brand { display: flex; align-items: center; }
.brand-logo { display: block; height: 46px; width: auto; }

.sync-status { font-family: 'Space Mono', monospace; font-size: 12px; color: var(--chalk-dim); }

/* ---- Signature: scoreboard ticker ---- */
.ticker {
  display: flex;
  align-items: center;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
  white-space: nowrap;
  padding: 10px 0;
}
.ticker-live {
  display: flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 0 16px 0 24px; margin-right: 4px;
  border-right: 1px solid var(--hairline);
  font-family: 'Space Mono', monospace; font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--danger);
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--danger); flex-shrink: 0;
  animation: live-pulse 1.7s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225,90,62,0.55); }
  50% { box-shadow: 0 0 0 5px rgba(225,90,62,0); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}
.ticker-track { display: inline-flex; gap: 28px; padding-left: 8px; }
.ticker-empty { font-family: 'Space Mono', monospace; color: var(--chalk-dim); font-size: 13px; }
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  padding: 4px 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  flex-shrink: 0;
}
.ticker-bar {
  width: 60px;
  height: 6px;
  background: var(--hairline);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.ticker-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green-bright); }

/* ---- Layout shell ---- */
.shell { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }

/* Signature moment: a stadium-light glow behind the hero headline — the one place the page
   spends its boldness, everything else in the UI stays quiet and disciplined around it. */
.panel.import-panel { position: relative; max-width: 560px; margin: 40px auto; }
.panel.import-panel::before {
  content: "";
  position: absolute;
  top: -80px; left: 50%; transform: translateX(-50%);
  width: 620px; height: 380px;
  background: radial-gradient(ellipse at 50% 35%, rgba(143,225,66,0.20), transparent 68%);
  pointer-events: none; z-index: -1;
}
.import-panel h1 { font-size: 40px; line-height: 1.05; }
.import-panel .sub { color: var(--chalk-dim); margin-bottom: 24px; line-height: 1.5; }

.import-form { display: flex; flex-direction: column; gap: 16px; }
.field-row { display: flex; gap: 16px; }
.field-row > label { flex: 1; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--chalk-dim); }
input, select {
  background: var(--bg-raised);
  border: 1px solid var(--hairline);
  color: var(--chalk);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}
input:focus, select:focus, button:focus {
  outline: 2px solid var(--green-bright);
  outline-offset: 1px;
}
.hint { font-size: 12px; color: var(--chalk-dim); margin: -8px 0 0; }

.btn-primary, .btn-secondary {
  border: none;
  border-radius: var(--radius);
  padding: 12px 18px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.btn-primary { background: var(--green-bright); color: #0A0C08; box-shadow: 0 4px 16px -6px rgba(143,225,66,0.55); }
.btn-primary:hover { background: #A6ED66; transform: translateY(-1px); box-shadow: 0 6px 20px -6px rgba(143,225,66,0.7); }
.btn-secondary { background: transparent; border: 1px solid var(--hairline); color: var(--chalk); }
.btn-secondary:hover { border-color: var(--green-bright); color: var(--green-bright); }

.error { color: var(--danger); font-size: 13px; margin-top: 12px; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hairline); margin-bottom: 4px; }
.tab {
  background: none; border: none; color: var(--chalk-dim);
  font-family: 'Anton', sans-serif; text-transform: uppercase; letter-spacing: 0.01em;
  padding: 12px 16px; font-size: 14px; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.12s ease, border-color 0.12s ease, text-shadow 0.12s ease;
}
.tab.active { color: var(--green-bright); border-bottom-color: var(--green-bright); text-shadow: 0 0 14px rgba(143,225,66,0.45); }

.tab-actions {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 0; border-bottom: 1px solid var(--hairline); margin-bottom: 24px;
}
.my-team-picker { flex-direction: row; align-items: center; gap: 8px; }
.my-team-picker select { padding: 8px 10px; }

.rankings-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.rankings-toolbar .sub { margin: 0; max-width: 560px; }

/* ---- Overview ---- */
.league-meta { font-family: 'Space Mono', monospace; color: var(--chalk-dim); font-size: 13px; margin-bottom: 20px; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.team-card {
  background: var(--bg-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 14px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.team-card:hover { transform: translateY(-2px); border-color: var(--green); box-shadow: 0 10px 24px -12px rgba(143,225,66,0.35); }
.team-card .team-name { font-weight: 700; margin-bottom: 4px; }
.team-card .team-record { font-family: 'Space Mono', monospace; color: var(--green-bright); font-size: 13px; }
.team-card .team-owner { color: var(--chalk-dim); font-size: 12px; margin-top: 4px; }

.roster-list { margin-top: 10px; border-top: 1px solid var(--hairline); padding-top: 8px; }
.roster-loading, .roster-error, .roster-empty { font-size: 12px; color: var(--chalk-dim); font-family: 'Space Mono', monospace; }
.roster-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: 'Space Mono', monospace; font-size: 12px; padding: 3px 0;
}
.roster-row.starter .roster-player-name { color: var(--chalk); }
.roster-row.bench .roster-player-name { color: var(--chalk-dim); }
.roster-player-points { color: var(--green-bright); flex-shrink: 0; margin-left: 8px; }

/* ---- Projections tab ---- */
.proj-team-total { font-family: 'Space Mono', monospace; color: var(--green-bright); font-size: 13px; margin-top: 2px; }
.roster-section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--chalk-dim);
  margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--hairline);
}

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--chalk-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 8px; border-bottom: 1px solid var(--hairline); }
td { padding: 10px 8px; border-bottom: 1px solid var(--hairline); font-family: 'Space Mono', monospace; }
tr:hover td { background: rgba(143,225,66,0.05); }
.value-positive { color: var(--green-bright); }
.value-negative { color: var(--danger); }

/* ---- Draft grade board ---- */
.grade-board { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.grade-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 8px 12px; font-size: 13px;
}
.grade-letter {
  font-family: 'Anton', sans-serif; font-size: 16px;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 4px; background: var(--green); color: var(--bg-sunken);
}
.grade-letter.low { background: var(--danger); color: var(--chalk); }

/* ---- Toggle group (e.g. Draft Grades / Pre-season Power Ranking) ---- */
.toggle-group { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.toggle-btn {
  background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: var(--radius);
  color: var(--chalk-dim); padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.toggle-btn.active { color: var(--green-bright); border-color: var(--green-bright); }

/* ---- Recommendations ---- */
.rec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 24px; }
.rec-card {
  background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 16px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.rec-card:hover { transform: translateY(-2px); border-color: var(--green); box-shadow: 0 10px 24px -12px rgba(143,225,66,0.35); }
.rec-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.rec-card-header h3 { margin: 0; }
.rec-card-header select { padding: 4px 8px; font-size: 12px; }
.hide-qb-toggle {
  display: flex; align-items: center; gap: 6px; flex-direction: row;
  font-size: 12px; color: var(--chalk-dim); cursor: pointer; white-space: nowrap;
}
.hide-qb-toggle input { accent-color: var(--green-bright); cursor: pointer; }
.rec-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--hairline); font-size: 13px; }
.rec-row:last-child { border-bottom: none; }
.rec-reason { color: var(--chalk-dim); font-size: 12px; margin-top: 2px; }

/* ---- Roster needs diverging bar chart ---- */
.needs-row { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.needs-row:last-child { border-bottom: none; }
.needs-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; margin-bottom: 6px; }
.needs-pos { font-weight: 600; letter-spacing: 0.02em; }
.needs-bar-track { position: relative; height: 8px; background: var(--hairline); border-radius: 999px; overflow: hidden; }
.needs-bar-center { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--bg-raised); z-index: 1; }
.needs-bar-fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.needs-bar-fill.positive { background: var(--green-bright); }
.needs-bar-fill.negative { background: var(--danger); }

.activity-feed { background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 16px; }
.activity-row { padding: 8px 0; border-bottom: 1px solid var(--hairline); font-size: 13px; }
.activity-row:last-child { border-bottom: none; }

@media (max-width: 640px) {
  .field-row { flex-direction: column; }
  .tabs { overflow-x: auto; }
}
