:root {
  color-scheme: dark;
  --bg: #08070f;
  --bg-2: #0e0c1a;
  --panel: rgba(21, 19, 40, .82);
  --panel-strong: rgba(30, 27, 58, .78);
  --line: rgba(255, 255, 255, .08);
  --line-strong: #454064;
  --text: #f0f1ff;
  --muted: #a0a3c8;
  --quiet: #5f6388;
  --accent: #c6ff4f;
  --accent-2: #41f2ff;
  --warn: #ffb24d;
  --danger: #ff4d6d;
  font: 15px/1.45 "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
html.dashboard-active body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

#dashboard-shell {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% -8%, rgba(111, 72, 190, .25), transparent 38rem),
    radial-gradient(circle at 92% 105%, rgba(65, 242, 255, .055), transparent 32rem),
    var(--bg);
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

.masthead {
  width: min(1280px, calc(100% - 72px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-grid;
  gap: 3px;
  color: var(--text);
  text-decoration: none;
}
.brand strong {
  color: var(--accent);
  font: 800 1.875rem/1 "Space Grotesk", ui-sans-serif, sans-serif;
  letter-spacing: .05em;
}
.brand small {
  color: var(--quiet);
  font: 600 .72rem/1 "Space Grotesk", ui-sans-serif, sans-serif;
}
.brand:hover small { color: var(--accent-2); }

.dashboard-privacy {
  position: fixed;
  z-index: 4;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--quiet);
  background: rgba(8, 7, 15, .78);
  font-size: .76rem;
  text-decoration: none;
}
.dashboard-privacy:hover { color: var(--accent-2); }

main {
  width: min(1280px, calc(100% - 72px));
  margin: 38px auto 64px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
}
.loading {
  width: min(440px, 100%);
  margin: 14vh auto 0;
  padding: 34px;
  text-align: center;
  color: var(--muted);
}
.loading p { margin: 14px 0 0; }
.spinner {
  display: inline-block;
  width: 25px;
  height: 25px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#dashboard-shell[data-view="auth"] .masthead,
#dashboard-shell[data-view="loading"] .masthead { display: none; }
#dashboard-shell[data-view="auth"] main,
#dashboard-shell[data-view="loading"] main {
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
  display: grid;
  place-items: center;
}
#dashboard-shell[data-view="auth"] .loading,
#dashboard-shell[data-view="loading"] .loading { margin: 0; }

.auth-shell {
  width: min(440px, 100%);
  margin: 8vh auto 0;
  padding: 34px;
  border-color: #393552;
  border-radius: 22px;
  background: rgba(18, 19, 32, .96);
}
#dashboard-shell[data-view="auth"] .auth-shell { margin: 0; }
.returning-auth { gap: 12px; }
.remembered-account {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  margin: 8px 0 10px;
  padding: 15px;
  border: 1px solid rgba(65, 242, 255, .22);
  border-radius: 15px;
  background:
    linear-gradient(110deg, rgba(198, 255, 79, .07), rgba(65, 242, 255, .045)),
    rgba(8, 7, 15, .58);
}
.remembered-avatar {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(198, 255, 79, .48);
  border-radius: 13px;
  color: var(--accent);
  background: rgba(198, 255, 79, .08);
  font-weight: 800;
  letter-spacing: .04em;
}
.remembered-copy { min-width: 0; display: grid; gap: 2px; }
.remembered-copy strong,
.remembered-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.remembered-copy strong { color: var(--text); font-size: 1rem; }
.remembered-copy span { color: var(--muted); font-size: .82rem; }
.passkey-primary { position: relative; }
.text-button {
  padding: 7px 10px;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
  font-size: .84rem;
  font-weight: 650;
}
.text-button:hover { color: var(--accent-2); background: transparent; filter: none; }
.remembered-account-choices {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.remembered-account-choices .text-button { width: auto; }
.remembered-account-choices .text-button + .text-button::before {
  content: '';
  display: inline-block;
  width: 1px;
  height: .9em;
  margin-right: 12px;
  vertical-align: -.08em;
  background: var(--line-strong);
}
.account-dashboard { display: grid; }
.dashboard-home-link { width: max-content; text-decoration: none; }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.auth-back {
  display: inline-block;
  margin-top: 22px;
  color: #bfc3df;
  font-size: .88rem;
  text-underline-offset: 4px;
}
.auth-back:hover { color: var(--accent-2); }

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font: 700 .74rem/1.4 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .15em;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: -.04em;
}
.auth-shell h1 { font-size: clamp(1.9rem, 7vw, 2.5rem); }
h2 { margin-bottom: 15px; font-size: 1.35rem; letter-spacing: -.025em; }
h3 { margin-bottom: 4px; font-size: 1rem; }
.lede, .muted { color: var(--muted); }
.lede { margin-bottom: 26px; }

form { display: grid; gap: 14px; }
label {
  display: grid;
  gap: 7px;
  color: #c5c6da;
  font-size: .88rem;
  font-weight: 650;
}
input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  background: var(--bg-2);
  transition: border-color 120ms ease, background-color 120ms ease;
}
input:hover { border-color: #625d82; }
input:focus { border-color: var(--accent-2); background: #0a0912; }
input::placeholder { color: var(--quiet); }
.honeypot { position: fixed; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.button, button {
  width: fit-content;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #08070f;
  cursor: pointer;
  font-weight: 760;
  text-align: center;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, filter 120ms ease;
}
form > button { width: 100%; margin-top: 2px; }
button:hover, .button:hover { filter: brightness(1.08); }
button:disabled { cursor: wait; opacity: .55; }
.secondary {
  color: #d2d3e4;
  background: rgba(26, 23, 51, .45);
  border-color: var(--line-strong);
}
.secondary:hover { color: var(--text); background: var(--panel-strong); border-color: #676188; }
.danger { color: #ffdbe2; background: rgba(255, 77, 109, .09); border-color: rgba(255, 77, 109, .34); }
.danger:hover { background: rgba(255, 77, 109, .16); }
.compact { padding: 8px 11px; font-size: .8rem; }
.form-error { min-height: 1.35em; margin: -2px 0 0; color: #ff818d; font-size: .85rem; }
.form-error:empty { min-height: 0; margin: 0; }

.owner-console { display: grid; gap: 28px; }
.console-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 12px 0 24px;
  border-bottom: 1px solid var(--line);
}
.console-intro h1 { margin-bottom: 0; }
.view-section { min-width: 0; }
.dashboard-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 18px;
}
.dashboard-head h2 { margin-bottom: 4px; }
.dashboard-head p { margin-bottom: 0; }
.view-title { font-size: clamp(1.55rem, 3vw, 2.1rem); }

.admin-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(14, 12, 26, .85);
}
.admin-tabs .tab {
  margin: 0;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font: 700 .72rem/1.2 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .035em;
}
.admin-tabs .tab:hover { color: var(--text); background: var(--panel-strong); filter: none; }
.admin-tabs .tab.active {
  color: var(--accent);
  background: rgba(198, 255, 79, .09);
  border-color: rgba(198, 255, 79, .46);
}

.live-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font: 700 .72rem/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .04em;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(198, 255, 79, .55); }
.live-dot.offline { background: var(--danger); box-shadow: 0 0 12px rgba(255, 77, 109, .45); }

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.metric { min-width: 0; padding: 16px; border-radius: 16px; }
.metric small {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font: 700 .66rem/1.35 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.metric strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(1.22rem, 2vw, 1.8rem);
  letter-spacing: -.035em;
  text-overflow: ellipsis;
}
.metric em, .live-count { color: var(--accent); font-style: normal; }
.catalog-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 210px)); gap: 10px; margin-bottom: 18px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .68fr);
  gap: 16px;
  align-items: start;
}
.panel { overflow: hidden; }
.panel-head {
  min-height: 62px;
  padding: 15px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; font-size: 1.08rem; }
.panel-head input { width: min(250px, 44vw); padding: 8px 11px; }
.table-scroll { overflow: auto; max-height: 570px; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td {
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #100e1b;
  font: 700 .64rem/1.35 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .075em;
  text-transform: uppercase;
}
th:first-child, td:first-child { text-align: left; }
tbody tr:hover { background: rgba(65, 242, 255, .035); }
.game-name { font-weight: 700; }
.empty { padding: 32px 18px; color: var(--muted); text-align: center; }

.game-summary-row { cursor: pointer; }
.game-summary-row:hover,
.game-summary-row:focus-within { background: rgba(198, 255, 79, .055); }
.game-detail-link {
  min-height: 44px;
  margin: -7px -10px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  color: var(--text);
  font-weight: 750;
  text-decoration-color: rgba(65, 242, 255, .42);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.game-detail-link:hover {
  color: var(--accent);
  background: rgba(198, 255, 79, .07);
  text-decoration-color: currentColor;
}
.game-detail-link:focus-visible { position: relative; z-index: 2; }
.release-game-link { max-width: 100%; overflow-wrap: anywhere; }

.game-dashboard {
  min-width: 0;
  display: grid;
  gap: 16px;
}
.game-dashboard > *,
.game-detail-grid > *,
.game-events-grid > * { min-width: 0; }
.game-dashboard-head,
.game-dashboard .game-metrics { margin-bottom: 0; }
.game-dashboard-head .muted { overflow-wrap: anywhere; }
.game-detail-loading {
  display: flex;
  align-items: center;
  gap: 13px;
}
.game-detail-loading p { margin: 0; }
.game-summary-details,
.game-breakdowns {
  min-width: 0;
  display: grid;
  gap: 10px;
}
.section-heading {
  min-width: 0;
  padding: 6px 2px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.section-heading h2 { margin: 0; font-size: 1.08rem; }
.section-heading p { margin: 0; font-size: .78rem; text-align: right; }
.game-summary-details .game-stat-strip + .section-heading { margin-top: 6px; }
.game-stat-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.game-stat {
  min-width: 0;
  padding: 13px 15px;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(65, 242, 255, .035), transparent 65%),
    var(--panel);
}
.game-stat small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font: 700 .62rem/1.35 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .065em;
  text-transform: uppercase;
}
.game-stat strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(.86rem, 1.35vw, 1.08rem);
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}
.network-data-table {
  table-layout: fixed;
  white-space: normal !important;
}
.network-data-table th,
.network-data-table td {
  width: 1px;
  max-width: 1px;
  padding: 0;
  overflow: hidden;
}

.game-network-panel {
  min-width: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 34% 40%, rgba(65, 242, 255, .055), transparent 32rem),
    linear-gradient(145deg, rgba(111, 72, 190, .07), transparent 58%),
    var(--panel);
}
.network-panel-head { align-items: flex-start; }
.network-panel-head h2 { margin: 0; }
.network-head-status {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 9px;
}
.network-live-badge {
  min-height: 25px;
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--quiet);
  background: rgba(8, 7, 15, .58);
  font: 700 .63rem/1.2 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .035em;
  text-transform: uppercase;
  white-space: nowrap;
}
.network-live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--quiet);
}
.network-live-badge.active {
  color: var(--accent);
  border-color: rgba(198, 255, 79, .34);
  background: rgba(198, 255, 79, .065);
}
.network-live-badge.active::before {
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
  animation: network-live-blink 1.8s ease-in-out infinite;
}
.network-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px 11px;
  color: var(--quiet);
  font: 650 .59rem/1.2 "JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}
.network-legend-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.network-legend-dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 50%;
  background: var(--quiet);
  box-shadow: 0 0 7px currentColor;
}
.network-legend-dot.good { color: var(--accent); background: currentColor; }
.network-legend-dot.fair { color: var(--accent-2); background: currentColor; }
.network-legend-dot.slow { color: var(--warn); background: currentColor; }
.network-legend-dot.poor { color: var(--danger); background: currentColor; }

.network-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  align-items: stretch;
}
.world-stage {
  position: relative;
  min-width: 0;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  isolation: isolate;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 52% 44%, rgba(65, 242, 255, .07), transparent 54%),
    linear-gradient(180deg, rgba(8, 7, 15, .5), rgba(8, 7, 15, .9));
}
.world-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, .025) 48%, transparent 70%);
}
.world-map { width: 100%; height: 100%; display: block; }
.world-grid line {
  stroke: rgba(160, 163, 200, .075);
  stroke-width: 1;
  stroke-dasharray: 3 7;
  vector-effect: non-scaling-stroke;
}
.world-land path {
  fill: rgba(69, 64, 100, .32);
  stroke: rgba(160, 163, 200, .3);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 4px 9px rgba(0, 0, 0, .3));
}
.latency-good { --latency-color: var(--accent); }
.latency-fair { --latency-color: var(--accent-2); }
.latency-slow { --latency-color: var(--warn); }
.latency-poor { --latency-color: var(--danger); }
.latency-unknown { --latency-color: var(--quiet); }
.connection-path {
  fill: none;
  stroke: var(--latency-color, var(--quiet));
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-dasharray: 4 7;
  opacity: .68;
  vector-effect: non-scaling-stroke;
  animation: network-connection-flow 2.4s linear infinite;
  transition: opacity 140ms ease, stroke-width 140ms ease;
}
.connection-path.is-stale { stroke-dasharray: 2 8; opacity: .35; }
.connection-path.is-highlighted { stroke-width: 3; opacity: 1; }
.connection-rtt { pointer-events: none; transition: opacity 140ms ease; }
.connection-rtt rect {
  fill: rgba(8, 7, 15, .91);
  stroke: color-mix(in srgb, var(--latency-color, var(--quiet)) 58%, transparent);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.connection-rtt text {
  fill: var(--latency-color, var(--muted));
  font: 750 13px/1 "JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  paint-order: stroke;
  stroke: rgba(8, 7, 15, .9);
  stroke-width: 2px;
}
.connection-rtt.is-stale { opacity: .58; }
.connection-rtt.is-highlighted { opacity: 1; }
.connection-rtt.is-highlighted rect { stroke-width: 2; }

.player-map-marker { cursor: default; }
.player-map-pulse,
.server-map-ring {
  transform-box: fill-box;
  transform-origin: center;
}
.player-map-pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: .7;
  vector-effect: non-scaling-stroke;
  animation: network-marker-pulse 1.8s ease-out infinite;
}
.player-map-halo {
  fill: rgba(198, 255, 79, .12);
  stroke: rgba(198, 255, 79, .55);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: fill 140ms ease, stroke-width 140ms ease;
}
.player-map-core {
  fill: var(--accent);
  filter: drop-shadow(0 0 6px rgba(198, 255, 79, .95));
  animation: network-dot-blink 1.8s ease-in-out infinite;
}
.player-map-count {
  fill: var(--text);
  font: 800 12px/1 "JetBrains Mono", ui-monospace, monospace;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3px;
}
.player-map-marker.is-highlighted .player-map-halo { fill: rgba(198, 255, 79, .3); stroke-width: 2.5; }
.player-map-marker.is-highlighted .player-map-core { fill: #fff; }
.server-map-ring {
  fill: rgba(65, 242, 255, .06);
  stroke: rgba(65, 242, 255, .65);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  animation: network-server-pulse 2.8s ease-out infinite;
}
.server-map-core {
  fill: var(--accent-2);
  stroke: #eaffff;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 8px rgba(65, 242, 255, .72));
}
.server-map-label {
  fill: #e8fdff;
  font: 800 14px/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .025em;
  paint-order: stroke;
  stroke: rgba(8, 7, 15, .96);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.connection-path.phase-1,
.phase-1 .player-map-pulse,
.phase-1 .player-map-core { animation-delay: -.3s; }
.connection-path.phase-2,
.phase-2 .player-map-pulse,
.phase-2 .player-map-core { animation-delay: -.6s; }
.connection-path.phase-3,
.phase-3 .player-map-pulse,
.phase-3 .player-map-core { animation-delay: -.9s; }
.connection-path.phase-4,
.phase-4 .player-map-pulse,
.phase-4 .player-map-core { animation-delay: -1.2s; }
.connection-path.phase-5,
.phase-5 .player-map-pulse,
.phase-5 .player-map-core { animation-delay: -1.5s; }

.network-tooltip {
  position: absolute;
  z-index: 4;
  width: max-content;
  max-width: min(260px, calc(100% - 24px));
  padding: 9px 11px;
  display: grid;
  gap: 2px;
  pointer-events: none;
  border: 1px solid rgba(65, 242, 255, .31);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(8, 7, 15, .95);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .42);
  font-size: .7rem;
  transform: translate(-50%, calc(-100% - 15px));
}
.network-tooltip[hidden] { display: none; }
.network-tooltip strong { overflow-wrap: anywhere; color: var(--text); }
.network-tooltip-rtt { color: var(--latency-color, var(--muted)); font-family: "JetBrains Mono", ui-monospace, monospace; }
.network-map-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: min(330px, calc(100% - 28px));
  padding: 14px 17px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(8, 7, 15, .87);
  box-shadow: 0 14px 35px rgba(0, 0, 0, .34);
  text-align: center;
  transform: translate(-50%, -50%);
}
.network-map-empty.compact { top: auto; bottom: 12px; transform: translateX(-50%); }
.network-map-empty strong { color: var(--text); }
.network-map-empty span { font-size: .74rem; }
.network-unmapped-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 3;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(8, 7, 15, .84);
  font: 700 .61rem/1.2 "JetBrains Mono", ui-monospace, monospace;
  text-transform: uppercase;
}

.network-roster {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: rgba(8, 7, 15, .28);
}
.network-roster-head {
  min-height: 47px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.network-roster-head h3 { margin: 0; font-size: .82rem; }
.network-roster-head span {
  color: var(--accent);
  font: 750 .68rem/1 "JetBrains Mono", ui-monospace, monospace;
}
.network-roster-list {
  max-height: 450px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.network-roster-list .empty { margin: 0; }
.network-roster-row {
  min-width: 0;
  padding: 10px 13px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  transition: background-color 140ms ease;
}
.network-roster-row:last-child { border-bottom: 0; }
.network-roster-row:hover,
.network-roster-row:focus-within,
.network-roster-row.is-highlighted { background: rgba(198, 255, 79, .05); }
.network-player-copy { min-width: 0; }
.network-player-copy .player-identity-button {
  min-height: 34px;
  max-width: 100%;
  margin: -5px -7px 1px;
  padding: 5px 7px;
}
.network-player-copy .player-identity-label { display: block; overflow: hidden; color: var(--text); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.network-player-copy small {
  display: block;
  overflow: hidden;
  color: var(--quiet);
  font-size: .66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.network-player-telemetry { display: grid; justify-items: end; gap: 4px; }
.network-player-telemetry time {
  color: var(--quiet);
  font: .61rem/1.2 "JetBrains Mono", ui-monospace, monospace;
  white-space: nowrap;
}
.network-latency {
  min-height: 22px;
  padding: 3px 7px;
  display: inline-flex;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--latency-color, var(--quiet)) 42%, transparent);
  border-radius: 999px;
  color: var(--latency-color, var(--muted));
  background: color-mix(in srgb, var(--latency-color, var(--quiet)) 7%, transparent);
  font: 750 .61rem/1.2 "JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.network-latency.is-stale { opacity: .62; }
.network-note {
  min-height: 43px;
  padding: 9px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font: .61rem/1.4 "JetBrains Mono", ui-monospace, monospace;
}
.network-note span:last-child { text-align: right; }

@keyframes network-connection-flow { to { stroke-dashoffset: -22; } }
@keyframes network-marker-pulse {
  0% { opacity: .72; transform: scale(.66); }
  72%, 100% { opacity: 0; transform: scale(1.8); }
}
@keyframes network-dot-blink {
  0%, 100% { opacity: .68; }
  42% { opacity: 1; }
}
@keyframes network-server-pulse {
  0% { opacity: .75; transform: scale(.78); }
  75%, 100% { opacity: .08; transform: scale(1.62); }
}
@keyframes network-live-blink {
  0%, 100% { opacity: .52; }
  45% { opacity: 1; }
}

.game-trend-panel { min-width: 0; }
.game-trend-panel .panel-head p { margin: 3px 0 0; font-size: .78rem; }
.range-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(8, 7, 15, .52);
}
.range-tabs button { min-width: 48px; border-color: transparent; }
.range-tabs button[aria-pressed="true"] {
  color: var(--accent);
  border-color: rgba(198, 255, 79, .38);
  background: rgba(198, 255, 79, .09);
}
.trend-bars {
  height: 196px;
  padding: 22px 18px 0;
  display: flex;
  align-items: end;
  gap: clamp(1px, .28vw, 4px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to top, rgba(255, 255, 255, .045) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(180deg, rgba(65, 242, 255, .025), transparent);
}
.trend-bar-shell {
  height: 100%;
  min-width: 1px;
  flex: 1 1 0;
  display: flex;
  align-items: end;
}
.trend-bar {
  width: 100%;
  min-height: 1px;
  border-radius: 3px 3px 0 0;
  background: rgba(160, 163, 200, .23);
}
.trend-bar.has-data {
  background: linear-gradient(180deg, var(--accent-2), #6f48be);
  box-shadow: 0 0 12px rgba(65, 242, 255, .13);
}
.trend-caption {
  min-height: 48px;
  padding: 11px 18px;
  display: grid;
  grid-template-columns: minmax(74px, 1fr) minmax(0, auto) minmax(74px, 1fr);
  align-items: center;
  gap: 12px;
  color: var(--quiet);
  font: .65rem/1.35 "JetBrains Mono", ui-monospace, monospace;
}
.trend-caption strong {
  overflow: hidden;
  color: var(--muted);
  font-size: .7rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trend-caption span:last-child { text-align: right; }

.game-detail-grid,
.game-events-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.game-current-panel,
.game-players-panel,
.game-sessions-panel,
.event-types-panel,
.game-events-panel {
  min-width: 0;
  overflow: hidden;
}
.game-dashboard .table-scroll {
  max-width: 100%;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.game-current-panel .table-scroll { max-height: 330px; }
.game-players-panel .table-scroll { max-height: 540px; }
.game-sessions-panel .table-scroll { max-height: 610px; }
.game-current-panel .game-current-list { max-height: 340px; overscroll-behavior: contain; }
.event-types-table,
.game-events-panel .game-event-list { max-height: 520px; overscroll-behavior: contain; }
.game-dashboard .panel-head p { margin: 3px 0 0; font-size: .78rem; }
.game-current-panel .panel-head > p { margin: 0; text-align: right; }
.game-player-cell small {
  display: block;
  color: var(--quiet);
  font: .62rem/1.35 "JetBrains Mono", ui-monospace, monospace;
}
.player-identity-button {
  min-height: 40px;
  max-width: min(360px, 42vw);
  margin: -7px -8px;
  padding: 7px 8px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  color: var(--text);
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-identity-button:hover,
.player-identity-button:focus-visible {
  color: var(--accent);
  background: rgba(198, 255, 79, .065);
  filter: none;
}
.session-status,
.risk-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(14, 12, 26, .68);
  font: 700 .61rem/1.2 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .035em;
  text-transform: uppercase;
  white-space: nowrap;
}
.session-status.live {
  color: var(--accent);
  border-color: rgba(198, 255, 79, .38);
  background: rgba(198, 255, 79, .075);
}
.session-status.live::before {
  content: '';
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 7px currentColor;
}
.risk-pill.medium {
  color: var(--warn);
  border-color: rgba(255, 178, 77, .4);
  background: rgba(255, 178, 77, .07);
}
.risk-pill.high {
  color: #ff8298;
  border-color: rgba(255, 77, 109, .43);
  background: rgba(255, 77, 109, .08);
}
.session-detail {
  max-width: 340px;
  overflow: hidden;
  color: var(--quiet);
  font: .67rem/1.45 "JetBrains Mono", ui-monospace, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-detail strong,
.session-detail small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-kind {
  color: var(--accent-2);
  font: 700 .68rem/1.35 "JetBrains Mono", ui-monospace, monospace;
  text-transform: none;
}
.game-event-row .event-name { min-width: 0; }

.breakdown-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.breakdown-card {
  min-width: 0;
  border-radius: 14px;
  overflow: hidden;
}
.breakdown-card.wide { grid-column: 1 / -1; }
.breakdown-card .panel-head { min-height: 54px; }
.breakdown-card .panel-head h3 { margin: 0; }
.breakdown-list {
  padding: 7px 15px 11px;
  display: grid;
}
.breakdown-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, .7fr);
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .76rem;
}
.breakdown-row:last-child { border-bottom: 0; }
.breakdown-copy { min-width: 0; }
.breakdown-copy strong,
.breakdown-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breakdown-copy strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.breakdown-copy small { margin-top: 2px; color: var(--quiet); font-size: .67rem; }
.breakdown-meter {
  width: 100%;
  height: 6px;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .065);
}
.breakdown-bar {
  height: 100%;
  display: block;
  min-width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #6f48be, var(--accent-2));
}

.side-stack { display: grid; gap: 16px; }
.activity-list { max-height: 383px; overflow: auto; }
.activity-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.activity-row:last-child { border-bottom: 0; }
.player-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.player-row:hover, .player-row:focus-visible { background: rgba(198, 255, 79, .055); filter: none; }
.activity-row .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.activity-row.suspicious .pulse { background: var(--warn); }
.activity-row small { display: block; color: var(--muted); font-size: .75rem; }
.activity-row time { color: var(--quiet); font: .68rem/1.35 "JetBrains Mono", ui-monospace, monospace; white-space: nowrap; text-align: right; }
.event-name { overflow-wrap: anywhere; }
.player-profile { display: grid; gap: 16px; }
.player-profile .dashboard-head, .player-profile .metrics { margin-bottom: 0; }
.profile-identity { padding: 20px; }
.profile-identity h2 { margin-bottom: 5px; }
.profile-identity p { margin: 0; }

.settings { padding: 17px; }
.settings p:last-child { margin-bottom: 0; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border-bottom: 0; }
.key-list { margin: 8px 0 15px; padding: 0; list-style: none; }
.key-list li { padding: 9px 0; color: var(--muted); font-size: .82rem; }
.key-list strong { color: var(--text); }
.release-list { display: grid; }
.release-row {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(260px, 1.6fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 62px;
  padding: 11px 17px;
  border-bottom: 1px solid var(--line);
}
.release-row:last-child { border-bottom: 0; }
.release-row strong, .release-row small { display: block; }
.release-row small { margin-top: 2px; color: var(--quiet); font: .7rem/1.4 "JetBrains Mono", ui-monospace, monospace; }
.tag-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.tag-editor .tag-input { min-width: 0; padding: 9px 11px; font: .74rem/1.3 "JetBrains Mono", ui-monospace, monospace; }
.tag-editor button { margin: 0; white-space: nowrap; }
.release-toggle { display: inline-flex; align-items: center; gap: 10px; min-width: 92px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.release-toggle input { width: 19px; height: 19px; margin: 0; padding: 0; accent-color: var(--accent); }
.release-toggle span.released { color: var(--accent); }
.empty-state { width: min(560px, 100%); padding: 24px; }
.empty-state p { margin-bottom: 18px; }
.security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

#header-actions { display: flex; align-items: center; gap: 9px; }
.admin-chip {
  max-width: 240px;
  overflow: hidden;
  color: var(--muted);
  font: .72rem/1 "JetBrains Mono", ui-monospace, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(390px, calc(100% - 44px));
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--text);
  background: #121020;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .4);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: .2s;
}
#toast.show { opacity: 1; transform: none; }
#toast.error { color: #ffe1e5; border-color: rgba(255, 77, 109, .5); }

@media (max-width: 1050px) {
  .metrics, .game-stat-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .game-detail-grid, .game-events-grid { grid-template-columns: 1fr; }
  .network-layout { grid-template-columns: 1fr; }
  .world-stage { border-right: 0; border-bottom: 1px solid var(--line); }
  .network-roster-list { max-height: 260px; }
}
@media (max-width: 620px) {
  .masthead, main { width: min(100% - 24px, 1280px); }
  .masthead { min-height: 58px; }
  .brand small, .admin-chip { display: none; }
  #dashboard-shell[data-view="auth"] main,
  #dashboard-shell[data-view="loading"] main { padding: 12px 0; }
  .auth-shell { margin-top: 3vh; padding: 24px; }
  .remembered-account-choices { align-items: stretch; flex-direction: column; gap: 0; }
  .remembered-account-choices .text-button { width: 100%; }
  .remembered-account-choices .text-button + .text-button::before { display: none; }
  .account-actions { align-items: stretch; flex-direction: column; }
  .account-actions .button, .account-actions button { width: 100%; }
  .console-intro, .dashboard-head { align-items: flex-start; flex-direction: column; }
  .admin-tabs { width: 100%; }
  .admin-tabs .tab { flex: 1; padding-inline: 8px; }
  .metrics, .game-stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-summary, .security-grid { grid-template-columns: 1fr; }
  .metric { padding: 14px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .panel-head input { width: 100%; }
  .release-row { grid-template-columns: 1fr; gap: 11px; }
  .release-toggle { justify-self: start; }
  .game-dashboard { gap: 12px; }
  .game-dashboard-head > button { min-height: 42px; }
  .game-stat { padding: 12px; }
  .game-stat strong { font-size: .84rem; }
  .network-head-status { width: 100%; justify-items: stretch; }
  .network-live-badge { justify-self: start; }
  .network-legend { justify-content: flex-start; }
  .world-stage { aspect-ratio: 4 / 3; }
  .network-map-empty { padding: 11px 13px; }
  .network-unmapped-badge { right: 8px; top: 8px; }
  .network-roster-list { max-height: 240px; }
  .network-roster-row { padding-inline: 11px; }
  .network-note { align-items: flex-start; flex-direction: column; gap: 3px; }
  .network-note span:last-child { text-align: left; }
  .network-tooltip { font-size: .66rem; }
  .range-tabs { width: 100%; }
  .range-tabs button { min-height: 40px; flex: 1; }
  .trend-bars { height: 150px; padding: 17px 11px 0; }
  .trend-caption {
    min-height: 72px;
    padding-inline: 12px;
    grid-template-columns: 1fr 1fr;
    gap: 5px 10px;
  }
  .trend-caption strong {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .trend-caption span:first-child { grid-column: 1; grid-row: 2; }
  .trend-caption span:last-child { grid-column: 2; grid-row: 2; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  .section-heading p,
  .game-current-panel .panel-head > p { text-align: left; }
  .breakdown-row { grid-template-columns: minmax(0, 1fr) minmax(70px, .52fr); gap: 9px; }
  .game-current-panel .table-scroll,
  .game-players-panel .table-scroll,
  .game-sessions-panel .table-scroll { max-height: 460px; }
  .player-identity-button { max-width: 58vw; }
  input { font-size: 16px; }
  th, td { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .connection-path,
  .player-map-pulse,
  .player-map-core,
  .server-map-ring,
  .network-live-badge.active::before { animation: none !important; }
  .player-map-pulse { opacity: .42; transform: none; }
  .player-map-core,
  .server-map-ring,
  .network-live-badge.active::before { opacity: 1; transform: none; }
}
