:root {
  --bg: rgba(8, 10, 18, 0.92);
  --surface: #111522;
  --text: #f4f7ff;
  --accent: #5eead4;
  --muted: #9aa4bf;
  --danger: #f87171;
  --ok: #4ade80;
  --border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: #0b0d14;
}

a {
  color: var(--accent);
}

.app-shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.app-title {
  margin: 0;
  font-size: 22px;
  color: var(--accent);
}

.app-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.app-nav a {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
}

.app-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.app-nav a.active {
  color: var(--accent);
  background: rgba(94, 234, 212, 0.1);
}

.lang-switch {
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: 13px;
}

.lang-switch button {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.lang-switch button.active {
  border-color: rgba(94, 234, 212, 0.45);
  background: rgba(94, 234, 212, 0.1);
  color: var(--accent);
}

.app-main {
  min-height: 320px;
}

.control-section {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.control-section h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}

.control-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.control-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 13px;
}

.control-field input,
.control-field select {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}

.control-field-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.control-btn {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

a.control-btn {
  display: inline-block;
  text-decoration: none;
  line-height: 1.25;
}

.control-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.control-btn-primary {
  background: rgba(94, 234, 212, 0.12);
  border-color: rgba(94, 234, 212, 0.35);
}

.control-btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}

.control-btn-danger {
  border-color: rgba(248, 113, 113, 0.45);
  color: var(--danger);
}

.control-btn-danger:hover {
  background: rgba(248, 113, 113, 0.12);
}

.control-status {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.control-status.error {
  color: var(--danger);
}

.control-status.ok {
  color: var(--ok);
}

.tournament-meta-name {
  font-weight: 600;
  font-size: 16px;
}

.tournament-meta-slug {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-live {
  background: rgba(74, 222, 128, 0.15);
  color: var(--ok);
}

.badge-warmup {
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
}

.badge-ended {
  background: rgba(154, 164, 191, 0.15);
  color: var(--muted);
}

.badge-other {
  background: rgba(94, 234, 212, 0.12);
  color: var(--accent);
}

.matches-table .match-clock {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.matches-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.matches-table th,
.matches-table td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.matches-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
}

.match-id {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
}

.match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.control-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.control-section-head h2 {
  margin: 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.results-scoreboard-section {
  margin: 12px 0;
}

/* Scoreboard is a small summary - size to content, not full width. */
.results-scoreboard-table {
  width: auto;
  min-width: 260px;
  max-width: 440px;
}

.results-scoreboard-table th,
.results-scoreboard-table td {
  padding: 5px 12px;
}

.results-scoreboard-table th.sb-num,
.results-scoreboard-table td.sb-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.results-scoreboard-table td:first-child {
  font-weight: 600;
}

.results-load-more-row {
  justify-content: center;
}

.results-filter-row {
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.results-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.results-filter-field > span:first-child {
  color: var(--muted);
  font-weight: 600;
}

.results-filter-field select,
.results-filter-field input {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--hub-radius, 0);
  background: var(--surface);
  color: var(--text);
}

.results-new-banner {
  cursor: pointer;
  color: var(--accent);
  text-decoration: underline;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.stat-card {
  padding: 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.stat-card-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.stat-card-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.bracket-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.bracket-row {
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.match-page-header {
  margin-bottom: 16px;
}

.match-page-title {
  margin: 0 0 6px;
  font-size: 20px;
}

.match-page-meta {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.match-page-clock-row {
  margin: 8px 0 0;
  min-height: 1.4em;
}

.match-page-clock {
  display: inline-block;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: 0.02em;
}

.match-page-clock-warmup {
  font-size: 14px;
  font-weight: 600;
  color: #facc15;
}

.match-page-clock-paused {
  color: #93c5fd;
}

.match-page-paused-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.45);
  background: rgba(147, 197, 253, 0.12);
  border-radius: 999px;
  padding: 2px 8px;
  vertical-align: middle;
}

.match-timeline-pauses {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 0;
  height: 16px;
  pointer-events: none;
  z-index: 0;
}

.match-timeline-pause-band {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 3px;
  background: rgba(147, 197, 253, 0.22);
  border: 1px solid rgba(147, 197, 253, 0.35);
}

.match-timeline-pause-band--live {
  background: rgba(147, 197, 253, 0.32);
  border-style: dashed;
}

.match-lifecycle-badge--paused {
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.45);
  background: rgba(147, 197, 253, 0.12);
}

.match-timeline-legend-item--pause .match-timeline-legend-dot {
  background: #93c5fd;
}

.match-timeline-panel {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.match-timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.match-timeline-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.match-timeline-label {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* Track wraps the range with a kill-marker lane above and a scale ruler below.
   The marker/tick lanes are inset 8px (≈ thumb radius) so positions line up
   approximately with the range thumb travel. */
.match-timeline-track {
  position: relative;
  padding: 20px 0 24px;
}

.match-timeline-scrub {
  position: relative;
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
  z-index: 2;
  touch-action: none;
}

.match-timeline-kills {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 0;
  height: 18px;
  pointer-events: none;
}

.match-timeline-kill {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: flex-end;
  line-height: 0;
}

.match-timeline-kill-icon {
  width: 13px;
  height: 13px;
}

.match-timeline-kill-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.match-lifecycle-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.match-lifecycle-badge--hidden {
  display: none;
}

.match-lifecycle-badge--countdown,
.match-lifecycle-badge--warmup {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.12);
}

.match-lifecycle-badge--started,
.match-lifecycle-badge--playing {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(74, 222, 128, 0.1);
}

.match-lifecycle-badge--ended {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.1);
}

.match-timeline-lifecycle {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 18px;
  height: 14px;
  pointer-events: none;
  z-index: 1;
}

.match-timeline-life {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
}

.match-timeline-life-mark {
  display: block;
  width: 2px;
  height: 12px;
  border-radius: 1px;
}

.match-timeline-life--countdown .match-timeline-life-mark {
  background: #fbbf24;
}

.match-timeline-life--started .match-timeline-life-mark {
  background: #4ade80;
}

.match-timeline-life--ended .match-timeline-life-mark {
  background: #f87171;
}

.match-timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}

.match-timeline-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.match-timeline-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.match-timeline-legend-item--countdown .match-timeline-legend-dot {
  background: #fbbf24;
}

.match-timeline-legend-item--started .match-timeline-legend-dot {
  background: #4ade80;
}

.match-timeline-legend-item--ended .match-timeline-legend-dot {
  background: #f87171;
}

.match-timeline-ticks {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 22px;
  pointer-events: none;
}

.match-timeline-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.match-timeline-tick.tick-first {
  transform: translateX(0);
  align-items: flex-start;
}

.match-timeline-tick.tick-last {
  transform: translateX(-100%);
  align-items: flex-end;
}

.match-timeline-tick-mark {
  width: 1px;
  height: 6px;
  background: var(--border);
}

.match-timeline-tick-label {
  margin-top: 2px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

.match-timeline-actions {
  display: flex;
  justify-content: flex-end;
}

.match-section-title {
  margin: 16px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.match-debug-banner {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: #facc15;
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.25);
}

.match-analytics-grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 720px) {
  .match-analytics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .match-analytics-span-2 {
    grid-column: 1 / -1;
  }
}

.match-analytics-panel {
  padding: 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.match-analytics-panel h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.match-analytics-scroll {
  max-height: 280px;
  overflow: auto;
}

.match-analytics-empty {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

/* Shared pickup/weapon HUD sprite icon. */
.ql-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  image-rendering: -webkit-optimize-contrast;
}

/* Compact killfeed: killer · weapon icon · victim. */
.ql-killfeed {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ql-kill {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

.ql-kill-time {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  padding-right: 6px;
}

/* Killer · weapon · victim group, left-aligned (time sits on the right). */
.ql-kill-body {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.ql-kill-actor {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ql-kill-killer {
  font-weight: 600;
}

.ql-kill-victim {
  color: var(--muted);
}

.ql-kill-mod {
  display: inline-flex;
  align-items: center;
  flex: none;
}

.ql-kill-mod-abbr {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--accent);
}

/* Pickup quick filters (collapsed behind a toggle button). */
.ql-pk-toolbar {
  display: flex;
  margin-bottom: 8px;
}

.ql-pk-filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.ql-pk-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.ql-pk-filter-label {
  font-size: 11px;
  color: var(--muted);
  margin-right: 2px;
}

.ql-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ql-chip:hover {
  border-color: var(--accent);
}

.ql-chip-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0f17;
  font-weight: 600;
}

.ql-chip-icon {
  width: 14px;
  height: 14px;
  pointer-events: none;
}

/* Pickup list rows: time · icon+label · player. */
.ql-pickups-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ql-pk-row {
  display: grid;
  grid-template-columns: 44px 1fr 1fr;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

.ql-pk-time {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 11px;
}

.ql-pk-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.ql-pk-player {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Combined weapon stats: per-player columns for side-by-side duel compare. */
.ql-ws-compare {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 0;
  align-items: flex-start;
}

.ql-ws-player-col {
  flex: 0 1 auto;
  min-width: 132px;
  max-width: 200px;
}

.ql-ws-player-col + .ql-ws-player-col {
  margin-left: 20px;
  padding-left: 20px;
  border-left: 1px solid var(--border);
}

.ql-ws-player-title {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.ql-ws-table-compact th,
.ql-ws-table-compact td {
  padding: 2px 6px;
  font-size: 11px;
}

.ql-ws-table {
  width: 100%;
  min-width: 0;
}

.ql-ws-table th,
.ql-ws-table td {
  padding: 3px 8px;
  font-size: 12px;
}

.ql-ws-table th.ql-ws-num,
.ql-ws-table td.ql-ws-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Player sub-header row: name printed once above its weapon rows. */
.ql-ws-group th {
  text-align: left;
  padding-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
}

.ql-ws-group:first-child th {
  padding-top: 2px;
}

.ql-ws-weapon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.ql-ws-icon {
  width: 16px;
  height: 16px;
}

.hidden {
  display: none !important;
}

.match-timeline-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 4px;
}

.match-timeline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.match-timeline-btn:hover {
  border-color: var(--accent);
}

.match-timeline-btn-icon {
  width: 20px;
  height: 20px;
  opacity: 0.95;
  filter: invert(0.92) brightness(1.2);
}

.match-timeline-speed-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.match-timeline-speed {
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.results-detail-hero {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

@media (min-width: 720px) {
  .results-detail-hero {
    grid-template-columns: 1fr minmax(220px, 320px);
    align-items: start;
  }
}

.results-detail-hero-main h2 {
  margin: 0 0 8px;
}

.results-scoreboard-side {
  min-width: 0;
}

.results-scoreboard-wrap {
  padding: 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.results-scoreboard-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.results-scoreboard-table {
  width: 100%;
  font-size: 12px;
}

.results-scoreboard-table th,
.results-scoreboard-table td {
  padding: 4px 8px;
}

.results-matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  padding: 16px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.results-matchup-name {
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.results-matchup-left {
  text-align: right;
}

.results-matchup-right {
  text-align: left;
}

.results-matchup-score {
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  white-space: nowrap;
}

.results-map-stack {
  width: 100%;
  max-width: min(100%, 720px);
  margin: 0 auto 16px;
}

.results-matchup-above-map .results-matchup {
  margin: 0 0 8px;
}

.results-matchup-above-map:empty {
  display: none;
}

/* Embedded map widget (match-analytics page). Contain the overlay chrome that
   is position:fixed on the standalone OBS page so it stays inside the widget. */
.match-map-widget {
  position: relative;
  overflow: hidden;
  width: 100%;
  border: none;
  border-radius: 10px;
  background: #0b0d12;
}

.map-widget-embedded #status,
.map-widget-embedded #map-replay-bar,
.map-widget-embedded #map-record-controls {
  display: none !important;
}

/* Fullscreen has no room for the dashboard's own separate "Match timeline"
   panel (it lives outside this widget's DOM entirely, so it can't be part of
   the fullscreen element) - un-hide the widget's own built-in replay bar
   instead. It's already fully wired to the same OverlayApp replay state
   (overlay.js binds #map-replay-play/-scrub/-speed unconditionally), just
   suppressed above in favor of the dashboard's panel; overlay.css fades it
   in/out on mousemove the same as the fullscreen button. */
.match-map-widget.map-widget-maximized #map-replay-bar,
.match-map-widget.map-widget-maximized #map-replay-playback {
  display: flex !important;
}

.match-map-widget .map-page-overlays {
  position: absolute;
}

.match-map-widget .map-layout {
  margin: 0;
}

/* Pin the main column to the 512px map base so the replay bar wraps INSIDE the
   square instead of widening .map-layout past 512. With a fixed natural width
   the widget's applyFit() zoom (clientWidth / contentWidth) fills the column
   with no horizontal crop. */
.match-map-widget .map-main {
  width: 512px;
}

/* Fullscreen (map-widget.js's CSS overlay, position:fixed covering the
   browser viewport - see overlay.css .map-widget-maximized) replaces the
   dashboard column entirely - drop the embedded-only overlay confinement
   and the 512px width pin so applyFit()'s natural-size measurement (and the
   toolbar's true viewport-corner anchoring) behave the same as the
   standalone OBS page instead of being skewed by rules that only make sense
   inside a narrower dashboard column. */
.match-map-widget.map-widget-maximized .map-page-overlays {
  position: fixed;
}

.match-map-widget.map-widget-maximized .map-main {
  width: auto;
}

.match-map-widget .map-meta {
  display: none;
}

.server-location {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.server-location-flag {
  font-size: 1.05em;
  line-height: 1;
}

.server-location-code {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--dash-muted, #9aa3b2);
}

.server-location-name {
  display: block;
  margin-top: 2px;
  font-size: 0.88rem;
  color: var(--dash-text, #e8eaed);
}

td .server-location-name {
  display: inline;
  margin-top: 0;
  margin-left: 2px;
}

.server-hero-players {
  margin-top: 10px;
  min-height: 0;
}

.server-hero-matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.server-hero-matchup-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-hero-matchup-left {
  text-align: right;
}

.server-hero-matchup-right {
  text-align: left;
}

.server-hero-matchup-score {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  white-space: nowrap;
}

.server-hero-players-line {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}

.server-hero-player {
  font-weight: 600;
}

.server-hero-sep {
  color: var(--muted);
  font-weight: 400;
}

.server-hero-player-meta {
  margin-left: 4px;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.92em;
}

.restore-checkpoint-panel {
  margin-top: 16px;
}

.restore-checkpoint-meta {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0;
}

.restore-checkpoint-json {
  width: 100%;
  min-height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--hub-radius, 0);
  background: var(--panel, #111);
  color: var(--text);
  resize: vertical;
  box-sizing: border-box;
}

.restore-checkpoint-actions {
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.restore-checkpoint-paste {
  margin-top: 10px;
  padding: 10px;
  font-size: 11px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  max-height: 160px;
  overflow: auto;
}

.ql-restore-editor-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ql-restore-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ql-restore-editor-body.ql-restore-readonly input[readonly],
.ql-restore-editor-body.ql-restore-readonly select:disabled,
.ql-restore-editor-body.ql-restore-readonly .ql-restore-wa-owns input:disabled,
.ql-restore-editor-body.ql-restore-readonly .ql-restore-wa-ammo-input:disabled {
  opacity: 0.85;
  cursor: default;
}

.ql-restore-actions {
  margin-top: 0;
}

.ql-restore-global {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.ql-restore-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.ql-restore-field > span:first-child {
  color: var(--muted);
  font-weight: 600;
}

.ql-restore-field input,
.ql-restore-field select,
.ql-restore-w-select {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--hub-radius, 0);
  background: var(--surface);
  color: var(--text);
}

.ql-restore-field-hint {
  font-size: 11px;
  color: var(--muted);
}

.ql-restore-players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.ql-restore-player {
  border: 1px solid var(--border);
  border-radius: var(--hub-radius, 0);
  background: var(--surface);
  padding: 12px;
}

.ql-restore-player-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.ql-restore-player-head h4 {
  margin: 0;
  font-size: 14px;
}

.ql-restore-player-slot {
  font-size: 11px;
  color: var(--muted);
}

.ql-restore-player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.ql-restore-pos-row,
.ql-restore-vel-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ql-restore-pos-label,
.ql-restore-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  width: 100%;
}

.ql-restore-pos-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
}

.ql-restore-pos-field input {
  width: 72px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  background: var(--panel, #111);
  color: var(--text);
}

.ql-restore-wpn-icon,
.ql-restore-wa-icon-img {
  width: 22px;
  height: 22px;
  image-rendering: pixelated;
  object-fit: contain;
}

.ql-restore-wpn-abbr {
  font-size: 11px;
  font-weight: 700;
}

/* Merged weapon+ammo table (design spec "вариант C") - replaces the old
   separate .ql-restore-lo-grid (weapon checkboxes) and .ql-restore-ammo-grid
   (ammo numbers). Ammo is editable independent of the owns-weapon checkbox. */
.ql-restore-wa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 6px;
}

.ql-restore-wa-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
}

.ql-restore-wa-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.ql-restore-wa-row.ql-restore-wa-owned td {
  background: rgba(255, 200, 0, 0.08);
}

.ql-restore-wa-ammo-input {
  width: 56px;
  text-align: center;
  padding: 2px 4px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--panel, #111);
  color: var(--text);
}

.ql-restore-wa-noammo {
  color: var(--muted);
}

/* Staleness indicator: dim + label while a fresh checkpoint fetch is in
   flight. The last-known values stay fully visible underneath - never
   blanked - per docs/superpowers/specs/2026-07-26-restore-editor-rework-design.md. */
.ql-restore-players.ql-restore-stale {
  opacity: 0.55;
  position: relative;
}

.ql-restore-players.ql-restore-stale::after {
  content: attr(data-ql-restore-stale-label);
  position: absolute;
  top: -20px;
  right: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.ql-restore-players.ql-restore-fetch-error::before {
  content: attr(data-ql-restore-error-label);
  display: block;
  grid-column: 1 / -1;
  font-size: 11px;
  color: #f88;
  margin-bottom: 6px;
}

.ql-restore-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.ql-restore-output-head h4 {
  margin: 0;
  font-size: 13px;
}

.ql-restore-encode-status {
  font-size: 11px;
}

.ql-restore-toggle-wrap {
  margin-top: 12px;
}

.ql-restore-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
}

.demo-drop-zone {
  margin-top: 12px;
  padding: 28px 20px;
  border: 2px dashed var(--border, #444);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.15s, background 0.15s;
}

.demo-drop-zone:hover,
.demo-drop-zone.demo-drop-active,
.demo-drop-zone:focus-visible {
  border-color: var(--accent, #6cf);
  background: rgba(102, 204, 255, 0.06);
  outline: none;
}

.demo-drop-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}

.demo-drop-sub {
  margin: 0;
  font-size: 12px;
  color: var(--muted, #888);
}

.demo-summary-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  margin: 12px 0 0;
  font-size: 13px;
}

.demo-summary-dl dt {
  margin: 0;
  color: var(--muted, #888);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.demo-summary-dl dd {
  margin: 0;
}

.demo-viewer-section {
  margin-top: 8px;
}
