@font-face {
  font-family: "Inter";
  src: url("/static/assets/InterVariable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg-top: #111216;
  --bg-bot: #0a0b0d;
  --surface: #15171e;
  --surface-2: #1c1f29;
  --surface-3: #232735;
  --border: rgba(255, 255, 255, 0.08);
  --border-hi: rgba(255, 255, 255, 0.16);
  --txt: #f2f3f5;
  --txt-2: #a6abb3;
  --txt-3: #7a7f88;
  --ct: #62a0ff;
  --t: #f0b24c;
  --live: #ff5860;
  --win: #56de92;
  --gold: #f5c65e;
  --radius: 16px;
  --radius-sm: 10px;
}

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

html, body {
  min-height: 100%;
  background: radial-gradient(1200px 600px at 15% -10%, rgba(98,160,255,0.08), transparent 60%),
              radial-gradient(900px 500px at 90% 0%, rgba(240,178,76,0.06), transparent 55%),
              linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bot) 100%);
  color: var(--txt);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Navbar */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(14, 15, 20, 0.85);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1220px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; font-size: 18px;
}
.brand-badge {
  background: linear-gradient(135deg, var(--ct), #4376e6);
  color: #090b10; font-weight: 900; font-size: 11px; padding: 4px 8px; border-radius: 7px; letter-spacing: 0.04em;
}
.nav-tabs { display: flex; gap: 6px; background: var(--surface); padding: 4px; border-radius: 12px; border: 1px solid var(--border); }
.tab-btn {
  background: transparent; color: var(--txt-2); border: 0; padding: 8px 14px; border-radius: 9px;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: 0.15s;
}
.tab-btn:hover { color: var(--txt); }
.tab-btn.active { background: var(--surface-3); color: var(--txt); box-shadow: inset 0 0 0 1px var(--border-hi); }

.nav-right { display: flex; align-items: center; gap: 10px; }
.uid-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: var(--surface-2); border: 1px solid var(--border-hi); border-radius: 999px;
  font-size: 13px; font-weight: 600; cursor: pointer; color: var(--txt);
}
.uid-tag {
  background: rgba(98, 160, 255, 0.16); color: var(--ct); padding: 2px 7px; border-radius: 6px;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.elo-tag {
  background: rgba(245, 198, 94, 0.15); color: var(--gold); padding: 2px 7px; border-radius: 6px;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* Main Layout */
.container { max-width: 1220px; margin: 0 auto; padding: 24px 20px 64px; }
.section { display: none; }
.section.active { display: block; animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: 0.15s; text-decoration: none;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--ct); color: #090b10; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-win { background: var(--win); color: #08120c; }
.btn-win:hover:not(:disabled) { filter: brightness(1.06); }
.btn-danger { background: rgba(255, 88, 96, 0.15); color: var(--live); border-color: rgba(255, 88, 96, 0.35); }
.btn-danger:hover:not(:disabled) { background: rgba(255, 88, 96, 0.25); }
.btn-ghost { background: var(--surface-2); color: var(--txt); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { border-color: var(--border-hi); background: var(--surface-3); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
}
.card-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }

/* Status Bar (BABA-PUG server chips) */
.status-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.srv-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.srv-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; font-size: 13px; font-weight: 600;
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-free { background: var(--win); box-shadow: 0 0 8px var(--win); }
.dot-live { background: var(--live); box-shadow: 0 0 8px var(--live); animation: pulse 1.6s infinite; }
.dot-warn { background: var(--t); }
.dot-off { background: var(--txt-3); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

.meta-stats { display: flex; gap: 16px; color: var(--txt-2); font-size: 13px; }
.meta-stats strong { color: var(--txt); font-variant-numeric: tabular-nums; }

/* Hero Live Match Card (BABA-PUG scorecard style with map backdrop) */
.hero-match {
  position: relative; overflow: hidden; border-radius: 18px; border: 1px solid var(--border-hi);
  margin-bottom: 20px; background: var(--surface);
}
.hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0.24; filter: saturate(0.85) blur(1px);
}
.hero-grad {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(14,15,20,0.92) 0%, rgba(14,15,20,0.65) 50%, rgba(14,15,20,0.92) 100%);
}
.hero-body { position: relative; padding: 22px 24px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
}
.pill-live { background: rgba(255, 88, 96, 0.18); color: var(--live); border: 1px solid rgba(255, 88, 96, 0.35); }
.pill-ct { background: rgba(98, 160, 255, 0.16); color: var(--ct); }
.pill-win { background: rgba(86, 222, 146, 0.16); color: var(--win); }
.pill-gold { background: rgba(245, 198, 94, 0.16); color: var(--gold); }

.score-board {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.team-col { display: flex; flex-direction: column; gap: 6px; }
.team-col.right { text-align: right; align-items: flex-end; }
.team-name { font-size: 18px; font-weight: 800; }
.team-name.ct { color: var(--ct); }
.team-name.t { color: var(--t); }
.score-mid {
  font-size: 38px; font-weight: 900; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 12px;
}
.score-sep { color: var(--txt-3); font-size: 26px; }
.roster-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.team-col.right .roster-chips { justify-content: flex-end; }
.p-chip {
  background: rgba(17, 18, 22, 0.78); border: 1px solid var(--border); padding: 4px 9px; border-radius: 8px;
  font-size: 12px; color: var(--txt-2); display: inline-flex; align-items: center; gap: 5px;
}
.p-chip .cap { color: var(--gold); }
.p-chip .web-b { font-size: 10px; background: rgba(98,160,255,0.16); color: var(--ct); padding: 1px 5px; border-radius: 4px; font-weight: 700; }

/* My Active Match Box */
.my-match-box {
  background: linear-gradient(135deg, rgba(98,160,255,0.12), rgba(21,23,30,0.96));
  border: 1px solid rgba(98,160,255,0.38); border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.connect-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px;
  background: #0b0c10; border: 1px solid var(--border-hi); border-radius: 10px; padding: 10px 14px;
}
.connect-cmd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--win); flex: 1; word-break: break-all; }
.action-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Queue Grid (5 modes like BABA-PUG panel) */
.mode-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 22px;
}
@media (max-width: 1024px) { .mode-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .mode-grid { grid-template-columns: 1fr; } }

.mode-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: 0.15s;
}
.mode-card:hover { border-color: var(--border-hi); transform: translateY(-1px); }
.mode-card.joined { border-color: var(--win); box-shadow: 0 0 0 1px rgba(86,222,146,0.25), 0 10px 28px rgba(86,222,146,0.08); }
.mode-head { display: flex; justify-content: space-between; align-items: baseline; }
.mode-name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.mode-count { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ct); }
.mode-bar { height: 5px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.mode-bar-fill { height: 100%; background: linear-gradient(90deg, var(--ct), var(--win)); transition: width 0.25s; }
.mode-players { display: flex; flex-direction: column; gap: 5px; min-height: 54px; flex: 1; }
.q-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--txt-2); }
.q-row strong { color: var(--txt); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 125px; }
.q-empty { color: var(--txt-3); font-size: 12px; }

/* Media Gallery (Clips & Match Summaries) */
.subtabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 960px) { .media-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .media-grid { grid-template-columns: 1fr; } }

.media-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; transition: 0.15s;
}
.media-card:hover { border-color: var(--border-hi); }
.media-card video { width: 100%; aspect-ratio: 16 / 9; background: #000; display: block; object-fit: cover; }
.media-info { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.media-title { font-size: 13px; font-weight: 700; line-height: 1.35; }
.media-meta { font-size: 12px; color: var(--txt-3); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.media-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 8px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--txt-3); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 12px; border-bottom: 1px solid var(--border); }
td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); font-variant-numeric: tabular-nums; }
tr:hover td { background: rgba(255,255,255,0.02); }
.rank-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--surface-2); }

/* Account / Mullvad Panel */
.acc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .acc-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 600; color: var(--txt-2); }
.input {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border-hi);
  background: #0d0f14; color: var(--txt); font: inherit; font-size: 14px; outline: none;
}
.input:focus { border-color: var(--ct); }
.input-row { display: flex; gap: 8px; }

.mullvad-code-box {
  background: #0a0c10; border: 1px solid rgba(86, 222, 146, 0.45); border-radius: 14px; padding: 18px;
  text-align: center; margin: 14px 0;
}
.mullvad-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 24px; font-weight: 800;
  letter-spacing: 0.1em; color: var(--win); margin: 8px 0; user-select: all;
}
.warn-box {
  background: rgba(240, 178, 76, 0.12); border: 1px solid rgba(240, 178, 76, 0.35);
  color: #f6cf84; padding: 11px 14px; border-radius: 10px; font-size: 12.5px; line-height: 1.5;
}
.verify-box {
  background: rgba(98, 160, 255, 0.11); border: 1px solid rgba(98, 160, 255, 0.4);
  padding: 16px; border-radius: 12px; margin-top: 12px;
}

/* Modal & Toast */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80; background: rgba(5, 6, 9, 0.78); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: 18px; padding: 24px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}
.toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 95; max-width: 380px;
  background: var(--surface-2); border: 1px solid var(--border-hi); color: var(--txt);
  padding: 12px 16px; border-radius: 12px; font-size: 13px; font-weight: 600;
  box-shadow: 0 12px 35px rgba(0,0,0,0.45); display: none;
}
.toast.show { display: block; animation: fadeIn 0.18s ease; }
.toast.ok { border-color: rgba(86,222,146,0.5); color: var(--win); }
.toast.err { border-color: rgba(255,88,96,0.5); color: var(--live); }

.two-col { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.muted { color: var(--txt-3); font-size: 13px; }
