/* LeagueSwap — design system. Garnet & gold: dark garnet header chrome (a
   shade lighter for the nav strip than the topbar above it), cream body,
   gold as the CTA/accent color. Restyle = edit tokens. */

:root {
  /* palette — garnet & gold */
  --ink: #2a1315;
  --bg: #f7f1e3;
  --surface: #fffdf6;
  --surface-2: #efe6d3;
  --line: #e3d6bb;
  --line-strong: #b79f72;
  --muted: #7d6a5e;
  --red: #7a1f2b;          /* primary garnet — rank numbers, tabs, links */
  --red-dark: #5c1420;     /* topbar chrome, strong dividers */
  --red-bright: #a83a49;   /* lighter garnet accent */
  --gold: #c9a227;         /* CTAs, badges, active-nav fill */
  --gold-dark: #8a6a1a;    /* gold text on light backgrounds (contrast) */
  --gold-bright: #e0be4e;  /* gold on dark chrome (brand mark, hover) */
  --blue: #1e5a5a;
  /* sport accents — complementary to garnet/gold, not "team colors" */
  --nfl: #b5651d;
  --nba: #6b3369;
  --mlb: #1e5a5a;
  --ok: #4b6b3a;
  --warn: #b8860b;
  /* type + layout */
  --font-head: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(42,19,21,.06), 0 4px 12px rgba(42,19,21,.05);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14.5px/1.55 var(--font-body); }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 22px 20px 64px; }
.muted { color: var(--muted); }
/* metadata text — the small muted annotations on rows/cards everywhere */
.meta { font-size: 12px; color: var(--muted); }
.meta--xs { font-size: 11px; }
.nowrap { white-space: nowrap; }
form { margin: 0; }  /* forms are inline actions here — spacing comes from layout */
/* toolbar: the standard filter/action row (was ad-hoc flex everywhere) */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---- top bar ---- */
.topbar { background: var(--red-dark); border-bottom: 3px solid var(--gold); }
.topbar__inner { max-width: 1080px; margin: 0 auto; padding: 0 20px; height: 58px;
  display: flex; align-items: center; gap: 16px; }
.brand { font-family: var(--font-head); font-weight: 700; font-size: 27px; letter-spacing: .5px;
  text-transform: uppercase; color: #fdf6e3; }
.brand .brand__mark { color: var(--gold-bright); }
.brand__tag { color: #c99a9f; font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; }
.topbar__user { margin-left: auto; display: flex; align-items: center; gap: 12px;
  color: #e8d8b8; font-size: 13px; }
.topbar__user .btn { background: transparent; border: 1px solid var(--gold); color: var(--gold-bright); }

/* owner-layer nav in the topbar (P9): Dashboard · Contests · History + switcher */
.topbar__owner { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.topbar__owner a { color: #e8d8b8; font-family: var(--font-head); font-weight: 600;
  font-size: 13.5px; text-transform: uppercase; letter-spacing: .6px;
  padding: 6px 10px; border-radius: 999px; }
.topbar__owner a:hover { background: rgba(224,190,78,.18); color: #fdf6e3; text-decoration: none; }
.switcher { position: relative; }
.switcher summary { list-style: none; cursor: pointer; color: var(--gold-bright);
  font-family: var(--font-head); font-weight: 600; font-size: 13.5px;
  text-transform: uppercase; letter-spacing: .6px; padding: 6px 10px; border-radius: 999px; }
.switcher summary::-webkit-details-marker { display: none; }
.switcher summary:hover { background: rgba(224,190,78,.18); }
.switcher__menu { position: absolute; top: 110%; left: 0; z-index: 80; min-width: 240px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.switcher__menu a { color: var(--ink); font-family: var(--font-body); text-transform: none;
  letter-spacing: 0; font-size: 14px; font-weight: 600; padding: 8px 10px; border-radius: 8px; }
.switcher__menu a:hover { background: var(--surface-2); text-decoration: none; }
@media (max-width: 720px) { .topbar__owner a { padding: 6px 7px; font-size: 12.5px; } }

/* ---- nav (a shade lighter garnet than the topbar above it) ---- */
.nav { background: var(--red); }
.nav__inner { max-width: 1080px; margin: 0 auto; padding: 0 20px; display: flex; gap: 2px;
  overflow-x: auto; scrollbar-width: none; }
.nav__inner::-webkit-scrollbar { display: none; }
.nav__seasons { flex-shrink: 0; }
.nav a { color: #f0d9db; font-family: var(--font-head); font-weight: 600; font-size: 14.5px;
  text-transform: uppercase; letter-spacing: .6px; padding: 12px 15px; border-radius: 999px;
  margin: 7px 2px; border-bottom: 0; flex-shrink: 0; white-space: nowrap; }
.nav a:hover { color: #fff; text-decoration: none; background: rgba(0,0,0,.15); }
.nav a.is-active { background: var(--gold); color: var(--red-dark); }
.nav .chip { border-color: var(--gold); color: var(--gold-bright); background: transparent; }

/* ---- headings ---- */
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; margin: 0; line-height: 1.1; color: var(--ink); }
.page-title { font-size: 40px; margin: 4px 0 2px; }
.page-sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
/* page-head: title + optional right-aligned actions on one baseline (reusable
   so every module places page-level actions in the same spot) */
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-head .page-title { margin: 0; }
.page-head__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* quick-links: a standard cluster of pill buttons under a header */
.quick-links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.crumbs { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted);
  margin: 0 0 14px; }
.crumbs a { color: var(--red); }
.eyebrow { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 2px;
  font-size: 13px; color: var(--red); font-weight: 600; margin: 0 0 10px; }

/* ---- cards ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; }
.card__head { padding: 11px 16px; border-bottom: 2px solid var(--ink); display: flex;
  align-items: center; gap: 10px; background: var(--surface); }
.card__head h3 { font-size: 18px; }
.card__body { padding: 14px 16px; }
.card--accent { border-top: 3px solid var(--red); }
.card--link { display: block; color: var(--ink); }   /* card-shaped <a> — no link blue */
/* owner "hero" panel — dark garnet, gold trim; the you-centric callout that
   leads the league home so an owner lands on THEIR team, not a spectator view */
.hero { background: var(--red-dark); color: #fdf6e3; border-radius: var(--radius);
  border: 1px solid var(--red); box-shadow: var(--shadow); overflow: hidden;
  margin-bottom: 22px; }
.hero__top { padding: 16px 18px 14px; border-bottom: 1px solid rgba(224,190,78,.25); }
.hero__eyebrow { color: var(--gold-bright); font-family: var(--font-head);
  text-transform: uppercase; letter-spacing: 2px; font-size: 12px; }
.hero__name { font-family: var(--font-head); font-weight: 700; text-transform: uppercase;
  font-size: 30px; line-height: 1.05; margin-top: 2px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; }
.hero__actions .btn { background: rgba(253,246,227,.08); border-color: rgba(224,190,78,.5);
  color: #fdf6e3; }
.hero__actions .btn:hover { background: var(--gold); border-color: var(--gold); color: var(--red-dark); }
.hero__actions .btn--primary { background: var(--gold); border-color: var(--gold); color: var(--red-dark); }
.hero__actions .btn--primary:hover { background: var(--gold-bright); border-color: var(--gold-bright); }

/* sport accent strip on a card head */
.sport--nfl { border-left: 4px solid var(--nfl); }
.sport--nba { border-left: 4px solid var(--nba); }
.sport--mlb { border-left: 4px solid var(--mlb); }
.sport--nhl { border-left: 4px solid #444; }

/* ---- grids ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px;
  align-items: start; }
@media (max-width: 620px) { .grid-2, .grid-auto { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .brand__tag { display: none; } .brand { font-size: 22px; } }

/* ---- chips / badges / pills ----
   .badge defaults to a gold pill (e.g. the rankings "Default" tag); the
   --k/--franchise/--wild modifiers only override color, so they still read
   as gold pills with distinct ink (teal/garnet/terracotta) — order matters,
   modifiers must come after the base rule. */
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; background: transparent;
  color: var(--ink); white-space: nowrap; flex-shrink: 0; }
.badge { font-family: var(--font-head); font-weight: 700; font-size: 11px; letter-spacing: .5px;
  text-transform: uppercase; border-radius: 3px; padding: 1px 5px; border: 1px solid currentColor;
  background: var(--gold); color: var(--red-dark); }
.badge--k { color: var(--mlb); }
.badge--franchise { color: var(--red); }
.badge--wild { color: var(--nfl); }

/* ---- buttons (gold — not garnet, so CTAs read as their own color) ---- */
.btn { font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
  border: 1.5px solid var(--gold); background: transparent; color: var(--gold-dark);
  border-radius: 999px; padding: 9px 16px; cursor: pointer; font-size: 14px; }
.btn:hover { background: var(--gold); color: var(--red-dark); border-color: var(--gold); }
.btn--primary, .btn--go { background: var(--gold); border-color: var(--gold); color: var(--red-dark);
  font-weight: 700; }
.btn--primary:hover, .btn--go:hover { background: var(--gold-bright); border-color: var(--gold-bright); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--sm { padding: 5px 10px; font-size: 12px; }

/* ---- forms ---- */
.field { display: block; }
.label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.input, .select { width: 100%; background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--ink); border-radius: var(--radius); padding: 9px 12px; font: inherit; }
.input:focus, .select:focus { outline: 2px solid var(--red); outline-offset: -1px; border-color: var(--red); }
.select--auto { width: auto; }                       /* content-width, for toolbars */
.select--sm { padding: 2px 6px; font-size: 12px; }   /* compact, for table rows */

/* ---- tables ---- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead th { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 1.3px;
  font-size: 12px; color: var(--red-dark); text-align: left; padding: 10px 14px; border-bottom: 2px solid var(--ink); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.table tbody tr:nth-child(even) { background: var(--surface-2); }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .rank { color: var(--red); font-family: var(--font-head); font-weight: 700; font-size: 18px; }

/* ---- alerts ---- */
.alert { border-radius: var(--radius); padding: 11px 14px; font-size: 14px; border-left: 4px solid;
  margin-bottom: 14px; }
.alert:last-child { margin-bottom: 0; }
.alert--err { border-color: var(--red); background: #fbeaec; color: var(--red-dark); }
.alert--ok { border-color: var(--ok); background: #eaf1e4; color: var(--ok); }
.alert--warn { border-color: var(--warn); background: #fbf1e0; color: var(--warn); }

/* ---- draft board ---- */
.board-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); background: var(--surface); }
.board { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.board th { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .4px;
  font-size: 12px; color: var(--muted); text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--line);
  min-width: 120px; }
.board td { padding: 6px 10px; border-left: 1px solid var(--line); border-top: 1px solid var(--line);
  vertical-align: top; }
.board .rd, .board thead .rd { position: sticky; left: 0; background: var(--surface);
  min-width: 40px; font-family: var(--font-head); font-weight: 700; color: var(--muted); border-left: 0; }
.board .num { color: #aab0b8; font-size: 10.5px; }
.board .on-clock-cell { outline: 2px solid var(--red); outline-offset: -2px; }
.board .on-clock-cell .tag { color: var(--red); font-weight: 600; }
.board .via { font-size: 10px; color: var(--nfl); }
.board .empty { color: #c2c7ce; }

/* on-the-clock banner */
.banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.banner .who { font-family: var(--font-head); font-weight: 700; font-size: 20px; }

/* roster rows */
.slot-code { width: 52px; font-family: var(--font-head); font-weight: 700; font-size: 12px;
  color: var(--muted); }
.row-bench { background: var(--surface-2); }

/* ---- draft room ---- */
.draft-grid { display: grid; grid-template-columns: 1fr 310px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .draft-grid { grid-template-columns: 1fr; } }

.ticker { display: flex; gap: 5px; overflow-x: auto; padding: 8px; background: var(--red-dark);
  border-radius: var(--radius); margin-bottom: 16px; }
.ticker__pick { flex: 0 0 auto; min-width: 96px; background: rgba(0,0,0,.2); border-radius: 5px;
  padding: 6px 10px; color: #e8d8b8; }
.ticker__pick .no { font-family: var(--font-head); font-weight: 700; font-size: 14px; color: #fff; }
.ticker__pick .fr { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
.ticker__pick.is-now { background: var(--gold); }
.ticker__pick.is-now .fr, .ticker__pick.is-now .no { color: var(--red-dark); }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tab { font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: .8px;
  font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--red);
  background: transparent; color: var(--red-dark); cursor: pointer; }
.tab:hover { text-decoration: none; color: var(--ink); }
.tab.is-active, .tab.is-active.tab--red { background: var(--red); color: #fdf6e3; border-color: var(--red); }

.pos-badge { font-family: var(--font-head); font-weight: 700; font-size: 11px; border-radius: 3px;
  padding: 1px 5px; color: #fdf6e3; }

.roster-panel .card__head { padding: 8px 12px; }
.roster-row { display: flex; align-items: center; gap: 8px; padding: 4px 12px; font-size: 13px;
  border-top: 1px solid var(--line); }
.roster-row .code { width: 34px; font-family: var(--font-head); font-weight: 700; font-size: 11px; color: var(--muted); }
.roster-row .empty { color: #c2c7ce; }

/* trade-builder asset rows: [checkbox] [asset label, flex] [destination select] */
.asset-row { display: flex; gap: 8px; padding: 3px 0; font-size: 14px; align-items: center; }
.asset-row label { flex: 1; cursor: pointer; }
.asset-row .select { width: auto; padding: 2px 6px; font-size: 12px; }
.asset-cols { display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-head); font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .8px; color: var(--muted); border-bottom: 1px solid var(--line);
  padding-bottom: 4px; margin-top: 10px; }
