/* CLUTCH — dark, premium, competitive. */

:root {
  --bg: #0E1117;
  --bg-2: #12161F;
  --bg-3: #171C28;
  --line: #232B3B;
  --text: #E8EDF5;
  --text-dim: #8B98A8;
  --cyan: #4DE1FF;
  --red: #FF4D5E;
  --gold: #F5C542;
  --violet: #B794FF;
  --font-display: 'Rajdhani', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

/* The hidden attribute must always win — author display rules (flex/grid)
   on the same element would otherwise override the UA stylesheet and leave
   "hidden" panels fully visible. */
[hidden] { display: none !important; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100%;
}

button { font-family: inherit; cursor: pointer; }
canvas { display: block; }

/* ---------------- top bar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 28px;
  height: 60px;
  background: rgba(14, 17, 23, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 3px;
  cursor: pointer;
  user-select: none;
}
.logo-mark {
  width: 26px;
  height: 26px;
  color: var(--cyan);
  filter: drop-shadow(0 0 6px rgba(77, 225, 255, 0.5));
  flex-shrink: 0;
}
.logo-word { line-height: 1; }
.logo-dot { color: var(--cyan); }

.nav-links { display: flex; gap: 22px; flex: 1; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.topbar.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topbar.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.topbar.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.4px;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--cyan); border-bottom-color: var(--cyan); }

.auth-area { display: flex; align-items: center; gap: 14px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 12px;
}
.chip-col { display: flex; flex-direction: column; line-height: 1.2; }
.chip-col span:first-child { font-weight: 600; font-size: 13px; }
.chip-rank { color: var(--cyan); font-size: 11px; letter-spacing: 0.5px; }
.chip-onyx { display: flex; align-items: center; gap: 5px; font-weight: 600; font-size: 13px; color: var(--gold); }

/* ---------------- buttons ---------------- */

.btn {
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn.big { padding: 14px 30px; font-size: 16px; }

.btn-primary {
  background: linear-gradient(135deg, #2BB8D9, var(--cyan));
  border-color: transparent;
  color: #04141B;
}
.btn-primary:hover { box-shadow: 0 0 24px rgba(77, 225, 255, 0.35); }

.btn-ghost { background: transparent; }
.btn-ghost:hover { border-color: var(--cyan); }

.btn-buy {
  background: linear-gradient(135deg, #C79A21, var(--gold));
  border-color: transparent;
  color: #1A1405;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-buy:hover { box-shadow: 0 0 20px rgba(245, 197, 66, 0.3); }

.btn-onyx { width: 100%; background: linear-gradient(135deg, #C79A21, var(--gold)); border-color: transparent; color: #1A1405; }

.btn-equipped { background: transparent; border-color: var(--cyan); color: var(--cyan); cursor: default; }

.onyx-icon {
  width: 14px; height: 14px;
  display: inline-block;
  background: linear-gradient(135deg, #F5C542, #8A6A12);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.onyx-icon.small { width: 11px; height: 11px; }

/* ---------------- hero ---------------- */

.hero {
  position: relative;
  height: min(78vh, 680px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  filter: saturate(1.1);
}
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(14,17,23,0.25) 0%, rgba(14,17,23,0.55) 55%, var(--bg) 100%),
    radial-gradient(ellipse at 30% 45%, rgba(14,17,23,0) 0%, rgba(14,17,23,0.55) 75%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 32px 0;
}
.hero-kicker {
  font-family: var(--font-display);
  color: var(--cyan);
  letter-spacing: 4px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 14px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 6.5vw, 72px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.hero-sub {
  margin-top: 18px;
  max-width: 560px;
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1.6;
}
.hero-ctas { display: flex; gap: 16px; margin-top: 32px; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: 26px;
  margin-top: 26px;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-size: 14px;
}
.hero-stats b { color: var(--cyan); font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-right: 4px; }
.hero-stats .live-dot { display: inline-flex; align-items: center; }
.hero-stats .live-dot::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4DFF88;
  box-shadow: 0 0 8px #4DFF88;
  margin-right: 7px;
  animation: livePulse 1.8s ease-in-out infinite;
}
@keyframes livePulse { 50% { opacity: 0.35; } }
.hero-stats .live-season { color: var(--cyan); font-weight: 600; letter-spacing: 0.5px; }
.hero-stats .founding-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.8px;
  border: 1px solid rgba(245, 197, 66, 0.4);
  border-radius: 20px;
  padding: 6px 16px;
  background: rgba(245, 197, 66, 0.06);
}

/* rotate-to-fullscreen prompt — only while a match runs on a portrait phone */
.rotate-hint { display: none; }
body.in-portrait-match:not(.rotate-dismissed) .rotate-hint {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px;
  text-align: center;
  background: rgba(7, 9, 13, 0.94);
  color: var(--text);
}
.rotate-icon {
  font-size: 64px;
  line-height: 1;
  color: var(--cyan);
  text-shadow: 0 0 20px rgba(77, 225, 255, 0.6);
  animation: rotateNudge 1.8s ease-in-out infinite;
}
@keyframes rotateNudge {
  0%, 100% { transform: rotate(0deg); }
  40%, 60% { transform: rotate(90deg); }
}
.rotate-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: 1px; }
.rotate-sub { color: var(--text-dim); font-size: 14px; max-width: 260px; line-height: 1.5; }
.rotate-hint .btn { margin-top: 8px; }

/* reconnect overlay */
.reconnect-overlay {
  position: absolute;
  inset: 0;
  z-index: 72;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(5, 7, 11, 0.82);
  backdrop-filter: blur(3px);
  color: var(--text);
  font-size: 15px;
}

/* profile */
.profile-page { max-width: 780px; margin: 0 auto; padding: 48px 32px; }
.profile-head { display: flex; align-items: center; gap: 20px; margin-bottom: 26px; }
.profile-rank { flex-shrink: 0; }
.profile-name { font-family: var(--font-display); font-size: 32px; letter-spacing: 1px; }
.profile-sub { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.profile-elo { color: var(--text-dim); }
.profile-title { color: var(--gold); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 30px; }
.pstat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px 10px; text-align: center; }
.pstat-val { display: block; font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--cyan); }
.pstat-label { font-size: 11px; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; }
.mh-title { font-family: var(--font-display); letter-spacing: 2px; font-size: 15px; color: var(--text-dim); margin-bottom: 12px; }
.mh-list { display: flex; flex-direction: column; gap: 6px; }
.mh-row {
  display: grid;
  grid-template-columns: 62px 1fr auto auto;
  gap: 12px;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
}
.mh-row.win { border-left: 3px solid var(--cyan); }
.mh-row.loss { border-left: 3px solid var(--red); }
.mh-res { font-weight: 700; font-size: 12px; letter-spacing: 1px; }
.mh-row.win .mh-res { color: var(--cyan); }
.mh-row.loss .mh-res { color: var(--red); }
.mh-score { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.mh-date { color: var(--text-dim); font-size: 12px; }
@media (max-width: 600px) {
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .mh-row { grid-template-columns: 54px 1fr auto; }
  .mh-date { display: none; }
}

/* settings */
.settings-page { max-width: 640px; margin: 0 auto; padding: 48px 32px; }
.settings-group { display: flex; flex-direction: column; gap: 4px; margin-top: 20px; }
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.set-row span { font-size: 15px; }
.set-row input[type=range] { width: 180px; accent-color: var(--cyan); }
.set-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--cyan); }

/* ---------------- sections ---------------- */

.section { max-width: 1100px; margin: 0 auto; padding: 72px 32px; }
.section-title {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.section-sub { color: var(--text-dim); margin-bottom: 32px; max-width: 640px; line-height: 1.6; }

.pillar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 28px; }
.pillar {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
}
.pillar h3 {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.8px;
  color: var(--cyan);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.pillar p { color: var(--text-dim); line-height: 1.65; font-size: 14.5px; }

/* ladder */
.ladder-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.rank-tile {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 16px;
  text-align: center;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.rank-tile::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--rank-c, var(--text-dim));
}
.rank-name { font-family: var(--font-display); font-weight: 700; letter-spacing: 2px; font-size: 18px; color: var(--rank-c, var(--text)); }
.rank-req { color: var(--text-dim); font-size: 12px; }
.rank-iron { --rank-c: #8B98A8; }
.rank-bronze { --rank-c: #C08A52; }
.rank-nova { --rank-c: #4DE1FF; }
.rank-phantom { --rank-c: #B794FF; }
.rank-spectre { --rank-c: #7CF5D4; }
.rank-legend { --rank-c: #F5C542; }

/* featured skins */
.featured-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.featured-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 24px;
  background:
    radial-gradient(circle at 80% 0%, color-mix(in srgb, var(--fc) 18%, transparent), transparent 60%),
    var(--bg-2);
}
.fc-tier { font-size: 11px; letter-spacing: 2px; color: var(--fc); font-weight: 600; margin-bottom: 10px; }
.fc-name { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: 0.6px; }
.fc-desc { color: var(--text-dim); margin-top: 6px; font-size: 14px; }
.featured-cta { margin-top: 28px; }

.footer {
  border-top: 1px solid var(--line);
  padding: 26px 32px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-size: 13px;
}

/* ---------------- play ---------------- */

.play-menu { max-width: 1100px; margin: 0 auto; padding: 56px 32px; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 8px; }
.mode-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px;
  background: var(--bg-2);
}
.mode-card.ranked { border-top: 3px solid var(--cyan); }
.mode-card.training { border-top: 3px solid var(--red); }
.mode-card.openworld { border-top: 3px solid #B79CFF; }
/* Open Arena weapon picker: weapon art + name + one-line description per card */
.ow-wep-toggle { align-items: stretch; flex-wrap: wrap; }
.ow-wep {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  flex: 1;
  min-width: 96px;
  overflow: hidden;
}
.ow-wep svg { width: 100%; max-width: 110px; height: 38px; }
.ow-wep-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
}
.ow-wep-desc {
  font-size: 10px;
  line-height: 1.25;
  color: var(--text-dim);
  letter-spacing: 0;
  text-transform: none;
}
.ow-wep.active .ow-wep-desc { color: inherit; opacity: 0.85; }
.ow-beta {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #B79CFF;
  color: #B79CFF;
  font-size: 11px;
  letter-spacing: 2px;
}
.mode-card h3 { font-family: var(--font-display); font-size: 26px; letter-spacing: 1px; text-transform: uppercase; }
.mode-card p { color: var(--text-dim); margin: 12px 0 22px; line-height: 1.6; font-size: 14.5px; }

.mode-toggle { display: flex; gap: 8px; margin-bottom: 14px; }
.mt-btn {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-dim);
  padding: 9px 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 13px;
  transition: color 0.15s, border-color 0.15s;
}
.mt-btn.active { color: var(--cyan); border-color: var(--cyan); }

.tier-buttons { display: grid; gap: 10px; }
.tier-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  text-align: left;
  transition: border-color 0.15s, transform 0.1s;
}
.tier-btn:hover { transform: translateY(-1px); }
.tier-name { font-family: var(--font-display); font-weight: 700; letter-spacing: 1px; font-size: 16px; }
.tier-desc { color: var(--text-dim); font-size: 12.5px; }
.tier-rookie:hover { border-color: #8B98A8; }
.tier-pro:hover { border-color: var(--cyan); }
.tier-elite:hover { border-color: var(--violet); }
.tier-nightmare:hover { border-color: var(--red); }
.tier-nightmare .tier-name { color: var(--red); }

.controls-hint { color: var(--text-dim); font-size: 13px; margin-top: 26px; }

.play-queue {
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  color: var(--text-dim);
  font-size: 16px;
}
.queue-spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--line);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.queue-elapsed { color: var(--text-dim); font-size: 13px; }
.queue-fallback {
  max-width: 360px;
  text-align: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.queue-fallback p { color: var(--text-dim); font-size: 14px; line-height: 1.5; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- game stage + HUD ---------------- */

/* Fullscreen takeover: the match owns the whole viewport, above the topbar.
   The stage keeps 16:9 and letterboxes on any device orientation. */
.game-wrap {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #05070B;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-stage {
  position: relative;
  width: min(100vw, calc(100dvh * 16 / 9));
  max-height: 100dvh;
  aspect-ratio: 16 / 9;
  touch-action: none;
}

/* Phone held upright: shrink the HUD so cards, badges, and titles fit inside
   the letterboxed 16:9 arena instead of spilling off the edges. */
body.portrait-play .player-card { width: 40%; padding: 4px 6px; transform: none; }
body.portrait-play .player-card > * { transform: none; }
body.portrait-play .pc-name { font-size: 10px; }
body.portrait-play .pc-rank { gap: 4px; margin: 1px 0 3px; }
body.portrait-play .rank-badge { font-size: 8px; padding: 1px 3px; }
body.portrait-play .pc-elo { font-size: 9px; }
body.portrait-play .pc-title { font-size: 8px; letter-spacing: 0.5px; }
body.portrait-play .rank-icon { width: 12px; height: 12px; }
body.portrait-play .round-timer { font-size: 20px; min-width: 48px; padding: 1px 8px; }
body.portrait-play .pip { width: 8px; height: 8px; }
body.portrait-play .kill-feed { top: 74px; }
body.portrait-play .kf-item { font-size: 10px; padding: 3px 8px; }
body.portrait-play .ammo-hud { bottom: 8px; }
/* Move the control buttons to the free bottom-left corner — top-right is
   fully occupied by the player card on a narrow phone. */
body.portrait-play .exit-btn { top: auto; bottom: 8px; left: 8px; right: auto; width: 34px; height: 34px; font-size: 20px; }
body.portrait-play .mute-btn { top: auto; bottom: 8px; left: 48px; right: auto; width: 34px; height: 34px; font-size: 17px; }

/* While a match runs, the page itself is frozen — no scroll, no rubber-band,
   no pull-to-refresh yanking a live round away. */
body.in-game {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
body.in-game .game-wrap {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Touch-device stage sizing is computed in JS (Game.layoutStage) — it
   measures the real viewport, fits 16:9 exactly, and rotates 90° in portrait.
   CSS media queries race orientation changes; arithmetic doesn't. */
#game-canvas {
  width: 100%;
  height: 100%;
  background: var(--bg);
}

.exit-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 70;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(18, 22, 31, 0.88);
  color: var(--text-dim);
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s, width 0.15s;
}
.exit-btn:hover { color: var(--red); border-color: rgba(255, 77, 94, 0.5); }
/* Instant taps on touch — no 300ms delay, no gesture interception. */
.exit-btn, .reload-btn, .ws-card { touch-action: manipulation; }
.exit-btn.confirm {
  width: auto;
  padding: 0 14px;
  color: var(--red);
  border-color: var(--red);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* ammo + reload */
.ammo-hud {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}
.ammo-weapon {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--text-dim);
}
.ammo-pips { display: flex; gap: 5px; }
.ammo-pip {
  width: 7px;
  height: 18px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--line);
  transform: skewX(-12deg);
}
.ammo-pip.full {
  background: var(--cyan);
  border-color: transparent;
  box-shadow: 0 0 8px rgba(77, 225, 255, 0.6);
}
.reload-bar {
  width: 140px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.reload-fill {
  height: 100%;
  width: 0%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.reload-btn {
  position: absolute;
  bottom: 90px;
  right: 18px;
  z-index: 60;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(18, 22, 31, 0.85);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 13px;
}
@media (hover: hover) and (pointer: fine) {
  .reload-btn { display: none; }
}

/* dash button — sits above reload, left of it, cyan-tinted */
.dash-btn {
  position: absolute;
  bottom: 90px;
  right: 128px;
  z-index: 60;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(77, 225, 255, 0.55);
  background: rgba(18, 30, 40, 0.85);
  color: var(--p0, #4DE1FF);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 13px;
  touch-action: manipulation;
  transition: opacity 0.12s ease, transform 0.08s ease;
}
.dash-btn:active { transform: scale(0.94); }
.dash-btn.cooling { opacity: 0.35; }
@media (hover: hover) and (pointer: fine) {
  .dash-btn { display: none; }
}

/* tactical-ability button — above dash, amber-tinted */
.skill-btn {
  position: absolute;
  bottom: 148px;
  right: 18px;
  z-index: 60;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 180, 90, 0.55);
  background: rgba(32, 26, 18, 0.85);
  color: #FFC24D;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 13px;
  touch-action: manipulation;
  transition: opacity 0.12s ease, transform 0.08s ease;
}
.skill-btn:active { transform: scale(0.94); }
.skill-btn.cooling { opacity: 0.35; }
@media (hover: hover) and (pointer: fine) {
  .skill-btn { display: none; }
}

/* ability picker in the weapon-select overlay */
.ws-sub {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--muted, #7C8CA8);
  margin-top: 6px;
}
.ws-abilities {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.ws-ability {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 14px;
  min-width: 140px;
  border-radius: 10px;
  border: 1px solid var(--line, #2A3348);
  background: rgba(18, 22, 31, 0.9);
  color: var(--text, #E8EEF6);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.ws-ability.selected {
  border-color: #FFC24D;
  box-shadow: 0 0 0 1px #FFC24D inset;
}
.ws-ability .ws-name { font-family: var(--font-display); font-weight: 700; letter-spacing: 1px; }
.ws-ability .ws-desc { font-size: 11px; color: var(--muted, #7C8CA8); }

/* weapon select overlay */
.weapon-select {
  position: absolute;
  inset: 0;
  z-index: 65;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(5, 7, 11, 0.72);
  backdrop-filter: blur(3px);
}
.ws-title {
  font-family: var(--font-display);
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: 5px;
}
.ws-cards {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 16px;
}
.ws-card {
  width: min(190px, 28vw);
  min-width: 130px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 14px;
  color: var(--text);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.ws-card:hover { transform: translateY(-2px); }
.ws-card.selected {
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(77, 225, 255, 0.25);
}
.ws-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}
.ws-stats { font-size: 11px; color: var(--cyan); letter-spacing: 0.5px; }
.ws-desc { font-size: 12px; color: var(--text-dim); line-height: 1.45; }
.ws-hint { font-size: 12px; color: var(--text-dim); letter-spacing: 0.5px; }

.hud { position: absolute; inset: 0; pointer-events: none; }

.hud-top {
  position: absolute;
  top: 14px; left: 14px; right: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.player-card {
  --pc-color: var(--cyan);
  width: min(230px, 30%);
  background: rgba(18, 22, 31, 0.88);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  transform: skewX(-8deg);
}
.player-card.right { transform: skewX(8deg); }
.player-card > * { transform: skewX(8deg); }
.player-card.right > * { transform: skewX(-8deg); }
.player-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--pc-color);
}
.player-card.right::before { inset: 0 0 0 auto; }
.pc-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 0.6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-rank { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; }
.pc-elo { color: var(--text-dim); font-size: 11px; }
.rank-icon { vertical-align: middle; flex-shrink: 0; }
.lt-rank { display: inline-flex; align-items: center; gap: 6px; }
.rank-tile .rank-icon { margin: 0 auto 4px; display: block; }
.es-rankup-badge { display: flex; align-items: center; gap: 10px; }

.rank-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg-3);
  border: 1px solid var(--line);
}
.rank-badge.rank-iron { color: #8B98A8; }
.rank-badge.rank-bronze { color: #C08A52; }
.rank-badge.rank-nova { color: var(--cyan); }
.rank-badge.rank-phantom { color: var(--violet); }
.rank-badge.rank-spectre { color: #7CF5D4; }
.rank-badge.rank-legend { color: var(--gold); }

.pc-title {
  width: 100%;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 1px;
}

/* card frames — season pass cosmetics */
.player-card.frame-silver { border-color: #C4D2DE; box-shadow: 0 0 10px rgba(196, 210, 222, 0.25); }
.player-card.frame-void { border-color: #8B5CF6; box-shadow: 0 0 14px rgba(139, 92, 246, 0.4); }
.player-card.frame-ember { border-color: #FF8C3B; box-shadow: 0 0 14px rgba(255, 140, 59, 0.4); }
.player-card.frame-champion {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(245, 197, 66, 0.45);
  animation: champPulse 2.2s ease-in-out infinite;
}
@keyframes champPulse {
  50% { box-shadow: 0 0 26px rgba(245, 197, 66, 0.75); }
}

.pc-hp { height: 7px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden; }
.pc-hp-fill {
  height: 100%;
  width: 100%;
  background: var(--pc-color);
  border-radius: 4px;
  transition: width 0.15s ease-out;
  box-shadow: 0 0 8px var(--pc-color);
}
.pc-hp-fill.low { background: var(--red); box-shadow: 0 0 8px var(--red); }

.hud-center { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.round-timer {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 2px;
  background: rgba(18, 22, 31, 0.88);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 16px;
  min-width: 76px;
  text-align: center;
}
.round-timer.urgent { color: var(--red); border-color: rgba(255,77,94,0.5); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

.round-pips { display: flex; align-items: center; gap: 10px; }
.pips-side { display: flex; gap: 5px; }
.pips-divider { width: 1px; height: 12px; background: var(--line); }
.pip {
  width: 10px; height: 10px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: rgba(255,255,255,0.10);
  border: 1px solid var(--line);
}
.pip.filled.p0 { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); border-color: transparent; }
.pip.filled.p1 { background: var(--red); box-shadow: 0 0 8px var(--red); border-color: transparent; }

.kill-feed {
  position: absolute;
  top: 96px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.kf-item {
  background: rgba(18, 22, 31, 0.88);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 500;
  transition: opacity 0.6s;
}
.kf-item.good { border-left: 3px solid var(--cyan); }
.kf-item.bad { border-left: 3px solid var(--red); }
.kf-item.fade { opacity: 0; }

.announce {
  position: absolute;
  top: 34%;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 58px;
  font-weight: 700;
  letter-spacing: 8px;
  text-transform: uppercase;
  opacity: 0;
  transform: scale(1.15);
  transition: opacity 0.18s, transform 0.18s;
  text-shadow: 0 0 30px rgba(77, 225, 255, 0.4);
}
.announce.show { opacity: 1; transform: scale(1); }
.announce.win { color: var(--cyan); }
.announce.loss { color: var(--red); text-shadow: 0 0 30px rgba(255, 77, 94, 0.4); }
.announce.fight { color: #FFFFFF; }

.announce-sub {
  position: absolute;
  top: calc(34% + 66px);
  left: 0; right: 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 15px;
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity 0.25s;
}
.announce-sub.show { opacity: 1; }

/* joysticks */
.joystick {
  position: fixed;
  width: 120px; height: 120px;
  display: none;
  pointer-events: none;
  z-index: 60;
}
.joystick.active { display: block; }
.joy-base {
  position: absolute; inset: 0;
  border: 2px solid rgba(255,255,255,0.22);
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.joy-knob {
  position: absolute;
  left: 35px; top: 35px;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: rgba(77, 225, 255, 0.35);
  border: 2px solid rgba(77, 225, 255, 0.6);
}

/* ---------------- armory ---------------- */

.armory { max-width: 1100px; margin: 0 auto; padding: 48px 32px; }
.armory-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.armory-head h2 { font-family: var(--font-display); font-size: 34px; letter-spacing: 2px; }
.onyx-balance {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 18px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
}
.onyx-word { font-size: 12px; color: var(--text-dim); letter-spacing: 2px; }
.armory-note { color: var(--text-dim); font-size: 13.5px; margin: 14px 0 26px; max-width: 720px; line-height: 1.6; }

.onyx-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 48px; }
.onyx-pack {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px 18px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.onyx-pack.tagged { border-color: rgba(245, 197, 66, 0.45); }
.pack-tag {
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #1A1405;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 10px;
  white-space: nowrap;
}
.pack-amount { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--gold); }
.pack-label { font-size: 11px; letter-spacing: 3px; color: var(--text-dim); margin-bottom: 14px; }

.tier-block { margin-bottom: 40px; }
.tier-title {
  font-family: var(--font-display);
  letter-spacing: 3px;
  font-size: 17px;
  color: var(--tier-color, var(--text));
  border-left: 3px solid var(--tier-color, var(--line));
  padding-left: 12px;
  margin-bottom: 16px;
}
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.skin-card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.skin-card.equipped { border-color: var(--cyan); box-shadow: 0 0 18px rgba(77, 225, 255, 0.12); }

/* rarity grades — border + glow scale with the grade; legendary pulses gold */
.skin-card.rarity-rare { border-color: rgba(77, 166, 255, 0.45); box-shadow: 0 0 12px rgba(77, 166, 255, 0.12); }
.skin-card.rarity-epic { border-color: rgba(183, 148, 255, 0.5); box-shadow: 0 0 14px rgba(183, 148, 255, 0.18); }
.skin-card.rarity-legendary {
  border-color: rgba(245, 197, 66, 0.7);
  box-shadow: 0 0 18px rgba(245, 197, 66, 0.3);
  animation: legendaryGlow 2.4s ease-in-out infinite;
}
@keyframes legendaryGlow {
  50% { box-shadow: 0 0 30px rgba(245, 197, 66, 0.55); border-color: var(--gold); }
}
/* Mythic — the rarest card in the game: a bright amber frame that breathes gold. */
.skin-card.rarity-mythic {
  border-color: #FFB000;
  box-shadow: 0 0 26px rgba(255, 176, 0, 0.5);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 176, 0, 0.14), transparent 65%),
    var(--bg-2);
  animation: mythicGlow 2s ease-in-out infinite;
}
@keyframes mythicGlow {
  50% { box-shadow: 0 0 44px rgba(255, 176, 0, 0.85); border-color: #FFDD8A; }
}
.btn-signin-unlock {
  width: 100%;
  background: linear-gradient(135deg, #1FC8A6, #54F0CE);
  border-color: transparent;
  color: #04231C;
  font-weight: 700;
}
.btn-signin-unlock:hover { box-shadow: 0 0 18px rgba(84, 240, 206, 0.4); }

.mythic-lock {
  text-align: center;
  padding: 9px 0;
  border-radius: 8px;
  color: #1A1405;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #FFDD8A, #FFB000);
  box-shadow: 0 0 16px rgba(255, 176, 0, 0.5);
}
.skin-meta-row { display: flex; justify-content: space-between; align-items: center; }
.skin-rarity { font-size: 10.5px; font-weight: 700; letter-spacing: 2px; }
.skin-preview { width: 100%; border-radius: 8px; background: #0A0D12; }
.skin-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: 0.5px; }
.skin-tier { font-size: 10.5px; font-weight: 700; letter-spacing: 2px; }
.skin-blurb { color: var(--text-dim); font-size: 12.5px; line-height: 1.5; min-height: 38px; }
.limited-ribbon {
  position: absolute;
  top: 12px; right: -34px;
  transform: rotate(38deg);
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 38px;
  z-index: 2;
}

/* ---------------- admin ---------------- */

.admin { max-width: 720px; margin: 0 auto; padding: 56px 32px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 20px 0 28px;
}
.stat-tile {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}
.stat-val {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1;
}
.stat-label {
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.admin-form { display: grid; gap: 14px; margin-top: 10px; }
.admin-form label { display: flex; flex-direction: column; gap: 6px; color: var(--text-dim); font-size: 13px; }
.admin-form input, .admin-form select {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
}
.admin-output {
  margin-top: 22px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: pre-wrap;
  min-height: 60px;
}

/* ---------------- duels ---------------- */

.mode-card.duel { border-top: 3px solid var(--gold); }
.duel-code-box {
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.duel-code {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 12px;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(245, 197, 66, 0.4);
}
.duel-code-hint { font-size: 12px; color: var(--text-dim); }
.duel-join { display: flex; gap: 10px; margin-top: 14px; }
.duel-join input {
  flex: 1;
  min-width: 0;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 6px;
  text-transform: uppercase;
  text-align: center;
}

/* ---------------- mute + end screen ---------------- */

.mute-btn {
  position: absolute;
  top: 10px;
  right: 60px;
  z-index: 70;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(18, 22, 31, 0.88);
  color: var(--cyan);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mute-btn.off { color: var(--text-dim); text-decoration: line-through; }

.end-screen {
  position: absolute;
  inset: 0;
  z-index: 68;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(5, 7, 11, 0.82);
  backdrop-filter: blur(4px);
  padding: 12px;
}
.es-result {
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 700;
  letter-spacing: 8px;
}
.es-result.win { color: var(--cyan); text-shadow: 0 0 30px rgba(77, 225, 255, 0.4); }
.es-result.loss { color: var(--red); text-shadow: 0 0 30px rgba(255, 77, 94, 0.4); }
.es-sub { color: var(--text-dim); font-size: 15px; letter-spacing: 0.5px; }

.es-rankup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  animation: rankPop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes rankPop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.es-rankup-label { font-size: 12px; letter-spacing: 4px; color: var(--gold); font-weight: 700; }
.es-rankup-badge {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 5px;
  color: var(--gold);
  text-shadow: 0 0 26px rgba(245, 197, 66, 0.55);
}

.es-stats { display: flex; flex-direction: column; gap: 4px; min-width: min(400px, 86vw); }
.es-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 8px;
  padding: 5px 14px;
  background: rgba(18, 22, 31, 0.7);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13.5px;
}
.es-row span:first-child { text-align: left; color: var(--cyan); font-weight: 600; }
.es-row span:nth-child(2) { text-align: center; color: var(--text-dim); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.es-row span:last-child { text-align: right; color: var(--red); font-weight: 600; }
.es-row.es-head span { color: var(--text); font-weight: 700; }

.es-xp { display: flex; flex-direction: column; gap: 6px; align-items: center; min-width: min(360px, 80vw); }
.es-xp-text { font-size: 13px; color: var(--gold); letter-spacing: 1px; font-weight: 600; }
.es-xp-bar {
  width: 100%;
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.es-xp-fill { height: 100%; background: var(--gold); box-shadow: 0 0 10px var(--gold); transition: width 0.4s; }
.es-actions { display: flex; gap: 14px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }

.owned-badge {
  text-align: center;
  padding: 9px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 2px;
}
.inline-link { color: var(--cyan); }

.pass-lock {
  text-align: center;
  padding: 9px 0;
  border: 1px dashed rgba(77, 255, 136, 0.4);
  border-radius: 8px;
  color: #4DFF88;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 2px;
}

/* ---------------- season pass ---------------- */

.season { max-width: 1100px; margin: 0 auto; padding: 48px 32px; }
.season-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.season-progress {
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}
.sp-big-tier { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: 2px; color: var(--gold); }
.sp-xp-label { font-size: 12px; color: var(--text-dim); }

.pass-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin: 26px 0;
  padding: 20px 24px;
  border: 1px solid rgba(245, 197, 66, 0.4);
  border-radius: 12px;
  background: radial-gradient(circle at 0% 0%, rgba(245, 197, 66, 0.08), transparent 60%), var(--bg-2);
}
.pass-cta-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: 1px; color: var(--gold); }
.pass-cta-sub { color: var(--text-dim); font-size: 13.5px; margin-top: 4px; }
.pass-owned {
  margin: 26px 0;
  padding: 14px 24px;
  border: 1px solid rgba(77, 255, 136, 0.4);
  border-radius: 12px;
  color: #4DFF88;
  font-weight: 700;
  letter-spacing: 1.5px;
  font-size: 13px;
}

.loadout-box, .challenge-box {
  margin: 0 0 30px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
}
.challenge-list { display: flex; flex-direction: column; gap: 12px; }
.challenge {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
}
.challenge.done { border-color: rgba(77, 255, 136, 0.5); box-shadow: 0 0 12px rgba(77, 255, 136, 0.12); }
.ch-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ch-text { font-size: 14.5px; }
.ch-xp { color: var(--gold); font-weight: 700; font-size: 13px; white-space: nowrap; }
.ch-bar { height: 6px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; margin: 8px 0 4px; }
.ch-fill { height: 100%; background: var(--cyan); border-radius: 4px; }
.challenge.done .ch-fill { background: #4DFF88; }
.ch-prog { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.loadout-title { font-family: var(--font-display); font-size: 18px; letter-spacing: 2.5px; margin-bottom: 4px; }
.loadout-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.loadout-item { display: flex; flex-direction: column; gap: 6px; color: var(--text-dim); font-size: 12.5px; }
.loadout-item select {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 10px;
  font-family: inherit;
  font-size: 14px;
}
.sp-frame-mark { color: #C4D2DE; border-color: #C4D2DE; }
.sp-fx-mark { color: var(--cyan); border-color: var(--cyan); }
.lt-title { display: block; font-size: 10.5px; color: var(--gold); letter-spacing: 1px; text-transform: uppercase; font-weight: 600; }

.sp-legend {
  display: grid;
  grid-template-columns: 44px 1fr 1fr;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  padding: 0 4px 8px 52px;
  font-weight: 700;
}
.sp-legend { grid-template-columns: 1fr 1fr; }
.prem-label { color: var(--gold); }

.sp-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 18px;
  scrollbar-width: thin;
}
.sp-tier {
  flex: 0 0 132px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sp-tier-num {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-dim);
  border-bottom: 2px solid var(--line);
  padding-bottom: 4px;
}
.sp-tier.reached .sp-tier-num { color: var(--gold); border-bottom-color: var(--gold); }
.sp-reward, .sp-empty {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  text-align: center;
}
.sp-empty { opacity: 0.25; }
.sp-reward.prem { border-color: rgba(245, 197, 66, 0.35); }
.sp-reward.locked { opacity: 0.45; }
.sp-reward.unlocked { box-shadow: 0 0 12px rgba(77, 255, 136, 0.15); border-color: rgba(77, 255, 136, 0.5); }
.sp-swatch { width: 22px; height: 22px; border-radius: 50%; }
.sp-title-mark {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1px solid var(--text-dim);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sp-reward-name { font-size: 11px; line-height: 1.3; color: var(--text); }

/* ---------------- ladder page ---------------- */

.ladder-page { max-width: 900px; margin: 0 auto; padding: 48px 32px; }
.ladder-table { display: flex; flex-direction: column; gap: 5px; }
.lt-row {
  display: grid;
  grid-template-columns: 36px 1fr 150px 64px 70px 46px;
  gap: 10px;
  align-items: center;
  padding: 9px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}
.lt-row.lt-head { background: transparent; border-color: transparent; color: var(--text-dim); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.lt-row.lt-top { border-color: rgba(245, 197, 66, 0.4); }
.lt-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) {
  .lt-row { grid-template-columns: 28px 1fr 30px 56px 56px; }
  .lt-row span:nth-child(6) { display: none; }
  /* Rank column collapses to the icon alone — the insignia stays visible. */
  .lt-row .lt-rank .rank-badge { display: none; }
  .lt-row.lt-head span:nth-child(3) { font-size: 0; }
}

/* ---------------- watch / replays ---------------- */

.watch-page { max-width: 1000px; margin: 0 auto; padding: 48px 32px; }
.replay-list { display: flex; flex-direction: column; gap: 6px; }
.replay-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-align: left;
  transition: border-color 0.15s;
}
.replay-row:hover { border-color: var(--cyan); }
.rr-names { font-weight: 600; }
.rr-score { font-family: var(--font-display); font-weight: 700; color: var(--cyan); }
.rr-date { color: var(--text-dim); font-size: 12.5px; }

.replay-viewer { margin-top: 26px; }
.rv-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.rv-head span { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: 0.5px; }
.rv-stage { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
#replay-canvas { width: 100%; display: block; }
.rv-controls { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.rv-bar {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  overflow: hidden;
}
.rv-fill { height: 100%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.rv-time { color: var(--text-dim); font-size: 12.5px; min-width: 84px; text-align: right; }

/* ---------------- tournament ---------------- */

.tourney-box {
  margin-bottom: 36px;
  padding: 20px 24px;
  border: 1px solid rgba(245, 197, 66, 0.4);
  border-radius: 12px;
  background: radial-gradient(circle at 100% 0%, rgba(245, 197, 66, 0.07), transparent 60%), var(--bg-2);
}
.tb-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: 1.5px; color: var(--gold); margin-bottom: 8px; }
.tb-info { color: var(--text); font-size: 14px; margin-bottom: 6px; }
.tb-players { color: var(--text-dim); font-size: 13px; margin-bottom: 14px; }
.tb-registered { color: #4DFF88; font-weight: 700; letter-spacing: 1.5px; font-size: 12.5px; }
.tb-bracket { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 8px; }
.tb-round { display: flex; flex-direction: column; gap: 10px; justify-content: space-around; min-width: 150px; }
.tb-round-title { font-size: 11px; letter-spacing: 2px; color: var(--text-dim); font-weight: 700; text-align: center; }
.tb-match {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-3);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.tb-match.live { border-color: var(--red); box-shadow: 0 0 10px rgba(255, 77, 94, 0.25); }
.tb-win { color: var(--gold); font-weight: 700; }
.tb-champion { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--gold); letter-spacing: 1px; }

.footer-links a { color: var(--text-dim); }
.footer-links a:hover { color: var(--cyan); }

/* ---------------- modal + toast ---------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  width: min(420px, calc(100vw - 40px));
}
.modal h3 { font-family: var(--font-display); font-size: 22px; letter-spacing: 0.6px; margin-bottom: 10px; }
.modal p { color: var(--text-dim); line-height: 1.6; font-size: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.copy-row { display: flex; gap: 8px; margin-top: 14px; }
.copy-row input {
  flex: 1;
  min-width: 0;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
}

/* onboarding: name pick + tutorial */
.onboard-backdrop { z-index: 130; }
.name-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 12px 14px;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 1px;
  margin-top: 14px;
}
.name-input:focus { outline: none; border-color: var(--cyan); }
.name-error { color: var(--red); font-size: 12.5px; min-height: 18px; margin-top: 6px; }
.modal.tutorial { width: min(480px, calc(100vw - 40px)); }
.tut-step { font-size: 11px; letter-spacing: 2px; color: var(--text-dim); font-weight: 700; margin-bottom: 8px; }
.name-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.name-current { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: 1px; margin-top: 4px; }
.name-cooldown { color: var(--text-dim); font-size: 13px; }
.btn-howto { margin-left: 12px; padding: 6px 14px; font-size: 12.5px; }

/* discord invite nudge */
.discord-nudge {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 125;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 40px);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-left: 3px solid #5865F2;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(28px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.discord-nudge.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.dn-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 0.4px; }
.dn-sub { color: var(--text-dim); font-size: 12.5px; margin-top: 2px; max-width: 220px; }
.btn-discord {
  background: #5865F2;
  border-color: transparent;
  color: #fff;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.btn-discord:hover { box-shadow: 0 0 18px rgba(88, 101, 242, 0.5); }
.dn-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.dn-close:hover { color: var(--text); }
@media (max-width: 600px) {
  .discord-nudge { right: 12px; left: 12px; bottom: 12px; }
  .dn-sub { max-width: none; }
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 18px);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 120;
  max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- responsive ---------------- */

@media (max-width: 760px) {
  .topbar { padding: 0 14px; gap: 14px; }
  .nav-toggle { display: flex; }
  /* Nav collapses into a dropdown under the bar; the burger toggles it. */
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(14, 17, 23, 0.98);
    border-bottom: 1px solid var(--line);
    padding: 6px 0;
    z-index: 60;
  }
  .topbar.nav-open .nav-links { display: flex; }
  .nav-links .nav-link {
    padding: 13px 22px;
    border-bottom: none;
    font-size: 16px;
  }
  .nav-links .nav-link.active { background: rgba(77, 225, 255, 0.08); border-left: 3px solid var(--cyan); }
  .chip-rank { display: none; }
  .hero-content { padding-top: 64px; }
  .hero { height: 72vh; }
  .section { padding: 48px 20px; }
  .player-card { width: 34%; padding: 6px 8px; }
  .pc-name { font-size: 12px; }
  .round-timer { font-size: 24px; min-width: 58px; }
  .announce { font-size: 36px; letter-spacing: 4px; }
  .kill-feed { top: 84px; }
  .exit-btn { top: 6px; right: 6px; }
}
