:root {
  --bg: #07090d;
  --panel: #11151d;
  --panel2: #171c26;
  --line: #232a37;
  --text: #f3f5f9;
  --muted: #8a93a6;
  --dim: #5b6476;
  --red: #e10600;
  --green: #2fd16f;
  --yellow: #ffd400;
  --purple: #b36bff;
  --soft: #ff3b3b;
  --medium: #ffd21f;
  --hard: #eef0f3;
  --inter: #3ccf4e;
  --wet: #2f8cff;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Titillium Web", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #1b1f27; color: var(--text); font-family: var(--sans); }
body { background: radial-gradient(1200px 700px at 50% 20%, #2a303b 0%, #14171d 70%); }
button { font: inherit; color: inherit; }

/* ---------- demo page: device frame + controls ---------- */
#page { min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: 24px 16px 20px; gap: 18px; }
#devwrap { position: relative; }
#device {
  position: absolute; top: 0; left: 0; transform-origin: 0 0;
  width: 1360px; height: 880px; padding: 40px; border-radius: 34px;
  background: linear-gradient(145deg, #2a2e35, #101215 60%);
  box-shadow: 0 0 0 2px #3a3f48 inset, 0 30px 80px rgba(0,0,0,.55), 0 4px 14px rgba(0,0,0,.4);
}
.cam { position: absolute; top: 17px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #0a0c10; box-shadow: 0 0 0 2px #22262d; }
#controls { width: min(1000px, 100%); background: rgba(10,12,16,.75); border: 1px solid #2b313c; border-radius: 14px; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.ctl-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ctl-label { color: var(--muted); font-size: 14px; letter-spacing: .04em; }
.ctl-note { margin: 0; color: var(--dim); font-size: 13px; }
.ctl-note code { color: var(--muted); }
.seg { display: inline-flex; background: #171b23; border: 1px solid #2b313c; border-radius: 10px; padding: 3px; }
.seg button { background: none; border: 0; padding: 6px 14px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 15px; }
.seg button.on { background: var(--red); color: #fff; }
.seg button:focus-visible, .iconbtn:focus-visible, #scrub:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.iconbtn { background: #171b23; border: 1px solid #2b313c; border-radius: 10px; width: 42px; height: 36px; cursor: pointer; font-size: 14px; }
#scrub { flex: 1; min-width: 200px; accent-color: var(--red); }
.mono { font-family: var(--mono); }

/* kiosk: just the screen, scaled to the display */
body.kiosk { background: #000; overflow: hidden; }
body.kiosk #page { padding: 0; display: block; }
body.kiosk #controls, body.kiosk .cam { display: none; }
body.kiosk #device { padding: 0; border-radius: 0; background: none; box-shadow: none; width: 1280px; height: 800px; }

/* ---------- the 1280x800 screen ---------- */
.screen {
  position: relative; width: 1280px; height: 800px; overflow: hidden; border-radius: 6px;
  background: var(--bg); color: var(--text);
  font-variant-numeric: tabular-nums;
  --flag: transparent;
}
body.kiosk .screen { border-radius: 0; }
.screen::after { /* flag glow around the whole display */
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 5px var(--flag), inset 0 0 60px -10px var(--flag);
  transition: box-shadow .4s;
}
.screen.f-YELLOW, .screen.f-SC, .screen.f-VSC, .screen.f-SC_ENDING, .screen.f-VSC_ENDING { --flag: var(--yellow); }
.screen.f-RED { --flag: var(--red); }
.boot { height: 100%; display: grid; place-content: center; text-align: center; }
.boot-mark { font-weight: 900; font-size: 64px; letter-spacing: .12em; }
.boot-mark::first-letter { color: var(--red); }
.boot-sub { color: var(--muted); font-size: 20px; }

/* header */
.hdr { height: 76px; display: flex; align-items: center; gap: 18px; padding: 0 26px; background: linear-gradient(180deg, #121722, #0b0e14); border-bottom: 1px solid var(--line); position: relative; }
.hdr::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--red); }
.hdr-title { display: flex; flex-direction: column; line-height: 1.02; min-width: 0; }
.hdr-event { font-size: 30px; font-weight: 900; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 560px; }
.hdr-sub { font-size: 16px; color: var(--muted); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.hdr-mid { margin-left: auto; display: flex; align-items: baseline; gap: 10px; }
.lapword { font-size: 16px; color: var(--muted); font-weight: 700; letter-spacing: .12em; }
.lapnum { font-size: 46px; font-weight: 900; line-height: 1; }
.lapof { font-size: 24px; color: var(--muted); font-weight: 700; }
.hdr-right { display: flex; align-items: center; gap: 16px; margin-left: 26px; }
.clock { font-family: var(--mono); font-size: 22px; color: var(--muted); }
.pill { padding: 8px 16px; border-radius: 8px; font-weight: 900; font-size: 18px; letter-spacing: .08em; white-space: nowrap; }
.pill.GREEN { background: rgba(47,209,111,.15); color: var(--green); box-shadow: inset 0 0 0 2px rgba(47,209,111,.5); }
.pill.YELLOW, .pill.SC, .pill.VSC, .pill.SC_ENDING, .pill.VSC_ENDING { background: var(--yellow); color: #111; }
.pill.RED { background: var(--red); color: #fff; }
.pill.CHEQUERED { background: repeating-conic-gradient(#fff 0 25%, #111 0 50%) 0 0 / 16px 16px; color: #fff; text-shadow: 0 0 4px #000, 0 0 2px #000; box-shadow: inset 0 0 0 2px #fff; }
.pill.REPLAY { background: #232a37; color: var(--muted); font-size: 14px; }
.pill.LIVE { background: var(--red); color: #fff; font-size: 14px; }

.body { height: 724px; padding: 12px 16px 14px; display: flex; gap: 14px; }

/* timing tower */
.tower { width: 812px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.trow { display: grid; grid-template-columns: 46px 40px 6px 1fr 102px 90px 104px 104px 70px 34px; align-items: center; column-gap: 8px; padding: 0 12px 0 6px; }
.thead { height: 28px; font-size: 12px; font-weight: 700; color: var(--dim); letter-spacing: .12em; border-bottom: 1px solid var(--line); background: #0d1118; }
.thead .r { text-align: right; }
.tbody { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.tbody .trow { flex: 1 1 0; min-height: 0; border-bottom: 1px solid #1a202b; font-size: 19px; line-height: 1.1; }
.tbody .trow > * { min-height: 0; }
.tbody .trow:nth-child(even) { background: rgba(255,255,255,.018); }
.tbody .trow:last-child { border-bottom: 0; }
.pos { text-align: center; font-weight: 900; font-size: 20px; }
.chg { font-size: 13px; font-weight: 700; text-align: left; }
.chg.up { color: var(--green); } .chg.dn { color: #ff5a52; } .chg.eq { color: var(--dim); }
.bar { height: 70%; border-radius: 3px; }
.drv { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.drv b { font-weight: 900; font-size: 21px; letter-spacing: .03em; }
.drv span { color: var(--muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t { font-family: var(--mono); font-size: 17px; text-align: right; color: #d9dee8; }
.t.lead { color: var(--muted); font-family: var(--sans); font-weight: 700; font-size: 15px; letter-spacing: .08em; }
.t.pb { color: var(--green); } .t.fl { color: var(--purple); }
.t.dim { color: var(--dim); }
.tyre { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.tyre i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 13px; border: 3px solid currentColor; color: var(--muted); background: #0b0e14; }
.tyre i.SOFT { color: var(--soft); } .tyre i.MEDIUM { color: var(--medium); } .tyre i.HARD { color: var(--hard); }
.tyre i.INTERMEDIATE { color: var(--inter); } .tyre i.WET { color: var(--wet); }
.tyre em { font-style: normal; font-family: var(--mono); font-size: 14px; color: var(--muted); min-width: 20px; text-align: right; }
.pits { text-align: center; font-family: var(--mono); font-size: 15px; color: var(--muted); }
.trow.out { opacity: .4; }
.trow.inpit .drv b::after { content: "PIT"; margin-left: 8px; font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #fff; color: #000; vertical-align: 3px; letter-spacing: .1em; }
.trow.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: rgba(47,209,111,.25); } to { background: transparent; } }

/* side column */
.side { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.card h3 { margin: 0 0 8px; font-size: 13px; letter-spacing: .16em; color: var(--dim); font-weight: 700; text-transform: uppercase; }
.status { padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.status .flagbox { width: 58px; height: 42px; border-radius: 6px; flex: none; }
.status .flagbox.GREEN { background: var(--green); }
.status .flagbox.YELLOW, .status .flagbox.SC, .status .flagbox.VSC, .status .flagbox.SC_ENDING, .status .flagbox.VSC_ENDING { background: var(--yellow); }
.status .flagbox.RED { background: var(--red); }
.status .flagbox.CHEQUERED { background: repeating-conic-gradient(#fff 0 25%, #111 0 50%) 0 0 / 14px 14px; }
.status .st-main { font-size: 26px; font-weight: 900; line-height: 1; }
.status .st-sub { color: var(--muted); font-size: 15px; margin-top: 4px; }
.fl { display: flex; align-items: center; gap: 12px; }
.fl .bar { width: 6px; height: 38px; }
.fl .who { font-size: 24px; font-weight: 900; }
.fl .time { margin-left: auto; font-family: var(--mono); font-size: 26px; color: var(--purple); }
.rc { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.rc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.rc li { display: grid; grid-template-columns: 46px 1fr; gap: 10px; font-size: 15px; line-height: 1.25; padding-bottom: 8px; border-bottom: 1px solid #1a202b; }
.rc li:last-child { border-bottom: 0; }
.rc .lp { font-family: var(--mono); color: var(--dim); font-size: 13px; padding-top: 2px; }
.rc li.f-YELLOW .tx, .rc li.f-DOUBLE.YELLOW .tx, .rc li.c-SafetyCar .tx { color: var(--yellow); }
.rc li.f-RED .tx { color: #ff6b63; }
.rc li.f-GREEN .tx { color: var(--green); }
.rc li.c-Other .tx { color: #c7cdd9; }
.wx { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.wx div { display: flex; flex-direction: column; }
.wx b { font-size: 24px; font-weight: 700; }
.wx span { font-size: 12px; color: var(--dim); letter-spacing: .12em; text-transform: uppercase; }

/* pre-race */
.pre-left { width: 812px; display: flex; flex-direction: column; gap: 14px; }
.hero { background: linear-gradient(135deg, #1b0f12 0%, #11151d 55%); border: 1px solid var(--line); border-radius: 12px; padding: 22px 26px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 26px solid rgba(225,6,0,.12); }
.kicker { color: var(--red); font-weight: 900; letter-spacing: .2em; font-size: 15px; }
.hero h1 { margin: 4px 0 0; font-size: 46px; line-height: 1.02; font-weight: 900; text-transform: uppercase; }
.hero .where { color: var(--muted); font-size: 19px; margin-top: 4px; }
.count { display: flex; gap: 14px; margin-top: 18px; align-items: flex-end; }
.count .u { background: #0b0e14; border: 1px solid var(--line); border-radius: 10px; width: 118px; padding: 8px 0 6px; text-align: center; }
.count .u b { display: block; font-family: var(--mono); font-size: 56px; line-height: 1; }
.count .u span { font-size: 12px; letter-spacing: .2em; color: var(--dim); }
.count .to { margin-left: 8px; color: var(--muted); font-size: 18px; line-height: 1.25; padding-bottom: 6px; }
.count .to strong { color: var(--text); display: block; font-size: 24px; }
.sched { flex: 1; min-height: 0; }
.sched ul { list-style: none; margin: 0; padding: 0; }
.sched li { display: grid; grid-template-columns: 1fr 160px 140px; align-items: center; padding: 9px 4px; border-bottom: 1px solid #1a202b; font-size: 19px; }
.sched li:last-child { border-bottom: 0; }
.sched li .nm { font-weight: 700; }
.sched li .dy { color: var(--muted); }
.sched li .tm { text-align: right; font-family: var(--mono); font-size: 18px; }
.sched li.done { color: var(--dim); } .sched li.done .dy, .sched li.done .tm { color: var(--dim); }
.sched li.next { color: #fff; } .sched li.next .nm::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 10px; vertical-align: 3px; }
.sched li.race .nm { color: var(--red); }
.lastrace { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.lastrace .lbl { color: var(--dim); font-size: 13px; letter-spacing: .14em; font-weight: 700; }
.lastrace .pod { display: flex; gap: 16px; margin-left: auto; font-size: 18px; }
.lastrace .pod span { display: flex; align-items: center; gap: 6px; }
.lastrace .pod i { width: 4px; height: 20px; border-radius: 2px; display: inline-block; }
.notice { background: rgba(255,212,0,.08); border: 1px solid rgba(255,212,0,.35); color: #ffe680; border-radius: 10px; padding: 10px 14px; font-size: 15px; }

/* standings */
.stand { display: flex; flex-direction: column; min-height: 0; }
.stand ol { list-style: none; margin: 0; padding: 0; }
.stand li { display: grid; grid-template-columns: 28px 5px 1fr auto; gap: 10px; align-items: center; padding: 4px 0; font-size: 18px; border-bottom: 1px solid #1a202b; }
.stand li:last-child { border-bottom: 0; }
.stand li .p { color: var(--muted); font-weight: 700; text-align: right; }
.stand li .c { height: 20px; border-radius: 2px; }
.stand li .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stand li .n b { font-weight: 700; }
.stand li .n small { color: var(--dim); font-size: 14px; margin-left: 6px; }
.stand li .pts { font-family: var(--mono); font-size: 17px; }
.stand.compact li { font-size: 16px; padding: 2px 0; }
.stand.compact li .c { height: 16px; }
.stand.compact li .pts { font-size: 15px; }

/* results */
.res .trow { grid-template-columns: 46px 40px 6px 1fr 190px 130px 60px; }
.res .tbody .trow { font-size: 18px; }
.team { color: var(--muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pts { text-align: right; font-family: var(--mono); font-weight: 700; }
.pts.z { color: var(--dim); font-weight: 500; }
.p1 .pos { color: #ffd76a; } .p2 .pos { color: #d6dbe4; } .p3 .pos { color: #e0a36a; }
.champ { background: linear-gradient(135deg, #2a2108, #11151d 70%); border-color: #5a4a14; }
.champ .kicker { color: #ffd76a; }
.champ .cname { font-size: 38px; font-weight: 900; line-height: 1.05; text-transform: uppercase; margin-top: 4px; }
.champ .cline { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 17px; margin-top: 4px; }
.champ .cline i { width: 5px; height: 18px; border-radius: 2px; }
.champ .cteam { margin-top: 10px; padding-top: 10px; border-top: 1px solid #3a3216; font-size: 18px; }
.champ .cteam b { font-weight: 900; }
.nextmini { display: flex; align-items: center; gap: 12px; }
.nextmini .nm { font-weight: 900; font-size: 20px; text-transform: uppercase; line-height: 1.1; }
.nextmini .sub { color: var(--muted); font-size: 15px; }
.nextmini .cd { margin-left: auto; font-family: var(--mono); font-size: 24px; text-align: right; }
.nextmini .cd small { display: block; font-family: var(--sans); color: var(--dim); font-size: 12px; letter-spacing: .14em; }

/* ======================= MLS ======================= */
.m-body { flex-direction: column; gap: 12px; }
.m-badge { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 900; font-size: 28px; letter-spacing: .04em; }
.m-badge.sm { width: 64px; height: 64px; font-size: 19px; }
.m-board { height: 190px; display: grid; grid-template-columns: 1fr 300px 1fr; align-items: center; padding: 18px 26px; background: linear-gradient(90deg, rgba(255,255,255,.03), transparent 30%, transparent 70%, rgba(255,255,255,.03)), var(--panel); }
.m-team { display: flex; align-items: center; gap: 22px; min-width: 0; }
.m-team.away { justify-content: flex-end; text-align: right; }
.m-tinfo { min-width: 0; }
.m-tname { font-size: 30px; font-weight: 900; text-transform: uppercase; line-height: 1.05; }
.m-scorers { list-style: none; margin: 8px 0 0; padding: 0; color: #c9cfdb; font-size: 17px; line-height: 1.45; }
.m-scorers b { color: var(--muted); font-weight: 600; font-family: var(--mono); font-size: 15px; }
.m-scorers small { color: var(--muted); }
.m-scorers .ball { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: #fff; margin-right: 8px; box-shadow: inset -2px -2px 0 #9aa3b5; vertical-align: 0; }
.m-team.away .m-scorers .ball { margin: 0 0 0 8px; float: none; }
.m-scorers .rc { display: inline-block; width: 9px; height: 13px; border-radius: 2px; background: var(--red); margin-right: 8px; vertical-align: -1px; }
.m-mid { text-align: center; }
.m-sc { display: flex; justify-content: center; align-items: center; gap: 18px; font-weight: 900; font-size: 104px; line-height: .95; }
.m-sc em { font-style: normal; color: var(--dim); font-size: 70px; }
.m-clock { margin-top: 6px; display: inline-block; padding: 4px 16px; border-radius: 999px; background: #0b0e14; border: 1px solid var(--line); font-family: var(--mono); font-size: 22px; color: var(--muted); }
.m-clock.on { color: #fff; border-color: rgba(225,6,0,.6); box-shadow: 0 0 0 3px rgba(225,6,0,.15); }

.m-tl { height: 84px; position: relative; padding: 0 22px 0 92px; display: flex; align-items: center; }
.m-tl-lbl { position: absolute; left: 18px; font-size: 14px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.m-tl-lbl i { width: 10px; height: 10px; border-radius: 2px; }
.m-tl-lbl.home { top: 14px; } .m-tl-lbl.away { bottom: 14px; }
.m-tl-track { position: relative; flex: 1; height: 6px; background: #232a37; border-radius: 3px; }
.m-tl-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #6b7385, #f3f5f9); border-radius: 3px; transition: width .8s linear; }
.m-tl-track .ht { position: absolute; top: -8px; bottom: -8px; width: 2px; background: var(--dim); }
.m-tl-track .tk { position: absolute; top: 12px; transform: translateX(-50%); font-family: var(--mono); font-size: 11px; color: var(--dim); }
.m-tl-track .tk:first-of-type { transform: none; }
.tm { position: absolute; transform: translateX(-50%); }
.tm.home { bottom: 12px; } .tm.away { top: 26px; }
.tm.goal { width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--tc), inset -3px -3px 0 #9aa3b5; }
.tm.yc { width: 10px; height: 14px; border-radius: 2px; background: var(--yellow); }
.tm.rc { width: 10px; height: 14px; border-radius: 2px; background: var(--red); }
.tm.sub { width: 4px; height: 12px; border-radius: 2px; background: var(--tc); opacity: .85; }
.tm.away.goal { top: 22px; }

.m-row { flex: 1; min-height: 0; display: grid; grid-template-columns: 372px 1fr 390px; gap: 12px; }
.m-stats { display: flex; flex-direction: column; gap: 7px; }
.m-stat-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; color: var(--muted); }
.m-stat-top b { color: var(--text); font-size: 19px; font-family: var(--mono); font-weight: 700; min-width: 44px; }
.m-stat-top b:last-child { text-align: right; }
.m-stat-bar { display: flex; gap: 3px; height: 6px; }
.m-stat-bar i { display: block; height: 100%; border-radius: 3px; min-width: 2px; }
.m-pitch { display: flex; flex-direction: column; }
.m-pitch svg { flex: 1; min-height: 0; width: 100%; }
.m-dir { float: right; color: var(--dim); letter-spacing: .08em; }
.m-legend { display: flex; gap: 16px; justify-content: center; font-size: 13px; color: var(--muted); margin-top: 4px; }
.m-legend span { display: flex; align-items: center; gap: 6px; }
.lg { width: 11px; height: 11px; border-radius: 50%; display: inline-block; font-style: normal; }
.lg.goal { background: #fff; box-shadow: 0 0 0 2px #888; } .lg.on { background: #c9cfdb; } .lg.off { border: 2px solid #c9cfdb; }
.lg.block { width: auto; height: auto; color: #c9cfdb; font-weight: 700; }
.m-feed { overflow: hidden; display: flex; flex-direction: column; }
.m-feed ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; overflow: hidden; }
.m-feed li { display: grid; grid-template-columns: 52px 1fr; gap: 8px; font-size: 15px; line-height: 1.28; padding-bottom: 7px; border-bottom: 1px solid #1a202b; }
.m-feed li:last-child { border-bottom: 0; }
.m-feed .mn { font-family: var(--mono); color: var(--dim); font-size: 13px; padding-top: 2px; }
.m-feed li.goal .tx { color: #fff; font-weight: 700; }
.m-feed li.goal .mn { color: var(--green); }
.m-feed li.yc .tx { color: var(--yellow); }
.m-feed li.rc .tx { color: #ff6b63; }
.m-feed li.sub .tx { color: #aeb6c6; }

/* pre-match */
.m-hero h1 { font-size: 40px; }
.m-vs { display: flex; align-items: center; gap: 18px; margin-top: 10px; }
.m-vs-txt { flex: 1; min-width: 0; }
.m-formcard .m-forms { display: flex; gap: 10px; }
.m-form { flex: 1; border-radius: 10px; padding: 10px 8px; text-align: center; background: #0b0e14; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.m-form b { font-size: 28px; font-weight: 900; line-height: 1; }
.m-form span { font-family: var(--mono); font-size: 18px; }
.m-form small { color: var(--muted); font-size: 14px; }
.m-form.W b { color: var(--green); } .m-form.L b { color: #ff5a52; } .m-form.D b { color: var(--muted); }
.m-form.W { border-color: rgba(47,209,111,.35); } .m-form.L { border-color: rgba(255,90,82,.3); }
.m-last { flex: 1; }
.m-last-row { display: flex; align-items: center; gap: 14px; font-size: 22px; }
.m-last-row b { font-size: 30px; font-weight: 900; }
.m-res { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; font-size: 18px; color: #000; }
.m-res.W { background: var(--green); } .m-res.L { background: #ff5a52; } .m-res.D { background: var(--muted); }
.m-last-sc { margin-top: 8px; color: var(--muted); font-size: 16px; }
.m-table { flex: 1; display: flex; flex-direction: column; min-height: 0; padding-bottom: 8px; }
.m-trow { display: grid; grid-template-columns: 26px 5px 1fr 36px 44px 40px; gap: 9px; align-items: center; font-size: 16px; padding: 3px 4px; border-bottom: 1px solid #1a202b; }
.m-trow:last-child { border-bottom: 0; }
.m-trow span:nth-child(n+4), .m-trow b { text-align: right; font-family: var(--mono); font-size: 14px; }
.m-trow b { font-size: 16px; }
.m-trow i { height: 16px; border-radius: 2px; }
.m-trow .rk { text-align: right; color: var(--muted); font-weight: 700; }
.m-trow.po .rk { color: var(--green); }
.m-trow .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-trow.me { background: rgba(225,6,0,.14); border-radius: 6px; font-weight: 700; }
.m-thead { font-size: 11px !important; color: var(--dim); letter-spacing: .12em; font-weight: 700; }
.m-thead span { font-family: var(--sans) !important; font-size: 11px !important; }
#sportseg button.on { background: #f3f5f9; color: #111; }

.m-screen .hdr-event { max-width: 820px; font-size: 28px; }

/* ---------- NHL (Bruins) ---------- */
.n-screen .hdr::before { background: #ffb81c; }
.n-screen .kicker { color: #ffb81c; }
.n-screen .hero { background: linear-gradient(135deg, #1a160b 0%, #11151d 55%); }
.n-screen .hero::after { border-color: rgba(255,184,28,.1); }
.n-screen .m-clock.on { border-color: rgba(255,184,28,.6); box-shadow: 0 0 0 3px rgba(255,184,28,.15); }
.n-goals { font-size: 16px; line-height: 1.35; max-height: 116px; overflow: hidden; }
.n-goals.many { columns: 2; column-gap: 14px; font-size: 14px; }
.n-goals li { break-inside: avoid; white-space: nowrap; }
.n-goals b { font-size: 13px; }
.n-goals .puck { display: inline-block; width: 12px; height: 6px; border-radius: 50%; background: #e9edf4; margin-right: 8px; vertical-align: 2px; box-shadow: 0 2px 0 #6b7385; }
.m-team.away .n-goals .puck { margin: 0 8px 0 0; }
.n-goals .st { font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 1px 5px; border-radius: 4px; background: #232a37; color: var(--muted); }
.n-goals .st.PP { color: #ffb81c; } .n-goals .st.SH { color: #7fd3ff; } .n-goals .st.EN { color: #c9cfdb; }
.n-str { margin: 8px auto 0; display: table; font-size: 14px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; padding: 3px 12px; border-radius: 6px; color: #111; background: var(--tc); animation: npulse 1.6s ease-in-out infinite; }
.n-str.EN { background: #e9edf4; }
@keyframes npulse { 50% { opacity: .65; } }
.n-so { margin-top: 6px; color: var(--muted); font-family: var(--mono); font-size: 15px; }

.n-tl { height: 100px; }
.n-tl .m-tl-track { margin-right: 120px; }
.n-tl .tk.mid { top: 33px; transform: translateX(-50%); letter-spacing: .14em; font-size: 10px; text-transform: uppercase; }
.n-tl .gl { position: absolute; width: 16px; height: 9px; border-radius: 50%; background: #e9edf4; transform: translateX(-50%); box-shadow: 0 0 0 3px var(--tc), 0 2px 0 3px #000; z-index: 2; }
.n-tl .gl.away { top: -24px; } .n-tl .gl.home { bottom: -24px; }
.n-tl .pen { position: absolute; height: 5px; border-radius: 3px; background: var(--tc); opacity: .55; }
.n-tl .pen.away { top: -10px; } .n-tl .pen.home { bottom: -10px; }
.n-tl-key { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.n-tl-key span { display: flex; align-items: center; gap: 7px; }
.n-tl-key .k-gl { width: 12px; height: 7px; border-radius: 50%; background: #e9edf4; box-shadow: 0 0 0 2px #6b7385; }
.n-tl-key .k-pen { width: 16px; height: 5px; border-radius: 3px; background: #6b7385; }

.n-row { grid-template-columns: 372px 1fr 390px; }
.n-stats { gap: 5px; }
.n-ls { margin-bottom: 6px; }
.n-ls-row { display: grid; grid-template-columns: 1fr repeat(var(--n), 34px) 40px 46px; align-items: center; font-family: var(--mono); font-size: 17px; padding: 3px 0; border-bottom: 1px solid #1a202b; text-align: center; }
.n-ls-row:last-child { border-bottom: 0; }
.n-ls-row .ab { text-align: left; font-family: var(--sans); font-weight: 900; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.n-ls-row .ab i { width: 5px; height: 18px; border-radius: 2px; }
.n-ls-row b { font-size: 20px; }
.n-ls-row .sog { color: var(--muted); }
.n-ls-head { font-family: var(--sans); font-size: 11px; color: var(--dim); letter-spacing: .12em; font-weight: 700; }
.n-stats .m-stat-top b { font-size: 17px; }

.n-feed li { grid-template-columns: 80px 1fr; font-size: 14.5px; }
.n-feed .mn { white-space: nowrap; }
.n-feed li.goal .tx { color: #fff; font-weight: 700; } .n-feed li.goal .mn { color: #ffb81c; }
.n-feed li.pen .tx { color: #ffb0a8; }
.n-feed li.period .tx { color: var(--muted); font-style: italic; }
.n-feed li.hit .tx, .n-feed li.block .tx, .n-feed li.miss .tx { color: #aeb6c6; }
.n-feed h3 + .n-stars { margin-bottom: 10px; }
.n-stars { display: flex; flex-direction: column; gap: 6px; }
.n-star { display: grid; grid-template-columns: 46px 5px 1fr auto; gap: 9px; align-items: center; font-size: 17px; background: #0b0e14; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.n-star .n-sn { color: #ffb81c; letter-spacing: -.05em; font-size: 14px; }
.n-star i { height: 18px; border-radius: 2px; }
.n-star .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-star .ln { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.m-last .n-stars { margin-top: 10px; }

.n-table h3.n-wc { margin-top: 14px; }
.n-trow { display: grid; grid-template-columns: 38px 5px 1fr 32px 32px 32px 32px 40px; gap: 8px; align-items: center; font-size: 16px; padding: 4px 4px; border-bottom: 1px solid #1a202b; }
.n-trow span:nth-child(n+4), .n-trow b { text-align: right; font-family: var(--mono); font-size: 14px; }
.n-trow b { font-size: 16px; }
.n-trow i { height: 16px; border-radius: 2px; }
.n-trow .rk { text-align: right; color: var(--muted); font-weight: 700; font-size: 14px; }
.n-trow .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-trow.me { background: rgba(255,184,28,.14); border-radius: 6px; font-weight: 700; }
.n-trow.cut { border-bottom: 2px dashed #3a4354; }
.m-form.D b { color: #c9cfdb; }
.n-screen .pre-left > * { flex-shrink: 0; }
.n-screen .pre-left > .m-last { flex: 1 1 auto; min-height: 0; }
.m-last .n-stars { flex-direction: row; }
.m-last .n-star { flex: 1; grid-template-columns: auto 5px 1fr; row-gap: 0; font-size: 16px; }
.m-last .n-star .ln { grid-column: 3; }
.n-board { grid-template-columns: 1fr 270px 1fr; }
.n-goals.many { font-size: 13.5px; column-gap: 12px; }
.n-goals.many .st { font-size: 9px; padding: 0 3px; }
.n-goals.many .puck { margin-right: 5px; }

/* ---------- MLB (Red Sox) ---------- */
.b-screen .hero { background: linear-gradient(135deg, #0d1424 0%, #11151d 55%); }
.b-screen .hero::after { border-color: rgba(189,48,57,.13); }
.b-board { height: 168px; }
.b-rec { margin-top: 6px; color: var(--muted); font-family: var(--mono); font-size: 18px; }
.b-ls { padding: 10px 18px; }
.b-ls-row { display: grid; grid-template-columns: 1fr repeat(var(--n), 44px) 54px 44px 44px; align-items: center; text-align: center; font-family: var(--mono); font-size: 21px; padding: 3px 0; border-bottom: 1px solid #1a202b; }
.b-ls-row:last-child { border-bottom: 0; }
.b-ls-row .ab { text-align: left; font-family: var(--sans); font-weight: 900; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.b-ls-row .ab i { width: 6px; height: 20px; border-radius: 2px; }
.b-ls-row .r { color: #fff; font-weight: 700; }
.b-ls-row span { color: #aeb6c6; }
.b-ls-row .now { background: rgba(225,6,0,.16); border-radius: 6px; color: #fff; }
.b-ls-row b { font-size: 24px; border-left: 1px solid var(--line); }
.b-ls-row .t { color: var(--muted); }
.b-ls-head { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--dim); }
.b-ls-head span { color: var(--dim); }
.b-row { grid-template-columns: 372px 1fr 390px; }
.b-atbat { display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.b-sit { display: flex; align-items: center; gap: 18px; }
.b-diamond { width: 128px; height: 95px; flex: none; }
.b-diamond rect { fill: #0b0e14; stroke: #5b6476; stroke-width: 2; }
.b-diamond rect.on { fill: #ffd400; stroke: #ffd400; filter: drop-shadow(0 0 6px rgba(255,212,0,.6)); }
.b-diamond .hp { fill: #c9cfdb; }
.b-count { display: flex; flex-direction: column; gap: 6px; }
.b-count div { display: flex; align-items: center; gap: 7px; }
.b-count span { width: 18px; font-weight: 900; color: var(--muted); font-size: 17px; }
.b-count i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #3a4354; }
.b-count i.on.b { background: var(--green); border-color: var(--green); }
.b-count i.on.s { background: #ff5a52; border-color: #ff5a52; }
.b-count i.on.o { background: #ffd400; border-color: #ffd400; }
.b-runners { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; color: #c9cfdb; }
.b-runners b { color: #ffd400; font-family: var(--mono); font-size: 12px; }
.b-match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.b-match div { background: #0b0e14; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-width: 0; }
.b-match small { display: block; font-size: 10px; letter-spacing: .14em; color: var(--dim); font-weight: 700; }
.b-match b { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-match em { font-style: normal; color: var(--muted); font-size: 13px; font-family: var(--mono); }
.b-result { font-size: 14px; color: #fff; line-height: 1.3; }
.b-pitches { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.b-pitches li { display: grid; grid-template-columns: 22px 1fr 44px 128px; gap: 6px; align-items: center; font-size: 14px; }
.b-pitches .pn { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #000; }
.b-pitches li.bl .pn { background: var(--green); } .b-pitches li.st .pn { background: #ff5a52; } .b-pitches li.ip .pn { background: #4aa3ff; }
.b-pitches .mph { font-family: var(--mono); color: var(--muted); font-size: 13px; text-align: right; }
.b-pitches .pc { color: #c9cfdb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.b-break { color: var(--muted); font-size: 22px; font-weight: 700; padding: 10px 0; }
.b-mid { display: flex; flex-direction: column; min-width: 0; }
.b-mid-in { flex: 1; min-height: 0; display: flex; gap: 10px; }
.b-zone { width: 46%; display: flex; flex-direction: column; }
.b-zone svg, .b-spray svg { flex: 1; min-height: 0; width: 100%; }
.b-zone .zn { fill: rgba(255,255,255,.03); stroke: rgba(255,255,255,.55); stroke-width: .025; }
.b-zone .zg { stroke: rgba(255,255,255,.14); stroke-width: .012; }
.b-zone .plate { fill: #c9cfdb; opacity: .7; }
.b-zone .pz circle { stroke: #0b0e14; stroke-width: .02; }
.b-zone .pz.bl circle { fill: var(--green); } .b-zone .pz.st circle { fill: #ff5a52; } .b-zone .pz.ip circle { fill: #4aa3ff; }
.b-zone .pz.last circle { stroke: #fff; stroke-width: .035; }
.b-zone .pz text { font-size: .22px; font-weight: 700; text-anchor: middle; fill: #000; font-family: var(--sans); }
.b-spray { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.b-spray .of { fill: #10301f; stroke: rgba(255,255,255,.3); stroke-width: .8; }
.b-spray .inf { fill: #4a3624; opacity: .7; }
.b-spray .dia { fill: #194a2c; stroke: rgba(255,255,255,.5); stroke-width: .8; }
.b-spray .mound { fill: #6b5137; }
.b-cap { text-align: center; color: var(--muted); font-size: 13px; margin-top: 4px; display: flex; justify-content: center; gap: 12px; }
.b-cap span { display: flex; align-items: center; gap: 5px; }
.b-feed li { grid-template-columns: 40px 1fr; font-size: 14.5px; }
.b-feed li.score .tx { color: #fff; font-weight: 700; } .b-feed li.score .mn { color: var(--green); }
.b-feed li.hr .tx { color: #ffd400; }
.b-feed li.out .tx, .b-feed li.k .tx { color: #aeb6c6; }
.b-feed li.action .tx { color: var(--muted); font-style: italic; }
.b-dec { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; }
.b-dec .k, .b-lastdec .k { width: 24px; height: 24px; border-radius: 6px; display: inline-grid; place-items: center; font-weight: 900; font-size: 14px; color: #000; flex: none; }
.k.W { background: var(--green); } .k.L { background: #ff5a52; } .k.S { background: #4aa3ff; }
.b-dec small { color: var(--muted); }
.b-dec em { display: block; font-style: normal; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.b-sum-stats { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.b-info { margin-top: auto; color: var(--dim); font-size: 13px; }
.b-lastdec { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; font-size: 16px; color: #c9cfdb; }
.b-lastdec .k { width: 20px; height: 20px; font-size: 12px; margin-right: 4px; }
.b-opener { margin-top: 14px; font-size: 16px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.b-opener b { color: var(--red); letter-spacing: .1em; text-transform: uppercase; font-size: 13px; margin-right: 8px; }
.b-opener span { float: right; color: var(--text); font-family: var(--mono); }
.b-screen .pre-left > * { flex-shrink: 0; }
.b-screen .pre-left > .m-last { flex: 1 1 auto; min-height: 0; }
.b-trow { display: grid; grid-template-columns: 38px 5px 1fr 34px 34px 50px 46px; gap: 8px; align-items: center; font-size: 16px; padding: 4px 4px; border-bottom: 1px solid #1a202b; }
.b-trow span:nth-child(n+4), .b-trow b { text-align: right; font-family: var(--mono); font-size: 14px; }
.b-trow i { height: 16px; border-radius: 2px; }
.b-trow .rk { text-align: right; color: var(--muted); font-weight: 700; font-size: 14px; }
.b-trow .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-trow .nm small { color: var(--dim); font-weight: 400; }
.b-trow.me { background: rgba(189,48,57,.2); border-radius: 6px; font-weight: 700; }
.b-trow.cut { border-bottom: 2px dashed #3a4354; }
