/* Two skins over one layout: Scoreboard (default) and Arcade (`data-skin="arcade"` on <html>).
   Each skin has light and dark tokens; dark follows the system until the visitor picks a theme. */

:root {
  color-scheme: light;
  --bg: #eef1f5;
  --panel: #ffffff;
  --ink: #0e1726;
  --muted: #4a5568;
  --line: #d5dbe3;
  --strip: #0e1726;
  --strip-ink: #ffffff;
  --hot: #f2a900;
  --hot-ink: #0e1726;
  --late: #b93c0c;
  --up: #1a7f37;
  --down: #c62828;
  --big: var(--ink);
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", system-ui, sans-serif;
  --body-size: 16px;
  --radius: 8px;
  --border: 1px solid var(--line);
  --shadow: none;
  --pink: var(--strip); --cyan: var(--strip); --lime: var(--strip); --yellow: var(--strip);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0f1a; --panel: #121a2a; --ink: #f3f5f8; --muted: #a3aec2; --line: #26324a;
    --strip: #000000; --hot: #ffb81c; --late: #ff8a5b; --up: #4ac26b; --down: #ff7b72;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f1a; --panel: #121a2a; --ink: #f3f5f8; --muted: #a3aec2; --line: #26324a;
  --strip: #000000; --hot: #ffb81c; --late: #ff8a5b; --up: #4ac26b; --down: #ff7b72;
}

/* Arcade tokens come after the Scoreboard ones so they win at equal specificity. */
:root[data-skin="arcade"] {
  color-scheme: light;
  --bg: #fff4da; --panel: #ffffff; --ink: #1b1530; --muted: #4e4766; --line: #c9c0a8;
  --pink: #b8165a; --cyan: #00677f; --lime: #2c6e1d; --yellow: #8a5a00;
  --strip: #1b1530; --strip-ink: #fff4da; --hot: #b8165a; --hot-ink: #ffffff; --late: #b8165a;
  --head-ink: #ffffff; --big: #8a5a00;
  --font-display: "Press Start 2P", monospace;
  --font-body: "VT323", monospace;
  --body-size: 21px;
  --radius: 0;
  --border: 4px solid var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root[data-skin="arcade"]:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0b1e; --panel: #17143a; --ink: #f4f1ff; --muted: #b9b2e6; --line: #4a4380;
    --pink: #ff6fae; --cyan: #4be3f2; --lime: #a6f33c; --yellow: #ffd43b;
    --strip: #000000; --strip-ink: #f4f1ff; --hot: #ff6fae; --hot-ink: #0d0b1e; --late: #ff6fae;
    --head-ink: #0d0b1e; --big: #ffd43b;
  }
}
:root[data-skin="arcade"][data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0b1e; --panel: #17143a; --ink: #f4f1ff; --muted: #b9b2e6; --line: #4a4380;
  --pink: #ff6fae; --cyan: #4be3f2; --lime: #a6f33c; --yellow: #ffd43b;
  --strip: #000000; --strip-ink: #f4f1ff; --hot: #ff6fae; --hot-ink: #0d0b1e; --late: #ff6fae;
  --head-ink: #0d0b1e; --big: #ffd43b;
}

/* Show the copy for the current skin. */
:root:not([data-skin="arcade"]) .ar,
:root[data-skin="arcade"] .sb { display: none !important; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: 1.35;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--hot); outline-offset: 2px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 28px 16px 48px; }
@media (min-width: 700px) { .wrap { padding: 28px 24px 48px; } }

/* ---- Ticker ---- */
.ticker {
  display: flex; align-items: center; gap: 12px;
  background: var(--strip); color: var(--strip-ink);
  padding: 0 0 0 16px; min-height: 44px; font-size: 14px;
}
.ticker[hidden] { display: none; }
.ticker-label {
  flex: none; background: var(--hot); color: var(--hot-ink);
  font-family: var(--font-display); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 3px;
}
.ticker-window { flex: 1; overflow: hidden; white-space: nowrap; }
.ticker-track { display: inline-flex; animation: ticker var(--ticker-seconds, 40s) linear infinite; }
.ticker-track ul { display: inline-flex; gap: 0; margin: 0; padding: 0; list-style: none; }
.ticker-track li { padding-right: 18px; }
.ticker-track li::after { content: "•"; padding-left: 18px; opacity: .5; }
.ticker-track b { font-weight: 600; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track, .ticker.paused .ticker-track { animation-play-state: paused; }
.ticker-pause {
  flex: none; width: 44px; height: 44px; border: 0; background: transparent; color: var(--strip-ink);
  display: grid; place-items: center; cursor: pointer; opacity: .8;
}
.ticker.paused .ticker-pause { opacity: 1; color: var(--hot); }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  /* No auto-scroll: the strip scrolls by hand, and the duplicate copy goes away. */
  .ticker-window { overflow-x: auto; }
  .ticker-track { animation: none; }
  .ticker-track ul[aria-hidden] { display: none; }
  .ticker-pause { display: none; }
}

/* ---- Masthead ---- */
.masthead {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-bottom: 3px solid var(--ink); padding-bottom: 12px; margin-bottom: 24px;
}
.masthead h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 56px; line-height: 1; letter-spacing: .02em; text-transform: uppercase; }
.masthead p { margin: 4px 0 0; color: var(--muted); font-weight: 500; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.controls > * { white-space: nowrap; }
.icon-btn, .arcade-btn {
  height: 44px; border-radius: var(--radius); border: var(--border); background: var(--panel); cursor: pointer;
}
.icon-btn { width: 44px; display: grid; place-items: center; }
.arcade-btn { padding: 0 14px; font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: .04em; }
.arcade-btn:hover, .icon-btn:hover { border-color: var(--ink); }

/* ---- Tiles ---- */
.tiles { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 700px) {
  /* Ten tiles in TILES order: five full rows of two. */
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1040px) {
  /* Nine tiles fill three rows of three; the h2h lookup gets the whole bottom row for its one-line form. */
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile.h2h-tile { grid-column: 1 / -1; }
}

/* Out & About: a one-line tile (Rudy's pick: smaller than the others). */
.tile.compact .tile-body { padding: 12px 16px; }
.compact-line { font-size: 18px; font-weight: 500; }
.compact-line b { font-family: var(--font-display); font-weight: 700; font-size: 32px; color: var(--big); margin-right: 2px; }
.compact-line .muted { color: var(--muted); font-size: 15px; }

.tile {
  --tile-head: var(--strip);
  background: var(--panel); border: var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.tile-head {
  background: var(--tile-head); color: var(--strip-ink);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 16px; font-family: var(--font-display); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.tile-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.tag { font-size: 15px; border: 1px solid currentColor; padding: 1px 8px; border-radius: 3px; white-space: nowrap; }
.tag:empty { display: none; }
.tag.hot { background: var(--hot); color: var(--hot-ink); border-color: var(--hot); }
.tile-body { padding: 16px; flex-grow: 1; }
.tile-body p { margin: 0; }
.big { font-family: var(--font-display); font-weight: 700; font-size: 72px; line-height: 1; color: var(--big); }
.big small { font-size: .4em; margin-left: 4px; }
.label { margin-top: 6px !important; }
.sub { margin-top: 8px !important; color: var(--muted); font-size: .94em; }
.kicker { color: var(--muted); font-weight: 500; margin-bottom: 8px !important; }
.headline { font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: 1.05; text-transform: uppercase; margin-bottom: 6px !important; }
.tile-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
.tile-foot a { font-weight: 600; color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; margin: -10px 0; }
.late { background: var(--late); color: #fff; padding: 1px 6px; border-radius: 3px; font-weight: 600; margin-left: 4px; }
.tile.failed .tile-body { color: var(--muted); }

/* King of the Court: picks board and last night. */
.split { display: flex; gap: 24px; flex-wrap: wrap; }
.split > div { flex: 1 1 260px; min-width: 0; }
.split .aside { flex: 1 1 200px; border: 0 solid var(--line); border-left-width: 1px; padding-left: 24px; }
@media (max-width: 699px) { .split .aside { border-left-width: 0 !important; padding-left: 0; border-top-width: 1px; padding-top: 14px; } }
.board { list-style: none; margin: 0; padding: 0; }
.board li { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 18px; }
.board li:last-child { border-bottom: 0; }
.board li > span:not(.rank) { flex-grow: 1; min-width: 0; }
.board .rank { font-family: var(--font-display); font-weight: 700; font-size: 22px; width: 18px; color: var(--muted); }
.board .team { color: var(--muted); font-weight: 500; font-size: 14px; }
.board b { font-family: var(--font-display); font-weight: 700; font-size: 26px; color: var(--big); }
.board .empty { color: var(--muted); font-weight: 500; }

/* Head to head lookup. */
.h2h { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 1040px) { .h2h { grid-template-columns: 1fr 1.4fr 1.4fr auto; align-items: end; } }
.h2h label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
.h2h input, .h2h select {
  height: 44px; padding: 0 12px; border: var(--border); border-radius: calc(var(--radius) - 2px);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; font-weight: 500; width: 100%;
}
.h2h button {
  height: 44px; padding: 0 18px; border: 0; border-radius: calc(var(--radius) - 2px); cursor: pointer;
  background: var(--hot); color: var(--hot-ink);
  font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: .06em; text-transform: uppercase;
}

.foot { margin-top: 32px; color: var(--muted); font-size: 14px; text-align: center; }
/* Footer alerts link and its panel (alerts.js): quiet on purpose, since the alerts are only for Rudy's devices. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.alerts-btn {
  display: block; margin: 8px auto 0; min-height: 44px; padding: 0 12px; border: 0; background: none; cursor: pointer;
  color: var(--muted); font: inherit; text-decoration: underline; text-underline-offset: 3px;
}
.alerts-btn:hover { color: var(--ink); }
.alerts-panel {
  max-width: 420px; margin: 4px auto 0; padding: 14px 16px; text-align: left; color: var(--ink);
  background: var(--panel); border: var(--border); border-radius: var(--radius);
}
.alerts-panel p { margin: 0; }
.alerts-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
form.alerts-row { margin-top: 0; }
.alerts-row input {
  flex: 1 1 160px; min-width: 0; height: 44px; padding: 0 12px; border: var(--border); border-radius: calc(var(--radius) - 2px);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; /* 16px stops iOS zooming in on focus */
}
.alerts-row button {
  height: 44px; padding: 0 16px; border: var(--border); border-radius: calc(var(--radius) - 2px); cursor: pointer;
  background: var(--panel); color: var(--ink); font: inherit; font-weight: 600;
}
.alerts-row button:hover { border-color: var(--ink); }
.alerts-row button[type="submit"] { background: var(--hot); color: var(--hot-ink); border-color: transparent; }
.alerts-msg { margin-top: 8px !important; color: var(--muted); font-size: 14px; }
.alerts-msg:empty { display: none; }

/* ---- Daily page (daily.html): no Arcade skin, but the hub link button on index.html gets one below. ---- */
.link-btn {
  height: 44px; padding: 0 14px; display: inline-flex; align-items: center; text-decoration: none;
  border-radius: var(--radius); border: var(--border); background: var(--panel);
  font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: .04em;
}
.link-btn:hover { border-color: var(--ink); }
@media (min-width: 700px) { .tile.full { grid-column: 1 / -1; } }
.daily .tile-foot { flex-wrap: wrap; }
/* Football, Basketball, Upsets and Top 25 (.row-tile) share rows, and any but Upsets can be hidden (no games,
   or no poll in summer). arrangeRow() in daily.js counts the ones showing into data-row and marks an odd last
   one: 4 or 2 take halves, 3 take thirds, 1 takes the whole row. Weather and Countdowns take halves. */
@media (min-width: 700px) and (max-width: 1039px) {
  .daily .row-last-odd { grid-column: 1 / -1; }
}
@media (min-width: 1040px) {
  .tiles.daily { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .daily > .tile:not(.full) { grid-column: span 3; }
  .daily[data-row="3"] > .row-tile { grid-column: span 2; }
  .daily[data-row="1"] > .row-tile { grid-column: 1 / -1; }
}
.meta { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; font-weight: 400; }
.daily a { text-decoration: none; }
.daily a:hover .vt, .headlines a:hover, .upset-list a:hover { text-decoration: underline; }

.news { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 28px; }
@media (min-width: 900px) { .news { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.news h3, .day {
  margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
/* Below 900 px the sections are tabs, one at a time (Rudy's choice: 9 stacked headlines pushed the scores
   2 screens down). The tab names stand in for the section headings, which stay for screen readers. */
.news-tabs, .poll-tabs { display: flex; gap: 6px; margin-bottom: 4px; }
.news-tabs button, .poll-tabs button {
  flex: 1; min-height: 44px; padding: 0 6px; cursor: pointer;
  border: var(--border); border-radius: var(--radius); background: var(--bg); color: var(--muted);
  font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .06em; text-transform: uppercase;
}
.news-tabs button[aria-selected="true"], .poll-tabs button[aria-selected="true"] { background: var(--strip); border-color: var(--strip); color: var(--strip-ink); }
.news section.off, .poll-panel.off { display: none; }
@media (max-width: 899px) { .news h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
@media (min-width: 900px) {
  .news-tabs { display: none; }
  .news section.off { display: block; }
}
.headlines, .games, .upset-list, .channels { list-style: none; margin: 0; padding: 0; }
.headlines li, .upset-list li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.headlines li:last-child, .upset-list li:last-child { border-bottom: 0; }
.headlines a { font-weight: 600; }

/* Scores: two team lines on the left, the status spanning both on the right. */
h3.day { margin-bottom: 2px; }
.older { margin-top: 12px; }
.older summary, .more summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.more summary { color: var(--muted); font-weight: 600; font-size: 14px; border-top: 1px solid var(--line); }
.more[open] summary { display: none; }
.older summary::before { content: "▸"; margin-right: 6px; }
.older[open] summary::before { content: "▾"; }
.game { border-bottom: 1px solid var(--line); }
.game:last-child { border-bottom: 0; }
.game > a, .game > div { display: grid; grid-template-columns: minmax(0, 1fr) auto 88px; column-gap: 12px; align-items: center; padding: 8px 0; }
.game .st { grid-column: 3; grid-row: 1 / span 4; text-align: right; color: var(--muted); font-size: 14px; }
.game .pick { grid-column: 1 / 3; justify-self: start; margin-top: 4px; font-size: 13px; font-weight: 600; padding: 0 6px; border-radius: 3px; border: 1px solid var(--line); }
.game .pick.good { color: var(--up); border-color: currentColor; }
.game .pick.bad { color: var(--down); border-color: currentColor; }
.game .info { grid-column: 1 / 3; color: var(--muted); font-size: 13px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game .pts { font-family: var(--font-display); font-weight: 600; font-size: 20px; text-align: right; font-variant-numeric: tabular-nums; }
.game .w { font-weight: 700; }
.game .l { color: var(--muted); }
.game .rk { color: var(--muted); font-size: 13px; font-weight: 600; margin-right: 5px; }
.game.in .st { color: var(--ink); font-weight: 600; }
.game.uva > a, .game.uva > div { box-shadow: inset 3px 0 0 var(--hot); padding-left: 10px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--late); margin-right: 6px; vertical-align: 1px; }

/* Weather and Coming Up: a short row under Markets, so they stay compact. */
.weather .tile-body, #countdowns .tile-body { padding: 10px 16px; }
/* The day's details follow the temperature on the same line when they fit. */
.weather .tile-body { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 16px; }
.weather .tile-body .sub { margin-top: 4px !important; }
.wx-now { display: flex; align-items: baseline; gap: 10px; }
.wx-temp { font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.wx-cond { font-weight: 600; font-size: 18px; }
.countdowns { list-style: none; margin: 0; padding: 0; }
.countdowns li { border-bottom: 1px solid var(--line); }
.countdowns li:last-child { border-bottom: 0; }
.countdowns li > a, .countdowns li:not(:has(a)) { display: grid; grid-template-columns: 92px minmax(0, 1fr); column-gap: 10px; padding: 4px 0; }
.countdowns a:hover .cd-what { text-decoration: underline; }
.cd-when { grid-row: 1 / span 2; font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding-top: 1px; }
.cd-what { font-weight: 600; }
.countdowns .meta { margin-top: 0; font-size: 13px; }
/* Wide enough for one line per item: the details follow the name. */
@media (min-width: 1040px) {
  .countdowns li > a, .countdowns li:not(:has(a)) { grid-template-columns: 92px auto minmax(0, 1fr); align-items: baseline; }
  .cd-when { grid-row: auto; }
  .countdowns .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Data Jobs: folded to one line when everything's fine; red and moved up under Markets when not. */
.jobs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 28px; }
@media (min-width: 900px) { .jobs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.job { border-bottom: 1px solid var(--line); }
.job > a, .job:not(:has(a)) { display: grid; grid-template-columns: 14px minmax(0, 1fr); column-gap: 8px; padding: 6px 0; }
.job > a:hover .jn { text-decoration: underline; }
.jdot { grid-row: 1 / span 2; width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: var(--up); }
.job.is-failed .jdot, .job.is-late .jdot { background: var(--late); }
.job.is-running .jdot { background: var(--hot); }
.job.is-off .jdot, .job.is-starting .jdot { background: var(--line); }
.jn { font-weight: 600; }
.js { color: var(--muted); font-size: 14px; }
.job.is-failed .js b, .job.is-late .js b { color: var(--late); }
#health.bad .tag { background: var(--late); border-color: var(--late); color: #fff; }

/* AP Top 25: rank, team and record, then the move since last week. */
.poll { list-style: none; margin: 0; padding: 0; }
.poll li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; column-gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.poll li:last-child { border-bottom: 0; }
.poll li.uva { box-shadow: inset 3px 0 0 var(--hot); padding-left: 10px; }
.poll .pr { font-family: var(--font-display); font-weight: 700; font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.poll .pt { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poll .rec { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 4px; }
.poll .mv { color: var(--muted); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.poll .mv.up { color: var(--up); }
.poll .mv.down { color: var(--down); }
.poll-panel .more { margin-top: 0; }
.upset-list a { font-weight: 500; }
.upset-list b { font-weight: 700; }
.line { font-family: var(--font-display); font-weight: 700; background: var(--hot); color: var(--hot-ink); padding: 0 5px; border-radius: 3px; }

/* Thumbnail-left cards: a list on a phone, two columns wider. Small thumbnails keep the tile short (Rudy's choice). */
.channels { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
/* The spare 4th row takes the thumbnail's extra height, so the text stays packed at the top. */
.channel a { display: grid; grid-template-columns: 128px minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; column-gap: 12px; row-gap: 2px; }
.channel img, .no-thumb { grid-row: 1 / -1; display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: calc(var(--radius) - 2px); background: var(--line); }
@media (min-width: 700px) {
  .channels { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .channel a { grid-template-columns: 176px minmax(0, 1fr); column-gap: 14px; }
}
.channel.fresh img { outline: 3px solid var(--hot); outline-offset: -3px; }
.channel .ch { color: var(--muted); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.channel .vt { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Markets: first on every width. On a phone it's a normal tile; wider, it's a one-row strip (label and
   status on the left, the indexes, then the close and the CNBC link), so the scores start higher up. */
.markets .tile-body { padding: 12px 16px; }
.indexes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 700px) {
  .markets { flex-direction: row; }
  .markets .tile-head { flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; }
  .markets .tile-body { display: flex; align-items: center; padding: 10px 24px; }
  .markets .tile-foot { border-top: 0; flex-direction: column; flex-wrap: nowrap; align-items: flex-end; justify-content: center; gap: 0; text-align: right; }
  .markets .tile-foot a { margin: 0; }
  .indexes { grid-template-columns: repeat(2, minmax(0, 200px)); gap: 32px; }
  .ix-pct { font-size: 32px; }
}
.ix-name { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ix-pct { margin: 2px 0 0 !important; font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.ix-pct span[aria-hidden] { font-size: .55em; vertical-align: .25em; }
.index.up .ix-pct { color: var(--up); }
.index.down .ix-pct { color: var(--down); }
.ix-sub { margin-top: 4px !important; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.ix-fut { margin-top: 2px !important; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ix-fut.up { color: var(--up); }
.ix-fut.down { color: var(--down); }
/* Rates use plain ink: a rising yield isn't good or bad news the way a rising index is. */
.rates { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; font-variant-numeric: tabular-nums; }
.rates li { display: flex; flex-direction: column; }
.r-name { font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.r-val { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.1; }
.r-chg { color: var(--muted); font-size: 14px; }
.markets .when > span { display: block; }
/* Wider, the rates sit to the right of the indexes as a small three-line table. */
@media (min-width: 700px) {
  .rates { grid-template-columns: auto auto auto; gap: 2px 14px; margin: 0 0 0 32px; padding: 0 0 0 24px; border-top: 0; border-left: 1px solid var(--line); align-items: baseline; }
  .rates li { display: contents; }
  .rates span, .index p, .markets .when > span:first-child { white-space: nowrap; }
  /* The futures footnote wraps instead of widening the footer. */
  .markets .tile-foot { max-width: 170px; }
  .r-val { font-size: 18px; }
}
@media (min-width: 700px) and (max-width: 1039px) {
  .indexes { grid-template-columns: repeat(2, auto); gap: 24px; }
  .rates { margin-left: 24px; padding-left: 20px; gap: 2px 10px; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.badge { background: var(--hot); color: var(--hot-ink); font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: .04em; }

/* ---- Home Base page (homebase.html): events across the top, then the money and housing tiles. ---- */
.section-head {
  grid-column: 1 / -1; margin: 12px 0 -4px; font-family: var(--font-display); font-weight: 700; font-size: 22px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.home .big { font-size: 56px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip-btn {
  min-height: 36px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: var(--border); border-radius: 999px; background: var(--bg); color: var(--muted); font-weight: 600; font-size: 14px;
}
.chip-btn span { font-variant-numeric: tabular-nums; font-weight: 500; opacity: .8; }
.chip-btn[aria-pressed="true"] { background: var(--strip); border-color: var(--strip); color: var(--strip-ink); }
.evs { list-style: none; margin: 0 0 6px; padding: 0; }
.ev { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev-time { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.ev-what a { font-weight: 600; }
.ev-what a:hover { text-decoration: underline; }
.ev-price { color: var(--muted); font-size: 14px; white-space: nowrap; }
.ev-flag { background: var(--late); color: #fff; font-size: 12px; font-weight: 600; padding: 0 6px; border-radius: 3px; }
.wk { font-size: 12px; letter-spacing: .04em; background: var(--hot); color: var(--hot-ink); padding: 0 6px; border-radius: 3px; vertical-align: 2px; }
#events h3.day { margin-top: 10px; }
@media (max-width: 520px) {
  /* Phones: time above the name, price after the venue line. */
  .ev { grid-template-columns: minmax(0, 1fr) auto; }
  .ev-time { grid-column: 1 / -1; font-size: 13px; }
}
.spark { display: block; width: 100%; height: 48px; margin-top: 12px; }
.split-fig { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-start; }
.split-fig > div { flex: 1 1 260px; min-width: 0; }
.trend-label { margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.trend .spark { margin-top: 6px; }
.wkpt { margin-right: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wkpt b { color: var(--ink); }

/* Paycheck share: one color per bill. Insurance is hatched because it's an estimate, not a local number. */
#payshare {
  --c-rent: var(--ink); --c-groceries: var(--hot); --c-electricity: #8fb3de; --c-gas: #2f6db5;
  --c-insurance: repeating-linear-gradient(45deg, var(--muted) 0 3px, var(--line) 3px 6px);
}
#payshare .big { font-size: 80px; }
.ps-grid { display: flex; flex-wrap: wrap; gap: 20px 40px; }
.ps-grid > div { flex: 1 1 320px; min-width: 0; }
.ps-lead { margin-top: 8px !important; font-size: 1.1em; line-height: 1.35; }
.ps-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 4px; }
.ps-bar { display: flex; height: 22px; border-radius: 4px; overflow: hidden; margin: 8px 0 4px; }
.ps-bar span, .ps-key { background: var(--c); }
.ps-rows { list-style: none; margin: 0; padding: 0; }
.ps-row {
  display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; column-gap: 10px; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.ps-row:last-child { border-bottom: 0; }
.ps-key { width: 12px; height: 12px; border-radius: 2px; align-self: center; }
.ps-note, .ps-chg { color: var(--muted); font-size: 14px; }
.ps-amt { font-family: var(--font-display); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; text-align: right; }
.ps-chg { grid-column: 2 / -1; text-align: left; }
@media (max-width: 559px) { .ps-note { display: block; } }
@media (min-width: 560px) {
  /* Wider screens: the change sits on the same line, after the amount. */
  .ps-row { grid-template-columns: 14px minmax(0, 1fr) auto 128px; }
  .ps-chg { grid-column: auto; text-align: right; }
}

@media (max-width: 480px) {
  .masthead h1 { font-size: 44px; }
  /* Daily: keep the Hub and theme buttons beside the title instead of on a row of their own. */
  .daily-head { flex-wrap: nowrap; align-items: center; }
  .daily-head h1 { font-size: 38px; }
  .daily-head .link-btn { padding: 0 10px; }
  /* Hub: four buttons fit one row once the arrows and "mode" drop. */
  .controls .arr { display: none; }
  .controls .link-btn, .controls .arcade-btn { padding: 0 10px; font-size: 16px; }
  .big { font-size: 56px; }
  .headline { font-size: 32px; }
}

/* ---- Arcade skin: same boxes, pixel type, hard shadows, a color per tile. ---- */
[data-skin="arcade"] .masthead { border-bottom: 0; }
[data-skin="arcade"] .masthead h1 { font-size: 36px; color: var(--yellow); text-shadow: 4px 4px 0 var(--pink); }
[data-skin="arcade"] .masthead p { margin-top: 12px; }
[data-skin="arcade"] .icon-btn, [data-skin="arcade"] .arcade-btn { box-shadow: 4px 4px 0 var(--ink); }
[data-skin="arcade"] .arcade-btn { font-size: 12px; font-weight: 400; background: var(--yellow); color: var(--head-ink); }
[data-skin="arcade"] .link-btn { box-shadow: 4px 4px 0 var(--ink); font-size: 12px; font-weight: 400; }
[data-skin="arcade"] .tiles { gap: 24px; }
[data-skin="arcade"] .tile { --tile-head: var(--accent); box-shadow: 6px 6px 0 var(--accent); }
[data-skin="arcade"] .tile[data-accent="pink"] { --accent: var(--pink); }
[data-skin="arcade"] .tile[data-accent="cyan"] { --accent: var(--cyan); }
[data-skin="arcade"] .tile[data-accent="lime"] { --accent: var(--lime); }
[data-skin="arcade"] .tile[data-accent="yellow"] { --accent: var(--yellow); }
[data-skin="arcade"] .tile-head { color: var(--head-ink); font-weight: 400; letter-spacing: 0; padding: 10px 14px; }
[data-skin="arcade"] .tile-head h2 { font-size: 12px; font-weight: 400; line-height: 1.5; }
[data-skin="arcade"] .tag { font-size: 10px; border: 0; padding: 0; }
[data-skin="arcade"] .tag.hot { background: var(--head-ink); color: var(--accent); padding: 4px 6px; animation: blink 1.2s steps(2, start) 3; }
[data-skin="arcade"] .big { font-weight: 400; font-size: 34px; line-height: 1.2; }
[data-skin="arcade"] .kicker { font-family: var(--font-display); font-size: 10px; line-height: 1.6; }
[data-skin="arcade"] .headline { font-weight: 400; font-size: 17px; line-height: 1.5; color: var(--lime); }
[data-skin="arcade"] .label { margin-top: 10px !important; }
[data-skin="arcade"] .sub { font-size: 1em; }
[data-skin="arcade"] .alerts-panel { box-shadow: 4px 4px 0 var(--ink); }
[data-skin="arcade"] .alerts-row button { box-shadow: 3px 3px 0 var(--ink); }
[data-skin="arcade"] .tile-foot { border-top: 0; font-size: 19px; }
[data-skin="arcade"] .tile-foot a { font-family: var(--font-display); font-size: 11px; font-weight: 400; }
[data-skin="arcade"] .late { background: var(--pink); color: var(--head-ink); font-weight: 400; }
[data-skin="arcade"] .split .aside { border-style: dotted; border-left-width: 4px; }
@media (max-width: 699px) { [data-skin="arcade"] .split .aside { border-top-width: 4px; } }
[data-skin="arcade"] .board li { border-bottom: 0; font-size: 26px; font-weight: 400; padding: 2px 0; }
[data-skin="arcade"] .board .rank { font-size: 26px; font-weight: 400; width: auto; }
[data-skin="arcade"] .board .rank::after { content: "."; }
[data-skin="arcade"] .board b { font-family: var(--font-body); font-weight: 400; font-size: 28px; }
[data-skin="arcade"] .h2h label { font-family: var(--font-display); font-weight: 400; font-size: 10px; color: var(--muted); }
[data-skin="arcade"] .h2h input, [data-skin="arcade"] .h2h select { border-width: 3px; font-size: 22px; }
[data-skin="arcade"] .h2h button { border: 3px solid var(--ink); background: var(--yellow); color: var(--head-ink); font-size: 13px; font-weight: 400; letter-spacing: 0; }
[data-skin="arcade"] .ticker { font-size: 19px; }
[data-skin="arcade"] .ticker-label { background: transparent; color: var(--pink); font-weight: 400; font-size: 11px; padding: 0; }
[data-skin="arcade"] .ticker-track li::after { content: ""; padding: 0; }
@media (max-width: 480px) {
  [data-skin="arcade"] .masthead h1 { font-size: 28px; }
  [data-skin="arcade"] .big { font-size: 26px; }
}
@keyframes blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { [data-skin="arcade"] .tag.hot { animation: none; } }

/* Switching into Arcade: a quick CRT flicker with scanlines (skipped for reduced motion in common.js). */
body.crt::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 10;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .28) 0 2px, transparent 2px 4px);
  animation: crt 380ms steps(6) forwards;
}
@keyframes crt {
  0% { opacity: 1; background-color: rgba(255, 255, 255, .55); }
  30% { opacity: .4; background-color: transparent; }
  55% { opacity: .9; background-color: rgba(75, 227, 242, .18); }
  100% { opacity: 0; }
}
