:root {
  --bg: #0a090c;
  --surface: #131117;
  --surface-2: #191620;
  --ink: #ece7db;
  --muted: #9a9284;
  --gold: #d4af5a;
  --gold-bright: #f2d488;
  --fire: #e8935a;
  --ice: #7ec8ea;
  --silver: #c9d2dc;
  --bronze: #d28a56;
  --line: rgba(212, 175, 90, 0.2);
  --line-soft: rgba(255, 255, 255, 0.08);
  --font-display: Georgia, "Times New Roman", serif;
  --font-sans: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 12% 0%, rgba(126, 200, 234, 0.08), transparent 36%),
    radial-gradient(circle at 88% 8%, rgba(232, 147, 90, 0.1), transparent 38%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 9, 12, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  font-size: 16px;
}

.brand img {
  width: 34px;
  height: 34px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topnav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.15s ease, background 0.15s ease;
}

.topnav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.topnav a.active {
  color: #120f08;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
}

.main-wrap {
  padding: 28px 0 48px;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}

.hero h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  color: var(--gold-bright);
}

.lead {
  margin: 0;
  max-width: 660px;
  color: var(--muted);
  font-size: 15px;
}

.hero-badge {
  background: linear-gradient(180deg, rgba(212, 175, 90, 0.12), rgba(19, 17, 23, 0.92));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.badge-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.hero-badge strong {
  font-size: 16px;
  color: var(--ink);
}

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

.controls-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.cluster-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cluster-tab {
  appearance: none;
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.cluster-tab:hover {
  border-color: var(--line);
  color: var(--ink);
}

.cluster-tab.active {
  border-color: var(--gold);
  background: rgba(212, 175, 90, 0.14);
  color: var(--gold-bright);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot-ice { background: var(--ice); box-shadow: 0 0 8px rgba(126, 200, 234, 0.65); }
.dot-fire { background: var(--fire); box-shadow: 0 0 8px rgba(232, 147, 90, 0.65); }
.dot-gold { background: var(--gold-bright); box-shadow: 0 0 8px rgba(242, 212, 136, 0.5); }

.filters-row {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 12px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

select,
input[type="search"] {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0e0d12;
  color: var(--ink);
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
}

select:focus,
input[type="search"]:focus {
  outline: 2px solid rgba(212, 175, 90, 0.45);
  border-color: var(--gold);
}

.search-wrap {
  position: relative;
}

.search-wrap input {
  padding-right: 36px;
}

.clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}

.btn-gold {
  height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #161108;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.btn-gold:hover {
  opacity: 0.94;
}

.btn-gold:active {
  transform: translateY(1px);
}

.btn-gold:disabled {
  opacity: 0.6;
  cursor: wait;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 14px 16px;
}

.kpi-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.kpi-value {
  display: block;
  font-size: 22px;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-leader {
  color: var(--gold-bright);
}

.status-banner {
  background: rgba(232, 147, 90, 0.12);
  border: 1px solid rgba(232, 147, 90, 0.45);
  color: #ffd5bc;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: 14px;
}

.podium-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.podium-card {
  background: linear-gradient(180deg, rgba(25, 22, 32, 0.95), rgba(15, 13, 19, 0.98));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.podium-card.rank-1 {
  border-color: rgba(242, 212, 136, 0.65);
  box-shadow: 0 10px 28px rgba(212, 175, 90, 0.14);
}

.podium-card.rank-2 {
  border-color: rgba(201, 210, 220, 0.42);
}

.podium-card.rank-3 {
  border-color: rgba(210, 138, 86, 0.42);
}

.podium-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.podium-medal {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(212, 175, 90, 0.16);
  color: var(--gold-bright);
}

.podium-card.rank-2 .podium-medal {
  background: rgba(201, 210, 220, 0.14);
  color: var(--silver);
}

.podium-card.rank-3 .podium-medal {
  background: rgba(210, 138, 86, 0.16);
  color: var(--bronze);
}

.podium-name {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.podium-points {
  font-size: 24px;
  font-weight: 800;
  color: var(--gold-bright);
  margin-bottom: 10px;
}

.podium-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.table-panel {
  margin-bottom: 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold-bright);
}

.panel-sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: rgba(212, 175, 90, 0.1);
  color: var(--gold-bright);
}

.pill-utc3 {
  border-color: rgba(126, 200, 234, 0.4);
  background: rgba(126, 200, 234, 0.12);
  color: var(--ice);
}

.pill-utc8 {
  border-color: rgba(232, 147, 90, 0.45);
  background: rgba(232, 147, 90, 0.12);
  color: var(--fire);
}

.table-scroll {
  overflow-x: auto;
}

.rank-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.rank-table th,
.rank-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}

.rank-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.rank-table tbody tr:hover {
  background: rgba(212, 175, 90, 0.05);
}

.rank-table .col-rank {
  width: 68px;
}

.rank-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.rank-badge.top1 { background: rgba(242, 212, 136, 0.2); color: var(--gold-bright); border: 1px solid rgba(242, 212, 136, 0.5); }
.rank-badge.top2 { background: rgba(201, 210, 220, 0.18); color: var(--silver); border: 1px solid rgba(201, 210, 220, 0.4); }
.rank-badge.top3 { background: rgba(210, 138, 86, 0.18); color: var(--bronze); border: 1px solid rgba(210, 138, 86, 0.4); }

.player-cell {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.player-name {
  font-weight: 700;
  color: var(--ink);
}

.server-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.server-tag.utc3 {
  border-color: rgba(126, 200, 234, 0.35);
  color: var(--ice);
}

.server-tag.utc8 {
  border-color: rgba(232, 147, 90, 0.35);
  color: var(--fire);
}

.points-cell {
  font-weight: 800;
  color: var(--gold-bright);
}

.empty-cell {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 16px;
}

.winners-list {
  display: flex;
  flex-direction: column;
}

.winner-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.winner-item:last-child {
  border-bottom: 0;
}

.winner-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.winner-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.winner-meta {
  font-size: 12px;
  color: var(--muted);
}

.winner-score {
  text-align: right;
  flex-shrink: 0;
}

.winner-score strong {
  display: block;
  color: var(--gold-bright);
  font-size: 14px;
}

.winner-score span {
  font-size: 12px;
  color: var(--muted);
}

.rules-grid {
  padding: 14px 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-size: 13px;
}

.rule-row strong {
  color: var(--gold-bright);
}

.tiebreak-box {
  padding: 0 20px 20px;
}

.tiebreak-box h3 {
  margin: 6px 0 8px;
  font-size: 14px;
  color: var(--ink);
}

.tiebreak-box ol {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer {
  border-top: 1px solid var(--line-soft);
  padding: 20px 0;
  color: var(--muted);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a:hover {
  color: var(--gold-bright);
}

@media (max-width: 860px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .podium-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }
  .filters-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .rules-grid {
    grid-template-columns: 1fr;
  }
  .topnav a {
    padding: 7px 10px;
    font-size: 13px;
  }
}
