:root {
  color-scheme: dark;
  --bg: #050709;
  --panel: #0b1014;
  --line: rgba(255, 255, 255, .13);
  --soft-line: rgba(255, 255, 255, .07);
  --text: #f7f9fb;
  --muted: #92a0ab;
  --amber: #ffb000;
  --red: #ff3b30;
  --cyan: #31d7ff;
  --green: #55e56b;
  --font-display: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --font-mono: "Roboto Mono", "Courier New", monospace;
  --font-ui: Roboto, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); }

body {
  color: var(--text);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button, input, select { font: inherit; }
button { color: inherit; }

.app {
  position: relative;
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr) 74px;
  width: 100%;
  height: 100dvh;
  min-height: 320px;
  background:
    radial-gradient(circle at 50% 46%, rgba(24, 38, 48, .55), transparent 50%),
    linear-gradient(180deg, #080b0e 0%, #030405 100%);
  isolation: isolate;
}

.matrix {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .23;
  background-image: radial-gradient(circle, rgba(255,255,255,.22) 1px, transparent 1.4px);
  background-size: 6px 6px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgba(2, 4, 5, .82);
}

.brand, .status-cluster { display: flex; align-items: center; gap: 10px; }
.brand { grid-column: 1; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.brand-mark { display: flex; gap: 2px; align-items: end; height: 14px; }
.brand-mark i { display: block; width: 3px; border-radius: 1px; background: var(--amber); box-shadow: 0 0 8px rgba(255,176,0,.55); }
.brand-mark i:nth-child(1) { height: 7px; }
.brand-mark i:nth-child(2) { height: 13px; }
.brand-mark i:nth-child(3) { height: 10px; }
.topbar-center { grid-column: 2; color: var(--muted); font-size: 11px; letter-spacing: .14em; }
.status-cluster { grid-column: 3; justify-self: end; justify-content: flex-end; }
.updated { color: var(--green); font-size: 10px; letter-spacing: .1em; }
.clock { font-family: var(--font-display); font-size: 18px; font-weight: 900; letter-spacing: .06em; }

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.04);
}
.icon-button svg { width: 18px; height: 18px; fill: currentColor; }
#settingsButton { width: 40px; height: 40px; }
#settingsButton svg { width: 21px; height: 21px; }

.display { position: relative; min-height: 0; overflow: hidden; }
.display-actions { position: absolute; z-index: 9; top: 12px; right: max(14px, env(safe-area-inset-right)); left: max(14px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.display-action { width: 44px; height: 44px; color: #e9eef2; background: rgba(5,7,9,.78); box-shadow: 0 5px 16px rgba(0,0,0,.32); backdrop-filter: blur(5px); pointer-events: auto; }
.display-action:hover, .display-action:focus-visible { border-color: rgba(255,176,0,.58); outline: 0; color: var(--amber); background: rgba(255,176,0,.09); }
.display-action svg { width: 23px; height: 23px; }
.display-action .games-list-icon { width: 25px; height: 25px; }
.display[data-view="loading"] .game-stage,
.display[data-view="loading"] .empty-state,
.display[data-view="games"] .loading-state,
.display[data-view="games"] .empty-state,
.display[data-view="empty"] .loading-state,
.display[data-view="empty"] .game-stage { display: none !important; }
.game-stage { width: 100%; height: 100%; touch-action: pan-y; overscroll-behavior: contain; }
.edge-nav { display: none; }
@media (hover: hover) and (pointer: fine) {
  .edge-nav { position: absolute; z-index: 8; top: 0; bottom: 0; display: grid; place-items: center; width: clamp(48px, 5vw, 76px); padding: 0; border: 0; color: var(--amber); background: transparent; cursor: pointer; opacity: .24; transition: opacity .18s ease, background .18s ease; }
  .edge-nav svg { width: 30px; height: 30px; fill: currentColor; filter: drop-shadow(0 0 7px rgba(255,176,0,.35)); }
  .edge-previous { left: 0; background: linear-gradient(90deg, rgba(255,176,0,.09), transparent); }
  .edge-next { right: 0; background: linear-gradient(270deg, rgba(255,176,0,.09), transparent); }
  .edge-nav:hover, .edge-nav:focus-visible { outline: 0; background-color: rgba(255,176,0,.08); opacity: 1; }
  .edge-nav:disabled { display: none; }
}
.loading-state, .empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 9px;
  text-align: center;
  overflow: hidden;
}
.loading-state strong, .empty-state strong { font: 900 clamp(40px, 9vw, 94px)/.9 var(--font-display); letter-spacing: .035em; }
.loading-kicker, .empty-kicker { color: var(--amber); font-size: 12px; font-weight: 800; letter-spacing: .28em; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }
.scanline { position: absolute; inset: 0; background: linear-gradient(transparent 48%, rgba(255,176,0,.06) 50%, transparent 52%); animation: scan 1.5s linear infinite; }
@keyframes scan { from { transform: translateY(-50%); } to { transform: translateY(50%); } }

.focus-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 14px clamp(26px, 6vw, 88px) 10px;
  animation: card-in .45s cubic-bezier(.2,.72,.25,1);
}
@keyframes card-in { from { opacity: 0; transform: translateX(4%); } to { opacity: 1; transform: translateX(0); } }

.team { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; text-align: center; }
.team.away { text-align: center; }
.team-logo-wrap { position: relative; display: grid; place-items: center; width: 108px; height: 108px; margin-bottom: 2px; }
.team-logo-wrap::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); background: radial-gradient(circle, rgba(255,255,255,.09), transparent 65%); }
.team-logo { position: relative; z-index: 1; width: 92px; height: 92px; object-fit: contain; filter: drop-shadow(0 5px 9px rgba(0,0,0,.7)); }
.possession-ball { position: absolute; z-index: 3; top: -19px; left: 50%; display: grid; place-items: center; width: 23px; height: 15px; color: #fff; filter: drop-shadow(0 2px 4px rgba(0,0,0,.85)); transform: translateX(-50%); }
.possession-ball svg { display: block; width: 100%; height: 100%; overflow: visible; }
.team-meta { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 280px; min-width: 0; }
.team-abbr { display: block; color: var(--amber); font: 900 clamp(14px, 2vw, 22px)/1 var(--font-display); letter-spacing: .13em; }
.team-name { display: block; width: 100%; margin-top: 5px; overflow: visible; color: var(--text); font: 900 clamp(17px, 2.7vw, 32px)/1 var(--font-display); letter-spacing: .015em; text-align: center; text-wrap: balance; white-space: normal; word-break: normal; }
.team-record { display: block; margin-top: 7px; color: var(--muted); font-size: clamp(10px, 1.4vw, 13px); letter-spacing: .08em; }

.score-center { display: grid; place-items: center; min-width: clamp(212px, 29vw, 390px); padding: 7px 22px; border: 1px solid transparent; border-radius: 8px; color: inherit; background: transparent; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.score-center:hover, .score-center:focus-visible { border-color: rgba(255,176,0,.48); outline: 0; background: rgba(255,176,0,.045); }
.score-center:active { transform: scale(.985); }
.score-line { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 2.5vw, 28px); }
.score { min-width: 1.25em; color: #fff; font: 900 clamp(80px, 18vw, 186px)/.75 var(--font-display); text-align: center; letter-spacing: -.02em; text-shadow: 0 0 16px rgba(255,255,255,.15); }
.score-line-compact .score { min-width: 1.55em; font-size: clamp(68px, 13vw, 136px); }
.score-line-compact .score-divider { font-size: clamp(36px, 6vw, 58px); }
.score.score-updated { animation: score-flash 1.8s ease-out; }
.score-divider { color: rgba(255,255,255,.26); font: 900 clamp(45px, 8vw, 78px)/1 var(--font-display); }
.score-alert { display: flex; align-items: center; width: min(390px, 88vw); height: 25px; margin-top: 10px; overflow: hidden; border: 1px solid rgba(255,176,0,.3); border-radius: 3px; color: #f5f7f9; background: rgba(3,6,8,.88); opacity: 1; transition: opacity .18s ease; }
.score-alert.is-leaving { opacity: 0; }
.score-alert-label { display: grid; flex: 0 0 auto; place-items: center; align-self: stretch; padding: 0 9px; border-right: 1px solid rgba(255,176,0,.3); color: #080a0b; background: var(--amber); font-size: 8px; font-weight: 900; letter-spacing: .1em; white-space: nowrap; }
.score-alert-window { min-width: 0; overflow: hidden; }
.score-alert-text { display: inline-block; min-width: 100%; padding-left: 100%; font-family: var(--font-ui); font-size: 11px; font-weight: 700; line-height: 23px; white-space: nowrap; will-change: transform; }
.score-alert-text.is-scrolling { animation: scoring-play-scroll 10.4s linear both; }
.score-alert + .game-live-info { margin-top: 8px; }
@keyframes scoring-play-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.pregame-score { display: grid; place-items: center; align-content: center; min-height: clamp(104px, 15vw, 168px); text-align: center; }
.pregame-label { color: var(--amber); font: 900 clamp(13px, 2vw, 21px)/1 var(--font-display); letter-spacing: .2em; text-shadow: 0 0 12px rgba(255,176,0,.22); }
.pregame-time { margin-top: 10px; color: #fff; font: 900 clamp(52px, 10vw, 104px)/.82 var(--font-display); letter-spacing: -.025em; white-space: nowrap; text-shadow: 0 0 16px rgba(255,255,255,.15); }
.schedule-status { display: grid; place-items: center; min-height: clamp(104px, 15vw, 168px); text-align: center; }
.schedule-status strong { color: var(--amber); font: 900 clamp(36px, 7vw, 72px)/.9 var(--font-display); letter-spacing: .08em; text-shadow: 0 0 14px rgba(255,176,0,.2); }
.game-live-info { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 26px; margin-top: 20px; }
.game-status { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 26px; margin-top: 0; padding: 5px 11px; border: 1px solid var(--line); border-radius: 3px; color: var(--amber); background: rgba(0,0,0,.3); font-size: clamp(10px, 1.5vw, 13px); font-weight: 800; letter-spacing: .12em; }
.game-status.live { color: #fff; border-color: rgba(255,59,48,.55); background: rgba(255,59,48,.16); }
.game-status.final { color: #e6eaee; border-color: rgba(146,160,171,.58); background: rgba(146,160,171,.16); }
.game-status.disrupted { color: #fff; border-color: rgba(255,176,0,.62); background: rgba(255,176,0,.13); }
.game-status.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 9px var(--red); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.game-note { margin-top: 9px; color: var(--muted); font-size: clamp(9px, 1.2vw, 11px); letter-spacing: .1em; text-align: center; }
.baseball-situation { display: inline-flex; align-items: center; justify-content: center; gap: 13px; min-height: 34px; margin-top: 0; color: #fff; font-size: clamp(10px, 1.4vw, 12px); font-weight: 900; letter-spacing: .1em; }
.base-diamond { position: relative; display: block; width: 47px; height: 29px; }
.base { position: absolute; width: 13px; height: 13px; border: 1px solid rgba(255,255,255,.38); background: rgba(255,255,255,.035); transform: rotate(45deg); }
.base.occupied { border-color: var(--amber); background: var(--amber); box-shadow: 0 0 8px rgba(255,176,0,.3); }
.base.third { left: 1px; bottom: 1px; }
.base.second { top: 1px; left: 17px; }
.base.first { right: 1px; bottom: 1px; }
.outs-label { padding-left: 13px; border-left: 1px solid var(--line); white-space: nowrap; }

.score-strip { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) 48px; align-items: center; gap: 0; border-top: 1px solid var(--line); background: #020303; overflow: visible; }
.strip-label { display: flex; align-items: center; gap: 8px; align-self: stretch; padding: 0 18px; border-right: 1px solid var(--line); color: var(--amber); font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 7px var(--red); }
.ticker-shell { position: relative; min-width: 0; height: 100%; }
.pager-rail { position: absolute; z-index: 4; top: -20px; left: 50%; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 20px; padding: 0 9px; border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; background: #020303; transform: translateX(-50%); }
.cycle-toggle { display: grid; flex: 0 0 auto; place-items: center; width: 14px; height: 14px; padding: 0; border: 0; color: #75828c; background: transparent; }
.cycle-toggle:hover, .cycle-toggle:focus-visible { outline: 0; color: var(--amber); }
.cycle-toggle:disabled { opacity: .3; }
.cycle-toggle svg { width: 10px; height: 10px; fill: currentColor; }
.cycle-toggle .cycle-play-icon { display: none; }
.cycle-toggle.is-paused { color: var(--amber); }
.cycle-toggle.is-paused .cycle-pause-icon { display: none; }
.cycle-toggle.is-paused .cycle-play-icon { display: block; }
.marquee-window { position: relative; min-width: 0; overflow: hidden; height: 100%; }
.marquee-window::before, .marquee-window::after { content: ""; position: absolute; z-index: 2; top: 0; bottom: 0; width: 26px; pointer-events: none; }
.marquee-window::before { left: 0; background: linear-gradient(to right, #020303, transparent); }
.marquee-window::after { right: 0; background: linear-gradient(to left, #020303, transparent); }
.marquee-track { display: flex; align-items: center; gap: 0; width: max-content; min-width: 100%; height: 100%; animation: marquee var(--marquee-duration, 32s) linear infinite; will-change: transform; }
.marquee-track.paused { animation-play-state: paused; }
.marquee-sequence { display: flex; flex: 0 0 auto; align-items: center; min-width: 100vw; height: 100%; }
.marquee-league-divider { display: flex; align-items: center; gap: 8px; align-self: stretch; padding: 0 17px; border-right: 1px solid rgba(255,176,0,.4); border-left: 1px solid rgba(255,176,0,.4); color: #07090a; background: var(--amber); font-size: 12px; font-weight: 900; letter-spacing: .16em; white-space: nowrap; }
.marquee-league-divider i { width: 3px; height: 18px; border-radius: 2px; background: rgba(5,7,9,.42); }
.marquee-league-divider b { color: inherit; font-size: inherit; }
.marquee-item { display: flex; align-items: center; gap: 10px; padding: 0 20px; border: 0; border-right: 1px solid var(--soft-line); color: #dce2e7; background: transparent; font: inherit; font-size: 14px; letter-spacing: .04em; white-space: nowrap; }
.marquee-item b { color: #fff; font-size: 17px; }
.marquee-item .mini-status { color: var(--amber); font-size: 11px; font-weight: 800; }
.ticker-state { display: inline-grid; flex: 0 0 auto; place-items: center; }
.ticker-state-live { width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 7px rgba(255,59,48,.9); animation: pulse 1.2s ease-in-out infinite; }
.ticker-state-final { width: 18px; height: 18px; border: 1px solid rgba(146,160,171,.5); border-radius: 3px; color: #c7d0d7; background: rgba(146,160,171,.16); font-size: 10px; font-weight: 900; line-height: 1; }
.marquee-item.is-final { color: #aeb8c0; }
.marquee-game { align-self: stretch; cursor: pointer; }
.marquee-game:hover, .marquee-game:focus-visible { outline: 0; background: rgba(255,176,0,.09); }
.marquee-game.is-current { background: rgba(255,176,0,.065); box-shadow: inset 0 -2px var(--amber); }
.marquee-item.is-score-updated { animation: ticker-score-flash 1.8s ease-out; }
.marquee-track:focus-within { animation-play-state: paused; }
@keyframes marquee { from { transform: translate3d(0,0,0); } to { transform: translate3d(-50%,0,0); } }
.strip-controls { display: flex; flex-direction: column; align-items: center; justify-content: center; align-self: stretch; gap: 2px; width: 48px; padding: 2px 5px; border-left: 1px solid var(--line); }
.score-freshness { min-height: 8px; color: #71808b; font-size: 7px; font-weight: 900; line-height: 1; letter-spacing: .06em; white-space: nowrap; }
.score-freshness.is-stale { color: var(--amber); }
.pager { display: flex; align-items: center; gap: 4px; }
.pager i { width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.25); }
.pager i.active { width: 11px; border-radius: 4px; background: var(--amber); }
.strip-refresh { display: grid; flex: 0 0 auto; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid rgba(255,176,0,.42); border-radius: 50%; color: var(--amber); background: rgba(255,176,0,.07); }
.strip-refresh svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.strip-refresh .refresh-check { display: none; }
.strip-refresh.is-refreshing .refresh-icon { animation: refresh-spin .75s linear infinite; }
.strip-refresh.is-success { color: #7bd88f; border-color: rgba(123,216,143,.6); background: rgba(123,216,143,.1); }
.strip-refresh.is-success .refresh-icon { display: none; }
.strip-refresh.is-success .refresh-check { display: block; }
.strip-refresh:disabled { cursor: wait; }
.strip-refresh:hover, .strip-refresh:focus-visible { border-color: var(--amber); outline: 0; background: rgba(255,176,0,.14); }
.strip-refresh:active { transform: scale(.93); }
@keyframes refresh-spin { to { transform: rotate(360deg); } }

.scrim { position: absolute; z-index: 9; inset: 0; background: rgba(0,0,0,.62); backdrop-filter: blur(3px); }
.settings-panel, .details-overlay { font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.games-overlay {
  position: absolute;
  z-index: 16;
  top: 52px;
  right: 0;
  bottom: 74px;
  left: 0;
  display: grid;
  place-items: center;
  padding: 14px max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left));
  background: rgba(1,3,4,.72);
  backdrop-filter: blur(5px);
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
}
.games-panel { display: grid; grid-template-rows: auto auto minmax(0,1fr); width: min(820px, 100%); max-height: 100%; border: 1px solid rgba(255,255,255,.18); border-radius: 9px; background: rgba(8,12,15,.985); box-shadow: 0 24px 70px rgba(0,0,0,.68); overflow: hidden; }
.games-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; padding: 10px 14px 10px 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.025); }
.games-head-copy { display: grid; align-content: center; min-width: 0; }
.games-head h2 { margin: 3px 0 0; font: 900 clamp(22px, 3vw, 32px)/1 var(--font-display); letter-spacing: .025em; }
.games-summary { display: flex; align-items: center; gap: 6px; min-height: 11px; margin-top: 5px; overflow: hidden; color: #83919b; font-size: 8px; font-weight: 900; letter-spacing: .08em; white-space: nowrap; }
.games-summary i { color: #4e5961; font-style: normal; }
.games-summary .summary-live { color: #ff6961; }
.games-summary .summary-disrupted { color: var(--amber); }
.games-head-actions { display: flex; align-items: center; gap: 9px; }
.games-date-nav { display: flex; align-items: center; gap: 4px; }
.games-date-nav button { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: #dce2e7; background: rgba(255,255,255,.035); }
.games-date-nav button:hover, .games-date-nav button:focus-visible { outline: 0; border-color: rgba(255,176,0,.58); color: var(--amber); background: rgba(255,176,0,.08); }
.games-date-nav button:disabled { color: #59646c; opacity: .5; }
.games-date-nav button svg { width: 16px; height: 16px; fill: currentColor; }
.games-date-nav .games-today { min-width: auto; padding-inline: 9px; border-radius: 15px; color: var(--amber); font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.games-league-tabs { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.015); overflow-x: auto; scrollbar-width: none; }
.games-league-tabs::-webkit-scrollbar { display: none; }
.games-league-tabs button { display: inline-flex; flex: 1 0 auto; align-items: center; justify-content: center; gap: 7px; min-width: 70px; min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; color: #89969f; background: rgba(255,255,255,.025); font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.games-league-tabs button b { display: grid; place-items: center; min-width: 17px; height: 17px; padding-inline: 4px; border-radius: 9px; color: #a9b3ba; background: rgba(255,255,255,.07); font-size: 8px; }
.games-league-tabs button[aria-pressed="true"] { border-color: var(--amber); color: #080a0b; background: var(--amber); }
.games-league-tabs button[aria-pressed="true"] b { color: #fff; background: rgba(5,7,9,.44); }
.games-list { min-height: 0; padding: 10px; overflow-y: auto; scrollbar-color: rgba(255,176,0,.55) transparent; }
.games-group + .games-group { margin-top: 12px; }
.games-group-title { position: sticky; top: -10px; z-index: 2; display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 8px 7px 7px; border-bottom: 1px solid rgba(255,176,0,.25); color: var(--amber); background: #080c0f; font-size: 11px; font-weight: 900; letter-spacing: .18em; }
.games-group-title small { color: #6f7c86; font-size: 8px; letter-spacing: .1em; }
.games-row { display: grid; grid-template-columns: 14px minmax(0,1fr) minmax(150px,auto) minmax(0,1fr) 14px; align-items: center; gap: 10px; width: 100%; min-height: 64px; padding: 8px 11px; border: 1px solid transparent; border-bottom-color: var(--soft-line); color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.games-row:hover, .games-row:focus-visible { outline: 0; border-color: rgba(255,176,0,.42); background: rgba(255,176,0,.055); }
.games-row.current { border-color: rgba(255,176,0,.72); border-radius: 5px; background: rgba(255,176,0,.085); }
.games-row-spacer { justify-self: center; width: 3px; height: 26px; border-radius: 2px; background: transparent; }
.games-row.current .games-row-spacer { background: var(--amber); box-shadow: 0 0 8px rgba(255,176,0,.45); }
.games-row.is-score-updated { animation: row-score-flash 1.8s ease-out; }
.games-team { display: flex; align-items: center; gap: 9px; min-width: 0; }
.games-team.home { flex-direction: row-reverse; text-align: right; }
.games-team img, .games-team-logo-fallback { flex: 0 0 auto; width: 32px; height: 32px; object-fit: contain; }
.games-team-text { display: grid; align-content: center; gap: 2px; min-width: 0; }
.games-team-abbr-line { display: flex; align-items: center; gap: 6px; min-height: 13px; }
.games-team.home .games-team-abbr-line { justify-content: flex-end; }
.games-team b { font-size: 13px; line-height: 1; letter-spacing: .06em; }
.games-team small { overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.games-team-logo-fallback { display: grid; place-items: center; color: var(--amber); font: 900 12px/1 var(--font-display); }
.games-possession-ball { display: inline-grid; flex: 0 0 auto; place-items: center; width: 16px; height: 10px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,.85)); }
.games-possession-ball svg { display: block; width: 100%; height: 100%; overflow: visible; }
.games-row-center { position: relative; display: grid; place-items: center; min-width: 150px; text-align: center; }
.games-row-center strong { color: #fff; font: 900 20px/1 var(--font-display); letter-spacing: .04em; white-space: nowrap; }
.games-row-status { position: absolute; top: 50%; left: calc(50% + 48px); display: inline-flex; align-items: center; gap: 6px; color: var(--amber); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%); }
.games-row-status.live { color: #ff6961; }
.games-row-status.final { color: #b9c2c9; }
.games-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 7px rgba(255,59,48,.9); animation: pulse 1.2s ease-in-out infinite; }
.games-live-stack { display: grid; place-items: center; gap: 1px; line-height: 1; }
.games-live-stack b, .games-live-stack span { color: inherit; font: inherit; letter-spacing: inherit; }
.games-row-chevron { width: 8px; height: 8px; border-top: 2px solid #71808b; border-right: 2px solid #71808b; transform: rotate(45deg); }
.games-empty { display: grid; place-items: center; min-height: 180px; padding: 24px; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.settings-panel {
  position: absolute;
  z-index: 10;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: min(390px, 88vw);
  height: 100%;
  padding: 24px max(24px, env(safe-area-inset-right)) 20px 24px;
  border-left: 1px solid var(--line);
  background: rgba(8,12,15,.98);
  box-shadow: -24px 0 70px rgba(0,0,0,.55);
  transform: translateX(105%);
  transition: transform .28s ease;
  overflow-y: auto;
}
.settings-panel.open { transform: translateX(0); }
.panel-head { display: flex; align-items: start; justify-content: space-between; }
.panel-head h1 { margin: 4px 0 0; font: 900 34px/1 var(--font-display); letter-spacing: .02em; }
.eyebrow { color: var(--amber); font-size: 10px; font-weight: 900; letter-spacing: .2em; }
.setting-group { display: grid; gap: 9px; }
.setting-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.setting-label output { color: var(--amber); }
.setting-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; padding: 7px 10px 7px 12px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.025); cursor: pointer; }
.setting-toggle-copy { display: grid; gap: 4px; min-width: 0; }
.setting-toggle-copy strong { color: var(--muted); font-size: 10px; letter-spacing: .14em; }
.setting-toggle-copy small { color: #6f7c86; font: 10px/1.3 var(--font-ui); }
.setting-toggle-control { position: relative; flex: 0 0 auto; }
.setting-toggle-control input { position: absolute; opacity: 0; pointer-events: none; }
.setting-toggle-track { position: relative; display: block; width: 42px; height: 23px; border: 1px solid #3a464f; border-radius: 999px; background: #11181d; transition: border-color .18s ease, background .18s ease; }
.setting-toggle-track i { position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #78858e; transition: transform .18s ease, background .18s ease; }
.setting-toggle-control input:checked + .setting-toggle-track { border-color: var(--amber); background: rgba(255,176,0,.18); }
.setting-toggle-control input:checked + .setting-toggle-track i { background: var(--amber); transform: translateX(19px); box-shadow: 0 0 8px rgba(255,176,0,.45); }
.setting-toggle-control input:focus-visible + .setting-toggle-track { outline: 2px solid rgba(255,176,0,.7); outline-offset: 2px; }
.label-button { padding: 0; border: 0; color: var(--text); background: transparent; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.setting-help { margin: 0; color: #6f7c86; font-size: 10px; line-height: 1.4; }
.matchup-picker-group { display: block; }
.matchup-picker-disclosure { border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.02); overflow: hidden; }
.matchup-picker-disclosure summary { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 0 12px; color: var(--muted); cursor: pointer; list-style: none; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.matchup-picker-disclosure summary::-webkit-details-marker { display: none; }
.matchup-picker-disclosure[open] { border-color: rgba(255,176,0,.48); }
.matchup-picker-summary-status { display: flex; align-items: center; gap: 9px; color: var(--amber); }
.disclosure-chevron { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .18s ease; }
.matchup-picker-disclosure[open] .disclosure-chevron { transform: translateY(2px) rotate(225deg); }
.matchup-picker-content { display: grid; gap: 9px; padding: 10px; border-top: 1px solid var(--soft-line); }
.matchup-picker-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.matchup-picker { display: grid; gap: 5px; max-height: 220px; padding-right: 3px; overflow-y: auto; scrollbar-color: rgba(255,176,0,.55) transparent; }
.picker-league { position: sticky; top: 0; z-index: 1; padding: 5px 7px; color: var(--amber); background: #080c0f; font-size: 9px; font-weight: 900; letter-spacing: .18em; }
.matchup-option { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 9px; min-height: 44px; padding: 6px 8px; border: 1px solid var(--soft-line); border-radius: 4px; color: var(--muted); background: rgba(255,255,255,.025); text-align: left; }
.matchup-option[aria-pressed="true"] { border-color: var(--amber); color: var(--text); background: rgba(255,176,0,.1); }
.matchup-option-main { display: grid; gap: 3px; min-width: 0; }
.matchup-option-teams { color: inherit; font-size: 11px; font-weight: 800; line-height: 1.2; }
.matchup-option-meta { color: #798791; font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.matchup-option[aria-pressed="true"] .matchup-option-meta { color: var(--amber); }
.matchup-option-check { width: 9px; height: 9px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; }
.matchup-option[aria-pressed="true"] .matchup-option-check { border-color: var(--amber); background: var(--amber); box-shadow: 0 0 7px rgba(255,176,0,.55); }
.picker-loading { padding: 12px 8px; color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: grid; place-items: center; min-height: 42px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.segmented input:checked + span { border-color: var(--amber); color: #090a0b; background: var(--amber); }
.range { width: 100%; accent-color: var(--amber); }
.select { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; color: var(--text); background: #0c1216; font-size: 13px; }
.date-control { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.date-input, .date-today-button { min-height: 42px; border: 1px solid var(--line); border-radius: 4px; color: var(--text); background: #0c1216; }
.date-input { min-width: 0; padding: 0 11px; color-scheme: dark; font: 700 13px/1 var(--font-ui); }
.date-today-button { padding: 0 13px; color: var(--amber); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.date-today-button:disabled { color: #6f7c86; opacity: .7; }
.setting-actions { display: grid; gap: 8px; margin-top: auto; }
.primary-button, .secondary-button { min-height: 43px; border-radius: 4px; font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.primary-button { border: 1px solid var(--amber); background: var(--amber); color: #050709; }
.secondary-button { border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--text); }
.panel-note { margin: -10px 0 0; color: #6f7c86; font-size: 10px; line-height: 1.45; }

.details-overlay {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background:
    radial-gradient(circle at 50% 0, rgba(35,55,67,.34), transparent 45%),
    rgba(4,7,9,.985);
}
.player-overlay { z-index: 30; }
.details-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 7px max(18px, env(safe-area-inset-right)) 7px max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgba(2,4,5,.78);
}
.details-content { min-height: 0; padding: 14px max(18px, env(safe-area-inset-right)) 20px max(18px, env(safe-area-inset-left)); overflow-y: auto; }
.details-scoreboard { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; width: min(920px, 100%); margin: 0 auto 16px; }
.details-team { display: grid; grid-template-columns: 62px minmax(0,1fr); grid-template-rows: auto auto; align-items: center; column-gap: 12px; min-width: 0; }
.details-team:last-child { grid-template-columns: minmax(0,1fr) 62px; text-align: right; }
.details-team img, .details-team > b { grid-row: 1 / 3; width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 5px 8px rgba(0,0,0,.6)); }
.details-team:last-child img, .details-team:last-child > b { grid-column: 2; }
.details-team strong { overflow: hidden; font: 900 clamp(16px, 2.2vw, 24px)/1.05 var(--font-display); text-overflow: ellipsis; white-space: nowrap; }
.details-team span { color: var(--muted); font-size: 11px; letter-spacing: .07em; }
.details-score { display: grid; grid-template-columns: auto auto auto; place-items: center; column-gap: 12px; min-width: 190px; padding-inline: 18px; }
.details-score > span { font: 900 clamp(42px, 7vw, 70px)/.85 var(--font-display); }
.details-score.is-compact { min-width: 230px; padding-inline: 10px; }
.details-score.is-compact > span { font-size: clamp(36px, 5vw, 56px); }
.details-score > i { color: rgba(255,255,255,.28); font: 900 32px/1 var(--font-display); font-style: normal; }
.details-score > small { grid-column: 1 / 4; margin-top: 8px; color: var(--amber); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-align: center; }
.details-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 14px; width: min(1080px, 100%); margin: 0 auto; }
.detail-section { min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.025); overflow: hidden; }
.detail-section h3 { margin: 0; padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--amber); font-size: 12px; letter-spacing: .16em; }
.line-score-section { width: min(1080px, 100%); margin: 0 auto 14px; }
.line-score-wrap { max-width: 100%; overflow-x: auto; scrollbar-color: rgba(255,176,0,.5) transparent; }
.line-score-wrap:focus-visible { outline: 1px solid rgba(255,176,0,.58); outline-offset: -1px; }
.line-score-table { width: 100%; min-width: var(--line-score-width, 344px); border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.line-score-table caption { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.line-score-table th, .line-score-table td { width: 24px; height: 34px; padding: 3px 1px; border-right: 1px solid var(--soft-line); border-bottom: 1px solid var(--soft-line); color: #eef2f5; font-size: 12px; font-weight: 800; text-align: center; }
.line-score-table thead th { height: 29px; color: #83919b; font-size: 10px; letter-spacing: .05em; }
.line-score-table th:first-child { position: sticky; left: 0; z-index: 2; width: 44px; color: #fff; background: #090d10; font-size: 12px; text-align: left; padding-left: 8px; }
.line-score-table thead th:first-child { z-index: 3; color: #83919b; font-size: 10px; }
.line-score-table .total-column { width: 28px; color: #fff; background: rgba(255,255,255,.025); }
.line-score-table .runs-column { border-left: 1px solid rgba(255,176,0,.8); color: var(--amber); }
.line-score-table .is-current-inning { color: var(--amber); background: rgba(255,176,0,.075); }
.line-score-table tbody tr:last-child th, .line-score-table tbody tr:last-child td { border-bottom: 0; }
.line-score-table th:last-child, .line-score-table td:last-child { border-right: 0; }
.football-line-score .line-score-table { width: min(100%, 480px); margin-inline: auto; }
.football-line-score .line-score-table th:not(:first-child), .football-line-score .line-score-table td:not(:first-child) { width: 36px; }
.football-line-score .line-score-table tbody td { font-size: 13px; }
.period-line-score .line-score-table { width: min(100%, 520px); margin-inline: auto; }
.period-line-score .line-score-table th:not(:first-child), .period-line-score .line-score-table td:not(:first-child) { width: 36px; }
.period-line-score .line-score-table tbody td { font-size: 13px; }
.stats-head, .stat-row { display: grid; grid-template-columns: 70px minmax(0,1fr) 70px; align-items: center; text-align: center; }
.stats-head { padding: 8px 12px; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .1em; }
.stat-row { min-height: 34px; padding: 4px 12px; border-top: 1px solid var(--soft-line); }
.stat-row b { color: #fff; font-size: 15px; }
.stat-row span { color: var(--muted); font-size: 12px; line-height: 1.25; }
.plays-list { display: grid; }
.scoring-play { padding: 10px 13px; border-top: 1px solid var(--soft-line); }
.scoring-play:first-child { border-top: 0; }
.play-meta { display: flex; align-items: baseline; justify-content: space-between; color: var(--amber); font-size: 11px; font-weight: 900; line-height: 1; letter-spacing: .09em; }
.play-meta b { min-width: 52px; color: #fff; font-size: 14px; line-height: 1; font-variant-numeric: tabular-nums; text-align: right; }
.scoring-play p { margin: 5px 0 0; color: #dce2e7; font-size: 14px; line-height: 1.4; }
.player-stats-section { width: min(1080px, 100%); margin: 14px auto 0; }
.player-category + .player-category { border-top: 1px solid var(--line); }
.player-category h4 { margin: 0; padding: 9px 14px; border-bottom: 1px solid var(--soft-line); color: #fff; background: rgba(255,176,0,.055); font-size: 12px; letter-spacing: .14em; }
.player-team-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.player-team-box { min-width: 0; }
.player-team-box + .player-team-box { border-left: 1px solid var(--line); }
.player-team-heading { display: flex; align-items: baseline; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--soft-line); }
.player-team-heading b { color: var(--amber); font-size: 14px; letter-spacing: .1em; }
.player-team-heading span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.player-table-wrap { max-width: 100%; overflow-x: auto; }
.player-table { width: 100%; min-width: 360px; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.player-table th, .player-table td { height: 31px; padding: 4px 6px; border-top: 1px solid var(--soft-line); text-align: right; white-space: nowrap; }
.player-table thead th { height: 27px; border-top: 0; color: #82909a; font-size: 10px; font-weight: 900; letter-spacing: .07em; }
.player-table th:first-child, .player-table td:first-child { position: sticky; left: 0; z-index: 1; width: 145px; max-width: 145px; padding-right: 4px; color: #e9eef2; background: #090d10; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.player-table tbody td { color: #fff; font-size: 13px; }
.player-table tbody td:first-child { font-weight: 800; }
.player-stat-link { display: flex; align-items: center; justify-content: space-between; gap: 7px; width: 100%; min-width: 0; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; font-weight: inherit; text-align: left; cursor: pointer; }
.player-stat-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-stat-link i { flex: 0 0 auto; width: 7px; height: 7px; border-top: 2px solid #697984; border-right: 2px solid #697984; transform: rotate(45deg); }
.player-stat-link:hover, .player-stat-link:focus-visible { outline: 0; color: var(--amber); }
.player-stat-link:hover i, .player-stat-link:focus-visible i { border-color: var(--amber); }
.player-table-empty { min-height: 74px; padding: 22px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.player-team-section + .player-team-section { border-top: 2px solid var(--line); }
.player-team-banner { display: flex; align-items: baseline; gap: 9px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: rgba(255,176,0,.09); }
.player-team-banner b { color: var(--amber); font-size: 15px; letter-spacing: .12em; }
.player-team-banner span { color: #edf1f4; font-size: 14px; font-weight: 800; }
.player-team-category + .player-team-category { border-top: 1px solid var(--line); }
.player-team-category h4 { margin: 0; padding: 9px 14px; border-bottom: 1px solid var(--soft-line); color: #fff; background: rgba(255,255,255,.025); font-size: 12px; letter-spacing: .14em; }
.team-grouped-player-stats .player-table { min-width: 420px; }
.nba-player-stats .player-table { min-width: 720px; }
.nhl-player-stats .player-table { min-width: 600px; }
.section-empty, .details-empty, .details-loading { display: grid; place-items: center; min-height: 120px; padding: 18px; color: var(--muted); font-size: 13px; text-align: center; }
.details-empty, .details-loading { min-height: 42vh; gap: 9px; }
.details-empty strong, .details-loading strong { color: var(--text); font: 900 clamp(24px, 4vw, 48px)/1 var(--font-display); letter-spacing: .04em; }
.details-empty p { margin: 0; }
.player-content { padding-top: 18px; }
.player-profile-card { position: relative; display: grid; grid-template-columns: 104px minmax(0,1fr) 64px; align-items: center; gap: 18px; width: min(1080px, 100%); min-height: 118px; margin: 0 auto 14px; padding: 8px 18px 8px 8px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(105deg, rgba(255,176,0,.12), rgba(255,255,255,.025) 48%, rgba(255,255,255,.015)); overflow: hidden; }
.player-headshot, .player-headshot-fallback { align-self: end; width: 100px; height: 108px; object-fit: contain; object-position: center bottom; }
.player-headshot-fallback { display: grid; place-items: center; align-self: center; height: 92px; border: 1px solid var(--line); border-radius: 50%; color: var(--amber); background: rgba(255,255,255,.035); font: 900 30px/1 var(--font-display); }
.player-profile-copy { min-width: 0; }
.player-profile-copy > span { color: var(--amber); font-size: 10px; font-weight: 900; letter-spacing: .18em; }
.player-profile-copy h2 { margin: 5px 0 6px; overflow: hidden; color: #fff; font: 900 clamp(30px, 5vw, 52px)/.95 var(--font-display); letter-spacing: .015em; text-overflow: ellipsis; white-space: nowrap; }
.player-profile-copy p { margin: 0; color: #abb6be; font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.player-profile-team-logo { justify-self: end; width: 58px; height: 58px; object-fit: contain; opacity: .9; }
.player-details-stack { display: grid; gap: 14px; width: min(1080px, 100%); margin: 0 auto; }
.player-detail-section h4 { margin: 0; padding: 9px 13px; border-bottom: 1px solid var(--soft-line); color: #dce2e7; background: rgba(255,255,255,.025); font-size: 11px; letter-spacing: .13em; }
.player-detail-group + .player-detail-group { border-top: 1px solid var(--line); }
.player-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); }
.player-stat-tile { display: grid; place-items: center; align-content: center; gap: 4px; min-height: 62px; padding: 7px 5px; border-right: 1px solid var(--soft-line); border-bottom: 1px solid var(--soft-line); text-align: center; }
.player-stat-tile span { color: #83919b; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.player-stat-tile b { color: #fff; font-size: 16px; }
.player-section-empty { min-height: 82px; }
.player-recent-list { display: grid; }
.player-recent-game { padding: 10px 13px; border-top: 1px solid var(--soft-line); }
.player-recent-game:first-child { border-top: 0; }
.player-recent-meta { display: grid; grid-template-columns: 62px minmax(0,1fr) auto; align-items: baseline; gap: 9px; }
.player-recent-meta time { color: var(--amber); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.player-recent-meta strong { color: #fff; font-size: 13px; }
.player-recent-meta > b { color: #fff; font-size: 14px; }
.player-result { display: inline-grid; place-items: center; min-width: 19px; height: 19px; margin-right: 4px; border: 1px solid var(--line); border-radius: 3px; color: #c7d0d6; font-size: 9px; font-style: normal; }
.player-result.win { border-color: rgba(85,229,107,.45); color: var(--green); }
.player-result.loss { border-color: rgba(255,105,97,.4); color: #ff6961; }
.player-recent-lines { display: grid; gap: 5px; margin-top: 8px; }
.player-recent-line { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 8px; align-items: start; }
.player-recent-line > strong { color: #8d9aa4; font-size: 9px; letter-spacing: .08em; }
.player-recent-line > div { display: flex; flex-wrap: wrap; gap: 5px 12px; color: #e8edf1; font-size: 11px; }
.player-recent-line span b { color: #7e8c96; font-size: 9px; letter-spacing: .04em; }

@keyframes score-flash {
  0%, 100% { color: #fff; transform: scale(1); text-shadow: 0 0 16px rgba(255,255,255,.15); }
  22% { color: var(--amber); transform: scale(1.08); text-shadow: 0 0 24px rgba(255,176,0,.7); }
}
@keyframes ticker-score-flash {
  0%, 100% { background: transparent; }
  22% { background: rgba(255,176,0,.28); }
}
@keyframes row-score-flash {
  0%, 100% { background-color: transparent; }
  22% { background-color: rgba(255,176,0,.2); }
}

@media (orientation: portrait) {
  .app { grid-template-rows: 48px minmax(0, 1fr) 58px; min-height: 500px; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding-inline: 12px; }
  .brand { font-size: 10px; letter-spacing: .12em; }
  .topbar-center, .updated { display: none; }
  .status-cluster { grid-column: 2; gap: 8px; }
  .clock { font-size: 16px; }
  .display-action { width: 42px; height: 42px; }
  .display-action svg { width: 21px; height: 21px; }
  .display-action .games-list-icon { width: 24px; height: 24px; }

  .loading-state, .empty-state { padding: 46px 20px 12px; }
  .loading-state strong, .empty-state strong { font-size: clamp(34px, 12vw, 54px); }
  .empty-state p { font-size: 12px; }

  .focus-card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    gap: 16px 6px;
    padding: 58px 14px 24px;
  }
  .team { align-self: center; gap: 2px; }
  .team.away { grid-column: 1; grid-row: 1; }
  .team.home { grid-column: 2; grid-row: 1; }
  .team-logo-wrap { width: 76px; height: 76px; margin-bottom: 0; }
  .team-logo { width: 64px; height: 64px; }
  .possession-ball { top: -16px; width: 20px; height: 13px; }
  .team-meta { max-width: 140px; }
  .team-abbr { font-size: 14px; }
  .team-name { margin-top: 4px; font-size: clamp(16px, 5vw, 21px); line-height: 1.05; }
  .team-record { margin-top: 5px; font-size: 10px; }

  .score-center {
    grid-column: 1 / 3;
    grid-row: 2;
    align-self: start;
    width: 100%;
    min-width: 0;
    padding: 10px 8px 8px;
  }
  .score-line { gap: 16px; }
  .score { min-width: 1em; font-size: clamp(62px, 23vw, 94px); line-height: .8; }
  .score-line-compact .score { min-width: 1.42em; font-size: clamp(54px, 18vw, 76px); }
  .score-line-compact .score-divider { font-size: clamp(28px, 9vw, 40px); }
  .score-divider { font-size: clamp(34px, 11vw, 48px); }
  .pregame-score { min-height: 76px; }
  .pregame-label { font-size: 12px; }
  .pregame-time { margin-top: 7px; font-size: clamp(42px, 15vw, 64px); }
  .schedule-status { min-height: 76px; }
  .schedule-status strong { font-size: clamp(31px, 10vw, 48px); }
  .game-live-info { flex-direction: column; gap: 6px; min-height: 24px; margin-top: 12px; }
  .score-alert { width: min(360px, 90vw); height: 27px; margin-top: 12px; }
  .score-alert-label { padding-inline: 7px; font-size: 7px; }
  .score-alert-text { font-size: 11px; line-height: 25px; }
  .score-alert + .game-live-info { margin-top: 7px; }
  .game-status { min-height: 24px; padding: 4px 9px; font-size: 10px; }
  .baseball-situation { min-height: 31px; gap: 11px; font-size: 10px; }
  .base-diamond { width: 43px; height: 27px; }
  .base { width: 12px; height: 12px; }
  .base.second { left: 16px; }
  .outs-label { padding-left: 11px; }
  .game-note { margin-top: 7px; font-size: 9px; }

  .score-strip { grid-template-columns: minmax(0, 1fr) 44px; min-height: 58px; }
  .strip-label { display: none; }
  .strip-controls { width: 44px; }
  .marquee-item { gap: 7px; padding-inline: 12px; font-size: 12px; }
  .marquee-item b { font-size: 14px; }
  .marquee-item .mini-status { font-size: 9px; }
  .marquee-league-divider { padding-inline: 12px; font-size: 10px; }
  .pager-rail { top: -20px; min-height: 20px; }

  .settings-panel { width: 100vw; padding-left: max(20px, env(safe-area-inset-left)); }
  .games-overlay { top: 48px; bottom: 58px; padding: 10px; }
  .games-panel { width: 100%; border-radius: 7px; }
  .games-head { min-height: 60px; padding: 8px 10px 8px 14px; }
  .games-head h2 { font-size: 23px; }
  .games-summary { gap: 4px; font-size: 7px; }
  .games-head-actions { gap: 6px; }
  .games-date-nav button { min-width: 28px; height: 28px; }
  .games-date-nav .games-today { padding-inline: 6px; }
  .games-league-tabs { gap: 5px; padding: 6px 7px; }
  .games-league-tabs button { min-width: 58px; min-height: 28px; padding-inline: 7px; }
  .games-list { padding: 7px; }
  .games-group-title { top: -7px; }
  .games-row { grid-template-columns: 10px minmax(0,1fr) minmax(122px,auto) minmax(0,1fr) 10px; gap: 6px; min-height: 58px; padding: 6px; }
  .games-row-spacer { width: 3px; }
  .games-team { gap: 6px; }
  .games-team img, .games-team-logo-fallback { width: 27px; height: 27px; }
  .games-team b { font-size: 12px; }
  .games-team small { display: none; }
  .games-row-center { min-width: 122px; }
  .games-row-center strong { font-size: 18px; }
  .games-row-status { left: calc(50% + 43px); gap: 5px; font-size: 8px; }
  .games-live-dot { width: 5px; height: 5px; }
  .games-possession-ball { width: 14px; height: 9px; }
  .details-content { padding-inline: 10px; }
  .details-scoreboard { grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); }
  .details-team, .details-team:last-child { display: flex; flex-direction: column; gap: 3px; text-align: center; }
  .details-team img, .details-team > b, .details-team:last-child img, .details-team:last-child > b { width: 42px; height: 42px; }
  .details-team strong { max-width: 90px; font-size: 13px; white-space: normal; }
  .details-team span { display: none; }
  .details-score { min-width: 112px; column-gap: 6px; padding-inline: 4px; }
  .details-score > span { font-size: 38px; }
  .details-score.is-compact { min-width: 144px; column-gap: 4px; padding-inline: 2px; }
  .details-score.is-compact > span { font-size: 31px; }
  .details-score > i { font-size: 24px; }
  .line-score-section { margin-bottom: 10px; }
  .line-score-table th, .line-score-table td { height: 32px; }
  .details-grid, .player-team-grid { grid-template-columns: minmax(0, 1fr); }
  .player-team-box + .player-team-box { border-top: 1px solid var(--line); border-left: 0; }
  .player-content { padding-top: 10px; }
  .player-profile-card { grid-template-columns: 82px minmax(0,1fr) 42px; gap: 10px; min-height: 98px; padding: 6px 10px 6px 5px; }
  .player-headshot, .player-headshot-fallback { width: 78px; height: 90px; }
  .player-headshot-fallback { height: 72px; font-size: 24px; }
  .player-profile-copy h2 { font-size: clamp(25px, 8vw, 34px); white-space: normal; }
  .player-profile-copy p { font-size: 11px; line-height: 1.3; }
  .player-profile-team-logo { width: 40px; height: 40px; }
  .player-details-stack { gap: 10px; }
  .player-stat-grid { grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); }
  .player-stat-tile { min-height: 58px; }
  .player-recent-meta { grid-template-columns: 54px minmax(0,1fr) auto; gap: 6px; }
  .player-recent-line { grid-template-columns: 70px minmax(0,1fr); }
}

@media (max-height: 500px) {
  .app { grid-template-rows: 42px minmax(0,1fr) 52px; }
  .topbar { padding-inline: 10px; }
  .brand { font-size: 10px; }
  .topbar-center, .updated { display: none; }
  .clock { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
  .icon-button { width: 32px; height: 32px; }
  .display-action { width: 38px; height: 38px; }
  .display-action svg { width: 21px; height: 21px; }
  .display-action .games-list-icon { width: 23px; height: 23px; }
  .focus-card { padding-top: 6px; padding-bottom: 4px; }
  .team-logo-wrap { width: 84px; height: 84px; }
  .team-logo { width: 74px; height: 74px; }
  .team-name { font-size: clamp(15px, 2.3vw, 26px); }
  .team-record { margin-top: 4px; }
  .score-center { min-width: clamp(180px, 25vw, 290px); padding: 4px 10px; }
  .score-line { gap: clamp(9px, 1.7vw, 16px); }
  .score { min-width: 1.08em; font-size: clamp(64px, 15vw, 128px); }
  .score-line-compact .score { min-width: 1.42em; font-size: clamp(52px, 9vw, 92px); }
  .score-line-compact .score-divider { font-size: clamp(30px, 5vw, 46px); }
  .score-divider { font-size: clamp(38px, 7vw, 58px); }
  .pregame-score { min-height: 94px; }
  .pregame-time { font-size: clamp(46px, 9vw, 82px); }
  .game-live-info { flex-wrap: nowrap; gap: 8px; min-height: 28px; margin-top: 10px; white-space: nowrap; }
  .score-alert { width: min(330px, 34vw); height: 22px; margin-top: 5px; }
  .score-alert-label { padding-inline: 7px; font-size: 7px; }
  .score-alert-text { font-size: 10px; line-height: 20px; }
  .score-alert + .game-live-info { margin-top: 4px; }
  .game-status { min-height: 24px; padding: 4px 9px; font-size: 10px; letter-spacing: .1em; }
  .baseball-situation { flex: 0 0 auto; gap: 8px; min-height: 28px; font-size: 10px; }
  .base-diamond { width: 39px; height: 24px; }
  .base { width: 11px; height: 11px; }
  .base.third { left: 1px; bottom: 1px; }
  .base.second { top: 1px; left: 14px; }
  .base.first { right: 1px; bottom: 1px; }
  .outs-label { padding-left: 8px; }
  .game-note { margin-top: 5px; }
  .score-strip { min-height: 52px; }
  .settings-panel { gap: 14px; padding-top: 16px; }
  .details-head { min-height: 48px; padding-block: 6px; }
  .games-overlay { top: 42px; bottom: 52px; padding-block: 8px; }
  .games-panel { width: min(880px, 100%); }
  .games-head { min-height: 48px; padding-block: 4px; }
  .games-head-copy { grid-template-columns: auto auto; align-items: center; column-gap: 12px; }
  .games-head-copy .eyebrow { grid-column: 1 / 3; font-size: 8px; }
  .games-head h2 { margin-top: 1px; font-size: 21px; }
  .games-summary { margin-top: 1px; }
  .games-row { min-height: 50px; }
  .details-content { padding-top: 9px; }
  .details-scoreboard { margin-bottom: 9px; }
  .details-team { grid-template-columns: 48px minmax(0,1fr); column-gap: 8px; }
  .details-team:last-child { grid-template-columns: minmax(0,1fr) 48px; }
  .details-team img, .details-team > b { width: 44px; height: 44px; }
  .details-score { min-width: 150px; padding-inline: 10px; }
  .details-score > span { font-size: clamp(34px, 6vw, 54px); }
  .details-score > small { margin-top: 4px; }
  .detail-section h3 { padding-block: 8px; }
  .stat-row { min-height: 30px; }
  .scoring-play { padding-block: 8px; }
  .player-stats-section { margin-top: 8px; }
  .player-category h4 { padding-block: 7px; }
  .player-team-heading { padding-block: 6px; }
  .player-table th, .player-table td { height: 28px; }
  .player-content { padding-top: 8px; }
  .player-profile-card { grid-template-columns: 78px minmax(0,1fr) 44px; gap: 10px; min-height: 82px; margin-bottom: 8px; padding: 4px 12px 4px 5px; }
  .player-headshot, .player-headshot-fallback { width: 74px; height: 76px; }
  .player-headshot-fallback { height: 66px; font-size: 23px; }
  .player-profile-copy h2 { margin-block: 3px 4px; font-size: 28px; }
  .player-profile-copy p { font-size: 11px; }
  .player-profile-team-logo { width: 42px; height: 42px; }
  .player-details-stack { gap: 8px; }
  .player-stat-tile { min-height: 50px; }
}

@media (max-width: 720px) and (orientation: landscape) {
  .details-team strong { font-size: 15px; }
  .details-team span { display: none; }
  .details-score { min-width: 130px; padding-inline: 7px; }
  .details-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 8px; }
  .stats-head, .stat-row { grid-template-columns: 48px minmax(0,1fr) 48px; padding-inline: 7px; }
  .stat-row span { font-size: 10px; }
  .player-team-grid { grid-template-columns: minmax(0,1fr); }
  .player-team-box + .player-team-box { border-top: 1px solid var(--line); border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
