:root{
  --bg:#151110; --panel:#201a18; --panel2:#2a2320; --line:#3b322e; --ink:#f4ede3; --muted:#b0a498;
  --scarlet:#E41C38; --scarlet-d:#a8132a; --cream:#FDF2D9; --gold:#f2c14e; --good:#5ec27a; --bad:#ff6b6b;
  --focus:#ffd166;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{background:var(--bg);color:var(--ink);font:14px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;display:flex;flex-direction:column;min-height:100vh}
button,select,input{font:inherit;color:inherit}
button{background:var(--panel2);border:1px solid var(--line);border-radius:8px;padding:6px 10px;cursor:pointer}
button:hover:not(:disabled){border-color:#6a5a52;background:#342b27}
button:disabled{opacity:.4;cursor:not-allowed}
button:focus-visible,select:focus-visible,input:focus-visible{outline:2px solid var(--focus);outline-offset:1px}
.top{display:flex;align-items:center;gap:16px;padding:8px 16px;background:linear-gradient(90deg,#3a0b12,#1b1413 70%);border-bottom:2px solid var(--scarlet)}
.top h1{margin:0;font-size:20px;letter-spacing:.5px;white-space:nowrap}
.ver{font-size:12px;font-weight:500;color:var(--cream);background:var(--scarlet-d);border-radius:6px;padding:1px 6px;vertical-align:middle;margin-left:4px}
.top-sub{color:var(--muted);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.top-btns{display:flex;gap:8px}
.layout{flex:1;display:grid;grid-template-columns:300px minmax(0,1fr) 300px;gap:10px;padding:10px;min-height:0}
.side{display:flex;flex-direction:column;gap:10px;min-height:0;overflow:auto}
.card{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:10px}
.card h2{margin:0 0 2px;font-size:16px}
.card h3{margin:0 0 6px;font-size:12px;text-transform:uppercase;letter-spacing:1px;color:var(--muted)}
.muted{color:var(--muted);font-size:12px}
.stage{position:relative;min-height:420px;border-radius:10px;overflow:hidden;border:1px solid var(--line);background:#0d1a10}
#field{position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:grab;display:block}
#field.drag{cursor:grabbing}
.zoomctl{position:absolute;right:10px;bottom:10px;display:flex;flex-direction:column;gap:6px}
.zoomctl button{width:36px;height:36px;padding:0;font-size:18px;background:rgba(20,16,15,.82)}
.zoomctl button.on{border-color:var(--gold);color:var(--gold)}
.fieldnote{position:absolute;left:10px;bottom:10px;font-size:12px;color:#e8f5e8;background:rgba(0,0,0,.45);padding:3px 8px;border-radius:6px;pointer-events:none}
.stamp{position:absolute;left:50%;top:10px;transform:translateX(-50%);max-width:min(560px,92%);background:rgba(18,14,13,.9);border:1px solid var(--line);border-left:4px solid var(--gold);border-radius:8px;padding:8px 12px;opacity:0;transition:opacity .25s;pointer-events:none}
.stamp.show{opacity:1}
.stamp .big{font-size:22px;font-weight:800;letter-spacing:.5px}
.stamp .sub{font-size:12px;color:var(--muted)}
.stamp .txt{font-size:13px}
.stamp.good{border-left-color:var(--good)} .stamp.bad{border-left-color:var(--bad)} .stamp.score{border-left-color:var(--scarlet)}
/* scoreboard */
.sb-row{display:grid;grid-template-columns:10px 1fr auto auto;align-items:center;gap:8px;padding:4px 0}
.sb-sw{width:10px;height:28px;border-radius:3px}
.sb-name{font-weight:700;font-size:15px;line-height:1.1}
.sb-name small{display:block;font-weight:400;color:var(--muted);font-size:11px}
.sb-score{font-size:28px;font-weight:800;font-variant-numeric:tabular-nums;min-width:44px;text-align:right}
.sb-pos{width:14px;color:var(--gold);font-size:14px}
.tos{display:flex;gap:3px;margin-top:2px}
.tos i{width:8px;height:4px;border-radius:2px;background:var(--gold);display:block}
.tos i.used{background:#4a403b}
.sb-status{display:flex;flex-wrap:wrap;gap:2px 10px;justify-content:space-between;align-items:center;border-top:1px solid var(--line);margin-top:6px;padding-top:6px;font-variant-numeric:tabular-nums}
.sb-clock{font-size:20px;font-weight:700}
.sb-clock .run{font-size:10px;color:var(--good);margin-left:4px;vertical-align:middle}
.sb-down{font-weight:700;color:var(--gold);white-space:nowrap}
.sb-venue{font-size:11px;color:var(--muted);margin-top:4px}
.bar{display:grid;grid-template-columns:70px 1fr 28px;align-items:center;gap:6px;font-size:12px;margin:3px 0}
.bar .track{height:8px;background:#3a302c;border-radius:4px;overflow:hidden}
.bar .fill{height:100%;border-radius:4px}
/* tabs */
.tabs-card{flex:1;display:flex;flex-direction:column;min-height:220px}
.tabs{display:flex;gap:4px;margin-bottom:8px;flex-wrap:wrap}
.tab{padding:4px 6px;font-size:11.5px}
.tab.on{background:var(--scarlet-d);border-color:var(--scarlet)}
.tabbody{flex:1;overflow:auto;font-size:12px;min-height:160px;max-height:52vh}
.log-item{padding:4px 0;border-bottom:1px solid #2c2522}
.log-item .meta{color:var(--muted);font-size:11px}
.log-item.score{color:var(--gold)}
.log-item.turnover{color:#ff9a8a}
.log-item.period,.log-item.final{color:var(--cream);font-weight:700}
table.t{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums}
table.t th,table.t td{padding:3px 4px;border-bottom:1px solid #2c2522;text-align:right}
table.t th:first-child,table.t td:first-child{text-align:left}
table.t th{color:var(--muted);font-weight:600}
.w{color:var(--good);font-weight:700}.l{color:var(--bad);font-weight:700}
/* calls */
.calls{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:8px}
.calls .grp{grid-column:1/-1;font-size:11px;text-transform:uppercase;letter-spacing:1px;color:var(--muted);margin-top:4px}
.call{text-align:left;padding:7px 8px;line-height:1.15;position:relative}
.call .k{font-size:10px;color:var(--gold);border:1px solid #5a4b2a;border-radius:4px;padding:0 4px;margin-right:6px}
.call.run{border-left:3px solid #c98b4a}.call.pass{border-left:3px solid #5b9bd5}.call.spec{border-left:3px solid #9a8f86}.call.def{border-left:3px solid var(--scarlet)}
.call.big{grid-column:1/-1;font-size:15px;padding:10px;text-align:center}
.tip{margin-top:8px;min-height:36px;font-size:12px;color:var(--muted)}
.seg{display:flex;gap:4px;margin-bottom:8px}
.seg button{flex:1;font-size:12px;padding:5px 4px}
.seg button.on{background:var(--scarlet-d);border-color:var(--scarlet)}
.wide{width:100%}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.opt{display:flex;align-items:center;gap:8px;margin:5px 0;font-size:13px}
.opt input[type=range]{margin-left:auto;width:120px;accent-color:var(--scarlet)}
.opt select{margin-left:auto;background:var(--panel2);border:1px solid var(--line);border-radius:6px;padding:3px}
.foot{padding:6px 16px 10px;color:#80766d;font-size:11px;text-align:center}
/* modal */
.modal{position:fixed;inset:0;background:rgba(5,3,3,.72);display:flex;align-items:center;justify-content:center;z-index:20;padding:16px}
.modal[hidden]{display:none}
.modal-box{background:var(--panel);border:1px solid var(--line);border-top:4px solid var(--scarlet);border-radius:12px;max-width:720px;width:100%;max-height:92vh;overflow:auto;padding:18px 20px}
.modal-box h2{margin:0 0 4px;font-size:22px}
.modal-box h3{margin:14px 0 6px;font-size:13px;text-transform:uppercase;letter-spacing:1px;color:var(--muted)}
.modal-box p{margin:6px 0}
.choice{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}
.choice label{display:flex;gap:8px;align-items:flex-start;background:var(--panel2);border:1px solid var(--line);border-radius:8px;padding:8px;cursor:pointer}
.choice label:has(input:checked){border-color:var(--scarlet);background:#3a1a1d}
.choice small{display:block;color:var(--muted)}
.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.primary{background:var(--scarlet);border-color:var(--scarlet);font-weight:700;padding:9px 16px}
.primary:hover:not(:disabled){background:#f23551}
.final-score{display:flex;justify-content:center;gap:24px;align-items:center;font-size:40px;font-weight:800;margin:8px 0}
.final-score small{display:block;font-size:13px;font-weight:600;color:var(--muted);text-align:center}
.banner{background:linear-gradient(90deg,#7a0f1f,#3a0b12);border:1px solid var(--scarlet);border-radius:8px;padding:10px;text-align:center;font-weight:700;margin:8px 0}
.kbd{font-family:ui-monospace,monospace;background:#342b27;border-radius:4px;padding:0 4px}
.sched-next{background:#2f1f1e}
@media (max-width:1100px){.layout{grid-template-columns:260px minmax(0,1fr) 260px}}
@media (max-width:900px){
  .layout{display:flex;flex-direction:column}
  .stage{order:1;height:56vh;min-height:320px;flex:none}
  .layout{flex:none}
  .side{flex:none;overflow:visible}
  #controls{order:2}
  #info{order:3}
  .fieldnote{display:none}
  .stamp{top:6px;padding:6px 10px}
  .stamp .big{font-size:18px}
  .top{flex-wrap:wrap;gap:6px 12px;padding:8px 12px}
  .top-sub{order:3;flex-basis:100%}
  .tabbody{max-height:none}
}
@media (max-width:480px){.layout{padding:8px 16px}.calls{grid-template-columns:1fr 1fr}.call{font-size:13px}}
@media (prefers-reduced-motion:reduce){.stamp{transition:none}}
.sb-wx{font-size:11px;color:#cfe3ff;margin-top:3px}
.mo{margin-top:8px}
.mo-lab{display:flex;justify-content:space-between;font-size:11px;color:var(--muted)}
.mo-lab b{color:var(--ink);font-weight:600}
.mo-track{position:relative;height:8px;background:#3a302c;border-radius:4px;margin-top:3px;overflow:hidden}
.mo-fill{position:absolute;top:0;bottom:0;border-radius:4px}
.mo-track i{position:absolute;left:50%;top:-2px;bottom:-2px;width:2px;background:var(--cream);opacity:.6}
.stamp.look{border-left-color:#5b9bd5}
.stamp .sub.read{color:#9fd0ff}
.call.current{outline:1px dashed var(--gold);opacity:.55}
.call.toggle{grid-column:1/-1;text-align:center}
.call.toggle.on{background:#1f3b5a;border-color:#5b9bd5}
.dr{display:grid;grid-template-columns:52px 1fr 70px 42px;gap:6px;align-items:center;font-size:11px;padding:2px 0}
.dr-f{position:relative;height:10px;background:linear-gradient(90deg,#1c3d22,#2a7035 10%,#2a7035 90%,#1c3d22);border-radius:3px}
.dr-b{position:absolute;top:2px;bottom:2px;border-radius:2px;border:1px solid rgba(255,255,255,.5)}
.dr-r{color:var(--muted)}.dr-r.ok{color:var(--gold);font-weight:700}
.dr-n{color:var(--muted);text-align:right;font-variant-numeric:tabular-nums}
.dr-key{display:flex;justify-content:space-between;font-size:10px;color:var(--muted);margin:0 48px 2px 58px}
.call .star{color:var(--gold);font-size:11px}
.call.installed{box-shadow:inset 0 0 0 1px rgba(242,193,78,.35)}
.inst{font-size:11px;color:var(--muted);margin-top:6px}.inst b{color:var(--ink)}
.inj{font-size:11px;color:#ff9a8a;margin-top:4px}

/* v1.3: development, Heisman watch */
.rat { font-variant-numeric: tabular-nums; color: var(--muted, #8a8f98); margin-left: 2px; }
.rat .up { color: #3fae5a; font-weight: 700; }
.xpbar { display: inline-block; vertical-align: middle; width: 26px; height: 4px; border-radius: 2px; background: rgba(127,127,127,.25); margin-left: 4px; overflow: hidden; }
.xpbar > span { display: block; height: 100%; background: #3fae5a; }
.heis-line { text-align: left; font-size: 11px; color: var(--muted); font-weight: 400; }
table.t.heis td:first-child { text-align: left; }
.heis-win { font-size: 15px; }
.heis-banner { background: linear-gradient(90deg, #7a5c00, #c9a227); color: #fff; }
.dev-news { background: rgba(63,174,90,.12); border-left: 3px solid #3fae5a; padding: 6px 8px; border-radius: 4px; }

/* v1.4: win probability, fourth-down card, defense */
.wp { margin-top: 6px; }
.wp-svg { display: block; border-radius: 3px; margin-top: 2px; }
.wp-line { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.wp-mid { stroke: rgba(255,255,255,.35); stroke-dasharray: 3 3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.wp-q { stroke: rgba(255,255,255,.15); stroke-width: 1; vector-effect: non-scaling-stroke; }
.potg { background: rgba(201,162,39,.12); border-left: 3px solid #c9a227; padding: 6px 8px; border-radius: 4px; font-size: 13px; }
.fourth { grid-column: 1 / -1; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 12px; }
.fourth-h { font-weight: 700; margin-bottom: 3px; } .fourth-h small { font-weight: 400; color: var(--muted); }
.fourth > div:not(.fourth-h):not(.fourth-note) { display: flex; justify-content: space-between; padding: 2px 4px; border-radius: 3px; }
.fourth small { color: var(--muted); }
.fourth .best { background: rgba(63,174,90,.2); outline: 1px solid #3fae5a; }
.fourth-note { color: var(--muted); margin-top: 3px; }
.call.advised { outline: 2px solid #3fae5a; outline-offset: -2px; }
tr.depth-split td { text-align: left !important; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding-top: 8px; }

/* v1.5: trick plays, trophy case */
.call.fake { border-style: dashed; }
.ach-new { background: rgba(201,162,39,.14); border-left: 3px solid #c9a227; padding: 6px 8px; border-radius: 4px; margin: 6px 0; font-size: 13px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; margin: 8px 0; }
.ach { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; opacity: .55; }
.ach.got { opacity: 1; border-color: #c9a227; background: rgba(201,162,39,.08); }
.ach b { display: block; font-size: 13px; } .ach small { display: block; color: var(--muted); font-size: 11px; }
.ach .ach-when { color: #c9a227; }

/* v1.6: the Husker Beat, playoff bracket */
.beat { border: 1px solid var(--line); border-top: 3px solid #e41c38; border-radius: 6px; padding: 8px 10px; margin: 8px 0; background: var(--panel2); }
.beat-mast { font-family: Georgia, 'Times New Roman', serif; font-weight: 700; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.beat-mast small { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.beat-head { font-family: Georgia, 'Times New Roman', serif; font-size: 20px; font-weight: 700; margin: 2px 0 4px; }
.beat ul { margin: 0; padding-left: 18px; font-size: 13px; } .beat li { margin: 1px 0; }
.bracket { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; font-size: 11px; }
.bk-col { display: flex; flex-direction: column; justify-content: space-around; gap: 6px; }
.bk-h { color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: 1px; }
.bk-g { border: 1px solid var(--line); border-radius: 4px; padding: 3px 4px; background: var(--panel2); }
.bk-g > div { display: flex; gap: 3px; align-items: baseline; white-space: nowrap; overflow: hidden; }
.bk-g small { color: var(--muted); min-width: 12px; }
.bk-w { font-weight: 700; } .bk-neb { color: #ff5a6e; }
.bk-s, .bk-l { color: var(--muted); font-size: 10px; }
