:root {
  --bg-main: #0d0e0b;
  --bg-card: #131510;
  --bg-elevated: #171913;
  --border: #25281f;
  --text-main: #ebe4d5;
  --text-muted: #8c887b;
  --accent-red: #b84a39;
  --accent-gold: #c89d4c;
  --accent-green: #6d8c52;
  --accent-blue: #4a89b8;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Segoe UI', Consolas, monospace, sans-serif;
  line-height: 1.5;
  padding: 24px 16px 48px;
}

.container {
  max-width: 1420px;
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

/* HEADER */
.top-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.gemer-logo-img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.gemer-logo-img:hover {
  transform: scale(1.04);
  border-color: var(--accent-gold);
}

.map-steam-link {
  color: var(--accent-gold);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px dashed rgba(200, 157, 76, 0.5);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.map-steam-link:hover {
  color: var(--text-main);
  border-bottom-color: var(--text-main);
}

.top-bar h1 {
  font-size: 20px;
  letter-spacing: 0.6px;
  font-weight: 700;
}

.server-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  display: inline-block;
}

.sep {
  color: #3a3e31;
}

.season-pill {
  border: 1px solid #3c4d2e;
  background: rgba(109, 140, 82, 0.12);
  color: #9dc27b;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 6px;
  letter-spacing: 0.8px;
}

/* SECTION HEADER */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 22px;
  font-weight: 700;
}

.source-pill {
  border: 1px solid #3c4d2e;
  background: rgba(109, 140, 82, 0.14);
  color: #9dc27b;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
}

/* KPI GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
}

.kpi-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
}

.accent-red { color: var(--accent-red); }
.accent-gold { color: var(--accent-gold); }
.accent-green { color: var(--accent-green); }
.accent-blue { color: var(--accent-blue); }

/* TOP 3 PODIUMS */
.top3-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.top3-card {
  padding: 16px 18px;
}

.top3-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.top3-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 4px;
}

.tag-green {
  background: rgba(109, 140, 82, 0.18);
  color: #9dc27b;
  border: 1px solid rgba(109, 140, 82, 0.4);
}

.tag-gold {
  background: rgba(200, 157, 76, 0.18);
  color: var(--accent-gold);
  border: 1px solid rgba(200, 157, 76, 0.4);
}

.tag-red {
  background: rgba(184, 74, 57, 0.18);
  color: #e07666;
  border: 1px solid rgba(184, 74, 57, 0.4);
}

.top3-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.top3-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top3-row {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.top3-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.medal {
  font-weight: 800;
  font-size: 13px;
  min-width: 26px;
}

.medal-1 { color: #e5b84b; }
.medal-2 { color: #b8bec4; }
.medal-3 { color: #c47d4e; }

.top3-nick {
  font-weight: 700;
  font-size: 14px;
}

.top3-extra {
  font-size: 11px;
  color: var(--text-muted);
}

.top3-val {
  font-weight: 800;
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
}

/* CONTROLS */
.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.search-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 6px;
  width: 310px;
  max-width: 100%;
  font-size: 13px;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

/* TABLE */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 24px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.leaderboard-table th {
  text-align: left;
  padding: 14px 14px;
  font-size: 11px;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.leaderboard-table th.col-score {
  color: var(--accent-red);
  border-bottom: 2px solid var(--accent-red);
  text-align: right;
}

.leaderboard-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #1c1f17;
  white-space: nowrap;
}

.leaderboard-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.leaderboard-table tbody tr:hover {
  background: var(--bg-elevated);
}

.rank-cell {
  color: var(--accent-red);
  font-weight: 700;
}

.nick-cell {
  font-weight: 700;
  font-size: 14px;
}

.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 8px;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

.badge-admin {
  background: rgba(200, 157, 76, 0.18);
  color: var(--accent-gold);
  border: 1px solid rgba(200, 157, 76, 0.4);
}

.badge-online {
  background: rgba(109, 140, 82, 0.18);
  color: #9dc27b;
  border: 1px solid rgba(109, 140, 82, 0.45);
}

.score-cell {
  text-align: right;
  font-weight: 800;
  color: var(--accent-red);
}

/* PANELS & FEEDS */
.bottom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 18px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
}

.panel h3 {
  font-size: 13px;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.feed-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.feed-ts {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.empty-msg {
  color: var(--text-muted);
  font-size: 13px;
  padding: 10px 0;
}

/* TIMELINE PANEL */
.timeline-panel {
  margin-top: 18px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.timeline-header h3 {
  margin-bottom: 3px;
}

.timeline-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--text-main);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 6px;
}

.leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-green { background: #5cb85c; box-shadow: 0 0 6px rgba(92, 184, 92, 0.6); }
.dot-blue  { background: #3b9eff; box-shadow: 0 0 6px rgba(59, 158, 255, 0.6); }
.dot-red   { background: #e0483e; box-shadow: 0 0 6px rgba(224, 72, 62, 0.7); }

.timeline-canvas-wrap {
  position: relative;
  height: 290px;
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
}

/* DETAIL HEADER */
.detail-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.btn-back {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 9px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.btn-back:hover {
  border-color: var(--accent-gold);
}

.detail-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* LANGUAGE SWITCHER */
.header-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 4px 6px;
  border-radius: 6px;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 16px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  opacity: 0.55;
  overflow: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.lang-btn svg {
  width: 100%;
  height: 100%;
  display: block;
}

.lang-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.lang-btn.active {
  opacity: 1;
  border-color: var(--accent-gold);
  box-shadow: 0 0 6px rgba(200, 157, 76, 0.55);
}
