﻿*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f0f14;
  --surface: #1a1a24;
  --surface-hover: #22222e;
  --border: #2a2a38;
  --border-light: #333345;
  --text: #e8e8ee;
  --text-secondary: #88889a;
  --text-muted: #5c5c6e;
  --win: #3dd68c;
  --win-dim: #1a3a2c;
  --loss: #e5484d;
  --loss-dim: #3a1a1c;
  --primary: #0f0f14;
  --accent: #e94560;
  --accent-dim: rgba(233,69,96,0.15);
  --radius: 6px;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
  background: #0a0a0f;
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-logo { height: 30px; width: auto; }
.header-text { display: flex; flex-direction: column; }
.header-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}
.header-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

/* Container */
.container { max-width: 1600px; margin: 0 auto; padding: 24px; }

/* Section title */
.section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 10px;
}

/* Map selector - 7 in a row */
.map-selector {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
.map-card {
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  text-align: center;
}
.map-card:hover { border-color: #555; transform: translateY(-1px); }
.map-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 12px rgba(233,69,96,0.25);
}
.map-card img {
  width: 100%;
  aspect-ratio: 1.5 / 1;
  object-fit: cover;
  display: block;
}
.map-card-name {
  padding: 6px 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}
.map-card.active .map-card-name { color: #fff; }

/* Controls row */
.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.faction-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.faction-btn {
  padding: 7px 18px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.faction-btn:first-child { border-right: 1px solid var(--border); }
.faction-btn:hover { color: var(--text); }
.faction-btn.active { background: var(--accent); color: #fff; }
.opponent-select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  background: var(--surface);
  color: var(--text);
  min-width: 140px;
  cursor: pointer;
}

/* Stat cards - esports visualization */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px 14px;
box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.stat-card-type-zh {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.stat-card-type-en {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-card-numbers {
  display: flex;
  align-items: last baseline;
  gap: 8px;
}
.stat-card-win {
  font-size: 36px;
  font-weight: 800;
  color: var(--win);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-card-loss {
  font-size: 36px;
  font-weight: 800;
  color: var(--loss);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-card-sep {
  font-size: 20px;
  color: var(--border-light);
  font-weight: 300;
  line-height: 1;
}
.stat-card-rate {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: auto;
  align-self: center;
}
.stat-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--loss-dim);
  overflow: hidden;
  margin-top: 10px;
}
.stat-bar-fill {
  height: 100%;
  background: var(--win);
  border-radius: 2px;
  transition: width 0.35s ease;
}
.stat-card-dual-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  margin-bottom: 2px;
}
.stat-card-dual-row:first-of-type { margin-top: 6px; }
.stat-card-faction-label {
  color: var(--text-muted);
  min-width: 20px;
  font-size: 10px;
}
.stat-bar-dual {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}
.stat-bar-fill.attack { background: var(--accent); }
.stat-bar-fill.defense { background: var(--win); }
select#factionSelect {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  background: var(--surface);
  color: var(--text);
}
.stat-card-empty {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 20px 0;
}

/* Detail section */
.detail-section { margin-top: 8px; }
.detail-table {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
.detail-table th {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 10px 16px;
  text-align: left;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}
.detail-table td {
  font-size: 12px;
  padding: 9px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text);
}
.detail-table tr:hover td { background: rgba(255,255,255,0.02); }
.detail-table tr:last-child td { border-bottom: none; }
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-win { background: rgba(61,214,140,0.12); color: var(--win); }
.badge-loss { background: rgba(229,72,77,0.12); color: var(--loss); }
.round-type-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}
.no-data {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}
.pagination-btn {
  padding: 6px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.pagination-btn:hover:not(:disabled) { border-color: #555; color: var(--text); }
.pagination-btn:disabled { opacity: 0.3; cursor: default; }
.pagination-info {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 60px;
  text-align: center;
}

/* Responsive */
@media (max-width: 900px) {
  .map-selector { grid-template-columns: repeat(4, 1fr); }
  .stat-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .map-selector { grid-template-columns: repeat(3, 1fr); }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .stat-card-win, .stat-card-loss { font-size: 28px; }
  .detail-table th, .detail-table td { padding: 8px 10px; font-size: 11px; }
}


/* Sidebar Navigation */
.app-body { display: flex; min-height: calc(100vh - 53px); }
.sidebar { width: 200px; background: #0a0a0f; border-right: 1px solid var(--border); padding: 8px 0; flex-shrink: 0; }
.sidebar-section-title { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; padding: 12px 16px 6px; }
.sidebar-module { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: all .15s; border-left: 3px solid transparent; }
.sidebar-module:hover { background: var(--surface-hover); color: var(--text); }
.sidebar-module.active { background: var(--accent-dim); color: var(--text); border-left-color: var(--accent); }
.sidebar-icon { font-size: 14px; }
.main-area { flex: 1; min-width: 0; }
