/* The War Room, dressed as a 1970s gameday program. Layout idea: the football field itself is the instrument:
   the cap is a 100-yard drive, the depth chart is a formation. Everything else stays quiet around it. */
:root {
  --bg: #f1e6c8;
  --surface: #fbf5e3;
  --ink: #23201a;
  --muted: #625a48;
  --line: #d6c79f;
  --pylon: #c9361c;
  --on-pylon: #ffffff;
  --good: #0b6a60;
  --bad: #ac2a14;
  --warn: #85620a;
  --turf: #0e6a68;
  --turf-2: #127674;
  --chalk: #fbf5e3;
  --team: #c9361c;
  --team-ink: #fbf5e3;
  --hero-cta: #f2b632;
  --on-hero-cta: #23201a;
  --slot: #fbf5e3;
  --slot-ink: #23201a;
  --los: #f2b632;
  --display: "Rokkitt", Rockwell, Georgia, serif;
  --body: "Archivo", Arial, sans-serif;
  --num: "Archivo Narrow", "Arial Narrow", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.45 var(--body); }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--pylon); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; margin: 0; line-height: 1; letter-spacing: .01em; text-wrap: balance; }
h2 { font-size: 30px; }
h3 { font-size: 22px; }
p { margin: 0; }
.wrap { max-width: 1280px; margin: 0 auto; padding-inline: 20px; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }

/* Header */
.top { background: var(--team); color: var(--team-ink); transition: background .25s; }
.top-in { display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font: 900 27px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; }
nav { display: flex; gap: 2px 4px; flex-wrap: wrap; align-items: center; }
nav a { text-decoration: none; padding: 5px 10px; border-radius: 4px; font-weight: 600; font-size: 14px; }
nav a:hover { background: color-mix(in srgb, var(--team-ink) 16%, transparent); }
nav a[aria-current="page"] { background: var(--team-ink); color: var(--team); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: 5px; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--pylon); border-color: var(--pylon); color: var(--on-pylon); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.small { padding: 3px 8px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 5px 10px; cursor: pointer; font-weight: 600; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; min-width: 0; }
.panel-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin-bottom: 12px; }
.eyebrow { font: 700 12px/1.2 var(--num); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
input[type="text"], input[type="number"], input[type="search"], select { background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 6px 9px; min-width: 0; }
label.f { display: grid; gap: 3px; font-size: 13px; font-weight: 600; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font: 700 12px/1.2 var(--num); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 6px 8px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); vertical-align: middle; }
th.r, td.r { text-align: right; }
td.r { font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.pname { font-weight: 600; }
.badge { display: inline-block; min-width: 30px; text-align: center; font: 700 14px/20px var(--num); border-radius: 4px; background: var(--line); color: var(--ink); padding-inline: 4px; font-variant-numeric: tabular-nums; }
.badge.a { background: var(--turf); color: #fff; }
.badge.b { background: color-mix(in srgb, var(--turf) 35%, var(--surface)); }
.pos { font: 700 12px/1 var(--num); letter-spacing: .05em; color: var(--muted); }
.tag { display: inline-block; font: 700 11px/16px var(--num); letter-spacing: .05em; padding-inline: 5px; border-radius: 3px; border: 1px solid currentColor; }
.tm { display: inline-block; min-width: 42px; text-align: center; font: 700 12px/20px var(--num); border-radius: 3px; padding-inline: 4px; letter-spacing: .03em; }

/* Home */
.hero { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; padding: 26px; background: var(--turf); color: var(--chalk); border-radius: 10px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(255,255,255,.1) calc(10% - 2px) 10%); pointer-events: none; }
.hero > * { position: relative; min-width: 0; }
.hero h1 { font-size: clamp(50px, 8vw, 104px); font-weight: 900; text-transform: uppercase; line-height: .9; }
.hero .lede { margin-top: 12px; max-width: 54ch; font-size: 17px; }
.hero .cta { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero .btn.primary { background: var(--hero-cta); border-color: var(--hero-cta); color: var(--on-hero-cta); font-size: 16px; padding: 10px 16px; }
.count { margin-top: 18px; font: 700 15px/1.3 var(--num); letter-spacing: .02em; }
.count b { font: 900 34px/1 var(--display); margin-right: 4px; }
.teamgrid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; align-content: start; }
.teamgrid .conf { grid-column: 1 / -1; font: 700 12px/1 var(--num); letter-spacing: .12em; margin-top: 6px; opacity: .85; }
.teamgrid .conf:first-child { margin-top: 0; }
.teamtile { display: block; text-align: center; padding: 9px 0; border-radius: 4px; text-decoration: none; font: 800 16px/1 var(--display); border: 1px solid rgba(255,255,255,.25); transition: transform .12s; }
.teamtile:hover { transform: translateY(-2px); }
.home-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
.cal { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; }
.cal li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.cal li:last-child { border-bottom: 0; }
.cal b { font: 700 14px/1.35 var(--num); }
.cal .soon b { color: var(--pylon); }
.standings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; }
.standings h3 { font-size: 18px; margin-bottom: 3px; }
.standings td, .standings th { padding: 3px 4px; font-size: 13px; }

/* Cap field: 100 yards = 100% of the cap */
.capfield { position: relative; height: 62px; border-radius: 5px; background: var(--turf); overflow: hidden; color: var(--chalk); display: grid; grid-template-columns: 7% minmax(0, 1fr) 7%; }
.cf-end { display: flex; align-items: center; justify-content: center; font: 800 12px/1 var(--display); letter-spacing: .08em; writing-mode: vertical-rl; transform: rotate(180deg); }
.cf-end.home { background: rgba(0,0,0,.2); }
.cf-end.over { background: var(--bad); color: #fff; }
.cf-play { position: relative; background: repeating-linear-gradient(90deg, var(--turf) 0 10%, var(--turf-2) 10% 20%); }
.cf-fill { position: absolute; inset: 0 auto 0 0; background: rgba(255,255,255,.17); transition: width .35s cubic-bezier(.2,.8,.2,1); }
.cf-dead { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(135deg, rgba(0,0,0,.42) 0 4px, transparent 4px 9px); transition: width .35s; }
.cf-line { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.55); }
.cf-yd { position: absolute; bottom: 4px; transform: translateX(-50%); font: 800 14px/1 var(--display); opacity: .9; }
.cf-ball { position: absolute; top: 9px; width: 24px; height: 15px; margin-left: -12px; background: #8a4a22; border-radius: 50%; border: 1.5px solid #fff; transition: left .35s cubic-bezier(.2,.8,.2,1); }
.cf-ball::after { content: ""; position: absolute; left: 6px; right: 6px; top: 5px; height: 1.5px; background: #fff; }
@media (prefers-reduced-motion: reduce) { .cf-ball, .cf-fill, .cf-dead, .top, .teamtile { transition: none; } }

/* GM */
.gm-head { margin-top: 18px; display: grid; gap: 12px; }
.gm-title { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: end; justify-content: space-between; }
.gm-title h1 { font-size: clamp(36px, 5.2vw, 62px); font-weight: 900; text-transform: uppercase; }
.gm-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.statline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.stat { background: var(--surface); padding: 8px 12px; min-width: 0; }
.stat b { display: block; font: 800 27px/1.05 var(--display); font-variant-numeric: tabular-nums; }
.stat span { font: 600 12px/1.2 var(--num); letter-spacing: .05em; color: var(--muted); text-transform: uppercase; }
.gm-grid { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.gm-col { display: grid; gap: 16px; min-width: 0; }

/* Formation */
.field { background: var(--turf); border-radius: 6px; color: var(--chalk); padding: 12px; background-image: repeating-linear-gradient(0deg, transparent 0 58px, rgba(255,255,255,.1) 58px 60px); }
.field-label { font: 700 12px/1 var(--num); letter-spacing: .14em; opacity: .8; margin: 2px 0 7px; }
.formation { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.los { border: 0; border-top: 2px solid var(--los); margin: 12px 0; position: relative; }
.slot { grid-column: var(--c); grid-row: var(--r); min-height: 62px; min-width: 0; background: var(--slot); color: var(--slot-ink); border: 1px solid transparent; border-radius: 5px; padding: 4px 5px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 1px; position: relative; font-size: 13px; }
.slot:hover { border-color: var(--los); }
.slot.empty { background: rgba(255,255,255,.06); color: var(--chalk); border: 1px dashed rgba(255,255,255,.5); }
.slot.over { outline: 2px solid var(--los); }
.slot .sl { font: 700 11px/1 var(--num); letter-spacing: .06em; opacity: .75; }
.slot .sn { font: 600 13px/1.1 var(--num); overflow-wrap: anywhere; }
.slot .sg { font: 700 12px/1 var(--num); margin-top: auto; font-variant-numeric: tabular-nums; }
.slot .off { color: var(--bad); }
.st-row { margin-top: 10px; }

/* Moves */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 7px 9px; cursor: pointer; font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { border-color: var(--pylon); }
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.filters input { flex: 1 1 130px; }
.list { display: grid; max-height: 520px; overflow-y: auto; }
.row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 6px 2px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.row[draggable="true"] { cursor: grab; }
.row .meta { font-size: 12.5px; color: var(--muted); }
.row .acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.trade-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.trade-sides h3 { font-size: 18px; margin-bottom: 6px; }
.trade-sides .list { max-height: 270px; font-size: 13px; }
.trow { display: flex; gap: 7px; align-items: center; padding: 4px 2px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); cursor: pointer; }
.trow input { flex: none; }
.trow .num { margin-left: auto; white-space: nowrap; }
.meter { margin-top: 10px; height: 13px; background: var(--line); border-radius: 7px; position: relative; overflow: hidden; }
.meter i { position: absolute; top: 0; bottom: 0; left: 0; background: var(--good); transition: width .2s; }
.meter i.low { background: var(--bad); }
.meter::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--ink); }
.verdict { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--line); background: var(--bg); border-radius: 0 4px 4px 0; font-size: 14px; }
.verdict.yes { border-color: var(--good); } .verdict.no { border-color: var(--bad); }
.pickrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 6px 2px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.pickno { font: 800 21px/1 var(--display); text-align: center; }
.log { display: grid; gap: 0; }
.log .row { grid-template-columns: minmax(0, 1fr) auto; }

/* Cap table */
.bar { height: 11px; background: var(--line); border-radius: 2px; overflow: hidden; min-width: 90px; }
.bar i { display: block; height: 100%; background: var(--turf); }
.bar i.over { background: var(--bad); }
.pagehead { margin: 22px 0 14px; display: grid; gap: 6px; }
.pagehead h1 { font-size: clamp(38px, 6vw, 64px); font-weight: 900; text-transform: uppercase; }
.pagehead p { max-width: 70ch; }

/* Dialog */
dialog { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); padding: 18px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
dialog::backdrop { background: rgba(8, 18, 12, .55); }
dialog.wide { width: min(760px, calc(100vw - 32px)); }
.dlg-h { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 10px; }
.formrow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-block: 10px; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-block: 10px; }
.kv div { background: var(--bg); padding: 7px 9px; border-radius: 5px; font-size: 12.5px; color: var(--muted); }
.kv b { display: block; font: 800 21px/1.1 var(--display); color: var(--ink); }
.dlg-f { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }
#graphic { display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto; margin-inline: auto; border-radius: 4px; }

.foot { margin-top: 28px; padding-block: 18px 34px; color: var(--muted); font-size: 13px; display: grid; gap: 6px; }
.foot p { max-width: 95ch; }

@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); }

  .c4, .c5, .c6, .c7, .c8 { grid-column: span 12; }
  .standings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .wrap { padding-inline: 16px; }
  .hero { padding: 18px; }
  .formation { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .slot { grid-column: auto; grid-row: auto; }
  .standings, .trade-sides { grid-template-columns: minmax(0, 1fr); }
  .statline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teamgrid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: 36px minmax(0, 1fr); }
  .row .acts { grid-column: 2; justify-content: flex-start; }
  .brand { font-size: 24px; }
}
@media (max-width: 1180px) {
  .gm-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Gameday Program details */
.panel { border: 2px solid var(--ink); }
.hero { outline: 4px double var(--chalk); outline-offset: -10px; }
.hero h1 { font-size: clamp(42px, 6.2vw, 80px); }
.gm-title h1 { font-size: clamp(28px, 2.8vw, 38px); }
.stat b { font-size: 23px; }
