*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #1a1a2e;
  color: #e0e0e0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 1rem;
}

.container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.main-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 1rem;
  width: 100%;
}

.tabs-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: #16213e;
  border: 1px solid #2a2a4a;
  border-radius: 12px;
  padding: 0.8rem;
  max-height: var(--tabs-max-h, none);
}

.tabs-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: #c0c0d0;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #2a2a4a;
}

.replay-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.replay-tabs::-webkit-scrollbar { display: none; }

.replay-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #0f3460;
  border: 1px solid #2a2a5a;
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
  color: #e0e0e0;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  user-select: none;
}

.replay-tab:hover {
  background: #173a6b;
}

.replay-tab:focus-visible {
  outline: 2px solid #e879a0;
  outline-offset: -2px;
}

.replay-tab.active {
  background: #2a2a5a;
  border-color: #e879a0;
}

.replay-tab-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.replay-tab-remove,
.replay-tab-share {
  background: transparent;
  color: #a0a0b0;
  border: none;
  border-radius: 3px;
  width: 1.4rem;
  height: 1.4rem;
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.replay-tab-remove:hover {
  background: #3a3a6a;
  color: #ff6b6b;
}

.replay-tab-share:hover {
  background: #3a3a6a;
  color: #e879a0;
}

.canvas-column {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 1280px;
}

.sidebar {
  grid-column: 3;
  justify-self: start;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.left-panel {
  grid-column: 1;
  justify-self: end;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 0;
}

.input-panel-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.input-panel {
  background: #16213e;
  border: 1px solid #2a2a4a;
  border-radius: 12px;
  padding: 1.2rem;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.tab-content {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.tab-content.hidden {
  visibility: hidden;
}

.panel-tabs {
  display: flex;
  justify-content: center;
  margin-top: -1px;
}

.panel-tab {
  background: #0f1c35;
  border: 1px solid #2a2a4a;
  border-radius: 0;
  color: #a0a0b0;
  padding: 0.4rem 1.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  position: relative;
  z-index: 1;
}

.panel-tab + .panel-tab {
  margin-left: -1px;
}

.panel-tab:hover:not(.active) {
  background: #16213e;
  color: #c0c0d0;
}

.panel-tab.active {
  background: #2a2a5a;
  color: #e879a0;
  border-color: #e879a0;
  cursor: default;
  z-index: 2;
}

.auth-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-state {
  font-size: 0.85rem;
  color: #c0c0d0;
  word-break: break-word;
}

.auth-btn {
  background: #e879a0;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.auth-btn:hover {
  background: #d4609a;
}

.auth-btn.hidden {
  display: none;
}

.input-panel input[type="text"] {
  background: #0f3460;
  border: 1px solid #2a2a5a;
  border-radius: 6px;
  color: #e0e0e0;
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  width: 100%;
  font-family: inherit;
}

.input-panel input[type="text"]::placeholder {
  color: #707080;
}

/* iOS/Android auto-zoom inputs below 16px font-size and leave the page zoomed after keyboard closes. */
@media (hover: none) and (pointer: coarse) {
  .input-panel input[type="text"] {
    font-size: 16px;
  }
  /* Match view isn't mobile-optimized yet. */
  .panel-tab[data-target="match"] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
  }
  .panel-tab[data-target="match"]::after {
    content: "desktop only";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 3px;
    font-size: 0.6rem;
    font-weight: 500;
    font-style: italic;
    letter-spacing: 0.02em;
    color: #8a8aa0;
    white-space: nowrap;
    pointer-events: none;
  }
}

#fetch-btn,
#match-fetch-btn {
  background: #e879a0;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  align-self: center;
  transition: background 0.15s ease;
  letter-spacing: 0.03em;
}

#fetch-btn:hover:not(:disabled),
#match-fetch-btn:hover:not(:disabled) {
  background: #d4609a;
}

#fetch-btn:disabled,
#match-fetch-btn:disabled {
  background: #7a4060;
  cursor: not-allowed;
  opacity: 0.6;
}

.file-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.file-row label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #c0c0d0;
}

.file-row .required {
  color: #e879a0;
}

.file-row .optional {
  color: #808090;
}

.file-drop {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.3rem;
  padding: 0.45rem 0.8rem;
  background: #0f3460;
  border: 1px dashed #2a2a5a;
  border-radius: 6px;
  color: #7a7a90;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.file-drop:hover {
  background: #143a6b;
  border-color: #3a3a6a;
  color: #b0b0c0;
}

.file-drop.dragover {
  background: #2a2a5a;
  border-style: solid;
  border-color: #e879a0;
  color: #e879a0;
}

.file-drop.has-file {
  border-style: solid;
  color: #e0e0e0;
}

.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-drop-text {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.file-row .skin-select {
  background: #0f3460;
  border: 1px solid #2a2a5a;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  width: 100%;
}

.skin-select-wrap {
  position: relative;
  width: 100%;
}

/* Native <select> is canonical state (and a11y target); custom UI below sits on top. */
.skin-select-wrap .skin-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.skin-dropdown-trigger {
  background: #0f3460;
  border: 1px solid #2a2a5a;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.skin-dropdown-trigger:hover {
  background: #173a6b;
}

.skin-dropdown-trigger[aria-expanded="true"] {
  border-color: #4a4a8a;
}

.skin-dropdown-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skin-dropdown-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #c0c0d0;
}

.skin-dropdown-icon {
  width: 14px;
  height: 14px;
  display: block;
}

.skin-dropdown-caret {
  font-size: 0.7rem;
  color: #8a8aaa;
  line-height: 1;
}

.skin-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #0f3460;
  border: 1px solid #2a2a5a;
  border-radius: 6px;
  list-style: none;
  margin: 0;
  padding: 0.2rem;
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.skin-dropdown-menu.hidden {
  display: none;
}

.skin-dropdown-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #e0e0e0;
  cursor: pointer;
}

.skin-dropdown-option:hover,
.skin-dropdown-option[aria-selected="true"] {
  background: #173a6b;
}

.skin-dropdown-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#load-btn {
  background: #e879a0;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  align-self: center;
  margin-top: 0.2rem;
  transition: background 0.15s ease;
  letter-spacing: 0.03em;
}

#load-btn:hover {
  background: #d4609a;
}

#load-btn:disabled {
  background: #7a4060;
  cursor: not-allowed;
}

.status {
  min-height: 1.5rem;
  font-size: 0.85rem;
  color: #e0e0e0;
  text-align: center;
}

.load-progress {
  align-self: center;
  width: 70%;
  max-width: 260px;
  height: 4px;
  margin-top: 0.55rem;
  background: rgba(232, 121, 160, 0.15);
  border-radius: 2px;
  overflow: hidden;
  display: none;
}

.load-progress.active {
  display: block;
}

.load-progress-bar {
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, #e879a0 50%, transparent 100%);
  animation: load-progress-slide 1.2s ease-in-out infinite;
}

@keyframes load-progress-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.player-controls.hidden {
  display: none;
}

.play-pause-btn {
  background: #e879a0;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
  line-height: 1;
  width: 2.4rem;
  text-align: center;
}

.play-pause-btn:hover {
  background: #d4609a;
}

.scrub-bar-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  height: 16px;
}

.scrub-bar {
  width: 100%;
  cursor: pointer;
  height: 4px;
  margin: 0;
  position: relative;
  z-index: 1;
}

.scrub-markers {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 12px;
  pointer-events: none;
  z-index: 2;
}

.scrub-marker {
  position: absolute;
  top: 0;
  width: 2px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 1px;
}

.scrub-marker.miss {
  background: #ff4d4d;
}

.scrub-marker.sliderbreak {
  background: #ffdd33;
}

.scrub-marker.miss.partner {
  background: #3d9bff;
}

.scrub-marker.sliderbreak.partner {
  background: #8fd2ff;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: #2a2a4a;
  border-radius: 2px;
}

input[type="range"]::-moz-range-track {
  height: 4px;
  background: #2a2a4a;
  border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 3px;
  height: 16px;
  background: #e879a0;
  border: none;
  border-radius: 1px;
  margin-top: -6px;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 3px;
  height: 16px;
  background: #e879a0;
  border: none;
  border-radius: 1px;
  cursor: pointer;
}

.time-display {
  font-size: 0.85rem;
  color: #a0a0b0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 7ch;
  text-align: right;
}

.share-at-time-btn {
  background: transparent;
  color: #a0a0b0;
  border: 1px solid #2a2a5a;
  border-radius: 4px;
  width: 1.8rem;
  height: 1.8rem;
  flex-shrink: 0;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.share-at-time-btn:hover {
  background: #3a3a6a;
  color: #e879a0;
  border-color: #e879a0;
}
.share-at-time-btn.hidden { display: none; }

.render-options {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  background: #16213e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 0.6rem 1rem;
}

/* Match mode: 1fr auto 1fr centers the swap control regardless of left/right group widths. */
.render-options:has(#audio-swap:not(.hidden)) {
  grid-template-columns: 1fr auto 1fr;
}

.render-options.hidden {
  display: none;
}

/* visibility:hidden (not display:none) so layout boxes remain and right-side controls stay pinned. */
.render-options.taiko-mode label.option-toggle:has(#opt-followpoints),
.render-options.taiko-mode label.option-toggle:has(#opt-key-overlay),
.render-options.mania-mode label.option-toggle:has(#opt-followpoints),
.render-options.mania-mode label.option-toggle:has(#opt-key-overlay) {
  visibility: hidden;
}

/* Catch: only the Judgement + Key Overlay toggles apply (no followpoints; UR bar deferred). */
.render-options.catch-mode label.option-toggle:has(#opt-followpoints),
.render-options.catch-mode label.option-toggle:has(#opt-ur-bar) {
  visibility: hidden;
}

/* Mania-only controls: hidden outside mania mode, visible only on mania replays.
   Chained selectors so we outrank the generic `.option-dim { display: flex }` rule
   below regardless of source order. */
.option-dim.option-mania-only { display: none; }
.render-options.mania-mode .option-dim.option-mania-only { display: flex; }

.opts-left,
.opts-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  min-width: 0;
}
.opts-left  { justify-self: start; justify-content: flex-start; }
.opts-right { justify-self: end;   justify-content: flex-end;   }

.option-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #c0c0d0;
  cursor: pointer;
  user-select: none;
}

.option-toggle input[type="checkbox"] {
  accent-color: #e879a0;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.option-dim {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #c0c0d0;
}

.option-dim input[type="range"] {
  accent-color: #e879a0;
  width: 110px;
  cursor: pointer;
}

.option-dim span {
  font-size: 0.8rem;
  color: #a0a0b0;
  font-variant-numeric: tabular-nums;
  min-width: 3.5ch;
  text-align: right;
}

.volume-stack {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.volume-stack .option-dim {
  margin-left: 0;
}

.vol-label {
  width: 4.5rem;
  display: inline-block;
}

.dim-stack {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dim-label {
  width: 6.75rem;
  display: inline-block;
}

.option-offset {
  gap: 0.35rem;
}

.option-offset span {
  min-width: 5ch;
}

.offset-btn {
  background: transparent;
  border: 1px solid #2a2a4a;
  border-radius: 5px;
  color: #c0c0d0;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.offset-btn:hover {
  background: #2a2a5a;
  color: #e879a0;
  border-color: #e879a0;
}

.offset-btn:active {
  background: #3a3a6a;
}

.offset-reset {
  font-size: 0.95rem;
  padding: 0.15rem 0.35rem;
}

.sync-btn {
  background: transparent;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  color: #c0c0d0;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.25rem 0.45rem;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.sync-btn:hover {
  background: #2a2a5a;
  color: #e879a0;
  border-color: #e879a0;
}

.sync-btn:active {
  background: #3a3a6a;
}

/* Inner 1fr auto 1fr grid pins the swap arrow to canvas-gap center regardless of username widths. */
.audio-swap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  justify-self: center;
}
.audio-swap.hidden { display: none; }

.audio-swap > .audio-swap-note:first-of-type { justify-self: end; }
.audio-swap > .audio-swap-note:last-of-type  { justify-self: start; }

.audio-swap-note {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  background: transparent;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  color: #a0a0b0;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  max-width: 11rem;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.audio-swap-note:hover {
  background: #2a2a5a;
  color: #e879a0;
  border-color: #e879a0;
}
.audio-swap-note.active {
  background: rgba(232, 121, 160, 0.18);
  color: #e879a0;
  border-color: #e879a0;
  box-shadow: 0 0 0 1px rgba(232, 121, 160, 0.5) inset;
}

.audio-swap-icon {
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
}

.audio-swap-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
  font-weight: 600;
}

.audio-swap-btn {
  background: transparent;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  color: #c0c0d0;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.audio-swap-btn:hover {
  background: #2a2a5a;
  color: #e879a0;
  border-color: #e879a0;
}
.audio-swap-btn:active {
  background: #3a3a6a;
}
/* `.hidden` is scoped per-element (no global rule); 1v1 widget children need this to vanish in team mode. */
.audio-swap-note.hidden,
.audio-swap-btn.hidden {
  display: none;
}

/* Grid mirrors canvas layout; JS sets per-button gridColumn/gridRow so positions match canvases. */
.audio-swap.team-mode {
  display: grid;
  column-gap: 4px;
  row-gap: 3px;
  align-items: stretch;
  justify-items: stretch;
}
.audio-swap.team-2v2 { grid-template-columns: repeat(2, minmax(72px, 1fr)); }
.audio-swap.team-4v4 { grid-template-columns: repeat(4, minmax(60px, 1fr)); }
.audio-swap.team-mode .audio-swap-note {
  padding: 0.2rem 0.4rem;
  font-size: 0.72rem;
  max-width: none;
  margin: 0;
}
.audio-swap.team-mode .audio-swap-icon { font-size: 0.85rem; }

/* Team-tinted idle; hover/active reuses pink accent for 1v1 consistency. */
.audio-swap-note.team-red   { border-color: rgba(232, 100, 130, 0.45); color: #f3c5cd; }
.audio-swap-note.team-blue  { border-color: rgba(120, 155, 230, 0.45); color: #c8d6ee; }
.audio-swap-note.team-red:hover,
.audio-swap-note.team-blue:hover {
  background: #2a2a5a;
  color: #e879a0;
  border-color: #e879a0;
}
.audio-swap-note.team-red.active,
.audio-swap-note.team-blue.active {
  background: rgba(232, 121, 160, 0.18);
  color: #e879a0;
  border-color: #e879a0;
  box-shadow: 0 0 0 1px rgba(232, 121, 160, 0.5) inset;
}

.info-panel {
  position: relative;
  background: #16213e;
  border: 1px solid #2a2a4a;
  border-radius: 12px;
  padding: 1rem 1.1rem 1.1rem;
  overflow: hidden;
  flex: 0 1 auto;
  min-height: 0;
}

.info-header {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  border-bottom: 1px solid #2a2a4a;
  padding-bottom: 0.55rem;
  margin-bottom: 0.7rem;
}

.info-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #e879a0;
  letter-spacing: 0.02em;
  line-height: 1;
}

.info-version {
  font-size: 0.7rem;
  color: #808095;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.info-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.78rem;
  color: #c0c0d0;
  line-height: 1.4;
}

.info-body p {
  margin: 0;
}

.info-author {
  color: #a0a0b0;
}

.info-author strong {
  color: #e0e0e0;
  font-weight: 600;
}

.info-notes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: #a0a0b0;
  font-size: 0.75rem;
}

.info-notes li {
  position: relative;
  padding-left: 0.8rem;
}

.info-notes li::before {
  content: "•";
  position: absolute;
  left: 0.1rem;
  color: #e879a0;
}

.info-tips {
  color: #a0a0b0;
  font-size: 0.75rem;
}

.info-tips-label {
  color: #e879a0;
  font-weight: 600;
}

.info-key {
  display: inline-block;
  min-width: 1.2rem;
  padding: 0 0.3rem;
  border: 1px solid #2a2a5a;
  border-radius: 4px;
  background: #0f3460;
  color: #e0e0e0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.3;
  text-align: center;
}

.info-tip-sep {
  color: #4a4a6a;
  margin: 0 0.15rem;
}

.info-unsupported {
  color: #a0a0b0;
  font-size: 0.75rem;
}

.info-unsupported-label {
  color: #e879a0;
  font-weight: 600;
}

.info-credits {
  color: #a0a0b0;
  font-size: 0.75rem;
}

.info-credits-label {
  color: #e879a0;
  font-weight: 600;
}

.info-credits-link {
  color: #e879a0;
  text-decoration: none;
}

.info-credits-link:hover {
  text-decoration: underline;
}

.info-contact {
  margin-top: 0.15rem;
  color: #c0c0d0;
}

.info-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.1rem;
}

.info-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  background: #0f3460;
  border: 1px solid #2a2a5a;
  border-radius: 6px;
  color: #e0e0e0;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.info-link:hover {
  background: #2a2a5a;
  border-color: #e879a0;
  color: #e879a0;
}

.info-link-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.info-horse {
  position: absolute;
  right: 24px;
  bottom: -4px;
  width: 70px;
  height: auto;
  opacity: 0.18;
  pointer-events: none;
  filter: saturate(0.9);
}

#replay-canvas,
#replay-canvas-2,
#replay-canvas-3,
#replay-canvas-4,
#replay-canvas-5,
#replay-canvas-6,
#replay-canvas-7,
#replay-canvas-8 {
  /* Explicit CSS w/h so `zoom` has a box to scale; Firefox won't infer from HTML attrs alone. */
  width: 1280px;
  height: 720px;
  border: 2px solid #2a2a4a;
  border-radius: 8px;
  background: #0a0a1a;
  display: block;
}

#replay-canvas.hidden,
#replay-canvas-2.hidden,
#replay-canvas-3.hidden,
#replay-canvas-4.hidden,
#replay-canvas-5.hidden,
#replay-canvas-6.hidden,
#replay-canvas-7.hidden,
#replay-canvas-8.hidden {
  display: none;
}

/* <1880px: collapse 3-col to stack; canvas CSS-scales while backing store stays 1280×720. */
@media (max-width: 1880px) {
  body { padding: 0.6rem; }

  .main-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.8rem;
  }

  .canvas-column,
  .left-panel,
  .sidebar {
    grid-column: auto;
    justify-self: center;
    width: 100%;
    max-width: 1280px;
  }

  .canvas-column { order: 1; }
  .sidebar       { order: 2; }
  .left-panel    { order: 3; }

  #replay-canvas,
  #replay-canvas-2 {
    width: 100%;
    height: auto;
    max-width: 1280px;
  }

  /* Release the JS-set cap (only meaningful in 3-col layout). */
  .tabs-panel { max-height: none; }
}

@media (max-width: 600px) {
  body { padding: 0.4rem; }
  .main-row { gap: 0.6rem; }
  .input-panel { padding: 0.9rem; }
  .tabs-panel { padding: 0.6rem; }
  .player-controls { gap: 0.6rem; }
  .time-display { min-width: 6ch; font-size: 0.8rem; }
  .info-panel { padding: 0.9rem 0.9rem 2.8rem; }
  .info-horse { width: 56px; right: 14px; }

  /* Collapse render-options to a single column. */
  .render-options,
  .render-options:has(#audio-swap:not(.hidden)) {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
  }
  .opts-left,
  .opts-right {
    justify-self: stretch;
    justify-content: flex-start;
    gap: 0.6rem 1rem;
  }
  .opts-left  { column-gap: 0.9rem; }
  .option-dim input[type="range"] { width: 100px; }
  .vol-label { width: auto; min-width: 3.4rem; }
  .dim-label { width: auto; }
}

/* Phone landscape: svh (URL-bar-visible viewport) keeps canvas + scrub bar on-screen when Safari chrome expands. */
@media (orientation: landscape) and (max-height: 560px) {
  body { padding: 0.25rem; }
  .main-row { gap: 0.3rem; }
  .canvas-column { gap: 0.3rem; }

  #render-options { order: 1; }

  .render-options,
  .render-options:has(#audio-swap:not(.hidden)) {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
  }
  .opts-left,
  .opts-right {
    justify-self: stretch;
    justify-content: flex-start;
    gap: 0.35rem 0.9rem;
  }
  .option-toggle,
  .option-dim { font-size: 0.78rem; gap: 0.3rem; }
  .option-toggle input[type="checkbox"] { width: 13px; height: 13px; }
  .option-dim input[type="range"] { width: 95px; }
  .option-dim span { min-width: 2.8ch; font-size: 0.72rem; }
  .vol-label { width: auto; min-width: 3rem; }
  .dim-label { width: auto; }
  .volume-stack { gap: 0.2rem; }
  .offset-btn { padding: 0.1rem 0.3rem; font-size: 0.8rem; }
  .sync-btn { padding: 0.15rem 0.35rem; font-size: 0.85rem; }

  /* Fill viewport minus scrub bar; aspect-ratio picks width. */
  #replay-canvas,
  #replay-canvas-2 {
    align-self: center;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 50px);
    max-height: calc(100svh - 50px);
    aspect-ratio: 16 / 9;
  }

  .player-controls { gap: 0.5rem; }
  .time-display { min-width: 5ch; font-size: 0.75rem; }
  .play-pause-btn { font-size: 1rem; width: 2rem; padding: 0.3rem 0; }
}

/* Dual mode visually halves each canvas (backing store unchanged; browser downscales). */
.canvas-stack { display: flex; justify-content: center; gap: 8px; }
.canvas-frame { position: relative; display: block; line-height: 0; }
.canvas-frame.hidden { display: none; }
.canvas-stack.dual #replay-canvas,
.canvas-stack.dual #replay-canvas-2 {
  width: 640px;
  height: 360px;
}

.player-label {
  position: absolute;
  bottom: 14px;
  right: 20px;
  color: #dce2ee;
  font-family: 'Exo', 'Segoe UI', sans-serif;
  font-style: italic;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85), 0 0 10px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  line-height: 1;
}
.player-label.hidden { display: none; }
.canvas-stack.dual .player-label { font-size: 18px; bottom: 10px; right: 14px; }
/* Tint matches scrub-bar marker colors (red = canvas1, blue = canvas2). */
.canvas-stack.dual #player-label-1 { color: #f3cfd1; }
.canvas-stack.dual #player-label-2 { color: #ccdcf5; }

/* Dual score readout below scrub bar; sides align toward center, leader bumps weight/size. */
.match-score-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 28px;
  align-items: flex-end;
  width: 100%;
  padding: 0 4px;
  pointer-events: none;
}
.match-score-strip.hidden { display: none; }

.match-score-side {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.match-score-side-left  { align-items: flex-end;  }
.match-score-side-right { align-items: flex-start; }

.match-score-diff {
  font-family: 'Exo', 'Segoe UI', sans-serif;
  font-style: italic;
  font-weight: 600;
  font-size: 13px;
  color: #ff9bb3;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 4px;
  min-height: 13px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  font-variant-numeric: tabular-nums;
}

.match-score {
  font-family: 'Exo', 'Segoe UI', sans-serif;
  font-style: italic;
  font-weight: 500;
  font-size: 32px;
  color: #dce2ee;
  letter-spacing: 0.02em;
  line-height: 1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
  font-variant-numeric: tabular-nums;
  transition: font-size 0.12s ease, font-weight 0.12s ease, color 0.12s ease;
}
.match-score.leading {
  font-weight: 800;
  font-size: 34px;
  color: #ffffff;
}

/* Fail overlay still paints the beatmap background underneath so the pair stays visually balanced. */
.fail-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ffd8d8;
  font-family: 'Exo', 'Segoe UI', sans-serif;
  font-style: italic;
  font-weight: 700;
  font-size: 44px;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  background: rgba(20, 10, 20, 0.55);
  padding: 0.8rem 1.6rem;
  border-radius: 10px;
  pointer-events: none;
  white-space: nowrap;
  line-height: 1;
}
.fail-overlay.hidden { display: none; }
.canvas-stack.dual .fail-overlay { font-size: 30px; padding: 0.5rem 1rem; }

/* body.match-view collapses the 3-col shell to a single canvas-dominant column. */
body.match-view .left-panel,
body.match-view .sidebar {
  display: none;
}
body.match-view .main-row {
  grid-template-columns: minmax(0, 1fr);
}
body.match-view .canvas-column {
  grid-column: 1;
  justify-self: center;
  width: 100%;
  max-width: none;
}
body.match-view .canvas-stack.dual {
  gap: 12px;
}
body.match-view .canvas-stack.dual #replay-canvas,
body.match-view .canvas-stack.dual #replay-canvas-2 {
  width: min(calc(50vw - 24px), 1280px);
  height: auto;
  aspect-ratio: 16 / 9;
}
body.match-view .canvas-stack.dual .player-label {
  font-size: clamp(18px, 1.6vw, 28px);
  bottom: clamp(10px, 1vw, 16px);
  right:  clamp(14px, 1.4vw, 22px);
}
body.match-view .canvas-stack.dual .fail-overlay {
  font-size: clamp(30px, 3vw, 54px);
}

/* Team layouts: JS sets per-frame gridColumn/gridRow; canvases keep 1280×720 backing store. */
.canvas-stack.team-2v2,
.canvas-stack.team-4v4 {
  display: grid;
  justify-content: center;
  column-gap: 6px;
  row-gap: 6px;
  width: 100%;
}
.canvas-stack.team-2v2 {
  grid-template-columns: repeat(2, auto);
  grid-template-rows:    repeat(2, auto);
}
.canvas-stack.team-4v4 {
  grid-template-columns: repeat(4, auto);
  grid-template-rows:    repeat(2, auto);
}
/* Emergency fallback if a team match renders outside match-view; IDs match base-rule specificity. */
.canvas-stack.team-2v2 #replay-canvas,
.canvas-stack.team-2v2 #replay-canvas-2,
.canvas-stack.team-2v2 #replay-canvas-3,
.canvas-stack.team-2v2 #replay-canvas-4 {
  width: 320px;
  height: 180px;
}
.canvas-stack.team-4v4 #replay-canvas,
.canvas-stack.team-4v4 #replay-canvas-2,
.canvas-stack.team-4v4 #replay-canvas-3,
.canvas-stack.team-4v4 #replay-canvas-4,
.canvas-stack.team-4v4 #replay-canvas-5,
.canvas-stack.team-4v4 #replay-canvas-6,
.canvas-stack.team-4v4 #replay-canvas-7,
.canvas-stack.team-4v4 #replay-canvas-8 {
  width: 180px;
  height: 101px;
}

/* Cap by vh/2-rows or per-layout column budget; min() takes the tighter. */
body.match-view .canvas-stack.team-2v2 #replay-canvas,
body.match-view .canvas-stack.team-2v2 #replay-canvas-2,
body.match-view .canvas-stack.team-2v2 #replay-canvas-3,
body.match-view .canvas-stack.team-2v2 #replay-canvas-4 {
  /* 2v2 is height-constrained; 35vh × 2 rows leaves room for chrome. */
  width: min(calc(50vw - 10px), calc(35vh * 16 / 9));
  height: auto;
  aspect-ratio: 16 / 9;
}
body.match-view .canvas-stack.team-4v4 #replay-canvas,
body.match-view .canvas-stack.team-4v4 #replay-canvas-2,
body.match-view .canvas-stack.team-4v4 #replay-canvas-3,
body.match-view .canvas-stack.team-4v4 #replay-canvas-4,
body.match-view .canvas-stack.team-4v4 #replay-canvas-5,
body.match-view .canvas-stack.team-4v4 #replay-canvas-6,
body.match-view .canvas-stack.team-4v4 #replay-canvas-7,
body.match-view .canvas-stack.team-4v4 #replay-canvas-8 {
  /* 4v4 is width-constrained; 4×23vw = 92vw leaves 8vw for gaps + padding. */
  width: min(23vw, calc(35vh * 16 / 9));
  height: auto;
  aspect-ratio: 16 / 9;
}

.canvas-stack.team-2v2 .player-label,
.canvas-stack.team-4v4 .player-label {
  font-size: 14px;
  bottom: 8px;
  right: 10px;
}
body.match-view .canvas-stack.team-2v2 .player-label,
body.match-view .canvas-stack.team-4v4 .player-label {
  font-size: clamp(12px, 0.9vw, 18px);
  bottom: clamp(6px, 0.5vw, 10px);
  right:  clamp(8px, 0.7vw, 14px);
}
.canvas-stack.team-2v2 .fail-overlay,
.canvas-stack.team-4v4 .fail-overlay {
  font-size: 22px;
  padding: 0.4rem 0.8rem;
}
body.match-view .canvas-stack.team-2v2 .fail-overlay,
body.match-view .canvas-stack.team-4v4 .fail-overlay {
  font-size: clamp(18px, 1.6vw, 32px);
  padding: clamp(0.3rem, 0.4vw, 0.6rem) clamp(0.6rem, 0.8vw, 1rem);
}
.player-label.team-red  { color: #ffc1c9; }
.player-label.team-blue { color: #b8d0f5; }

.match-strip {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  background: #16213e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  width: 100%;
  position: relative;
}
.match-strip.hidden { display: none; }

.match-strip-info {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.9rem;
  color: #c0c0d0;
  overflow: hidden;
}

.match-strip-room {
  color: #e879a0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  max-width: 30ch;
}

.match-strip-sep { color: #5a5a75; flex-shrink: 0; }

.match-strip-current {
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.match-strip-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.match-strip-btn {
  background: #0f3460;
  border: 1px solid #2a2a5a;
  border-radius: 6px;
  color: #e0e0e0;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  line-height: 1;
}
.match-strip-btn:hover {
  background: #2a2a5a;
  border-color: #e879a0;
  color: #e879a0;
}

.match-strip-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.match-strip-back-arrow { font-size: 0.95rem; line-height: 1; }

/* Overlay on canvas1 (already 55% dimmed bg paint underneath); gradient scrim aids text contrast. */
.match-overview {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.4rem 1.8rem;
  color: #e8e8f0;
  font-size: 0.95rem;
  line-height: 1.3;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 20, 0.55) 0%,
    rgba(10, 10, 20, 0.25) 35%,
    rgba(10, 10, 20, 0.55) 100%
  );
}
.match-overview.hidden { display: none; }

.match-overview-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.match-overview-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.01em;
  margin: 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85), 0 0 16px rgba(0, 0, 0, 0.55);
}

.match-overview-meta {
  font-size: 0.85rem;
  color: #c8c8dc;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.match-overview-players {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  font-size: 0.9rem;
}
.match-overview-players.team {
  align-items: stretch;
}
.match-overview-team-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 0 0 auto;
  min-width: 0;
}
.match-overview-team-col-red  .match-overview-player {
  border-color: rgba(232, 100, 130, 0.45);
}
.match-overview-team-col-blue .match-overview-player {
  border-color: rgba(120, 155, 230, 0.45);
}
.match-overview-summary-team { flex: 1 1 auto; align-self: center; }

.match-overview-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: rgba(15, 52, 96, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(42, 42, 90, 0.85);
  border-radius: 10px;
  min-width: 16rem;
  flex: 0 0 auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.match-overview-player.leader { border-color: #e879a0; }

.match-overview-player-avatar {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.4);
}
.match-overview-player-avatar-placeholder {
  background: rgba(30, 30, 60, 0.7);
  border: 1px dashed rgba(180, 180, 220, 0.3);
}

.match-overview-player-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1 1 auto;
}

.match-overview-player-topline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.match-overview-player-flag {
  width: 22px;
  height: auto;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.match-overview-player-name {
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.match-overview-player-stats {
  color: #c4c8e0;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.match-overview-player-ranks {
  color: #9fa8c8;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* Scoreboard fills gap between player cards; `.leading` echoes the live dual-score strip. */
.match-overview-summary {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  min-width: 10rem;
  font-variant-numeric: tabular-nums;
  color: #dce2ee;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.match-overview-summary-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  column-gap: 0.8rem;
  font-family: 'Exo', 'Segoe UI', sans-serif;
  font-style: italic;
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1;
}
.match-overview-summary-wins {
  color: #c8cede;
  transition: color 0.12s ease, font-weight 0.12s ease;
}
.match-overview-summary-wins:first-child { text-align: right; }
.match-overview-summary-wins:last-child  { text-align: left;  }
.match-overview-summary-wins.leading {
  color: #ffffff;
  font-weight: 800;
}
.match-overview-summary-dash {
  color: #9fa8c8;
  font-weight: 500;
}

.match-overview-summary-stat {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  column-gap: 0.8rem;
  font-size: 0.85rem;
}
.match-overview-summary-stat-label {
  color: #8d93ad;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.match-overview-summary-stat-val {
  color: #c8cede;
  font-style: italic;
  transition: color 0.12s ease, font-weight 0.12s ease;
}
.match-overview-summary-stat-val.left  { text-align: right; }
.match-overview-summary-stat-val.right { text-align: left;  }
.match-overview-summary-stat-val.leading {
  color: #ffffff;
  font-weight: 700;
}

.match-overview-maps {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  /* flex:0 1 auto so the scrim ends at the last map; still shrinks + scrolls when tall. */
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.55rem;
  background: rgba(10, 10, 20, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(42, 42, 74, 0.55);
  border-radius: 8px;
  scrollbar-width: none;
}
.match-overview-maps::-webkit-scrollbar { display: none; }

.match-overview-map {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.75rem;
  background: rgba(26, 26, 46, 0.82);
  border: 1px solid rgba(42, 42, 74, 0.7);
  border-radius: 5px;
  font-size: 0.85rem;
}
.match-overview-map.current {
  border-color: #e879a0;
  background: rgba(52, 22, 48, 0.85);
}

.match-overview-map-index {
  color: #a0a0c0;
  font-variant-numeric: tabular-nums;
  min-width: 1.5rem;
  text-align: right;
  flex-shrink: 0;
}

.match-overview-map-title {
  color: #e8e8f0;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-overview-map-scores {
  color: #b4b4cc;
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.match-overview-map-score.leading {
  color: #ffffff;
  font-weight: 700;
}

/* Team-match row stacks (title > sums > players); .team flips to column with full-width scores. */
.match-overview-map.team {
  flex-wrap: wrap;
  align-items: flex-start;
}
.match-overview-map.team .match-overview-map-scores {
  white-space: normal;
  flex-basis: 100%;
  order: 2;
}
.match-overview-map-team-sums {
  display: inline-flex;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.match-overview-map-team-sum {
  font-style: italic;
  font-weight: 500;
  color: #b4b4cc;
}
.match-overview-map-team-sum.team-red  { color: #f3c5cd; }
.match-overview-map-team-sum.team-blue { color: #c8d6ee; }
.match-overview-map-team-sum.leading {
  font-weight: 700;
  color: #ffffff;
}
.match-overview-map-team-vs {
  color: #6a6a7a;
  font-style: italic;
}
.match-overview-map-players {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  margin-top: 3px;
  font-size: 0.75rem;
  color: #8d8da0;
}
.match-overview-map-team-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.match-overview-map-team-col .match-overview-map-score.team-red  { color: #e7a8b2; }
.match-overview-map-team-col .match-overview-map-score.team-blue { color: #adc1e3; }

.match-overview-map-load {
  background: rgba(42, 42, 90, 0.9);
  color: #e8e8f0;
  border: 1px solid rgba(58, 58, 106, 0.9);
  border-radius: 4px;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.match-overview-map-load:hover:not(:disabled) {
  background: rgba(58, 58, 106, 1);
  border-color: #e879a0;
}
.match-overview-map-load:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.match-overview-map-share {
  background: transparent;
  color: #a0a0b0;
  border: 1px solid rgba(58, 58, 106, 0.9);
  border-radius: 4px;
  width: 1.8rem;
  height: 1.8rem;
  margin-left: 0.25rem;
  font-size: 0.9rem;
  line-height: 1;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.match-overview-map-share:hover {
  background: rgba(58, 58, 106, 1);
  color: #e879a0;
  border-color: #e879a0;
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 0.5rem;
}
.match-header {
  font-size: 0.85rem;
  color: #a0a0c0;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #2a2a4a;
}
.match-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.4rem 0.5rem;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 4px;
  font-size: 0.8rem;
}
.match-item-title { color: #e0e0e0; font-weight: 600; }
.match-item-score { color: #c0c0d0; padding-left: 0.5rem; }
.match-item-load {
  align-self: flex-start;
  margin-top: 0.2rem;
  padding: 0.2rem 0.6rem;
  background: #2a2a5a;
  color: #e0e0e0;
  border: 1px solid #3a3a6a;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.75rem;
}
.match-item-load:hover:not(:disabled) { background: #3a3a6a; }
.match-item-load:disabled { opacity: 0.4; cursor: not-allowed; }
