/* Admin overlay */
.admin-esp {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.admin-esp > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.admin-esp g[data-team='1'] {
  color: var(--player-team-t);
}
.admin-esp g[data-team='2'] {
  color: var(--player-team-ct);
}
.admin-esp path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.admin-esp text {
  font: 600 13px var(--ui-font);
  text-anchor: middle;
  fill: currentColor;
}
.admin-esp-distance {
  font-size: 11px;
  font-weight: 500;
}
.admin-esp-state {
  position: absolute;
  left: 50%;
  top: calc(
    var(--team-top) + max(var(--team-roster-height), calc(var(--team-avatar) + 18px)) +
      var(--ui-gap)
  );
  bottom: auto;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  color: #efd096;
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}
.admin-esp-state strong {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.7px;
}

/* Panel frames */
/* Shared window frames and layout. Controls and content cards live in components.css. */
.ui-panel,
#game-panel .game-content {
  width: 1220px;
  height: 800px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - var(--menu-padding) * 2);
}
.ui-panel {
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  background: var(--panel-surface);
  color: var(--panel-text);
  font-size: 14px;
  overflow: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-scrollbar) transparent;
}
.ui-panel[open] {
  display: flex;
  flex-direction: column;
}
.ui-panel::backdrop {
  background: var(--ui-backdrop);
}
.ui-panel .dialog-header,
.game-panel .game-header,
.scoreboard-header,
.capture > strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  min-height: 72px;
  padding: 16px var(--panel-padding);
  background: var(--panel-header);
  border-bottom: 1px solid var(--panel-line);
}
.ui-panel .dialog-header h2,
.game-panel .game-header .game-title,
.scoreboard-server,
.capture > strong {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--panel-text);
  font-family: var(--ui-font);
  font-size: var(--panel-title-size);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.3px;
  overflow-wrap: anywhere;
}
.ui-panel .dialog-header h2 > .ui-control-icon,
.game-panel .game-header .game-title > .ui-control-icon,
.capture > strong > .ui-control-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 var(--panel-icon-size);
  width: var(--panel-icon-size);
  height: var(--panel-icon-size);
  margin: 0;
  padding: 0;
  border: 1px solid var(--panel-icon-border);
  border-radius: var(--ui-radius);
  background: var(--panel-icon-surface);
  color: var(--panel-icon-color);
  font-size: 16px;
  line-height: 1;
  opacity: 1;
  transform: translateY(var(--panel-icon-offset-y));
}
/* Align header icons with Montserrat's visible letter height. */
.ui-panel .dialog-header .panel-close,
.scoreboard-header .scoreboard-emblem {
  transform: translateY(var(--panel-icon-offset-y));
}
.ui-panel .dialog-header button > .ui-control-icon {
  color: var(--panel-icon-color);
  opacity: 1;
}
.ui-panel .dialog-body {
  flex: 1;
  min-height: 0;
  padding: var(--panel-padding);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-scrollbar) transparent;
}
.ui-panel .dialog-body[data-pane] {
  min-height: 0;
}
.ui-panel .dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px var(--panel-padding);
  border-top: 1px solid var(--panel-line);
  background: var(--panel-surface);
}
.ui-panel .dialog-body label {
  font-size: 13px;
  line-height: 1.6;
  color: #c6d6e1;
}
.ui-panel .dialog-body > label {
  display: block;
  margin-bottom: 22px;
}
.ui-panel .dialog-body input:not([type='range']):not([type='checkbox']),
.ui-panel .dialog-body select {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 7px;
}
.ui-panel .dialog-body input[type='range'] {
  display: block;
  width: 100%;
  margin-top: 12px;
}
.ui-panel .dialog-body output {
  color: var(--ui-accent);
  font-variant-numeric: tabular-nums;
}
.ui-panel .help {
  font-size: 12px;
  line-height: 1.7;
  color: var(--panel-muted);
}
.ui-panel .option-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.ui-panel .servers-note,
.ui-panel [data-admin-note] {
  font-size: 12px;
  line-height: 1.6;
  color: var(--panel-muted);
}
.ui-panel [data-stats-overview],
.ui-panel [data-stats-player] {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.ui-panel [data-stats-content],
.ui-panel [data-stats-detail] {
  flex: 1;
  min-height: 0;
  padding: var(--panel-padding);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.ui-panel.statistics-dialog :is([data-stats-content], [data-stats-detail]) {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
}
.ui-panel.loading-window {
  height: fit-content;
}
.ui-panel.loading-window .dialog-body {
  display: grid;
  flex: 0 1 auto;
  align-content: start;
  gap: 12px;
  padding-block: var(--panel-padding);
}
.loading-window .dialog-body > p {
  margin: 0;
}
.loading-window #asset-info:empty {
  display: none;
}
.ui-panel.loading-window progress {
  height: 8px;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff08;
  accent-color: var(--ui-accent);
}
.ui-panel.loading-window progress::-webkit-progress-bar {
  background: #ffffff08;
}
.ui-panel.loading-window progress::-webkit-progress-value {
  background: var(--ui-accent);
}
.ui-panel.loading-window progress::-moz-progress-bar {
  background: var(--ui-accent);
}
.ui-panel.diagnostics-window pre {
  padding: 14px;
  border: 1px solid #ffffff0e;
  border-radius: 4px;
  background: #0c151e;
  color: #c6d6e1;
  font-size: 12px;
  line-height: 1.7;
}
.ui-panel.servers-window .servers-body {
  padding: var(--panel-padding);
}

/* In-game windows use the same surface, header and controls. */
.game-panel {
  background: var(--ui-backdrop);
}
.game-panel .game-content {
  padding: var(--panel-padding);
  gap: 20px 24px;
  background: var(--panel-surface);
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  overflow: hidden;
}
.game-panel .game-header {
  grid-column: 1/-1;
  margin: calc(-1 * var(--panel-padding)) calc(-1 * var(--panel-padding)) 0;
}
.game-panel .game-header .game-title {
  position: static;
  height: auto;
  white-space: normal;
}
.game-panel .game-header .game-balance {
  display: grid;
  grid-template-columns: 28px auto;
  align-items: center;
  column-gap: 8px;
  flex-shrink: 0;
}
.game-balance > .ui-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--ui-accent);
  font-size: 14px;
}
.game-balance-label {
  color: var(--panel-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 11px;
  letter-spacing: 0.08em;
}
.game-balance-amount {
  color: var(--ui-accent-hover);
  font-size: 18px;
  font-weight: 700;
  line-height: 19px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.scoreboard,
.capture {
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  background: var(--panel-surface);
}
.scoreboard-header {
  height: 72px;
}
.scoreboard-header .scoreboard-emblem {
  width: var(--panel-icon-size);
  height: var(--panel-icon-size);
  padding: 3px;
  border: 1px solid var(--panel-icon-border);
  border-radius: var(--ui-radius);
  background: var(--panel-icon-surface);
}
.capture {
  padding: 0;
  text-align: left;
  overflow: hidden;
}
.capture > strong {
  padding: 16px var(--panel-padding);
  border-bottom: 1px solid var(--panel-line);
}
.capture > #capture-message {
  padding: 16px var(--panel-padding);
  max-width: none;
}

@media (max-width: 680px) {
  .ui-panel,
  #game-panel .game-content {
    max-width: calc(100vw - 24px);
  }
  .ui-panel .dialog-header,
  .game-panel .game-header {
    min-height: 72px;
    gap: 12px;
  }
  .ui-panel .dialog-actions {
    gap: 8px;
    padding-block: 12px;
  }
  .ui-panel .dialog-actions > p {
    flex-basis: 100%;
    margin: 0;
  }
  .game-panel .game-content {
    padding: var(--panel-padding);
    gap: 16px;
  }
  .game-panel .game-header {
    flex-wrap: wrap;
  }
  .game-panel .game-header .game-balance {
    margin-left: auto;
  }
}

/* Viewport layout */
/* Keep interface coordinates separate from the full game viewport. */
:root {
  --window-width: 100vw;
  --window-height: 100vh;
  --interface-max-width: 1920px;
  --menu-padding: 24px;
}
@supports (height: 100dvh) {
  :root {
    --window-width: 100dvw;
    --window-height: 100dvh;
  }
}
.interface-frame {
  width: 100%;
  max-width: var(--interface-max-width);
  margin-inline: auto;
}
.stage {
  --interface-gutter: max(0px, calc((100cqw - var(--interface-max-width)) / 2));
  --hud-edge: 12px;
  --hud-loadout-width: min(260px, calc(50cqw - var(--hud-edge) - 56px));
}
@media (max-width: 800px), (max-height: 650px) {
  .stage {
    --hud-edge: 6px;
  }
}
.tactical-hud {
  display: grid;
  grid-template-columns: var(--hud-loadout-width) minmax(0, 1fr) var(--hud-loadout-width);
  align-content: end;
  padding: 0 var(--hud-edge) var(--hud-edge);
}
.tactical-hud > .hud-vitals {
  grid-area: 1 / 1;
}
.tactical-hud > .hud-loadout {
  grid-area: 1 / 3;
}
@media (max-width: 600px) {
  .stage {
    --hud-loadout-width: clamp(120px, calc(50cqw - var(--hud-edge) - 42px), 200px);
  }
}
.menu-frame {
  position: relative;
  width: 100%;
  max-width: var(--interface-max-width);
  height: 100%;
  margin-inline: auto;
}
@media (min-width: 681px) {
  #launch .menu-topbar {
    left: var(--menu-padding);
    right: var(--menu-padding);
  }
  #launch .menu-column {
    left: var(--menu-padding);
  }
  #launch .menu-disclaimer {
    left: var(--menu-padding);
    right: var(--menu-padding);
  }
}
/* The scope covers the whole scene even when its HUD container is narrower. */
.extended-hud > .hud-scope {
  left: 50%;
  right: auto;
  width: 100vw;
  transform: translateX(-50%);
}
@media (max-width: 680px) {
  :root {
    --menu-padding: 16px;
  }
  .main-menu {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 0;
  }
  .main-menu .menu-topbar,
  .main-menu .menu-copy,
  .main-menu nav,
  .main-menu .menu-disclaimer {
    position: static;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: 100%;
    max-width: none;
    flex-shrink: 0;
    margin: 0;
  }
  .main-menu .menu-topbar {
    order: 0;
  }
  .main-menu .menu-copy {
    order: 1;
  }
  .main-menu nav {
    order: 3;
  }
  .main-menu .menu-disclaimer {
    order: 6;
    padding-bottom: 16px;
  }
  .main-menu .menu-copy h1,
  body[data-access='member'] .menu-copy h1 {
    font-size: 36px;
  }
  .main-menu .menu-description {
    display: block;
    font-size: 13px;
    margin: 18px 0 0;
  }
  .main-menu .menu-eyebrow {
    font-size: 9px;
  }
  .menu-frame {
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex-shrink: 0;
    height: auto;
    min-height: 100%;
    padding: var(--menu-padding);
  }
}

/* Control settings */
.crosshair-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: start;
}
.crosshair-layout .crosshair-settings {
  margin-bottom: 0;
}
.crosshair-preview {
  margin: 0;
  min-width: 0;
}
.crosshair-preview-surface {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  height: 180px;
  margin-top: 12px;
  overflow: hidden;
}
.crosshair-preview-scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}
.crosshair-preview #crosshair-preview {
  position: relative;
  z-index: 1;
  display: block;
  width: 160px;
  height: 160px;
  overflow: visible;
  shape-rendering: geometricPrecision;
}
.crosshair-preview p {
  margin: 10px 0 0;
  color: var(--panel-muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}
@media (max-width: 680px) {
  .crosshair-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .crosshair-preview {
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 1;
  }
  .crosshair-preview-surface {
    height: 160px;
  }
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex-shrink: 0;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  vertical-align: middle;
  white-space: nowrap;
  border: 1px solid #a3c5de59;
  border-radius: 4px;
  background: var(--ui-surface-raised);
  color: #e1eaf0;
  font: 600 11px/1 var(--ui-font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
}
.keyboard-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.keyboard-group {
  min-width: 0;
  overflow: hidden;
}
.keyboard-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 15px 16px;
  background: var(--panel-header);
  border-bottom: 1px solid var(--panel-line);
}
.keyboard-group-title > .ui-icon {
  font-size: 13px;
  color: var(--ui-accent);
}
.keyboard-bindings {
  margin: 0;
  padding: 0 16px;
}
.keyboard-binding {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  padding: 8px 0;
  border-bottom: 1px solid #ffffff0b;
}
.keyboard-binding:last-child {
  border-bottom: 0;
}
.keyboard-binding dt {
  min-width: 0;
  color: var(--panel-text);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.keyboard-binding dd {
  margin: 0;
  flex-shrink: 0;
}
.game-panel .game-choices button {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  column-gap: 10px;
}
.game-shortcut:empty {
  visibility: hidden;
}
.admin-esp-state {
  gap: 10px;
}
@media (max-width: 680px) {
  .keyboard-groups {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .keyboard-group-title {
    padding: 13px 14px;
  }
  .keyboard-bindings {
    padding-inline: 14px;
  }
}

/* Panel tables */
:is(.servers-table-wrap, .admin-table-wrap, .stats-table-wrap) {
  min-width: 0;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--table-border);
  border-radius: var(--table-radius);
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-scrollbar) transparent;
}
:is(.admin-table-wrap, .stats-table-wrap) {
  max-height: min(440px, 52dvh);
}
:is(.servers-table, .admin-table, .stats-table) {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  color: var(--panel-text);
  font-size: 13px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
:is(.servers-table, .admin-table, .stats-table) th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px var(--table-cell-padding);
  border: 0;
  border-bottom: 1px solid var(--panel-line);
  background: var(--table-header);
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  vertical-align: middle;
}
:is(.servers-table, .admin-table, .stats-table) td {
  height: 56px;
  padding: var(--table-cell-padding);
  border: 0;
  border-bottom: 1px solid var(--table-row-line);
  color: var(--ui-text);
  vertical-align: middle;
}
:is(.servers-table, .admin-table, .stats-table) th > .ui-icon {
  font-size: 11px;
  margin-inline-end: 7px;
}
:is(.servers-table, .admin-table, .stats-table) tbody tr:is(:hover, :focus-within) {
  background: var(--table-hover);
}
:is(.servers-table, .admin-table, .stats-table)
  tbody
  tr:is(.selected, [data-selected='true'], [data-own='true']) {
  background: var(--table-selected);
}
:is(.servers-table, .admin-table, .stats-table) tbody tr:focus-visible {
  outline: 1px solid var(--ui-accent) !important;
  outline-offset: -1px;
  background: var(--table-hover);
}
.servers-table td:first-child {
  color: #edf2f4;
  font-weight: 600;
}
.servers-table tbody tr.selected td:first-child {
  color: var(--ui-accent);
}
.servers-table :is(th, td):nth-child(n + 3) {
  text-align: center;
}
.servers-table td:nth-child(3) {
  color: #e8edf0;
}
.servers-table td:last-child {
  color: var(--ui-accent);
  font-weight: 600;
}
.servers-table tbody tr.unavailable td {
  color: #64717c;
}
.stats-table {
  min-width: 560px;
}
.stats-table :is(th, td) {
  text-align: center;
}
.stats-breakdown .stats-table :is(th, td):first-child,
.stats-ranking .stats-table :is(th, td):nth-child(2) {
  text-align: left;
}
.stats-table .stats-place {
  width: 36px;
  color: #849aa9;
}
.stats-table .stats-kd {
  color: var(--ui-accent);
  font-weight: 600;
}
.stats-table .stats-player-name {
  max-width: 220px;
}
.stats-dimension {
  color: var(--panel-text);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.stats-weapon {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stats-weapon > .weapon-icon {
  width: 50px;
  height: 28px;
  color: var(--ui-muted);
}
.stats-breakdown[data-dimension='weapon'] .stats-table {
  min-width: 860px;
}
.stats-breakdown[data-dimension='map'] .stats-table {
  min-width: 680px;
}
.stats-breakdown .stats-table {
  table-layout: fixed;
}
.stats-breakdown .stats-table th {
  overflow-wrap: anywhere;
}
.stats-breakdown .stats-table :is(th, td):first-child {
  width: 190px;
}
.stats-global-body .stats-breakdown .stats-table {
  min-width: 680px;
}
.stats-ranking-table-wrap {
  max-height: none;
}
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
  margin-top: 12px;
}

/* TAB keeps its team colors and compact match layout. */
.score-columns {
  position: sticky;
  top: 44px;
  z-index: 1;
  height: 36px;
  min-height: 36px;
  margin: 0;
  border-bottom: 1px solid var(--panel-line);
  background: var(--table-header);
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.scoreboard-list {
  margin: var(--panel-padding);
  scrollbar-color: var(--ui-scrollbar) transparent;
  scrollbar-gutter: stable both-edges;
}
.score-team {
  margin: 0;
  border: 1px solid var(--table-border);
  border-radius: var(--table-radius);
  overflow: clip;
}
.score-team-1 {
  color: var(--player-team-t);
}
.score-team-2 {
  color: var(--player-team-ct);
}
.score-team-3,
.score-team-0 {
  color: var(--panel-muted);
}
.score-team-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 44px;
  min-height: 44px;
  margin: 0;
  border-bottom: 1px solid var(--table-row-line);
  background: var(--table-header);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}
.score-team-heading .score-cell-2 {
  font-size: 18px;
}
.score-player {
  border-bottom: 1px solid var(--table-row-line);
  color: #c3cfd7;
  font-size: 13px;
}
.score-player:last-child {
  border-bottom: 0;
}
.score-player:hover {
  background: var(--table-hover);
}
.score-player.score-local {
  background: var(--table-selected);
  outline: 0;
}
.score-player .score-cell-0 {
  padding-left: 0;
}
.score-cell-1 {
  font-size: 11px;
  color: #8094a2;
}

.keyboard-group-title {
  padding-inline: 12px;
  border-bottom-color: var(--panel-line);
  background: var(--table-header);
}
.keyboard-bindings {
  padding-inline: 12px;
}
.keyboard-binding {
  min-height: 50px;
  padding-block: 12px;
  border-bottom-color: var(--table-row-line);
}
