/* ═══════════════════════════════════════════════════════════════
   DXX Dashboard — Stylesheet
   Dark space theme with distinct 1v1 (red) and FFA (green) accents
   ═══════════════════════════════════════════════════════════════ */

/* ── Font Face ── */
@font-face {
  font-family: 'Descent';
  src: url('../fonts/descent /DescScor.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* ── Reset & Variables ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Black/Purple Palette */
  --bg:           #020005;
  --bg-surface:   #0a0014;
  --bg-card:      #0e001c;
  --bg-card-hover:#1a0033;
  --bg-input:     #120024;

  --accent:       #d500f9; /* Neon Purple */
  --accent-dim:   #aa00c7;
  --accent-glow:  rgba(213, 0, 249, 0.4);

  --red:          #ff2e55;
  --red-dim:      rgba(255, 46, 85, 0.15);
  --green:        #00e676; /* Keep green for 'Live' indicators, but maybe less dominant */
  --green-dim:    rgba(0, 230, 118, 0.15);
  
  --text:         #f0e6fc; /* Lavender-tinted white */
  --text-dim:     #9e8fb0;
  --text-muted:   #6a5f7a;
  
  --border:       rgba(213, 0, 249, 0.2);
  --border-light: rgba(213, 0, 249, 0.3);

  --radius:       4px; /* Sleeker, less rounded */
  --radius-sm:    2px;
  --radius-pill:  50px;
  
  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Descent', 'Inter', system-ui, sans-serif;
  --mono:         'JetBrains Mono', monospace;

  --shadow:       0 4px 24px rgba(0,0,0,0.6);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.8);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: #020005 url('../images/space.png') center/cover fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  /* Lighter vignette to show more stars */
  background: radial-gradient(circle at center, rgba(10, 0, 20, 0.1) 0%, rgba(2, 0, 5, 0.7) 100%);
  pointer-events: none;
  z-index: -1;
}

body > * {
  position: relative;
  z-index: 5; /* Ensure content is above background/ships */
}

a { color: var(--accent); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: 0.8; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

/* ── Hero ── */
.hero {
  background: linear-gradient(160deg, #080b12 0%, #121830 40%, #0d1020 100%);
  padding: 3.5rem 1.5rem 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0,229,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.logo-icon { font-size: 2.2rem; }
.hero h1 {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent), var(--gold), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 200% center; }
}
.hero .subtitle {
  color: var(--text-dim);
  margin-top: 0.4rem;
  font-size: 1.05rem;
  font-weight: 500;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}
.stat-num {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}
.stat-num.accent-red { color: var(--red); }
.stat-num.accent-green { color: var(--green); }
.stat-num.accent-gold { color: var(--gold); }
.stat small {
  font-family: var(--font-heading);
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Table Filters (above table headers) ── */
.table-filters {
  display: flex;
  gap: 0.8rem;
  padding: 1rem;
  background: rgba(14, 0, 28, 0.6);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
}

.table-filters input,
.table-filters select {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  min-width: 140px;
  transition: border-color .2s;
}

.table-filters input:focus,
.table-filters select:focus {
  outline: none;
  border-color: var(--accent);
}

.table-filters input::placeholder {
  color: var(--text-muted);
}

/* ── Charts within view section ── */
.view-section .charts-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  transition: all 0.3s ease;
  width: 100%;
}

/* ── Unified Sub-Navigation (legacy - remove later) ── */
.unified-subnav {
  background: rgba(10, 0, 20, 0.95);
  border-bottom: 2px solid var(--accent);
  padding: 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.subnav-section {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

/* Mode tabs inline */
.mode-tabs-inline {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Filters section */
.subnav-filters {
  flex: 1;
  justify-content: center;
}

.subnav-filters input,
.subnav-filters select {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  min-width: 140px;
  transition: border-color .2s;
}

.subnav-filters input:focus,
.subnav-filters select:focus {
  outline: none;
  border-color: var(--accent);
}

.subnav-filters input::placeholder {
  color: var(--text-muted);
}

/* Actions section */
.subnav-actions {
  justify-content: center;
}

@media (max-width: 900px) {
  .unified-subnav {
    padding: 0.8rem 1rem;
  }
  
  .subnav-section {
    width: 100%;
  }
}

/* ── Tabs (legacy - kept for compatibility) ── */
.tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: transparent;
  border-bottom: 1px solid rgba(213, 0, 249, 0.2);
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto;
}
.tab {
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: var(--font-heading);
  font-weight: 500;
  transition: all 0.25s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tab:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(0,229,255,0.05);
}
.tab.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 700;
  box-shadow: 0 0 16px rgba(0,229,255,0.3);
}

/* ── Filters ── */
.filters {
  display: flex;
  gap: 0.8rem;
  padding: 1.5rem 2rem;
  background: rgba(10, 0, 20, 0.6);
  border-bottom: 1px solid rgba(213, 0, 249, 0.1);
  flex-wrap: wrap;
  justify-content: center;
  max-width: 1400px;
  margin: 0 auto 2rem;
  border-radius: 0 0 8px 8px;
}
.filters input,
.filters select {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  min-width: 140px;
  transition: border-color .2s;
}
.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,229,255,0.15);
}
.btn-primary, .btn-secondary {
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius);
  border: none;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover { background: #33ecff; box-shadow: 0 0 12px rgba(0,229,255,0.3); }
.btn-secondary {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { border-color: var(--text-dim); color: var(--text); }

.btn-load-more {
  background: linear-gradient(135deg, var(--accent-dim) 0%, var(--blue) 100%);
  color: var(--text);
  border: 1px solid var(--border-light);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.btn-load-more:hover {
  background: linear-gradient(135deg, var(--blue) 0%, var(--accent) 100%);
  box-shadow: 0 4px 16px rgba(0,229,255,0.3);
  transform: translateY(-1px);
}
.btn-load-more:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Charts ── */
.charts-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
  width: 100%;
  overflow: hidden;
}

.charts-toggle {
  text-align: center;
  margin-bottom: 1.5rem;
}

.charts-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  transition: all 0.3s ease;
  width: 100%;
}

.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--border);
  transition: border-color .2s;
  min-width: 0; /* Allow cards to shrink */
  overflow: hidden;
}
.chart-card:hover { border-color: var(--border-light); }
.chart-card.wide { grid-column: 1 / -1; }
.chart-card h3 {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.chart-card canvas { 
  max-width: 100%;
  width: 100% !important;
  height: 350px !important;
}
.chart-card.wide canvas {
  height: 550px !important;
}

@media (max-width: 900px) {
  .charts-container {
    grid-template-columns: 1fr;
  }
  .chart-card.wide { grid-column: 1; }
}

/* ── View Sections ── */
.view-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}
.view-section h2 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
}
.view-desc {
  color: var(--text-dim);
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
}

/* ── Tables ── */
.table-wrap { 
  overflow-x: auto;
  margin-top: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 0;
}
thead th {
  background: var(--bg-card);
  padding: 0.7rem 1rem;
  text-align: left;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  position: sticky;
  top: 56px; /* below sticky tabs */
  z-index: 10;
  border-bottom: 2px solid var(--border);
}
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--accent); }
th.active-sort { color: var(--accent); }
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
tbody tr:hover { background: var(--bg-card-hover); }
td { 
  padding: 0.8rem 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

/* Player column should be wider */
td:nth-child(5) {
  max-width: 350px;
  min-width: 180px;
}

/* Mode badges */
.mode-badge {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.mode-1v1 { background: var(--red-dim); color: var(--red); }
.mode-ffa  { background: var(--green-dim); color: var(--green); }

/* Version badges */
.version-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--mono);
}
.version-d1 { background: rgba(68,138,255,0.15); color: var(--blue); }
.version-d2 { background: var(--gold-dim); color: var(--gold); }

/* ── 1v1 Duel Cards ── */
.duel-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 1rem;
}
.duel-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.3rem;
  border: 1px solid rgba(255,64,96,0.15);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: all 0.25s ease;
}
.duel-card:hover {
  border-color: var(--red);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255,64,96,0.12);
}
.duel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.duel-header .map-name {
  color: var(--text);
  font-weight: 600;
}
.duel-versus {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem 0;
}
.duel-player {
  text-align: center;
  flex: 1;
}
.duel-player .name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.duel-player .score {
  font-family: var(--mono);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
}
.duel-player .sub-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.duel-player.winner .name { color: var(--gold); }
.duel-player.winner .score { color: var(--gold); text-shadow: 0 0 20px rgba(255,215,64,0.3); }
.duel-player.loser .name { color: var(--text-dim); }
.duel-player.loser .score { color: var(--text-dim); }
.duel-vs {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--red);
  text-shadow: 0 0 24px rgba(255,64,96,0.5);
  letter-spacing: 0.1em;
}

/* ── FFA Cards ── */
.ffa-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1rem;
}
.ffa-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.3rem;
  border: 1px solid rgba(0,230,118,0.15);
  transition: all 0.25s ease;
}
.ffa-card:hover {
  border-color: var(--green);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,230,118,0.1);
}
.ffa-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ffa-header .map-name {
  color: var(--text);
  font-weight: 600;
}
.ffa-standings {
  list-style: none;
}
.ffa-standings li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.ffa-standings li:last-child { border-bottom: none; }
.ffa-standings li:first-child {
  font-weight: 700;
  color: var(--gold);
  font-size: 1rem;
}
.ffa-standings .kills { color: var(--green); font-family: var(--mono); font-weight: 600; }
.ffa-standings .deaths { color: var(--red); font-size: 0.8rem; font-family: var(--mono); }
.ffa-standings .rank {
  width: 22px;
  display: inline-block;
  text-align: center;
}

/* ── Player Search ── */
.player-search {
  width: 100%;
  max-width: 400px;
  padding: 0.55rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
}
.player-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,229,255,0.15);
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.pagination button {
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.82rem;
  transition: all 0.2s;
}
.pagination button:hover,
.pagination button.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.pagination button:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ── Loading Overlay ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,13,20,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  gap: 1rem;
  transition: opacity 0.4s ease;
}
.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ── External link icon ── */
.ext-link {
  font-size: 0.8rem;
  opacity: 0.5;
  transition: opacity .2s;
}
.ext-link:hover { opacity: 1; }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  background: rgba(10, 0, 20, 0.8);
  font-size: 0.8rem;
  border-top: 1px solid var(--accent);
  margin-top: auto;
}
footer a { color: var(--text-dim); text-decoration: underline; }
footer a:hover { color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .charts-section { grid-template-columns: 1fr; padding: 1rem; }
}
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .stats-bar { gap: 1.2rem; }
  .stat-num { font-size: 1.4rem; }
  .duel-list, .ffa-list { grid-template-columns: 1fr; }
  .view-section { padding: 1rem; }
  .filters { padding: 0.75rem 1rem; }
  .filters input, .filters select { min-width: 120px; }
  thead th { top: 50px; }
}
@media (max-width: 480px) {
  .tabs { gap: 0.3rem; }
  .tab { padding: 0.5rem 0.9rem; font-size: 0.8rem; }
  .duel-player .score { font-size: 1.6rem; }
}

/* ── Clickable Cards ── */
.clickable-card, .clickable-ffa { cursor: pointer; }
.game-row:hover td { background: var(--bg-card-hover); }

/* ═══════════════════════════════════════════════════════════════
   Game Detail Modal
   ═══════════════════════════════════════════════════════════════ */
.game-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.game-detail-modal.active {
  opacity: 1;
  pointer-events: auto;
}
.gdm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(6px);
}
.gdm-dialog {
  position: relative;
  width: 95%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 229, 255, 0.08);
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}
.gdm-dialog::-webkit-scrollbar { width: 6px; }
.gdm-dialog::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
.gdm-dialog::-webkit-scrollbar-track { background: transparent; }

/* Header */
.gdm-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-surface) 100%);
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}
.gdm-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.gdm-title h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}
.gdm-meta {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.gdm-date { color: var(--text-dim); }
.gdm-duration {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.8rem;
}
.gdm-gamename { color: var(--text-dim); }
.gdm-close {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-dim);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.gdm-close:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-dim);
}
.gdm-archive-link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--accent-dim);
}
.gdm-archive-link:hover { color: var(--accent); }

/* Sections */
.gdm-section {
  padding: 1.2rem 1.5rem;
}
.gdm-section h3 {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.8rem;
}
.gdm-section h4 {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin: 1rem 0 0.6rem;
}
.gdm-empty {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-style: italic;
  padding: 1rem 0;
}

/* Notice */
.gdm-notice {
  margin: 1rem 1.5rem 1.5rem;
  padding: 1rem 1.2rem;
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
}
.gdm-notice code {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(0, 229, 255, 0.08);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

/* Loading */
.gdm-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  gap: 1rem;
  color: var(--text-dim);
}

/* ── Modal Tabs ── */
.gdm-tabs {
  display: flex;
  gap: 0.3rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.gdm-tab {
  padding: 0.6rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.gdm-tab:hover {
  color: var(--text);
  border-bottom-color: var(--border-light);
}
.gdm-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.gdm-panel {
  display: none;
}
.gdm-panel.active {
  display: block;
}

/* ── 1v1 Scoreboard ── */
.gdm-duel-scoreboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1.5rem 0;
}

.gdm-duel-player {
  text-align: center;
  flex: 1;
  max-width: 240px;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.gdm-duel-player.winner {
  border-color: var(--gold);
}

.gdm-duel-player .gdm-duel-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gdm-duel-player .gdm-duel-score {
  font-family: var(--mono);
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
  margin: 0.3rem 0;
}

.gdm-duel-player .gdm-duel-sub {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
  font-family: var(--mono);
}

.gdm-duel-player .gdm-duel-kd {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-top: 0.2rem;
}

.gdm-duel-player.winner .gdm-duel-name { color: var(--gold); }
.gdm-duel-player.winner .gdm-duel-score { color: var(--gold); }
.gdm-duel-player.loser .gdm-duel-name { color: var(--text-dim); }
.gdm-duel-player.loser .gdm-duel-score { color: var(--text-muted); }

.gdm-duel-divider {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--red);
  padding: 0.5rem;
}

/* ── FFA Scoreboard Table ── */
.gdm-scoreboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.gdm-scoreboard-table thead th {
  position: static;
  background: var(--bg-card);
  padding: 0.5rem 0.8rem;
  text-align: left;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.gdm-scoreboard-table tbody tr {
  border-bottom: 1px solid var(--border);
}

.gdm-scoreboard-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.gdm-scoreboard-table td {
  padding: 0.5rem 0.8rem;
}

.gdm-top-player td { 
  color: var(--gold);
  font-weight: 700;
}

.gdm-medal { 
  width: 40px;
  text-align: center;
  font-size: 0.85rem;
  font-family: var(--mono);
  font-weight: 700;
}

.gdm-rank { 
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
}

.gdm-kills { 
  color: var(--green);
  font-family: var(--mono);
  font-weight: 700;
}

.gdm-deaths { 
  color: var(--red);
  font-family: var(--mono);
}

.gdm-suicides { 
  color: var(--text-muted);
  font-family: var(--mono);
}

.gdm-kd { 
  font-family: var(--mono);
  color: var(--accent);
  font-weight: 600;
}

.gdm-time { 
  font-family: var(--mono);
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ── Kill Feed ── */
.kill-events-section {
  margin-bottom: 1rem;
}

.kill-events-section:last-child {
  margin-bottom: 0;
}

.gdm-kill-feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.gdm-kill-feed-header span:first-child {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.kf-count {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.gdm-kill-feed {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid var(--border);
  background: var(--bg-card);
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}

.gdm-kill-feed::-webkit-scrollbar { width: 5px; }
.gdm-kill-feed::-webkit-scrollbar-track { background: transparent; }
.gdm-kill-feed::-webkit-scrollbar-thumb { background: var(--border-light); }

.kf-entry {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.8rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.kf-entry:last-child { border-bottom: none; }

.kf-entry:hover { background: rgba(255, 255, 255, 0.02); }

.kf-entry.kf-suicide { opacity: 0.6; }
.kf-entry.kf-suicide .kf-msg { color: var(--text-muted); }

.kf-time {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.kf-icon { font-size: 0.85rem; }

.kf-msg { 
  flex: 1;
  color: var(--text);
}

.kf-method {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ── Kill Matrix ── */
.gdm-kill-matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
}

.gdm-kill-matrix {
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 100%;
}

.gdm-kill-matrix th,
.gdm-kill-matrix td {
  padding: 0.4rem 0.6rem;
  text-align: center;
  border: 1px solid var(--border);
}

.gdm-kill-matrix thead th {
  position: static;
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.km-corner {
  text-align: left !important;
  font-size: 0.7rem !important;
  color: var(--text-muted) !important;
}

.km-name {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.km-row-name {
  text-align: left !important;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-card);
}

.km-cell {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.9rem;
}

.km-self {
  background: rgba(255, 64, 96, 0.08);
  color: var(--text-muted);
}

.km-has-kills {
  color: var(--green);
  font-weight: 700;
  background: rgba(34, 197, 94, calc(0.05 + var(--intensity, 0) * 0.15));
}

.km-zero { 
  color: rgba(255, 255, 255, 0.1);
}

.gdm-matrix-hint {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.6;
}

/* ── Damage Breakdown ── */
.gdm-damage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.gdm-damage-table thead th {
  position: static;
  background: var(--bg-card);
  padding: 0.4rem 0.7rem;
  text-align: left;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.gdm-damage-table td {
  padding: 0.4rem 0.7rem;
  border-bottom: 1px solid var(--border);
}
.gdm-dmg-dealt { color: var(--green); font-family: var(--mono); font-weight: 600; }
.gdm-dmg-taken { color: var(--red); font-family: var(--mono); }
.gdm-dmg-ratio { font-family: var(--mono); color: var(--text-dim); }

.gdm-damage-bars {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.gdm-dmg-bar-row {
  display: grid;
  grid-template-columns: 100px 120px 1fr 60px 50px;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.82rem;
  padding: 0.25rem 0;
}
.gdm-dmg-player {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gdm-dmg-weapon {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gdm-dmg-bar-track {
  height: 8px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
}
.gdm-dmg-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  border-radius: 4px;
  transition: width 0.5s ease;
}
.gdm-dmg-value {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
  text-align: right;
}
.gdm-dmg-hits {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Timeline ── */
.gdm-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}
.gdm-timeline-header span:first-child {
  font-weight: 600;
  font-size: 0.9rem;
}
.tl-count {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.gdm-timeline {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}
.gdm-timeline::-webkit-scrollbar { width: 5px; }
.gdm-timeline::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
.tl-entry {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  transition: background 0.15s;
}
.tl-entry:last-child { border-bottom: none; }
.tl-entry:hover { background: var(--bg-card-hover); }
.tl-time {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 55px;
}
.tl-icon { font-size: 0.85rem; }
.tl-desc { flex: 1; }

/* Timeline type colors */
.tl-kill .tl-desc { color: var(--red); }
.tl-suicide .tl-desc { color: var(--text-dim); font-style: italic; }
.tl-death .tl-desc { color: #ff9100; }
.tl-join .tl-desc { color: var(--green); }
.tl-leave .tl-desc,
.tl-disconnect .tl-desc,
.tl-quit .tl-desc { color: var(--text-dim); }
.tl-reactor .tl-desc { color: var(--gold); font-weight: 600; }
.tl-escape .tl-desc { color: var(--accent); }
.tl-chat .tl-desc { color: #64b5f6; font-style: italic; }
.tl-chat strong { color: var(--accent); }

/* ── Chat Log ── */
.gdm-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}
.gdm-chat-header span:first-child {
  font-weight: 600;
  font-size: 0.9rem;
}
.chat-count {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.gdm-chat-log {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  padding: 0.5rem;
}
.chat-entry {
  display: flex;
  gap: 0.5rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.84rem;
}
.chat-time {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 55px;
}
.chat-player {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.chat-msg { color: var(--text); }

/* Observer chat styling */
.chat-observer .chat-player {
  color: #90caf9;
  opacity: 0.85;
}
.chat-observer {
  opacity: 0.9;
}

/* ── Modal responsive ── */
@media (max-width: 768px) {
  .gdm-dialog { width: 98%; max-height: 95vh; }
  .gdm-duel-scoreboard { gap: 1rem; }
  .gdm-duel-player .gdm-duel-score { font-size: 2.2rem; }
  .gdm-dmg-bar-row {
    grid-template-columns: 80px 90px 1fr 50px 40px;
    font-size: 0.78rem;
  }
  .gdm-section { padding: 1rem; }
}
@media (max-width: 480px) {
  .gdm-header { padding: 1rem; }
  .gdm-title h2 { font-size: 1.2rem; }
  .gdm-duel-scoreboard { flex-direction: column; gap: 0.5rem; }
  .gdm-duel-divider { font-size: 1rem; }
  .gdm-dmg-bar-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.2rem;
  }
  .gdm-dmg-bar-track { grid-column: 1 / -1; }
}
/* ──────────────────────────────────────────────────────────────────────
   Game Detail Page Styles
────────────────────────────────────────────────────────────────────── */

.game-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.game-page-back {
  margin-bottom: 1.5rem;
}

.game-page-back a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-family: var(--mono);
  transition: color 0.2s;
}

.game-page-back a:hover {
  color: var(--accent);
}

.game-page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.game-page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.game-page-header h1 {
  font-size: 2.5rem;
  font-weight: 900;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.game-page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  margin-top: 0.5rem;
}

.game-page-meta-item {
  font-size: 0.9rem;
  color: var(--text-dim);
  font-family: var(--mono);
}

.mode-badge {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 4px;
  font-family: var(--mono);
}

.mode-badge.mode-1v1 {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.mode-badge.mode-ffa {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.live-badge,
.archive-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 4px;
  font-family: var(--mono);
  white-space: nowrap;
}

.live-badge {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.archive-badge {
  background: rgba(156, 163, 175, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.game-page-section {
  margin-bottom: 2.5rem;
}

.game-page-section h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Enhanced duel scoreboard for game page */
.game-page-section .gdm-duel-scoreboard {
  padding: 2rem 0;
  gap: 3rem;
}

.game-page-section .gdm-duel-player {
  max-width: 280px;
  padding: 2rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.game-page-section .gdm-duel-player:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--text-dim);
}

.game-page-section .gdm-duel-player.winner {
  border-color: var(--gold);
  background: rgba(251, 191, 36, 0.05);
}

.game-page-section .gdm-duel-player .gdm-duel-name {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
}

.game-page-section .gdm-duel-player .gdm-duel-score {
  font-size: 3.5rem;
  margin: 0.5rem 0;
}

.game-page-section .gdm-duel-player .gdm-duel-sub {
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.game-page-section .gdm-duel-divider {
  font-size: 2rem;
  padding: 1rem;
}

/* No event data message */
.gamelog-status-notice {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-dim);
  padding: 2rem;
  margin: 2rem 0;
  max-width: 700px;
}

.gamelog-status-notice h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.8rem 0;
  color: var(--text);
}

.gamelog-status-notice p {
  margin: 0.5rem 0;
  color: var(--text-dim);
  line-height: 1.6;
}

.gamelog-status-notice details {
  margin-top: 1rem;
  color: var(--text-dim);
}

.gamelog-status-notice summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.9rem;
}

.gamelog-status-notice ul {
  margin: 0.8rem 0 0 1.5rem;
  color: var(--text-dim);
}

.gamelog-status-notice li {
  margin: 0.4rem 0;
  line-height: 1.5;
}

.gamelog-status-notice code {
  background: rgba(0, 0, 0, 0.5);
  color: var(--green);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Loading and not found states */
.game-page-loading,
.game-page-not-found {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-dim);
}

.game-page-loading h3,
.game-page-not-found h3 {
  font-size: 1.5rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
}

.game-page-loading p,
.game-page-not-found p {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.9rem;
}

.game-page-home-link {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.7rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  transition: all 0.2s;
}

.game-page-home-link:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--accent);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .game-page {
    padding: 1.5rem 1rem 3rem;
  }

  .game-page-header h1 {
    font-size: 2rem;
  }

  .game-page-title-row {
    flex-direction: column;
    gap: 1rem;
  }

  .game-page-section .gdm-duel-scoreboard {
    flex-direction: column;
    gap: 1.5rem;
  }

  .game-page-section .gdm-duel-player {
    max-width: 100%;
  }

  .game-page-section .gdm-duel-divider {
    transform: rotate(90deg);
  }

  .gamelog-status-notice {
    padding: 1.5rem;
  }
}