:root {
  --bg: #090d14;
  --panel: #111827;
  --panel-2: #151f31;
  --ink: #f8fafc;
  --muted: #9aa8bd;
  --line: rgba(255,255,255,.1);
  --gold: #f5c84b;
  --blue: #4c7dff;
  --green: #20d18f;
  --danger: #ff5d73;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0, rgba(76,125,255,.24), transparent 34%),
    radial-gradient(circle at 80% 15%, rgba(245,200,75,.14), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body:has(.auth-shell) {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(245,200,75,.2), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(76,125,255,.16), transparent 30%),
    linear-gradient(180deg, #090d14 0%, #0d1422 100%);
}
a { color: inherit; text-decoration: none; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 54px);
  background: rgba(9,13,20,.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand, .topbar nav, .hero-actions, .profile-strip {
  display: flex;
  align-items: center;
}
.brand { gap: 10px; font-weight: 950; }
.brand span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--gold);
  color: #111827;
}
.topbar nav { gap: 18px; color: var(--muted); font-size: 14px; font-weight: 800; }
.topbar nav a.active { color: var(--gold); }
.steam-small { color: var(--gold); }
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 70px; }
body:has(.auth-shell) main {
  width: min(1240px, calc(100% - 28px));
  padding-top: 28px;
}
.toast {
  margin-bottom: 18px;
  padding: 13px 16px;
  border: 1px solid rgba(32,209,143,.28);
  border-radius: 14px;
  background: rgba(32,209,143,.12);
  color: #b8ffe4;
  font-weight: 800;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: stretch;
  min-height: 520px;
}
.payment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 460px);
  gap: 20px;
  align-items: stretch;
}
.auth-visual {
  min-height: 680px;
  display: grid;
  align-content: end;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  padding: clamp(28px, 5vw, 64px);
}
.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(115deg, rgba(9,13,20,.98), rgba(9,13,20,.68) 48%, rgba(9,13,20,.96)),
    radial-gradient(circle at 72% 26%, rgba(245,200,75,.26), transparent 30%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 1px, transparent 1px 22px);
}
.auth-visual::after {
  content: "1.6";
  position: absolute;
  right: -18px;
  top: 48px;
  z-index: -1;
  color: rgba(245,200,75,.08);
  font-size: clamp(140px, 20vw, 270px);
  font-weight: 950;
  line-height: .8;
}
.auth-brandmark {
  position: absolute;
  left: clamp(24px, 4vw, 54px);
  top: clamp(22px, 4vw, 48px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 950;
}
.auth-brandmark span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--gold);
  color: #111827;
}
.auth-visual h1 {
  max-width: 680px;
  margin-bottom: 16px;
  font-size: clamp(44px, 7vw, 84px);
}
.auth-visual p { max-width: 590px; font-size: 18px; }
.auth-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 18px 0 0;
}
.auth-benefits span {
  padding: 9px 12px;
  border: 1px solid rgba(245,200,75,.22);
  border-radius: 999px;
  background: rgba(245,200,75,.09);
  color: #ffe8a4;
  font-size: 12px;
  font-weight: 950;
}
.auth-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}
.auth-stats span {
  min-height: 90px;
  display: grid;
  align-content: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}
.auth-stats strong {
  display: block;
  color: var(--ink);
  font-size: 28px;
}
.auth-card.panel {
  align-self: stretch;
  display: grid;
  align-content: start;
  padding: clamp(16px, 2.4vw, 24px);
  background:
    linear-gradient(145deg, rgba(18,27,44,.96), rgba(11,17,29,.94)),
    var(--panel);
}
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0,0,0,.22);
}
.auth-tabs button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}
.auth-tabs button.active {
  background: var(--gold);
  color: #111827;
}
.auth-form {
  display: none;
  padding: 8px 4px 4px;
}
.auth-form.active { display: grid; }
.auth-form h2 {
  margin-bottom: 6px;
  font-size: clamp(26px, 3vw, 34px);
}
.auth-form p {
  margin-bottom: 2px;
  font-size: 14px;
}
.form-stack {
  display: grid;
  gap: 14px;
}
.form-stack label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}
.form-stack input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 15px;
  background: rgba(255,255,255,.075);
  color: var(--ink);
  font: inherit;
  outline: none;
}
.form-stack input:focus {
  border-color: rgba(245,200,75,.7);
  box-shadow: 0 0 0 4px rgba(245,200,75,.1);
}
.btn.full { width: 100%; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.payment-panel article {
  min-height: 210px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
}
.profile-page { display: grid; gap: 18px; }
.profile-card, .steam-connect {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.profile-card { justify-content: flex-start; }
.profile-card img {
  width: 112px;
  height: 112px;
  border-radius: 28px;
  object-fit: cover;
  border: 1px solid rgba(245,200,75,.24);
}
.profile-card h1 {
  margin-bottom: 8px;
  font-size: clamp(34px, 5vw, 58px);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.detail-grid span {
  min-height: 94px;
  display: grid;
  align-content: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.04);
}
.detail-grid small {
  color: var(--muted);
  font-weight: 850;
}
.detail-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-copy, .status-card, .panel, .profile-strip {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(17,24,39,.92), rgba(21,31,49,.82));
  box-shadow: 0 24px 90px rgba(0,0,0,.28);
}
.hero-copy { padding: clamp(28px, 6vw, 72px); display: grid; align-content: center; }
.eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 780px; margin-bottom: 22px; font-size: clamp(42px, 7vw, 86px); line-height: .92; letter-spacing: 0; }
p { color: var(--muted); line-height: 1.7; }
.hero-copy p { max-width: 670px; font-size: 18px; }
.hero-actions { flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 18px;
  color: var(--ink);
  font-weight: 950;
  cursor: pointer;
}
.btn.primary, .btn.steam { background: var(--gold); color: #111827; border-color: transparent; }
.btn.secondary { background: var(--danger); color: white; border-color: transparent; }
.btn.ghost { background: rgba(255,255,255,.05); }
.status-card { padding: 26px; display: grid; align-content: center; text-align: center; }
.ring {
  width: 220px;
  height: 220px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--fill), rgba(255,255,255,.08) 0);
  position: relative;
}
.ring::after { content: ""; position: absolute; inset: 16px; border-radius: 50%; background: var(--panel); }
.ring strong, .ring span { position: relative; z-index: 1; display: block; }
.ring strong { font-size: 42px; }
.ring span { margin-top: 52px; margin-left: -92px; color: var(--muted); font-weight: 800; }
.status-card small { color: var(--gold); font-weight: 850; }
.profile-strip { margin: 26px 0; padding: 14px; gap: 14px; }
.profile-strip img {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  object-fit: cover;
}
.profile-strip div { min-width: 0; flex: 1; }
.profile-strip strong, .profile-strip span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-strip span { color: var(--muted); font-size: 13px; }
.profile-strip a { color: var(--gold); font-weight: 900; }
.panel { padding: clamp(18px, 4vw, 34px); margin-top: 26px; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.section-head h2 { margin-bottom: 0; font-size: clamp(26px, 4vw, 42px); }
.section-head > strong { color: var(--gold); font-size: 28px; }
.slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.slot {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.04);
}
.slot.filled { border-color: rgba(32,209,143,.28); background: rgba(32,209,143,.08); }
.slot img, .slot > span {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 14px;
}
.slot img { object-fit: cover; }
.slot > span { display: grid; place-items: center; background: rgba(255,255,255,.08); color: var(--muted); font-weight: 950; }
.slot strong, .slot small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot small { color: var(--muted); }
.match-list { display: grid; gap: 14px; }
.match-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
}
.match-card header, .teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.match-card header { align-items: center; margin-bottom: 14px; }
.match-card header span {
  justify-self: end;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(245,200,75,.14);
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}
.teams div { padding: 12px; border-radius: 14px; background: rgba(0,0,0,.18); }
.teams h3 { margin-bottom: 8px; color: var(--gold); }
.teams small { display: block; color: var(--muted); line-height: 1.7; }
details { margin-top: 12px; }
summary { cursor: pointer; color: var(--gold); font-weight: 900; }
pre {
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  border-radius: 14px;
  background: #05070b;
  color: #c7d2fe;
  font-size: 12px;
}
.empty { padding: 18px; border: 1px dashed var(--line); border-radius: 16px; }
@media (max-width: 820px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar nav { width: 100%; overflow-x: auto; }
  body:has(.auth-shell) main {
    width: min(100% - 20px, 520px);
    padding: 14px 0 34px;
  }
  .hero, .auth-shell, .payment-grid, .detail-grid { grid-template-columns: 1fr; min-height: 0; }
  .auth-shell { gap: 12px; }
  .auth-visual {
    min-height: 310px;
    padding: 24px;
    border-radius: 22px;
  }
  .auth-brandmark {
    position: relative;
    left: auto;
    top: auto;
    margin-bottom: 34px;
  }
  .auth-visual::after {
    right: -8px;
    top: 78px;
    font-size: 128px;
  }
  .auth-visual h1 {
    font-size: 34px;
    line-height: .98;
  }
  .auth-visual p { font-size: 15px; line-height: 1.55; }
  .auth-benefits { display: none; }
  .auth-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 14px;
  }
  .auth-stats span {
    min-height: 66px;
    padding: 9px;
    border-radius: 14px;
    font-size: 11px;
  }
  .auth-stats strong { font-size: 18px; }
  .auth-card.panel {
    border-radius: 22px;
    padding: 14px;
  }
  .auth-tabs { margin-bottom: 12px; }
  .auth-form { padding: 4px 0 0; }
  .form-stack { gap: 12px; }
  .form-stack input { min-height: 50px; }
  .profile-card, .steam-connect { align-items: flex-start; flex-direction: column; }
  .slots, .match-card header, .teams { grid-template-columns: 1fr; }
  .match-card header span { justify-self: start; }
}
@media (max-width: 520px) {
  body:has(.auth-shell) .topbar {
    padding: 12px 14px;
  }
  body:has(.auth-shell) .topbar nav {
    display: none;
  }
  .auth-visual {
    min-height: 260px;
    padding: 20px;
  }
  .auth-brandmark {
    margin-bottom: 22px;
  }
  .auth-brandmark span {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }
  .auth-brandmark strong { font-size: 18px; }
  .auth-visual h1 { font-size: 29px; }
  .auth-visual p { margin-bottom: 0; }
  .auth-stats { display: none; }
  .auth-form h2 { font-size: 24px; }
  .auth-form p { font-size: 13px; }
  .auth-divider { margin: 12px 0; }
}
.prize-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border-color: rgba(245,200,75,.28);
  background: linear-gradient(135deg, rgba(245,200,75,.14), rgba(17,24,39,.9));
}
.prize-panel strong {
  padding: 18px 22px;
  border-radius: 18px;
  background: var(--gold);
  color: #111827;
  font-size: clamp(28px, 4vw, 46px);
}
.server-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.server-card {
  min-height: 154px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
}
.server-card.open { border-color: rgba(32,209,143,.3); }
.server-card.busy { border-color: rgba(245,200,75,.34); background: rgba(245,200,75,.08); }
.server-card.locked { opacity: .56; }
.server-card header, .leader-row, .result-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.server-card header { justify-content: space-between; }
.server-card header span, .leader-row em {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(245,200,75,.14);
  color: var(--gold);
  font-size: 12px;
  font-weight: 950;
}
.server-card h3 { margin: 16px 0 8px; }
.queue-rooms { display: grid; gap: 18px; }
.queue-room {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,.12);
}
.queue-room h3 { color: var(--gold); }
.queue-actions { margin-bottom: 18px; }
.start-game-panel {
  border-color: rgba(32,209,143,.34);
  background: linear-gradient(135deg, rgba(32,209,143,.14), rgba(17,24,39,.94));
}
.start-game-panel h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(34px, 5vw, 62px);
}
.compact-slots { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.compact-slots .slot { min-height: 66px; }
.compact-slots .slot img, .compact-slots .slot > span { width: 40px; height: 40px; }
.leaderboard-list, .result-list { display: grid; gap: 8px; }
.leader-row, .result-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.04);
}
.leader-row > span {
  width: 42px;
  color: var(--gold);
  font-weight: 950;
}
.leader-row img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
}
.leader-row strong { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-row small { color: var(--muted); white-space: nowrap; }
.result-row { justify-content: space-between; }
.result-row span { color: var(--gold); font-size: 22px; font-weight: 950; }
.result-row small { color: var(--muted); }
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.roadmap-grid span {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-weight: 800;
}
@media (max-width: 980px) {
  .server-grid, .compact-slots, .roadmap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .leader-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; }
  .leader-row small { display: none; }
}
@media (max-width: 620px) {
  .prize-panel, .server-grid, .compact-slots, .roadmap-grid { grid-template-columns: 1fr; }
  .result-row { align-items: flex-start; flex-direction: column; }
}
