/* On Ice Tonight — "standing on the ice" theme.
 * Page = a frosted ice sheet with rink markings faintly under the surface.
 * Panels = frosted glass. Header = the dasher boards (white, yellow kick plate). */
:root {
  --ice-50: #f4fbff;
  --ice-100: #e3f4fe;
  --ice-200: #c7e8fb;
  --ice-300: #a3d8f6;
  --ice-400: #6fc0ee;
  --ice-500: #2f9fe0;
  --navy-900: #071a33;
  --navy-800: #0b2545;
  --navy-700: #113664;
  --rink-blue: #1c4fbf;        /* blue lines */
  --rink-red: #d7263d;         /* center / goal lines, goal light */
  --board-yellow: #f2c419;     /* kick plate */
  --puck: #141414;
  --line: rgba(11, 37, 69, 0.12);
  --line-strong: rgba(11, 37, 69, 0.22);
  --ink: var(--navy-800);
  --muted: #4f6b8a;
  --accent: #1a86d6;
  --live: var(--rink-red);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --slot-w: 92px;      /* width of one 30-minute column */
  --lane-h: 84px;      /* height of one game lane */
  --net-w: 168px;      /* width of the network column */
  --radius: 10px;
  --font-display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
html[data-theme="night"] { color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--ice-200);
  /* skate scratches, frost sheen, then the rink markings, then the ice gradient */
  background-image:
    repeating-linear-gradient(112deg, rgba(255,255,255,0) 0 23px, rgba(255,255,255,.45) 23px 24px, rgba(255,255,255,0) 24px 61px),
    repeating-linear-gradient(-27deg, rgba(255,255,255,0) 0 41px, rgba(255,255,255,.35) 41px 42px, rgba(255,255,255,0) 42px 97px),
    radial-gradient(900px 500px at 50% -5%, rgba(255,255,255,.9), rgba(255,255,255,0) 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 900' preserveAspectRatio='xMidYMid slice'%3E%3Cg fill='none' stroke-linecap='round'%3E%3Crect x='40' y='40' width='1520' height='820' rx='220' stroke='%231c4fbf' stroke-opacity='.18' stroke-width='6'/%3E%3Cpath d='M800 40V860' stroke='%23d7263d' stroke-opacity='.28' stroke-width='10' stroke-dasharray='24 14'/%3E%3Cpath d='M560 40V860M1040 40V860' stroke='%231c4fbf' stroke-opacity='.28' stroke-width='14'/%3E%3Ccircle cx='800' cy='450' r='150' stroke='%231c4fbf' stroke-opacity='.25' stroke-width='6'/%3E%3Ccircle cx='800' cy='450' r='9' fill='%231c4fbf' fill-opacity='.35'/%3E%3Cg stroke='%23d7263d' stroke-opacity='.22' stroke-width='6'%3E%3Ccircle cx='300' cy='250' r='150'/%3E%3Ccircle cx='300' cy='650' r='150'/%3E%3Ccircle cx='1300' cy='250' r='150'/%3E%3Ccircle cx='1300' cy='650' r='150'/%3E%3C/g%3E%3Cg fill='%23d7263d' fill-opacity='.3'%3E%3Ccircle cx='300' cy='250' r='9'/%3E%3Ccircle cx='300' cy='650' r='9'/%3E%3Ccircle cx='1300' cy='250' r='9'/%3E%3Ccircle cx='1300' cy='650' r='9'/%3E%3C/g%3E%3Cpath d='M130 40V860M1470 40V860' stroke='%23d7263d' stroke-opacity='.28' stroke-width='5'/%3E%3Cpath d='M130 390a60 60 0 0 1 0 120M1470 390a60 60 0 0 0 0 120' stroke='%23d7263d' stroke-opacity='.3' stroke-width='5' fill='%236fc0ee' fill-opacity='.35'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--ice-50) 0%, var(--ice-100) 35%, var(--ice-200) 100%);
  background-attachment: fixed, fixed, fixed, fixed, fixed;
  background-size: auto, auto, auto, cover, auto;
  background-position: center;
  min-height: 100vh;
}
a { color: var(--accent); }
button { font: inherit; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px;
  padding: 14px 16px 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
  backdrop-filter: blur(10px);
  border-bottom: 5px solid var(--board-yellow);      /* the kick plate */
  box-shadow: 0 1px 0 var(--line-strong), 0 6px 18px rgba(11,37,69,.12);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 44px; height: 44px; border-radius: 10px; box-shadow: 0 2px 10px rgba(11,37,69,.35); }
.brand h1 { margin: 0; font: 800 26px/1 var(--font-display); letter-spacing: .5px; text-transform: uppercase; font-style: italic; color: var(--navy-800); }
.brand h1 span { color: var(--ice-500); }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }

.days { display: flex; gap: 6px; overflow-x: auto; flex: 1 1 320px; scrollbar-width: thin; padding-bottom: 2px; }
.day-btn {
  flex: 0 0 auto; min-width: 64px; padding: 6px 10px;
  background: var(--glass); border: 1px solid var(--line-strong); color: var(--ink);
  border-radius: 8px; cursor: pointer; text-align: center; line-height: 1.05;
}
.day-btn small { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.day-btn b { display: block; font: 700 17px/1.1 var(--font-display); }
.day-btn em { display: block; font-style: normal; font-size: 10px; color: var(--muted); }
.day-btn:hover { background: var(--glass-strong); }
/* the selected day is a puck */
.day-btn.on { background: linear-gradient(180deg, #2a2a2a, var(--puck)); color: #fff; border-color: #000; box-shadow: 0 3px 0 #000, 0 6px 12px rgba(0,0,0,.35); }
.day-btn.on small, .day-btn.on em { color: #bdbdbd; }
.day-btn.today small { color: var(--accent); font-weight: 700; }
.day-btn.on.today small { color: #7fd0ff; }

.controls { display: flex; gap: 10px; align-items: center; }

/* favorite team */
.fav-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--glass); color: var(--ink); font-weight: 700; font-size: 13px; white-space: nowrap;
}
.fav-btn:hover { background: var(--glass-strong); }
.fav-btn.has-team { border-color: var(--fav); box-shadow: 0 0 0 2px var(--fav) inset; }
.fav-btn img { width: 22px; height: 22px; object-fit: contain; background: #fff; border-radius: 5px; padding: 1px; }
.day-btn.fav { border-color: var(--fav); box-shadow: 0 0 0 2px var(--fav) inset, 0 4px 12px rgba(11,37,69,.2); }
.day-btn.fav::after { content: ""; display: block; height: 4px; margin: 5px -10px -6px; background: var(--fav); border-radius: 0 0 7px 7px; }
.day-btn.fav em { color: var(--ink); font-weight: 700; }
.day-btn.on.fav { box-shadow: 0 0 0 2px var(--fav) inset, 0 3px 0 #000, 0 6px 12px rgba(0,0,0,.35); }
.day-btn.on.fav em { color: #fff; }
.game.fav { box-shadow: 0 0 0 3px var(--fav), 0 0 16px var(--fav), 0 4px 12px rgba(11,37,69,.28); }
.stream-item.fav { background: color-mix(in srgb, var(--fav) 14%, transparent); border-left: 4px solid var(--fav); padding-left: 8px; border-radius: 6px; }
.ag-item.fav { box-shadow: 0 0 0 2px var(--fav) inset, 0 0 16px color-mix(in srgb, var(--fav) 55%, transparent); }

.share-dlg { width: min(680px, calc(100vw - 24px)); }
.share-preview { padding: 12px 16px 0; }
.share-preview img { display: block; width: 100%; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px 4px; }
.share-primary, .share-secondary { flex: 1 1 140px; text-align: center; padding: 11px 14px; border-radius: 9px; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; border: 1px solid var(--line-strong); }
.share-primary { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
:root[data-theme="night"] .share-primary { background: #fff; color: var(--navy-900); border-color: #fff; }
.share-secondary { background: var(--glass); color: var(--ink); }
.share-hint { margin: 0; padding: 6px 16px 14px; color: var(--muted); font-size: 12px; }
.share-btn { gap: 4px; }

.fav-dlg { border: 1px solid var(--line-strong); border-radius: 14px; padding: 0; width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
  background: var(--glass-strong); color: var(--ink); backdrop-filter: blur(12px); box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.fav-dlg::backdrop { background: rgba(3, 12, 26, .55); backdrop-filter: blur(3px); }
.fav-dlg-head { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 14px 16px 10px; border-bottom: 3px solid var(--rink-red); }
.fav-dlg-head b { grid-column: 1; grid-row: 1; font: 800 24px/1 var(--font-display); text-transform: uppercase; letter-spacing: .5px; }
.fav-dlg-head span { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 13px; }
.fav-close { grid-column: 2; grid-row: 1 / span 2; align-self: start; border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; padding: 2px 6px; }
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; padding: 12px 16px; overflow: auto; max-height: calc(100vh - 220px); }
.fav-team { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--glass); color: var(--ink); cursor: pointer; text-align: left; border-left: 5px solid var(--fav); }
.fav-team:hover { background: var(--glass-strong); border-color: var(--fav); }
.fav-team.on { box-shadow: 0 0 0 2px var(--fav) inset; }
.fav-team img { width: 30px; height: 30px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; flex: 0 0 auto; }
.fav-team span { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.fav-team small { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.fav-team b { font: 800 15px/1.1 var(--font-display); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-none { display: block; width: calc(100% - 32px); margin: 0 16px 14px; padding: 9px; border-radius: 8px; border: 1px dashed var(--line-strong); background: transparent; color: var(--muted); cursor: pointer; font-weight: 600; }
.fav-none:hover { color: var(--ink); border-color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--glass); }
.seg button {
  background: transparent; border: 0; color: var(--muted); padding: 7px 12px; cursor: pointer;
  font-weight: 600; font-size: 13px; white-space: nowrap;
}
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--navy-800); color: #fff; }
.seg .short { display: none; }

/* now marker */
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--live); z-index: 1; pointer-events: none; box-shadow: 0 0 8px rgba(255,59,59,.8); }
.slots .now-line span { position: absolute; top: 2px; left: 4px; font: 700 9px/1 var(--font-body); letter-spacing: 1px; text-transform: uppercase; color: #fff; background: var(--live); padding: 2px 5px; border-radius: 999px; }
.now-line { box-shadow: 0 0 10px rgba(215,38,61,.7); }

/* ---------- agenda (list) view ---------- */
.agenda { display: flex; flex-direction: column; gap: 8px; }
.agenda[hidden], .grid-wrap[hidden], .stream[hidden] { display: none; }
.agenda-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 4px 2px 2px; }
.agenda-head b { font: 800 26px/1 var(--font-display); text-transform: uppercase; letter-spacing: .5px; }
.agenda-head span { color: var(--rink-blue); font: 700 13px/1 var(--font-display); text-transform: uppercase; letter-spacing: 1px; }
.agenda-head em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 12px; }
.ag-item {
  position: relative; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--glass-strong);
  overflow: hidden; padding-left: 6px; box-shadow: 0 4px 14px rgba(11,37,69,.10);
}
/* two-tone team stripe on the left edge */
.ag-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: linear-gradient(var(--away) 0 50%, var(--home) 50% 100%); }
.ag-item.done { opacity: .62; }
.ag-item.live { background: rgba(215, 38, 61, .08); border-color: rgba(215,38,61,.45); }
.ag-item.next { box-shadow: 0 0 0 2px var(--ice-500) inset, 0 4px 14px rgba(11,37,69,.10); }
.ag-item summary { list-style: none; display: grid; grid-template-columns: 58px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer; }
.ag-item summary::-webkit-details-marker { display: none; }
.ag-time { text-align: center; line-height: 1; }
.ag-time b { display: block; font: 800 20px/1 var(--font-display); }
.ag-time b.lv { color: var(--live); animation: pulse 1.4s ease-in-out infinite; }
.ag-time small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; letter-spacing: .5px; white-space: nowrap; }
.ag-teams { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ag-team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ag-team img { width: 26px; height: 26px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; flex: 0 0 auto; border: 1px solid var(--line); }
.ag-team .nm { font: 800 18px/1 var(--font-display); text-transform: uppercase; letter-spacing: .4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-team .nm i { font-style: normal; opacity: .55; font-size: 13px; margin-right: 4px; }
.ag-team .sc { margin-left: auto; font: 800 20px/1 var(--font-display); padding-left: 8px; color: var(--muted); }
.ag-team.win .sc { color: var(--navy-800); }
.ag-nets { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 34vw; }
.ag-nets .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.badge.nat { background: var(--navy-800); color: #fff; }
.badge.ss { background: #6b7280; color: #fff; }
a.badge.tap { text-decoration: none; cursor: pointer; }
a.badge.tap:hover { filter: brightness(1.15); box-shadow: 0 0 0 2px rgba(26,134,214,.35); }
a.badge.tap::after { content: " ↗"; opacity: .6; font-size: 9px; }
.game .tag.ss { left: auto; right: 58px; top: 2px; bottom: auto; transform: none; background: #6b7280; font-size: 9px; }
.ag-detail { padding: 4px 14px 12px; border-top: 1px dashed var(--line-strong); font-size: 13px; color: var(--navy-700); display: grid; gap: 8px; }
.ag-detail > div { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.ag-detail b { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); flex: 0 0 74px; }
.ag-detail .tvall { display: flex; flex-wrap: wrap; gap: 4px; }
.ag-detail .badge i { font-style: normal; opacity: .7; margin-left: 5px; font-weight: 500; text-transform: none; }
.ag-detail .muted { color: var(--muted); }
.ag-detail a { font-weight: 600; }
.ag-links { gap: 14px; }

.notice {
  margin: 12px 16px 0; padding: 10px 14px; border-radius: var(--radius);
  background: rgba(242, 196, 25, 0.22); border: 1px solid rgba(180, 140, 0, 0.45);
  color: #5a4300; font-size: 14px;
}
.notice.info { background: rgba(47, 159, 224, 0.14); border-color: rgba(47, 159, 224, 0.45); color: var(--navy-800); }

/* ---------- the grid ---------- */
main { padding: 14px 16px 24px; }
.grid-wrap { border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--glass); backdrop-filter: blur(6px); box-shadow: 0 8px 24px rgba(11,37,69,.10); }
.grid-scroll { overflow: auto; max-height: calc(100vh - 150px); scrollbar-width: thin; }

.grid-row { display: flex; min-width: max-content; border-bottom: 1px solid var(--line); }
.grid-row:last-child { border-bottom: 0; }
.net-col {
  position: sticky; left: 0; z-index: 3; flex: 0 0 var(--net-w);
  display: flex; align-items: center; justify-content: center; padding: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,.9), rgba(255,255,255,.7));
  border-right: 3px solid var(--rink-blue);          /* the blue line */
}
.lanes { position: relative; flex: 0 0 auto; }
.lanes.grid-bg {
  background-image: linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: var(--slot-w) 100%;
}

/* header row */
.grid-row.head { position: sticky; top: 0; z-index: 5; background: var(--glass-strong); backdrop-filter: blur(8px); border-bottom: 3px solid var(--rink-red); }   /* the goal line */
.grid-row.head .net-col { z-index: 6; }
.corner { display: block; text-align: center; width: 100%; }
.corner b { display: block; font: 800 24px/1 var(--font-display); text-transform: uppercase; letter-spacing: 1px; }
.corner small { display: block; font-size: 10px; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; margin-top: 4px; }
.corner em { display: block; font-style: normal; font: 700 13px/1 var(--font-display); color: var(--accent); margin-top: 3px; text-transform: uppercase; }
.slots { display: flex; }
.slot {
  flex: 0 0 var(--slot-w); text-align: left; padding: 8px 0 6px 6px; line-height: 1;
  border-left: 1px solid var(--line);
}
.slot b { display: block; font: 700 16px/1 var(--font-display); }
.slot small { display: block; font-size: 9px; letter-spacing: 1px; color: var(--muted); margin-top: 2px; }
.slot.hour b { color: var(--navy-800); }
.slot.half b { color: var(--muted); }

/* network wordmark tile */
.net-tile {
  width: 148px; height: 58px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  padding: 4px 8px; text-align: center; font-family: var(--font-display); letter-spacing: .5px;
  box-shadow: 0 3px 8px rgba(11,37,69,.22); border: 1px solid rgba(11,37,69,.12);
}
.net-tile span { font-size: 26px; line-height: 1; white-space: nowrap; }
.net-tile.small span { font-size: 19px; white-space: normal; }
.net-tile.italic span { font-style: italic; }

/* game block */
.game {
  position: absolute; top: 6px; height: calc(var(--lane-h) - 12px);
  display: grid; grid-template-columns: 52px 1fr 52px; grid-template-rows: 1fr 1fr;
  border-radius: 8px; overflow: hidden; background: #fff; color: #111;
  box-shadow: 0 4px 12px rgba(11,37,69,.28), 0 0 0 1px rgba(11,37,69,.12); text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.game:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(11,37,69,.4), 0 0 0 1px rgba(11,37,69,.15); z-index: 2; }
.game .logo { grid-row: 1 / span 2; grid-column: 1; display: flex; align-items: center; justify-content: center; background: #fff; padding: 4px; }
.game .logo.home { grid-column: 3; }
.game .band { grid-column: 2; min-width: 0; }
.game .band.away { grid-row: 1; }
.game .band.home { grid-row: 2; }
.game .logo img { width: 44px; height: 44px; object-fit: contain; }
.game .logo .fallback { font: 800 18px/1 var(--font-display); color: #333; }
.game .band { display: flex; align-items: center; gap: 8px; padding: 0 10px; font: 800 17px/1 var(--font-display); text-transform: uppercase; letter-spacing: .6px; white-space: nowrap; overflow: hidden; }
.game .band .at { font-size: 12px; opacity: .8; letter-spacing: 0; }
.game .band .nm { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.game .band .sc { font-size: 20px; font-weight: 800; padding-left: 6px; }
.game .band .sc.win { text-decoration: underline; text-underline-offset: 3px; }
.game .tag {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 2px;
  font: 700 10px/1 var(--font-body); letter-spacing: .8px; text-transform: uppercase;
  padding: 3px 7px; border-radius: 999px; background: rgba(0,0,0,.72); color: #fff; white-space: nowrap;
}
.game .tag.live { background: var(--live); animation: pulse 1.4s ease-in-out infinite; box-shadow: 0 0 10px rgba(215,38,61,.8); }  /* goal light */
.game .tag.final { background: #222; }
.game .tag.ppd { background: #7a4b00; }
.game .tag.also { left: auto; right: 58px; transform: none; background: rgba(0,0,0,.55); font-size: 9px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.empty-day { padding: 46px 20px; text-align: center; color: var(--muted); font-size: 16px; }
.empty-day b { display: block; font: 800 30px/1.1 var(--font-display); color: var(--ink); margin-bottom: 8px; text-transform: uppercase; }

/* ---------- streaming / regional list ---------- */
.stream { margin-top: 14px; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--glass); backdrop-filter: blur(6px); box-shadow: 0 8px 24px rgba(11,37,69,.10); }
.stream-head {
  background: linear-gradient(90deg, #1c4fbf, #2b6be0); color: #fff; padding: 10px 16px; text-align: center;
  font: 800 16px/1 var(--font-display); letter-spacing: 2px; text-transform: uppercase;
  border-bottom: 3px solid var(--rink-red);
}
.stream-head span { color: #b9d4ff; margin: 0 8px; }
.stream-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 4px 20px; padding: 12px 16px 14px; }
.stream-item { display: grid; grid-template-columns: 62px auto 1fr; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); min-width: 0; }
.stream-item .t { font: 700 15px/1 var(--font-display); color: var(--navy-800); text-align: right; }
.stream-item .t small { font-size: 10px; color: var(--muted); margin-left: 2px; }
.stream-item .nets { display: flex; gap: 4px; flex-wrap: wrap; }
.badge {
  display: inline-block; font: 700 10px/1 var(--font-body); letter-spacing: .5px; text-transform: uppercase;
  padding: 4px 6px; border-radius: 4px; background: var(--navy-800); color: #fff; white-space: nowrap;
}
.badge.espnplus { background: #C8102E; font-style: italic; }
.badge.reg { background: var(--ice-200); color: var(--navy-800); border: 1px solid rgba(11,37,69,.18); }
.stream-item .m { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stream-item .m .fin { color: var(--muted); font-size: 12px; margin-left: 6px; }
.stream-item .m .lv { color: var(--live); font-size: 12px; margin-left: 6px; font-weight: 700; }
.stream-empty { padding: 14px 16px; color: var(--muted); }

/* ---------- footer ---------- */
.foot { padding: 6px 16px 30px; color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.foot .sep { opacity: .5; }
.foot .live-dot::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #17a55a; margin-right: 5px; }


/* ---------- night game: the same rink under the arena lights ---------- */
:root[data-theme="night"] {
  --navy-800: #0b2545;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.22);
  --ink: #eaf6ff;
  --muted: #9dbbd6;
  --accent: #5cc8ff;
  --glass: rgba(6, 24, 48, 0.62);
  --glass-strong: rgba(8, 30, 58, 0.86);
}
:root[data-theme="night"] body {
  background-color: #071a33;
  background-image:
    repeating-linear-gradient(112deg, rgba(255,255,255,0) 0 23px, rgba(255,255,255,.10) 23px 24px, rgba(255,255,255,0) 24px 61px),
    repeating-linear-gradient(-27deg, rgba(255,255,255,0) 0 41px, rgba(255,255,255,.07) 41px 42px, rgba(255,255,255,0) 42px 97px),
    radial-gradient(900px 520px at 50% -8%, rgba(120, 200, 255, .45), rgba(120,200,255,0) 70%),
    radial-gradient(700px 400px at 12% 110%, rgba(47,159,224,.25), rgba(47,159,224,0) 70%),
    radial-gradient(700px 400px at 88% 110%, rgba(47,159,224,.25), rgba(47,159,224,0) 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 900' preserveAspectRatio='xMidYMid slice'%3E%3Cg fill='none' stroke-linecap='round'%3E%3Crect x='40' y='40' width='1520' height='820' rx='220' stroke='%237fd0ff' stroke-opacity='.22' stroke-width='6'/%3E%3Cpath d='M800 40V860' stroke='%23ff5a6e' stroke-opacity='.45' stroke-width='10' stroke-dasharray='24 14'/%3E%3Cpath d='M560 40V860M1040 40V860' stroke='%234d8cff' stroke-opacity='.5' stroke-width='14'/%3E%3Ccircle cx='800' cy='450' r='150' stroke='%234d8cff' stroke-opacity='.4' stroke-width='6'/%3E%3Ccircle cx='800' cy='450' r='9' fill='%234d8cff' fill-opacity='.6'/%3E%3Cg stroke='%23ff5a6e' stroke-opacity='.35' stroke-width='6'%3E%3Ccircle cx='300' cy='250' r='150'/%3E%3Ccircle cx='300' cy='650' r='150'/%3E%3Ccircle cx='1300' cy='250' r='150'/%3E%3Ccircle cx='1300' cy='650' r='150'/%3E%3C/g%3E%3Cg fill='%23ff5a6e' fill-opacity='.5'%3E%3Ccircle cx='300' cy='250' r='9'/%3E%3Ccircle cx='300' cy='650' r='9'/%3E%3Ccircle cx='1300' cy='250' r='9'/%3E%3Ccircle cx='1300' cy='650' r='9'/%3E%3C/g%3E%3Cpath d='M130 40V860M1470 40V860' stroke='%23ff5a6e' stroke-opacity='.45' stroke-width='5'/%3E%3Cpath d='M130 390a60 60 0 0 1 0 120M1470 390a60 60 0 0 0 0 120' stroke='%23ff5a6e' stroke-opacity='.45' stroke-width='5' fill='%234d8cff' fill-opacity='.3'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, #0f3462 0%, #0a2649 40%, #071a33 100%);
  background-attachment: fixed, fixed, fixed, fixed, fixed, fixed, fixed;
  background-size: auto, auto, auto, auto, auto, cover, auto;
}
:root[data-theme="night"] .topbar {
  background: linear-gradient(180deg, rgba(10, 34, 66, .94), rgba(8, 28, 56, .84));
  box-shadow: 0 1px 0 rgba(255,255,255,.12), 0 6px 18px rgba(0,0,0,.45);
}
:root[data-theme="night"] .brand h1 { color: #fff; }
:root[data-theme="night"] .brand-logo { box-shadow: 0 0 16px rgba(92, 200, 255, .55); }
:root[data-theme="night"] .day-btn.on { border-color: #7fd0ff; box-shadow: 0 3px 0 #000, 0 0 12px rgba(92,200,255,.45); }
:root[data-theme="night"] .seg button.on { background: #fff; color: var(--navy-900); }
:root[data-theme="night"] .net-col { background: linear-gradient(90deg, rgba(10, 34, 66, .95), rgba(8, 28, 56, .8)); }
:root[data-theme="night"] .slot.hour b { color: #fff; }
:root[data-theme="night"] .grid-wrap, :root[data-theme="night"] .stream { box-shadow: 0 8px 24px rgba(0,0,0,.35); }
:root[data-theme="night"] .stream-item .t { color: #cfe4ff; }
:root[data-theme="night"] .badge.nat { background: #fff; color: var(--navy-900); }
:root[data-theme="night"] .badge.reg { background: rgba(255,255,255,.12); color: #dbeeff; border-color: rgba(255,255,255,.22); }
:root[data-theme="night"] .badge { background: #fff; color: var(--navy-900); }
:root[data-theme="night"] .badge.espnplus { background: #C8102E; color: #fff; }
:root[data-theme="night"] .ag-item { box-shadow: 0 4px 14px rgba(0,0,0,.35); }
:root[data-theme="night"] .ag-item.next { box-shadow: 0 0 0 2px var(--accent) inset, 0 0 14px rgba(92,200,255,.35); }
:root[data-theme="night"] .ag-team.win .sc { color: #fff; }
:root[data-theme="night"] .ag-detail { color: #cfe4ff; }
:root[data-theme="night"] .notice { background: rgba(242, 196, 25, 0.14); border-color: rgba(242,196,25,.4); color: #ffe08a; }
:root[data-theme="night"] .notice.info { background: rgba(92, 200, 255, 0.12); border-color: rgba(92,200,255,.4); color: #dbeeff; }
:root[data-theme="night"] .empty-day b { color: #fff; }
:root[data-theme="night"] .agenda-head span { color: #7fd0ff; }
:root[data-theme="night"] .foot .live-dot::before { background: #35d07f; }

@media (max-width: 720px) {
  :root { --slot-w: 76px; --lane-h: 76px; --net-w: 116px; }
  .topbar { gap: 8px 10px; padding: 10px 12px 8px; }
  .brand { width: 100%; }
  .brand-logo { width: 34px; height: 34px; }
  .brand p { display: none; }
  .days { order: 3; flex-basis: 100%; }
  .controls { order: 2; width: 100%; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
  .seg button { padding: 6px 9px; font-size: 12px; }
  .seg .long { display: none; }
  .fav-btn { padding: 6px 9px; font-size: 12px; }
  .fav-grid { grid-template-columns: repeat(2, 1fr); }
  .seg .short { display: inline; }
  main { padding: 10px 12px 20px; }
  .notice { margin: 10px 12px 0; font-size: 13px; }
  .foot { padding: 6px 12px 28px; }
  .ag-team .nm { font-size: clamp(15px, 4.4vw, 18px); }
  .ag-nets { max-width: 30vw; }
  .net-tile { width: 100px; height: 50px; }
  .net-tile span { font-size: 20px; }
  .net-tile.small span { font-size: 15px; }
  .brand h1 { font-size: 22px; }
  .grid-scroll { max-height: none; }
  .game { grid-template-columns: 40px 1fr 40px; }
  .game .logo img { width: 34px; height: 34px; }
  .game .band { font-size: 14px; padding: 0 7px; }
  .corner b { font-size: 18px; }
  .stream-item .m { white-space: normal; font-size: 14px; }
  .stream-head { font-size: 13px; letter-spacing: 1px; }
}
