/* The game page: a dark theme after Age of Empires IV's menus (near-black
   slate, bronze edges, gold for what matters, parchment text). */
:root {
  --page: #0e1013;
  --panel: #171a1f;
  --panel-edge: #4a3f2c;
  --rule: #2a2d33;
  --ink: #e6dfcf;
  --ink-muted: #9b9484;
  --gold: #d6b25e;
  --victory: #d6b25e;
  --defeat: #c25a4b;
  --up: #7fbf6a;
  --down: #d0705f;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.game-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}
.back { margin: 0 0 0.75rem; font-size: 0.9rem; }

/* Sharing the game (pages.rs share_box): a button at the top right of the
   game's header, its icon before the word; once the link is made, it opens
   a panel under it with the link and the button that copies it. */
.share { float: right; margin: 0.15rem 0 0.5rem 1rem; font-size: 0.85rem; }
/* the panel is placed within the header, so it never leaves the page */
.game-head { position: relative; }
.share form { margin: 0; }
.share-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #2a2417;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 3px;
  padding: 0.4rem 0.85rem;
  font: 600 0.72rem/1.2 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.share-button::-webkit-details-marker { display: none; }
.share-button:hover, .share[open] .share-button { background: #332b1b; }
.share-button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.share-icon { width: 1rem; height: 1rem; flex: none; }
.share-panel {
  position: absolute;
  right: 1.25rem;
  top: 3.6rem;
  z-index: 5;
  width: min(30rem, calc(100% - 2.5rem));
  box-sizing: border-box;
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-top: 2px solid var(--gold);
  border-radius: 4px;
  padding: 0.75rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.share-panel label { display: flex; flex-direction: column; gap: 0.35rem; color: var(--ink-muted); flex: 1; min-width: 0; }
.share-link {
  min-width: 0;
  background: var(--page);
  color: var(--ink);
  border: 1px solid var(--panel-edge);
  border-radius: 3px;
  padding: 0.35rem 0.5rem;
  font: 0.85rem/1.3 ui-monospace, Consolas, monospace;
}
.share-link:focus { outline: none; border-color: var(--gold); }
.share-copy {
  background: #2a2417;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 3px;
  padding: 0.4rem 0.85rem;
  font: 600 0.72rem/1.2 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.share-copy:hover { background: #332b1b; }
/* the teams start under the share button */
.game-head .teams { clear: both; }

/* The bar over every page (pages.rs bar): a strip across the page, a panel
   under a gold hairline, its contents in the pages' 1100px column: the
   site's emblem and name on the left (home), the viewer's name and signing
   out (or signing in) on the right. */
.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem max(1rem, calc((100% - 1100px) / 2));
  background: linear-gradient(to bottom, #1b1e24, #14171b);
  border-bottom: 1px solid var(--panel-edge);
  box-shadow: inset 0 -1px 0 rgba(214, 178, 94, 0.18), 0 2px 10px rgba(0, 0, 0, 0.35);
  margin-bottom: 0.75rem;
}
.site-bar .brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); }
.site-bar .brand:hover { text-decoration: none; color: var(--gold); }
.site-bar .brand .emblem { width: 1.9rem; height: 1.9rem; margin: 0; }
.site-bar .brand span { font: 600 1.05rem/1 Georgia, "Times New Roman", serif; letter-spacing: 0.04em; }
.site-user { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; min-width: 0; }
.site-name {
  color: var(--ink);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-name:hover { color: var(--gold); text-decoration: none; }
.site-user form { margin: 0; }
/* the way to the settings: a gear, muted, gold on hover */
.site-settings { display: inline-flex; color: var(--ink-muted); }
.site-settings:hover { color: var(--gold); }
.site-settings svg { width: 1.25rem; height: 1.25rem; }
/* an answer to the viewer's feedback waits: a gold dot on the gear */
.site-settings.answered { position: relative; color: var(--gold); }
.site-settings .dot {
  position: absolute;
  top: -0.15rem;
  right: -0.2rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 2px #171a1f;
}
.site-user button {
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid var(--panel-edge);
  border-radius: 3px;
  padding: 0.3rem 0.7rem;
  font: 600 0.7rem/1.2 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  white-space: nowrap;
}
.site-user button:hover { color: var(--gold); border-color: var(--gold); }
/* signed out: the way to sign in, small, gold (the home card has it big) */
.site-user .steam-in, .site-user .xbox-in {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 3px;
  padding: 0.3rem 0.7rem;
  font: 600 0.7rem/1.2 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.site-user .steam-in:hover, .site-user .xbox-in:hover { text-decoration: none; background: #332b1b; }
.site-user .steam-logo, .site-user .xbox-logo { width: 1rem; height: 1rem; flex: none; }

/* Every page's footer (pages.rs): where the data comes from, and
   Microsoft's notice; small and muted, under a bronze rule. */
.site-foot {
  max-width: 1100px;
  margin: 1rem auto 0;
  padding: 1rem 1rem 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.78rem;
  text-align: center;
}
.site-foot p { margin: 0 auto 0.4rem; max-width: 46rem; }
/* the way to send feedback about the game, at the foot of its page */
.game-feedback { margin: 1.5rem 0 0; text-align: center; font-size: 0.85rem; }
.back a::before { content: "\2190\00a0"; }

/* Header: the map and the game's facts, then the teams side by side. */
.game-head {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-top: 2px solid var(--gold);
  border-radius: 4px;
  padding: 1rem 1.25rem 1.25rem;
  margin-bottom: 1.25rem;
}
.game-head h1 {
  margin: 0;
  font: 600 1.7rem/1.2 Georgia, "Times New Roman", serif;
  letter-spacing: 0.04em;
  color: var(--gold);
}
.game-head h1 .mode { color: var(--ink); }
.game-head h1 .mode::before { content: "\00b7"; margin: 0 0.45em; color: var(--ink-muted); }
.facts {
  list-style: none;
  margin: 0.35rem 0 1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  color: var(--ink-muted);
  font-size: 0.9rem;
}
.facts li + li::before { content: "\00b7"; margin: 0 0.5rem; }

.teams {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
}
.team {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule);
  border-radius: 3px;
  padding: 0.6rem 0.8rem;
  background: rgba(0, 0, 0, 0.18);
}
.team.win { border-left-color: var(--victory); }
.team.loss { border-left-color: var(--defeat); }
.team h2 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 0.4rem;
  font: 600 0.8rem/1.4 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.team.win .outcome { color: var(--victory); }
.team.loss .outcome { color: var(--defeat); }
.team-mmr { color: var(--ink-muted); font-weight: 400; letter-spacing: 0.05em; }
.team ul { list-style: none; margin: 0; padding: 0; }
.team li {
  display: grid;
  grid-template-columns: 0.7rem minmax(0, 1fr) auto;
  grid-template-areas: "swatch name mmr" ". civ mmr";
  column-gap: 0.5rem;
  align-items: center;
  padding: 0.35rem 0;
  border-top: 1px solid var(--rule);
}
.team li:first-child { border-top: 0; }
.swatch {
  grid-area: swatch;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  background: var(--rule);
}
.name {
  grid-area: name;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.civ { grid-area: civ; color: var(--ink-muted); font-size: 0.82rem; }
.mmr { grid-area: mmr; text-align: right; font-variant-numeric: tabular-nums; }
.mmr .none { color: var(--ink-muted); font-size: 0.82rem; }
.diff { font-size: 0.8rem; margin-left: 0.2rem; }
.diff.up { color: var(--up); }
.diff.down { color: var(--down); }
.diff.even { color: var(--ink-muted); }
.vs {
  align-self: center;
  color: var(--ink-muted);
  font: italic 1rem Georgia, serif;
}

/* The sections under the header (the replay, and more to come): each opens
   with its title in gold, small capitals, and a bronze rule running to the
   right edge. */
.game-section { margin-bottom: 1.5rem; }
.section-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
  color: var(--gold);
  font: 600 1rem/1.3 Georgia, "Times New Roman", serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.section-head::before {
  content: "";
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  background: var(--gold);
  transform: rotate(45deg);
}
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--panel-edge), transparent);
}
.game-section .replay-section { margin-bottom: 0; }

#status { color: var(--ink-muted); margin: 0; }
/* the demo's page (pages.rs demo): under the header, why the names are hidden */
.demo-note { margin: -0.75rem 0 1.25rem; color: var(--ink-muted); font-size: 0.85rem; }
#status.waiting { display: flex; align-items: center; gap: 0.6rem; }

/* The HUD over the replay (static/hud.js): two teams face each other, as in
   the game's replay HUD; more teams stack. */
.hud {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.hud-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
.hud-many { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.hud-team {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 4px;
  padding: 0.5rem 0.7rem;
}
.hud-right { text-align: right; }

.hud-players { list-style: none; margin: 0 0 0.4rem; padding: 0; }
.hud-players li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.1rem 0;
  min-width: 0;
}
.hud-right .hud-players li { flex-direction: row-reverse; }
.hud-sw { flex: none; width: 0.6rem; height: 0.6rem; border-radius: 2px; background: var(--rule); }
.hud-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
/* the civilization after the name, giving way first when space runs out */
.hud-civ {
  color: var(--ink-muted);
  font-size: 0.75em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 3;
}
.hud-age {
  flex: none;
  min-width: 1.9rem;
  padding: 0 0.3rem;
  border: 1px solid var(--panel-edge);
  border-radius: 3px;
  color: var(--gold);
  font: 600 0.75rem/1.4 Georgia, "Times New Roman", serif;
  text-align: center;
}

.hud-res {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0 0;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
}
.hud-right .hud-res { justify-content: flex-end; }
.hud-res li { display: flex; align-items: center; gap: 0.3rem; }
.hud-res svg { width: 1rem; height: 1rem; flex: none; }
.hud-val { display: flex; flex-direction: column; line-height: 1.15; }
.hud-big { font-weight: 600; }
.hud-small { color: var(--ink-muted); font-size: 0.75rem; }

.hud-counts {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0.35rem 0 0;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}
.hud-right .hud-counts { justify-content: flex-end; }
.hud-counts li { display: flex; align-items: baseline; gap: 0.35rem; }
/* The team's chance to win, in the site's gold. */
.hud-counts li.hud-win .hud-big { color: var(--gold); }
.hud-label {
  color: var(--ink-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Over the map (the player's overlay, wide maps and fullscreen): compact,
   see-through panels in the map's top corners, its middle left seen. */
.hud.hud-over {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.5rem;
  gap: 0.5rem;
  align-items: start;
  font-size: 0.8rem;
}
.hud-over.hud-two { grid-template-columns: minmax(0, 24rem) 1fr minmax(0, 24rem); }
.hud-over.hud-two .hud-right { grid-column: 3; }
.hud-over.hud-many { grid-template-columns: repeat(auto-fill, minmax(11rem, 15rem)); }
.hud-over .hud-team {
  background: rgba(14, 16, 19, 0.8);
  border-color: rgba(74, 63, 44, 0.8);
  padding: 0.35rem 0.55rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.hud-over .hud-players { margin-bottom: 0.25rem; }
.hud-over .hud-players li { padding: 0; gap: 0.35rem; }
.hud-over .hud-age { min-width: 1.6rem; font-size: 0.65rem; }
.hud-over .hud-res { gap: 0.15rem 0.6rem; padding-top: 0.25rem; }
.hud-over .hud-res svg { width: 0.85rem; height: 0.85rem; }
.hud-over .hud-small { font-size: 0.68rem; }
.hud-over:not(.hud-duel) .hud-val { flex-direction: row; align-items: baseline; gap: 0.1rem; }
.hud-over .hud-counts { margin-top: 0.25rem; padding-top: 0.25rem; gap: 0.15rem 0.7rem; }
.hud-over .hud-label { font-size: 0.6rem; }

/* Match stats (static/stats.js): tabs over a panel. */
.st-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 1px solid var(--panel-edge); }
.st-tab {
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  padding: 0.45rem 1rem;
  margin-bottom: -1px;
  font: 600 0.8rem/1.3 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.st-tab:hover { color: var(--ink); }
/* a tab's "i" (the Win chance's), its tooltip shown at once */
.st-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-left: 0.35rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: italic 600 0.7rem/1 Georgia, "Times New Roman", serif;
  text-transform: none;
  letter-spacing: 0;
  vertical-align: 0.05em;
}
.st-info:hover { color: var(--gold); }
.st-info-tip {
  display: none;
  position: absolute;
  z-index: 10;
  top: calc(100% + 0.5rem);
  left: -0.6rem;
  width: max-content;
  max-width: min(22rem, 80vw);
  background: rgba(14, 16, 19, 0.96);
  border: 1px solid var(--panel-edge);
  border-radius: 4px;
  padding: 0.5rem 0.7rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  color: var(--ink);
  font: 400 0.82rem/1.45 system-ui, sans-serif;
  text-align: left;
  white-space: normal;
  pointer-events: none;
}
.st-info:hover .st-info-tip, .st-tab:focus-visible .st-info-tip { display: block; }
.st-tab[aria-selected="true"] {
  color: var(--gold);
  background: var(--panel);
  border-color: var(--panel-edge);
  box-shadow: inset 0 2px 0 var(--gold);
}
.st-panel {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-top: 0;
  border-radius: 0 0 4px 4px;
  padding: 1rem 1.1rem 0.8rem;
}
/* the tab bar's end: the open tab's own controls, then fullscreen */
.st-end { margin-left: auto; align-self: center; display: flex; align-items: center; gap: 0.5rem; padding: 0 0 0.3rem 0.5rem; }
.st-fs {
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid var(--panel-edge);
  border-radius: 3px;
  padding: 0 0.45rem;
  font: 0.85rem/1.3rem system-ui, sans-serif;
  cursor: pointer;
}
.st-fs:hover { color: var(--gold); }
/* fullscreen: the open tab fills the screen, its chart the height left */
#match-stats:fullscreen, #game-insights:fullscreen {
  display: flex;
  flex-direction: column;
  background: var(--page);
  padding: 1rem 1.25rem;
  overflow: auto;
}
#match-stats:fullscreen .st-panel:not([hidden]), #game-insights:fullscreen .st-panel:not([hidden]) {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
}
#match-stats:fullscreen .st-chart, #game-insights:fullscreen .st-chart { flex: 1; min-height: 320px; }
.st-tools[hidden] { display: none; }
.st-toggle { display: flex; border: 1px solid var(--panel-edge); border-radius: 3px; overflow: hidden; }
.st-toggle button {
  background: transparent;
  color: var(--ink-muted);
  border: 0;
  padding: 0 0.6rem;
  font: 600 0.68rem/1.2rem system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.st-toggle button + button { border-left: 1px solid var(--panel-edge); }
.st-toggle button:hover { color: var(--ink); }
.st-toggle button[aria-pressed="true"] { background: rgba(214, 178, 94, 0.15); color: var(--gold); }
.st-sw {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  margin-right: 0.45rem;
  vertical-align: -0.05rem;
}
.st-scroll { overflow-x: auto; margin-bottom: 0.6rem; }
.st-table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.st-table th, .st-table td { padding: 0.35rem 0.6rem; text-align: right; border-bottom: 1px solid var(--rule); }
.st-table thead th {
  color: var(--ink-muted);
  font: 600 0.7rem/1.3 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.st-table th[scope="row"] { text-align: left; font-weight: 600; white-space: nowrap; }
/* headings and numbers on one line (the table scrolls instead), so every tab's
   table is as tall as the others */
.st-table thead th, .st-table td { white-space: nowrap; }
.st-table tbody tr:last-child > * { border-bottom: 0; }
.st-at { color: var(--ink-muted); font-size: 0.8rem; }
.st-legend {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  font-size: 0.82rem;
}
.st-key { color: var(--ink-muted); display: flex; align-items: center; gap: 0.4rem; }
.st-key-line { width: 1.1rem; height: 2px; background: var(--ink); }
.st-key-area { width: 1.1rem; height: 0.7rem; background: rgba(230, 223, 207, 0.15); border-top: 1px solid rgba(230, 223, 207, 0.5); }
.st-key-bar { width: 0.5rem; height: 0.7rem; background: rgba(230, 223, 207, 0.7); }
.st-chart { position: relative; }
rect.st-kd { stroke: none; }
rect.st-kd-lost { fill: var(--ink-muted); }
rect.st-kd-vil { fill-opacity: 0.4; }
text.st-kd-ratio { fill: var(--ink); font: 600 12px system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.st-key-kd { width: 0.5rem; height: 0.7rem; background: var(--ink); }
.st-key-kd.st-kd-lost { background: var(--ink-muted); }
.st-key-kd.st-kd-vil { background: rgba(230, 223, 207, 0.4); }
.st-hit.st-kd-hit { cursor: default; }
/* Age-ups: slate in the Dark Age, warming to gold by the Imperial */
.st-age-0 { --age: #2b3037; --age-ink: var(--ink-muted); }
.st-age-1 { --age: #4b4331; --age-ink: var(--ink); }
.st-age-2 { --age: #7a6534; --age-ink: var(--ink); }
.st-age-3 { --age: #c9a453; --age-ink: #14161a; }
rect.st-age { fill: var(--age); stroke: var(--panel); stroke-width: 1; }
text.st-age-text { fill: var(--age-ink); font: 11px system-ui, sans-serif; pointer-events: none; }
.st-key-age { width: 0.9rem; height: 0.7rem; border-radius: 2px; background: var(--age); }
.st-name { font: 600 12px system-ui, sans-serif; fill: var(--ink); }
.st-name-civ { font: 10px system-ui, sans-serif; fill: var(--ink-muted); }
/* a civilization after a name (tables, legends, tooltips) */
.st-civ { color: var(--ink-muted); font-weight: 400; font-size: 0.85em; }
/* Upgrades: each icon framed in its kind's colour; the player's age-ups as ticks */
.st-up-economy { --up: #3987e5; }
.st-up-military { --up: #d95926; }
.st-up-other { --up: #199e70; }
.st-up-many { --up: var(--ink-muted); }
text.st-up-count { fill: var(--ink); font: 600 10px system-ui, sans-serif; pointer-events: none; }
.st-toggle .st-sw { margin-right: 0.35rem; }
rect.st-up { fill: #14161a; stroke: var(--up); stroke-width: 1.5; }
.st-age-tick { stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 2 2; }
text.st-age-num { fill: var(--ink); font: 600 9px Georgia, "Times New Roman", serif; pointer-events: none; }
rect.st-age-tag { fill: #14161a; stroke: var(--ink-muted); stroke-width: 0.75; opacity: 0.92; }
.st-key-up { width: 0.7rem; height: 0.7rem; border-radius: 2px; border: 2px solid var(--up); }
.st-key-tick { width: 1px; height: 0.8rem; border-left: 1px dashed var(--ink-muted); }
.st-tip-up { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.15rem; }
.st-up-frame {
  display: inline-block;
  width: 1.2rem;
  height: 1.2rem;
  border: 1.5px solid var(--up);
  border-radius: 2px;
  background: #14161a;
}
.st-up-frame img { display: block; width: 100%; height: 100%; }
.st-chart svg { display: block; }
.st-grid { stroke: var(--rule); stroke-width: 1; }
.st-even { stroke: var(--ink-muted); stroke-dasharray: 3 3; }
.st-note { color: var(--ink-muted); margin: 0.4rem 0; }
.st-tick { stroke: var(--ink-muted); }
.st-axis { fill: var(--ink-muted); font: 11px system-ui, sans-serif; }
.st-area { fill-opacity: 0.1; stroke-opacity: 0.45; stroke-width: 1; }
.st-bar { fill-opacity: 0.75; }
.st-line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.st-cursor { stroke: var(--ink-muted); stroke-width: 1; }
.st-replay { stroke: var(--gold); stroke-width: 1; stroke-dasharray: 4 3; }
.st-hit { fill: transparent; cursor: pointer; }
/* the point of no return: a line, and the time after it dimmed when the
   tables leave it out; above the tabs, when it was and the tables' toggle */
.st-decided { stroke: var(--defeat); stroke-width: 1.5; }
.st-after { fill: var(--page); fill-opacity: 0.55; pointer-events: none; }
.st-scope { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1rem; margin-bottom: 0.6rem; }
.st-scope .st-note { margin: 0; }
.st-scope .st-note b { color: var(--ink); }
/* while the stats wait for their data */
.st-loading { display: flex; align-items: center; gap: 0.6rem; color: var(--ink-muted); margin: 0.6rem 0; }
/* waiting: the stats for their data, the page for its replay (#status) */
.spinner {
  flex: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--panel-edge);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.st-tip {
  position: absolute;
  pointer-events: none;
  background: rgba(14, 16, 19, 0.94);
  border: 1px solid var(--panel-edge);
  border-radius: 4px;
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.st-tip-time { color: var(--gold); font-weight: 600; margin-bottom: 0.15rem; }
.st-tip-hint { color: var(--ink-muted); font-size: 0.72rem; margin-top: 0.2rem; }

@media (max-width: 640px) {
  .st-panel { padding: 0.7rem 0.6rem; }
  .st-table { font-size: 0.85rem; }
  .st-table th, .st-table td { padding: 0.3rem 0.35rem; }
  .teams { flex-direction: column; }
  .vs { align-self: center; }
}

/* Highlights (static/highlights.js): tabs over the replay, the first the
   replay itself, then a tab per moment: its looping clip in a panel and on a
   stage the size of the player's (minimap.css: the panel's border and padding,
   the stage's height), so the map is drawn the same size; under it a bar
   filling as it plays, then when, the swing and what happened. */
.rp-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 1px solid var(--panel-edge); }
.rp-tabs[hidden], .rp-main[hidden], .hl-pane[hidden] { display: none; }
.rp-tab {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  padding: 0.45rem 0.9rem;
  margin-bottom: -1px;
  font: 600 0.8rem/1.3 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.rp-tab b { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.rp-tab .hl-kind { font-size: 0.66rem; }
.rp-tab:hover { color: var(--ink); }
.rp-tab.active {
  color: var(--gold);
  background: var(--panel);
  border-color: var(--panel-edge);
  box-shadow: inset 0 2px 0 var(--gold);
}
.rp-tab.active .hl-kind { color: inherit; }
.hl-dot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; align-self: center; }
.rp-tabs:not([hidden]) + .rp-main .minimap-player,
.rp-tabs:not([hidden]) ~ .hl-pane { border-top: 0; border-radius: 0 0 4px 4px; }
.hl-pane {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 4px;
  padding: 0.7rem 1.1rem 0.8rem;
}
.hl-pane .minimap-player.mm-clip .mm-stage { aspect-ratio: auto; height: 62vh; min-height: 360px; }
.hl-progress { height: 2px; background: var(--rule); margin: 0.4rem 0 0.55rem; }
.hl-progress span { display: block; height: 100%; width: 0; background: var(--gold); }
.hl-pane figcaption p { margin: 0 0 0.25rem; }
.hl-when { display: flex; align-items: baseline; gap: 0.6rem; }
.hl-when b { color: var(--ink); font-variant-numeric: tabular-nums; }
.hl-kind {
  color: var(--ink-muted);
  font: 600 0.7rem/1.3 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.hl-swing { font-variant-numeric: tabular-nums; }
.hl-team { font-weight: 600; }
.hl-events { margin: 0.3rem 0 0; padding-left: 1.1rem; color: var(--ink-muted); font-size: 0.9rem; }
.hl-swing b { color: var(--ink); font-variant-numeric: tabular-nums; }
.hl-chance { color: var(--ink-muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }

/* on phones the bar keeps the emblem, without the site's name */
@media (max-width: 520px) {
  .site-bar .brand span { display: none; }
  /* the ways to sign in keep their logos; their words only for screen readers */
  .site-user { gap: 0.5rem; }
  .site-user .steam-in span, .site-user .xbox-in span {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .site-user .steam-in, .site-user .xbox-in { padding: 0.35rem 0.55rem; }
}
