/* WAFLvision on the site (W-039, N-95): the settled viewer's styles (side/waflvision/viewer/waflvision.src.html, rev 6) as they are,
   plus the header's logo link and the "WAFL" link home. The page has its own frame: no site rail, ticker, strip or boxes. */
:root {
  --bg: #f4f2ec; --panel: #ffffff; --panel2: #f9f8f4; --ink: #1d1f24; --muted: #6b6f78; --line: #dedad0;
  --accent: #1f5fbf; --td: #1d8a4a; --to: #c0392b; --flag: #b8860b; --big: #7a4fc4; --field: #2f7d46; --field2: #286b3c;
  --chip: #eceae3; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161a; --panel: #1d2026; --panel2: #23272e; --ink: #e8e9ec; --muted: #9aa0aa; --line: #30353d;
    --accent: #6ea8ff; --td: #4cc27f; --to: #ff6b5e; --flag: #f0c040; --big: #b48cff; --field: #2a6a3c; --field2: #235a33;
    --chip: #2a2e36; --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  --bg: #14161a; --panel: #1d2026; --panel2: #23272e; --ink: #e8e9ec; --muted: #9aa0aa; --line: #30353d;
  --accent: #6ea8ff; --td: #4cc27f; --to: #ff6b5e; --flag: #f0c040; --big: #b48cff; --field: #2a6a3c; --field2: #235a33;
  --chip: #2a2e36; --shadow: 0 1px 2px rgba(0,0,0,.4);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, select { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1600px; margin: 0 auto; padding: 0 16px; }

header { background: var(--panel); border-bottom: 1px solid var(--line); }
header .wrap { display: flex; align-items: baseline; gap: 14px; padding-top: 9px; padding-bottom: 9px; }
header .wrap { align-items: center; }
.logo { display: block; height: 60px; width: 180px; border-radius: 6px; }
.logolink { display: block; flex: none; line-height: 0; }
.back { color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; font-size: 13px; }
.back:hover { color: var(--accent); }
.brand { font-weight: 800; letter-spacing: .02em; font-size: 18px; }
.brand span { color: var(--accent); }
#weekTitle { color: var(--muted); font-weight: 600; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.panel h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; padding: 10px 12px 6px; }

/* channels: tiles across the top */
#channels { padding: 12px 0; display: flex; flex-direction: column; gap: 6px; }
#channels .tiles { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
#channels .wave { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 2px; }
.ch.wait { opacity: .65; }
.ch.wait .st span:first-child { white-space: normal; line-height: 1.2; }
.ch { display: flex; flex-direction: column; gap: 2px; padding: 7px 8px 6px; border: 1px solid var(--line); border-radius: 9px;
  cursor: pointer; background: var(--panel); text-align: left; width: 100%; min-width: 0; box-shadow: var(--shadow); }
.ch:hover { border-color: var(--accent); }
.ch.on { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent), var(--shadow); }
.ch .row { display: flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.ch .row img, .ch .row .ph { width: 30px; height: 30px; flex: none; object-fit: contain; }
.ch .row .ab { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch .row .sc { font-weight: 800; font-size: 17px; }
.ch .st { font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 4px; border-top: 1px solid var(--line); padding-top: 3px; margin-top: 1px; }
.ch .st b { color: var(--ink); font-weight: 700; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--flag); display: inline-block; visibility: hidden; flex: none; }
.dot.on { visibility: visible; }
.ph { display: inline-grid; place-items: center; border-radius: 6px; font-size: 10px; font-weight: 800; }
.ch.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { background: color-mix(in srgb, var(--td) 35%, var(--panel)); } 100% { background: var(--panel); } }
.rz { color: var(--to); font-weight: 700; }

/* three columns */
main.wrap { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; gap: 14px; padding-bottom: 40px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* featured */
#featured { display: flex; flex-direction: column; min-width: 0; }
.board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 16px 8px; gap: 10px; }
.side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.side.home { justify-content: flex-end; text-align: right; }
.side img, .side .ph { width: 56px; height: 56px; flex: none; object-fit: contain; }
.side.home img { transform: scaleX(-1); }
.tname { font-weight: 700; font-size: 16px; line-height: 1.15; min-width: 0; }
.tname small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.score { font-size: 34px; font-weight: 800; min-width: 44px; text-align: center; }
.mid { text-align: center; color: var(--muted); font-weight: 600; }
.mid .clk { font-size: 18px; color: var(--ink); }
.poss { color: var(--flag); font-size: 12px; visibility: hidden; }
.poss.on { visibility: visible; }
.situ { padding: 4px 16px 12px; }
.situ .txt { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 6px; gap: 10px; }
.situ .txt .where { color: var(--muted); font-weight: 500; }
.bar { position: relative; height: 34px; border-radius: 6px; overflow: hidden; background: repeating-linear-gradient(90deg, var(--field) 0 10%, var(--field2) 10% 20%); }
.ez { position: absolute; top: 0; bottom: 0; width: 8%; display: grid; place-items: center; font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.ez.l { left: 0; } .ez.r { right: 0; }
.play { position: absolute; left: 8%; right: 8%; top: 0; bottom: 0; }
.ball { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #f6d36b; border: 2px solid #5a3c12; transition: left .45s ease; }
.ltg { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: #ffd400; transition: left .45s ease; }
.los { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #4aa3ff; transition: left .45s ease; }
.ticks { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 2px 1px; font-size: 9px; color: rgba(255,255,255,.65); pointer-events: none; }
.drivehead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 16px 7px; border-top: 1px solid var(--line); background: var(--panel2); font-size: 13px; }
.drivehead b { font-weight: 700; }
.drivehead span:last-child { color: var(--muted); white-space: nowrap; }
#feed { list-style: none; margin: 0; padding: 0 12px 12px; min-height: 220px; }
#feed li { padding: 9px 6px 9px 10px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
#feed li:first-child { animation: fadein .35s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
#feed .hd { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
#feed .hd b { color: var(--ink); font-weight: 600; }
#feed .pre { font-size: 12px; color: var(--muted); margin-top: 2px; }
#feed.nopre .pre { display: none; }
#feed .main { margin-top: 2px; }
#feed .ex { color: var(--muted); }
#feed li.td { border-left-color: var(--td); background: color-mix(in srgb, var(--td) 7%, transparent); }
#feed li.to { border-left-color: var(--to); background: color-mix(in srgb, var(--to) 7%, transparent); }
#feed li.fl .flag { color: var(--flag); font-weight: 600; }
#feed li.note { color: var(--muted); font-style: italic; }
.scorechip { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 10px; background: var(--chip); font-weight: 700; font-size: 12px; }
.empty { color: var(--muted); padding: 30px 16px; text-align: center; }

/* controls */
.ctl { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.master { display: flex; justify-content: space-between; align-items: baseline; }
.master .clk { font-size: 26px; font-weight: 800; }
.master small { color: var(--muted); }
.ctl select { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); }
.btnrow { display: flex; gap: 6px; }
.btn { border: 1px solid var(--line); background: var(--panel2); border-radius: 7px; padding: 7px 12px; cursor: pointer; }
.btn.primary { flex: 1; background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.seg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { border: 0; background: var(--panel2); padding: 6px 2px; cursor: pointer; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.tog { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.tog input { appearance: none; width: 36px; height: 20px; border-radius: 10px; background: var(--line); position: relative; cursor: pointer; flex: none; margin: 0; transition: background .2s; }
.tog input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.tog input:checked { background: var(--accent); }
.tog input:checked::after { left: 18px; }
.tog small { display: block; color: var(--muted); font-size: 12px; }

/* stats, leaders, big plays */
table.ts { width: 100%; border-collapse: collapse; }
table.ts th, table.ts td { padding: 5px 12px; border-top: 1px solid var(--line); }
table.ts th { text-align: left; font-weight: 500; color: var(--muted); }
table.ts td { text-align: right; font-weight: 600; white-space: nowrap; }
table.ts thead td { border-top: 0; font-weight: 800; }
.gl { padding: 4px 12px 10px; font-size: 13px; }
.gl div { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.gl span:last-child { color: var(--muted); text-align: right; white-space: nowrap; }
.tabs { display: flex; gap: 4px; padding: 0 10px 6px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--panel2); border-radius: 12px; padding: 2px 9px; font-size: 12px; cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
ol.lead { margin: 0; padding: 0 12px 10px; list-style: none; counter-reset: r; }
ol.lead li { counter-increment: r; display: grid; grid-template-columns: 18px 1fr auto; gap: 6px; padding: 4px 0; border-top: 1px solid var(--line); align-items: baseline; }
ol.lead li::before { content: counter(r); color: var(--muted); font-size: 12px; }
ol.lead li.none { display: block; color: var(--muted); }
ol.lead li.none::before { content: none; }
ol.lead .nm small { color: var(--muted); }
ol.lead .v { font-weight: 700; text-align: right; }
ol.lead .v small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
#bigplays { list-style: none; margin: 0; padding: 0 8px 8px; max-height: 520px; overflow: auto; }
#bigplays li { padding: 6px 6px 6px 9px; border-top: 1px solid var(--line); font-size: 13px; cursor: pointer; border-left: 3px solid transparent; }
#bigplays li:hover { background: var(--panel2); }
#bigplays li .k { font-size: 11px; font-weight: 800; letter-spacing: .06em; }
#bigplays li.td { border-left-color: var(--td); } #bigplays li.td .k { color: var(--td); }
#bigplays li.fg { border-left-color: var(--accent); } #bigplays li.fg .k { color: var(--accent); }
#bigplays li.to { border-left-color: var(--to); } #bigplays li.to .k { color: var(--to); }
#bigplays li.big { border-left-color: var(--big); } #bigplays li.big .k { color: var(--big); }
#bigplays li small { color: var(--muted); }
#bigplays li.none { cursor: default; color: var(--muted); border: 0; }
#bigplays li.passing { transition: opacity .7s ease; }
#bigplays li.gone { opacity: 0; }
.hidden { display: none !important; }

@media (max-width: 1280px) {
  #channels .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  main.wrap { grid-template-columns: 260px minmax(0, 1fr) 270px; }
}
@media (max-width: 1000px) {
  main.wrap { grid-template-columns: minmax(0, 1fr) 280px; }
  #colL { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 12px; }
  .logo { height: 40px; width: 120px; }
  header .wrap { padding-top: 6px; padding-bottom: 6px; gap: 10px; }
  #weekTitle { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  #channels { padding: 10px 0; }
  #channels .tiles { display: flex; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 2px; }
  .ch { min-width: 138px; scroll-snap-align: start; }
  main.wrap { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .col, #colL { display: contents; }
  #featured { order: 1; } #controls { order: 2; } #statsP { order: 3; } #leadP { order: 4; } #bigP { order: 5; }
  .tname { display: none; }
  .board { padding: 12px 12px 6px; }
  .side img, .side .ph { width: 44px; height: 44px; }
  .score { font-size: 28px; }
  .situ { padding: 4px 12px 10px; }
  #feed { padding: 0 6px 10px; }
  .drivehead { padding: 8px 12px 6px; flex-direction: column; gap: 0; }
}
