/* HL2DM BR — Competitive Platform Demo */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

:root {
  --hl2-orange: #ff6b1a;
  --hl2-orange-bright: #ff8c3a;
  --hl2-orange-dim: #cc4a00;
  --hl2-blue: #3d8fd9;
  --hl2-blue-dim: #1a4a7a;
  --hl2-green: #6abf4b;
  --hl2-red: #e63946;
  --hl2-yellow: #f4d03f;
  --bg-dark: #0a0c0f;
  --bg-panel: #11151a;
  --bg-panel-hover: #181e26;
  --bg-hud: rgba(10, 14, 20, 0.92);
  --border-hud: rgba(255, 107, 26, 0.35);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --text-primary: #e8eaed;
  --text-secondary: #8b95a5;
  --text-dim: #5a6478;
  --glow-orange: 0 0 20px rgba(255, 107, 26, 0.4);
  --glow-blue: 0 0 20px rgba(61, 143, 217, 0.3);
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
  --radius: 2px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

/* Custom scrollbars — HL2 HUD orange on dark track */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 107, 26, 0.5) rgba(255, 255, 255, 0.04);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.35);
  border-left: 1px solid var(--border-subtle);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 140, 58, 0.55), rgba(255, 107, 26, 0.4));
  border: 1px solid rgba(255, 107, 26, 0.35);
  border-radius: var(--radius);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--hl2-orange);
  border-color: var(--hl2-orange-bright);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scanline overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Background grid */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 107, 26, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 107, 26, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.bg-vignette {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.6) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Lambda watermark */
.lambda-watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(20rem, 40vw, 50rem);
  font-weight: 900;
  color: rgba(255, 107, 26, 0.02);
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

/* ─── Navigation ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-hud);
  border-bottom: 1px solid var(--border-hud);
  backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-img {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-lambda {
  width: 36px;
  height: 36px;
  background: var(--hl2-orange);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--bg-dark);
  box-shadow: var(--glow-orange);
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.logo-text span {
  color: var(--hl2-orange);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--hl2-orange);
  border-color: var(--border-hud);
  background: rgba(255, 107, 26, 0.05);
}

.nav-cta {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--hl2-orange);
  color: var(--bg-dark);
  border: none;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
}

.nav-cta:hover {
  background: var(--hl2-orange-bright);
  box-shadow: var(--glow-orange);
}

.nav-auth {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 8.5rem;
  min-height: 2.5rem;
}

.nav-auth--pending:not(.nav-auth--ready) {
  opacity: 0;
  pointer-events: none;
}

.nav-auth--ready {
  opacity: 1;
  pointer-events: auto;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nav-user-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  min-width: 0;
}

.nav-user-link:hover .nav-user-name {
  color: var(--hl2-orange);
}

.nav-user-avatar {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-hud);
  object-fit: cover;
  flex-shrink: 0;
}

.nav-user-avatar--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 107, 26, 0.12);
  color: var(--hl2-orange);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
}

.nav-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-logout {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  transition: var(--transition);
}

.nav-admin {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.7rem;
  transition: var(--transition);
}

.nav-admin:hover {
  color: var(--hl2-orange);
  border-color: var(--border-hud);
}

.nav-logout:hover {
  color: var(--hl2-orange);
  border-color: var(--border-hud);
}

.auth-error-banner {
  position: fixed;
  top: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: rgba(230, 57, 70, 0.95);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.9rem;
  max-width: min(92vw, 520px);
  text-align: center;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-hud);
  color: var(--hl2-orange);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 1.2rem;
}

/* ─── HUD Corner decorations ─── */
.hud-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--hl2-orange);
  border-style: solid;
  opacity: 0.6;
}

.hud-corner--tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.hud-corner--tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.hud-corner--bl { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.hud-corner--br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

/* ─── Main layout ─── */
main {
  position: relative;
  z-index: 1;
  padding-top: 64px;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hl2-orange);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--hl2-orange);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  font-weight: 400;
}

/* ─── Hero ─── */
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60%;
  height: 100%;
  background: radial-gradient(ellipse at 70% 50%, rgba(255, 107, 26, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero-live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.hero-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hl2-green);
  opacity: 0.9;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--hl2-green);
  border: 1px solid rgba(106, 191, 75, 0.3);
  background: rgba(106, 191, 75, 0.08);
  padding: 0.4rem 0.85rem;
  margin-bottom: 1.5rem;
}

.hero-badge .pulse {
  width: 6px;
  height: 6px;
  background: var(--hl2-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(106, 191, 75, 0.6); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(106, 191, 75, 0); }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero h1 .accent {
  color: var(--hl2-orange);
  display: block;
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin-bottom: 2.5rem;
  font-weight: 400;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.btn {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.85rem 1.75rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-primary {
  background: var(--hl2-orange);
  color: var(--bg-dark);
}

.btn-primary:hover {
  background: var(--hl2-orange-bright);
  box-shadow: var(--glow-orange);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-hud);
}

.btn-secondary:hover {
  border-color: var(--hl2-orange);
  color: var(--hl2-orange);
  background: rgba(255, 107, 26, 0.05);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
}

.hero-stat {
  position: relative;
}

.hero-stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--hl2-orange);
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
}

/* Hero visual — soft oval blob, no visible rectangle */
.hero-visual {
  position: absolute;
  inset: 8% 0 8% auto;
  width: min(46%, 540px);
  pointer-events: none;
  z-index: 1;
}

.hero-bg-frame {
  position: absolute;
  inset: 0;
  /* Ellipse dies out inside the box — corners stay empty */
  mask-image: radial-gradient(
    ellipse 58% 58% at 58% 54%,
    #000 0%,
    rgba(0, 0, 0, 0.85) 28%,
    rgba(0, 0, 0, 0.4) 52%,
    rgba(0, 0, 0, 0.08) 74%,
    transparent 90%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 58% 58% at 58% 54%,
    #000 0%,
    rgba(0, 0, 0, 0.85) 28%,
    rgba(0, 0, 0, 0.4) 52%,
    rgba(0, 0, 0, 0.08) 74%,
    transparent 90%
  );
}

.hero-bg-frame::after {
  display: none;
}

.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 58%;
  opacity: 0.5;
}

@media (max-width: 960px) {
  .hero-visual {
    width: min(55%, 420px);
    inset: 14% 0 14% auto;
    opacity: 0.85;
  }
}

/* ─── Stats bar ─── */
.stats-bar {
  background: var(--bg-panel);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 2rem 0;
}

.stats-bar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.stat-card {
  text-align: center;
  position: relative;
}

.stat-card:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: var(--border-subtle);
}

.stat-card-value {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-card-value span {
  color: var(--hl2-orange);
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
}

/* ─── Features ─── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.feature-card {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  padding: 2rem 1.5rem;
  transition: var(--transition);
}

.feature-card:hover {
  border-color: var(--border-hud);
  background: var(--bg-panel-hover);
  transform: translateY(-2px);
}

.feature-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  border: 0;
  background: transparent;
  padding: 0;
}

.feature-icon-img {
  width: 56px;
  height: 56px;
  display: block;
  object-fit: contain;
  image-rendering: auto;
}

.feature-card:hover .feature-icon-img {
  filter: brightness(1.08);
}

/* Legacy mask glyphs (unused on home; kept for safety) */
.feature-icon__glyph {
  display: block;
  width: 24px;
  height: 24px;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.feature-icon__glyph--matchmaking {
  -webkit-mask-image: url('/images/icons/matchmaking.svg');
  mask-image: url('/images/icons/matchmaking.svg');
}

.feature-icon__glyph--stats {
  -webkit-mask-image: url('/images/icons/stats.svg');
  mask-image: url('/images/icons/stats.svg');
}

.feature-icon__glyph--levels {
  -webkit-mask-image: url('/images/icons/levels.svg');
  mask-image: url('/images/icons/levels.svg');
}

.feature-icon__glyph--servers {
  -webkit-mask-image: url('/images/icons/servers.svg');
  mask-image: url('/images/icons/servers.svg');
}

.feature-icon__glyph--tournaments {
  -webkit-mask-image: url('/images/icons/tournaments.svg');
  mask-image: url('/images/icons/tournaments.svg');
}

.feature-icon__glyph--integration {
  -webkit-mask-image: url('/images/icons/integration.svg');
  mask-image: url('/images/icons/integration.svg');
}

.feature-card:hover .feature-icon:not(:has(.feature-icon-img)) {
  color: var(--hl2-orange-bright);
  border-color: var(--hl2-orange);
  box-shadow: var(--glow-orange);
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ─── Level system preview ─── */
.levels-preview {
  margin-top: 3rem;
}

.levels-track {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--hl2-orange) var(--bg-panel);
}

.level-pip {
  flex-shrink: 0;
  width: 100px;
  text-align: center;
  position: relative;
}

.level-pip-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 0.75rem;
  position: relative;
  overflow: hidden;
}

.level-pip-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--pip-color, var(--hl2-orange));
  transform: scaleX(var(--pip-fill, 0));
  transform-origin: left;
  transition: transform 0.6s ease;
}

.level-pip-num {
  display: flex;
  justify-content: center;
  margin: 0.35rem 0;
}

.level-pip-name {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  line-height: 1.3;
  text-align: center;
}

.level-pip.active .level-pip-name { color: var(--text-primary); font-weight: 600; }

/* ─── Top players preview (homepage) ─── */
.players-preview {
  margin-top: 3rem;
}

.players-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.players-preview-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.demo-server-filter {
  margin-bottom: 0.85rem;
}

.demo-server-filter .server-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.demo-server-filter .server-filter-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.demo-server-filter .filter-select {
  width: 100%;
  box-sizing: border-box;
}

.player-row {
  display: grid;
  grid-template-columns: 48px 1fr 120px 80px 80px 80px 100px;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.5rem;
  transition: var(--transition);
  cursor: pointer;
}

.player-row:hover {
  border-color: var(--border-hud);
  background: var(--bg-panel-hover);
}

.player-row.header {
  background: transparent;
  border: none;
  cursor: default;
  padding: 0.5rem 1rem;
  margin-bottom: 0.25rem;
}

.player-row.header:hover {
  background: transparent;
  border: none;
}

.player-row.header span {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.player-rank {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
}

.player-rank.gold { color: #ffd700; }
.player-rank.silver { color: #c0c0c0; }
.player-rank.bronze { color: #cd7f32; }

.player-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.player-avatar {
  width: 36px;
  height: 36px;
  background: var(--bg-dark);
  border: 1px solid var(--border-hud);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--hl2-orange);
  flex-shrink: 0;
  overflow: hidden;
}

.player-avatar img,
.podium-avatar img,
.modal-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.player-avatar img {
  filter: contrast(1.05) saturate(1.05);
}

.podium-avatar img,
.modal-avatar img {
  filter: contrast(1.05) saturate(1.05);
}

.player-name {
  font-weight: 600;
  font-size: 1rem;
}

.player-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

.level-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.level-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1;
  border: 2px solid var(--level-color, #888);
  color: var(--level-color, #888);
  background: color-mix(in srgb, var(--level-color, #888) 16%, rgba(0, 0, 0, 0.35));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  vertical-align: middle;
}

.level-circle--sm {
  width: 26px;
  height: 26px;
  font-size: 0.7rem;
  border-width: 2px;
}

.level-circle--md {
  width: 32px;
  height: 32px;
  font-size: 0.82rem;
}

.level-circle--lg {
  width: 40px;
  height: 40px;
  font-size: 1rem;
  border-width: 2.5px;
}

.level-circle--xl {
  width: 48px;
  height: 48px;
  font-size: 1.15rem;
  border-width: 3px;
}

.player-stat {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.player-stat.kd-high { color: var(--hl2-green); }
.player-stat.kd-mid { color: var(--hl2-yellow); }
.player-stat.kd-low { color: var(--hl2-red); }

.player-elo {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--hl2-orange);
  text-align: center;
}

/* ─── CTA Banner ─── */
.cta-banner {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 107, 26, 0.12) 0%, rgba(61, 143, 217, 0.08) 100%);
  border: 1px solid var(--border-hud);
  padding: 3rem;
  text-align: center;
  margin: 2rem 0;
}

.cta-banner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.cta-banner p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0 2rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 1rem;
  max-width: 280px;
  line-height: 1.6;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--hl2-orange);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--hl2-orange);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════
   PLAYERS PAGE
   ═══════════════════════════════════════ */

.page-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-header p {
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-size: 1.05rem;
}

/* Filters */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.filter-select,
.filter-input {
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  outline: none;
  transition: var(--transition);
}

.filter-select:focus,
.filter-input:focus {
  border-color: var(--hl2-orange);
}

.filter-tabs {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.filter-tab {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.filter-tab:hover,
.filter-tab.active {
  border-color: var(--hl2-orange);
  color: var(--hl2-orange);
  background: rgba(255, 107, 26, 0.05);
}

/* Podium */
.podium {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 1rem;
  align-items: end;
  padding: 2.5rem 0;
  max-width: 800px;
  margin: 0 auto;
}

.podium-slot {
  text-align: center;
  position: relative;
}

.podium-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem 1rem;
  position: relative;
  transition: var(--transition);
}

.podium-slot:hover .podium-card {
  border-color: var(--border-hud);
  transform: translateY(-4px);
}

.podium-slot--1 .podium-card {
  border-color: rgba(255, 215, 0, 0.4);
  padding: 2rem 1rem;
}

.podium-slot--1 .podium-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.podium-rank {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 0.75rem;
}

.podium-slot--1 .podium-rank { color: #ffd700; font-size: 2.5rem; }
.podium-slot--2 .podium-rank { color: #c0c0c0; }
.podium-slot--3 .podium-rank { color: #cd7f32; }

.podium-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.75rem;
  background: var(--bg-dark);
  border: 2px solid var(--border-hud);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--hl2-orange);
}

.podium-slot--1 .podium-avatar {
  width: 80px;
  height: 80px;
  font-size: 1.5rem;
  border-color: rgba(255, 215, 0, 0.5);
}

.podium-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.podium-level {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.podium-stats {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
}

.podium-stat {
  text-align: center;
}

.podium-stat-value {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.podium-stat-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.podium-elo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--hl2-orange);
  margin-top: 0.75rem;
}

/* Full leaderboard table */
.leaderboard {
  margin-top: 1rem;
}

.leaderboard-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table thead th {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: var(--transition);
}

.leaderboard-table thead th:hover {
  color: var(--hl2-orange);
}

.leaderboard-table thead th.sorted {
  color: var(--hl2-orange);
}

.leaderboard-table thead th .sort-icon {
  margin-left: 0.25rem;
  opacity: 0.4;
}

.leaderboard-table thead th.sorted .sort-icon {
  opacity: 1;
}

.leaderboard-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition);
  cursor: pointer;
}

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

.leaderboard-table tbody td {
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  vertical-align: middle;
}

.td-rank {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  width: 48px;
  text-align: center;
}

.td-player {
  min-width: 200px;
}

.td-stat {
  font-family: var(--font-display);
  font-weight: 600;
  text-align: center;
}

.td-elo {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--hl2-orange);
}

.td-level {
  white-space: nowrap;
  text-align: center;
}

.level-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.winrate-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.winrate-track {
  width: 60px;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.winrate-fill {
  height: 100%;
  background: var(--hl2-green);
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--hl2-green);
  font-weight: 600;
}

.streak-badge.cold {
  color: var(--hl2-red);
}

/* Level legend */
.level-legend {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
}

.level-legend h3 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.level-legend-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.legend-item:hover {
  border-color: var(--border-hud);
}

.legend-num {
  flex-shrink: 0;
}

.legend-info {
  flex: 1;
}

.legend-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.legend-range {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Player modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-hud);
  max-width: min(1120px, 96vw);
  width: 100%;
  max-height: 92vh;
  overflow: hidden;
  position: relative;
  transform: translateY(20px);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
  z-index: 2;
}

.modal-close:hover {
  border-color: var(--hl2-orange);
  color: var(--hl2-orange);
}

.modal-header {
  padding: 1.25rem 2rem;
  display: flex;
  gap: 1.25rem;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(135deg, rgba(255, 107, 26, 0.06) 0%, transparent 60%);
  flex-shrink: 0;
}

.modal-avatar {
  width: 72px;
  height: 72px;
  background: var(--bg-dark);
  border: 2px solid var(--border-hud);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--hl2-orange);
  flex-shrink: 0;
}

.modal-player-name {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.modal-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-col {
  padding: 1.25rem 1.75rem 1.75rem;
  overflow-y: auto;
  min-height: 0;
}

.modal-col--stats {
  border-right: 1px solid var(--border-subtle);
}

@media (min-width: 900px) {
  .modal-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.modal-body {
  padding: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.player-level-col {
  display: flex;
  justify-content: center;
  align-items: center;
}

.player-row.header .player-level-col {
  text-align: center;
}

.modal-player-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.modal-playtime-servers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.45rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  opacity: 0.9;
}

.modal-playtime-server {
  white-space: nowrap;
}

.modal-level-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.modal-stat-box {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 0.5rem;
  text-align: center;
}

.modal-stat-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
}

.modal-stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

.modal-section-title {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hl2-orange);
  margin-bottom: 0.75rem;
}

.modal-weapons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.modal-weapon {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.modal-weapon.primary {
  border-color: var(--hl2-orange);
  color: var(--hl2-orange);
}

.modal-weapon-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.modal-weapon-row {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.modal-weapon-row--fav {
  border-color: rgba(255, 107, 26, 0.35);
}

.modal-weapon-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.modal-weapon-row-name {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 600;
}

.modal-weapon-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* HUD weapon silhouettes from hud.ttf (HPH_HUD_WeaponIcons) */
.weapon-hud-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'HL2HudIcons', sans-serif;
  font-size: 1.55rem;
  line-height: 1;
  height: 1em;
  min-width: 1.6rem;
  color: #ff8000;
  speak: never;
}

.modal-weapon-row-kills {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.modal-weapon-row-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 1px;
  overflow: hidden;
}

.modal-weapon-row-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hl2-orange-dim), var(--hl2-orange));
  min-width: 2px;
}

.modal-weapon-row--fav .modal-weapon-row-fill {
  background: linear-gradient(90deg, var(--hl2-orange), var(--hl2-orange-bright));
}

.modal-weapon-row-meta {
  margin-top: 0.25rem;
  font-size: 0.68rem;
  color: var(--text-dim);
}

.modal-recent {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.modal-match-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.5rem;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.modal-match-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  background: var(--bg-panel);
  transition: border-color var(--transition), background var(--transition);
}

.modal-match-card:hover {
  border-color: var(--border-hud);
  background: var(--bg-panel-hover);
}

.modal-match-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.modal-match-map {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.modal-match-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}

.modal-match-result,
.modal-match-status {
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.35rem;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.modal-match-result.is-win,
.modal-match-result.is-gold {
  color: var(--hl2-green);
  border-color: rgba(106, 191, 75, 0.4);
  background: rgba(106, 191, 75, 0.1);
}

.modal-match-result.is-loss {
  color: var(--hl2-red);
  border-color: rgba(230, 57, 70, 0.4);
  background: rgba(230, 57, 70, 0.1);
}

.modal-match-result.is-silver {
  color: #c8d0dc;
  border-color: rgba(200, 208, 220, 0.3);
}

.modal-match-result.is-bronze {
  color: #c9855a;
  border-color: rgba(201, 133, 90, 0.35);
}

.modal-match-status.is-mode {
  color: var(--hl2-orange);
  border-color: rgba(255, 107, 26, 0.35);
  background: rgba(255, 107, 26, 0.08);
}

.modal-match-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 0.75rem;
  font-size: 0.8rem;
}

.modal-match-kd {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.modal-match-kd .modal-match-sep {
  margin: 0 0.15rem;
  color: var(--text-dim);
  font-weight: 500;
}

.modal-match-kd.is-good { color: var(--hl2-green); }
.modal-match-kd.is-ok { color: var(--hl2-yellow); }
.modal-match-kd.is-bad { color: var(--hl2-red); }

.modal-match-ratio,
.modal-match-dur,
.modal-match-players {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.modal-match-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.modal-match-teams {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.modal-match-team.is-combine {
  color: var(--hl2-blue);
}

.modal-match-team.is-rebels {
  color: var(--hl2-red);
}

.modal-match-team-sep {
  color: var(--text-dim);
  font-weight: 500;
}

.modal-match-winner {
  color: var(--text-secondary);
}

/* legacy row kept for safety */
.modal-match-row {
  display: none;
}

.form-dot {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
}

.form-dot.win {
  background: rgba(106, 191, 75, 0.15);
  border-color: rgba(106, 191, 75, 0.4);
  color: var(--hl2-green);
}

.form-dot.loss {
  background: rgba(230, 57, 70, 0.15);
  border-color: rgba(230, 57, 70, 0.4);
  color: var(--hl2-red);
}

/* ─── Servers page ─── */
.servers-list {
  padding: 0.5rem 0 2.5rem;
}

.servers-status {
  color: var(--text-secondary);
  padding: 2rem 0;
}

.servers-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.server-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.15rem 1.25rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.server-row:hover {
  border-color: rgba(255, 107, 26, 0.35);
  background: var(--bg-panel-hover);
}

.server-row-main {
  min-width: 0;
  flex: 1;
}

.server-row-name {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.server-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.75rem;
}

.server-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.server-meta-label {
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.server-meta-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  word-break: break-word;
}

.server-host {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.server-players.is-open { color: var(--hl2-green); }
.server-players.is-busy { color: var(--hl2-orange); }
.server-players.is-full { color: var(--hl2-red); }

.server-connect {
  flex-shrink: 0;
  text-decoration: none;
}

@media (max-width: 720px) {
  .server-row {
    flex-direction: column;
    align-items: stretch;
  }

  .server-connect {
    text-align: center;
  }
}

/* ─── Awards page ─── */
.awards-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.awards-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.awards-loading,
.awards-error {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.awards-section {
  margin-bottom: 2.5rem;
}

.medal-legend {
  margin-top: 3rem;
}

.medal-legend-desc {
  color: var(--text-secondary);
  margin: -0.5rem 0 1.5rem;
  line-height: 1.65;
  max-width: 760px;
  font-size: 0.95rem;
}

.medal-legend-grid {
  grid-template-columns: repeat(4, 1fr);
}

.medal-legend-icon img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}

.medal-legend-item .legend-range + .legend-range {
  margin-top: 0.15rem;
}

.awards-section-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hl2-orange);
  margin-bottom: 1rem;
}

.awards-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.award-card {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
}

.award-card-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.award-card-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.award-winner-col {
  text-align: center;
}

.award-col-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}

.award-icon-wrap {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.35rem;
}

.award-icon {
  max-height: 44px;
  max-width: 64px;
  object-fit: contain;
}

.award-winner-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hl2-blue);
  text-decoration: none;
}

.award-winner-name:hover {
  color: var(--hl2-orange);
}

.award-winner-count {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.award-winner-empty {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ─── Modal awards / ribbons ─── */
.modal-ribbons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-ribbon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.modal-award-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.modal-section-title + .modal-section-title,
.modal-weapon-stats + .modal-section-title,
.modal-ribbons + .modal-section-title,
.modal-award-list + .modal-section-title {
  margin-top: 1rem;
}

.modal-empty {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0;
}

.modal-award-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.modal-award-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.modal-award-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.modal-award-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ─── Demo viewer ─── */
.demo-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 4rem;
}

.demo-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 5.5rem;
}

.demo-list-wrap {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 0.85rem 0.75rem;
}

.demo-list-title {
  font-family: var(--font-display);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--hl2-orange);
  margin: 0 0 0.65rem;
}

.demo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: min(70vh, 640px);
  overflow-y: auto;
}

.demo-list-empty {
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 0.5rem 0;
}

.demo-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.65rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.015);
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  transition: border-color var(--transition), background var(--transition);
}

.demo-card:hover {
  background: var(--bg-panel-hover);
  border-color: rgba(255, 107, 26, 0.25);
}

.demo-card.is-active {
  background: rgba(255, 107, 26, 0.08);
  border-color: var(--border-hud);
  box-shadow: inset 2px 0 0 var(--hl2-orange);
}

.demo-card:disabled,
.demo-list.is-loading .demo-card {
  cursor: wait;
  opacity: 0.55;
  pointer-events: none;
}

.demo-card.is-loading {
  opacity: 1;
  border-color: rgba(255, 107, 26, 0.45);
  background: rgba(255, 107, 26, 0.06);
}

.demo-card-badge.is-loading {
  color: var(--hl2-orange);
  border-color: rgba(255, 107, 26, 0.45);
  background: rgba(255, 107, 26, 0.1);
  animation: demo-loading-blink 1s ease-in-out infinite;
}

.demo-card.is-archived {
  opacity: 0.88;
}

.demo-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.demo-card-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.demo-card-map {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-card-when {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.demo-card-badge {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.18rem 0.4rem;
  border: 1px solid var(--border-subtle);
}

.demo-card-badge.is-live {
  color: var(--hl2-green);
  border-color: rgba(106, 191, 75, 0.4);
  background: rgba(106, 191, 75, 0.08);
}

.demo-card-badge.is-archived {
  color: var(--text-dim);
}

.demo-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.demo-card-chip {
  font-size: 0.68rem;
  color: var(--text-secondary);
  padding: 0.12rem 0.35rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
}

.demo-card-chip.is-mode {
  color: var(--hl2-orange);
  border-color: rgba(255, 107, 26, 0.35);
  background: rgba(255, 107, 26, 0.08);
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.demo-card-podium {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border-top: 1px solid var(--border-subtle);
}

.demo-card-podium.is-empty {
  font-size: 0.72rem;
  color: var(--text-dim);
  border-top: none;
  padding-top: 0;
}

.demo-card-podium-row {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.78rem;
}

.demo-card-place {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-dim);
}

.demo-card-podium-row.is-gold .demo-card-place { color: var(--hl2-yellow); }
.demo-card-podium-row.is-silver .demo-card-place { color: #c8d0dc; }
.demo-card-podium-row.is-bronze .demo-card-place { color: #c9855a; }

.demo-card-player {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.demo-card-score {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.demo-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
}

.demo-pager-btn {
  box-sizing: border-box;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-hud);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.demo-pager-btn:hover:not(:disabled) {
  border-color: var(--hl2-orange);
  color: var(--hl2-orange);
  background: rgba(255, 107, 26, 0.08);
}

.demo-pager-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.demo-pager-label {
  font-family: var(--font-display);
  font-size: 0.68rem;
  color: var(--text-dim);
  min-width: 3.5rem;
  text-align: center;
  letter-spacing: 0.04em;
  line-height: 2rem;
}

.demo-unavailable {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.72);
  z-index: 2;
}

.demo-unavailable[hidden] {
  display: none !important;
}

.demo-unavailable-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.demo-unavailable-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.demo-stage {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
}

.demo-stage-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.demo-map-name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--hl2-orange);
}

.demo-meta-chip {
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.demo-meta-chip--warn {
  color: var(--hl2-orange);
  background: rgba(255, 107, 26, 0.1);
}

a.demo-download-chip {
  text-decoration: none;
  color: var(--hl2-orange);
  border: 1px solid rgba(255, 107, 26, 0.4);
  background: rgba(255, 107, 26, 0.08);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

a.demo-download-chip:hover {
  background: rgba(255, 107, 26, 0.16);
  border-color: var(--hl2-orange);
}

@font-face {
  font-family: 'HL2MPDeath';
  src: url('/fonts/hl2mp.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'HL2DeathIcons';
  src: url('/fonts/death.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'HL2HudIcons';
  src: url('/fonts/hud.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.demo-canvas-wrap {
  position: relative;
  background: #06090e;
}

.demo-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}

.demo-canvas-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  pointer-events: none;
}

.demo-canvas-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background: rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(2px);
  pointer-events: all;
}

.demo-canvas-loading[hidden] {
  display: none;
}

.demo-loading-pulse {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--hl2-orange);
  box-shadow: 0 0 0 0 rgba(255, 107, 26, 0.55);
  animation: demo-loading-pulse 1.1s ease-out infinite;
}

.demo-loading-text {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
}

@keyframes demo-loading-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 107, 26, 0.5); transform: scale(1); }
  70% { box-shadow: 0 0 0 14px rgba(255, 107, 26, 0); transform: scale(1.05); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 26, 0); transform: scale(1); }
}

@keyframes demo-loading-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.demo-killfeed {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.28rem;
  max-width: min(420px, 58%);
  pointer-events: none;
}

.demo-killfeed-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.5rem;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f2f2f2;
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  opacity: var(--killfeed-opacity, 1);
  transition: opacity 0.15s linear;
}

.demo-killfeed-name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9.5rem;
  color: #f2f2f2;
}

.demo-killfeed-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'HL2MPDeath', sans-serif;
  font-size: 1.35rem;
  line-height: 1;
  height: 1em;
  /* Classic HL2 death-notice weapon orange */
  color: #ff8000;
  min-width: 1.35rem;
  text-align: center;
  speak: never;
  /* HL2MP death glyphs sit high in the em-box — nudge to optical center vs names */
  transform: translateY(0.32em);
}

.demo-killfeed-icon.is-fallback {
  font-family: inherit;
  font-size: 0.72rem;
  height: auto;
  color: #ff8000;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transform: none;
}

.demo-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border-subtle);
}

.demo-btn {
  box-sizing: border-box;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-hud);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.demo-btn:hover {
  border-color: var(--hl2-orange);
  color: var(--hl2-orange);
  background: rgba(255, 107, 26, 0.08);
}

.demo-scrubber-wrap {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  min-width: 0;
  min-height: 2.5rem;
}

.demo-death-markers {
  position: relative;
  width: 100%;
  height: 0.95rem;
  pointer-events: none;
  z-index: 1;
}

.demo-death-marker {
  position: absolute;
  top: 0;
  width: 1rem;
  height: 0.95rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translateX(-50%);
  cursor: pointer;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0.85;
}

.demo-death-skull {
  font-family: 'HL2DeathIcons', sans-serif;
  font-size: 0.95rem;
  line-height: 1;
  color: #e8eaed;
  filter: none;
  pointer-events: none;
  user-select: none;
  speak: never;
}

/* TDM: tint skull by victim team (Combine blue / Rebels red). */
.demo-death-marker.is-combine .demo-death-skull {
  filter: grayscale(1) sepia(1) saturate(8) hue-rotate(180deg) brightness(0.95) contrast(1.1);
}

.demo-death-marker.is-rebels .demo-death-skull {
  filter: grayscale(1) sepia(1) saturate(10) hue-rotate(-50deg) brightness(0.95) contrast(1.1);
}

.demo-death-marker:hover,
.demo-death-marker.is-active {
  opacity: 1;
  z-index: 2;
}

.demo-death-marker:hover .demo-death-skull,
.demo-death-marker.is-active .demo-death-skull {
  font-size: 1.1rem;
}

.demo-death-marker:not(.is-combine):not(.is-rebels):hover .demo-death-skull,
.demo-death-marker:not(.is-combine):not(.is-rebels).is-active .demo-death-skull {
  filter: none;
}

.demo-death-marker.is-combine:hover .demo-death-skull,
.demo-death-marker.is-combine.is-active .demo-death-skull {
  filter: grayscale(1) sepia(1) saturate(10) hue-rotate(180deg) brightness(1.05) contrast(1.15);
}

.demo-death-marker.is-rebels:hover .demo-death-skull,
.demo-death-marker.is-rebels.is-active .demo-death-skull {
  filter: grayscale(1) sepia(1) saturate(12) hue-rotate(-50deg) brightness(1.05) contrast(1.15);
}

.demo-scrubber {
  position: relative;
  z-index: 0;
  width: 100%;
  flex: 0 0 auto;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--hl2-orange);
}

.demo-time {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  line-height: 2.25rem;
  min-width: 17ch;
  text-align: right;
  white-space: nowrap;
  box-sizing: content-box;
}

.demo-presence {
  border-top: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem 1rem;
}

.demo-presence-title {
  margin: 0 0 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.demo-presence-count {
  color: var(--text-muted);
  font-weight: 500;
}

.demo-presence-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 160px;
  overflow: auto;
}

.demo-presence-item {
  width: 100%;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0.65rem;
  align-items: center;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.45rem 0.55rem;
  color: inherit;
  cursor: pointer;
}

.demo-presence-item:hover,
.demo-presence-item.is-active {
  border-color: rgba(100, 180, 255, 0.35);
  background: rgba(100, 180, 255, 0.08);
}

.demo-presence-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.demo-presence-text {
  font-size: 0.84rem;
  color: var(--text);
}

.demo-presence-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
}

.demo-presence-tag.is-join {
  color: #8dffb0;
  background: rgba(80, 200, 120, 0.12);
}

.demo-presence-tag.is-leave {
  color: #ffb0a0;
  background: rgba(220, 90, 70, 0.12);
}

.demo-chat {
  border-top: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem 1rem;
}

.demo-chat-title {
  margin: 0 0 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.demo-chat-count {
  color: var(--text-muted);
  font-weight: 500;
}

.demo-chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 220px;
  overflow: auto;
}

.demo-chat-item {
  width: 100%;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0.65rem;
  align-items: start;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.45rem 0.55rem;
  color: inherit;
  cursor: pointer;
}

.demo-chat-item:hover,
.demo-chat-item.is-active {
  border-color: rgba(255, 170, 0, 0.35);
  background: rgba(255, 170, 0, 0.08);
}

.demo-chat-time {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  padding-top: 0.1rem;
}

.demo-chat-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.demo-chat-name {
  font-size: 0.78rem;
  font-weight: 700;
}

.demo-chat-tag {
  display: inline-block;
  width: fit-content;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
}

.demo-chat-tag.is-server {
  color: #f0c060;
  background: rgba(255, 170, 0, 0.12);
}

.demo-chat-text {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

.demo-voice {
  border-top: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem 1rem;
}

.demo-voice-title {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.demo-voice-count {
  color: var(--text-muted);
  font-weight: 500;
}

.demo-voice-hint {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.demo-voice-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 280px;
  overflow: auto;
}

.demo-voice-item {
  width: 100%;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0.65rem;
  align-items: start;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.45rem 0.55rem;
  color: inherit;
}

.demo-voice-item:hover,
.demo-voice-item.is-active {
  border-color: rgba(90, 180, 255, 0.35);
  background: rgba(90, 180, 255, 0.08);
}

.demo-voice-item.is-playing {
  border-color: rgba(90, 180, 255, 0.55);
  background: rgba(90, 180, 255, 0.12);
}

.demo-voice-time {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  padding-top: 0.1rem;
}

.demo-voice-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.demo-voice-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.65rem;
  min-width: 0;
}

.demo-voice-name {
  font-size: 0.78rem;
  font-weight: 700;
}

.demo-voice-duration {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.demo-voice-seek {
  border: 0;
  background: transparent;
  color: var(--hl2-orange);
  font-size: 0.7rem;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.demo-voice-seek:hover {
  color: #ffc04d;
}

.demo-voice-player {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.demo-voice-player .demo-voice-play {
  width: 1.85rem;
  height: 1.85rem;
  min-width: 1.85rem;
  font-size: 0.72rem;
}

.demo-voice-scrub {
  flex: 1;
  min-width: 0;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--hl2-orange);
  cursor: pointer;
}

.demo-voice-audio {
  display: none;
}

.demo-players {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.4rem;
  padding: 0.55rem 0.85rem 0.7rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.22);
}

.demo-players:empty {
  display: none;
}

.demo-players-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  grid-column: 1 / -1;
}

.demo-player-card {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.35rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
}

.demo-player-card.is-dead {
  opacity: 0.72;
}

.demo-player-dead {
  font-family: 'HL2DeathIcons', sans-serif;
  color: #ccc;
  font-size: 0.95em;
  speak: never;
}

.demo-player-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.demo-player-name {
  font-size: 0.82rem;
  font-weight: 600;
}

.demo-player-info {
  flex: 1;
  min-width: 0;
}

.demo-player-hp {
  margin-top: 0.35rem;
  height: 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.demo-player-hp-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: #2ecc71;
}

.demo-player-card.is-dead .demo-player-hp-fill {
  width: 0 !important;
}

.demo-scoreboard {
  border-top: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem 1rem;
}

.demo-scoreboard-title {
  margin: 0 0 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.demo-scoreboard-table-wrap {
  overflow-x: auto;
}

.demo-scoreboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.demo-scoreboard-table thead th {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: left;
  padding: 0.35rem 0.55rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.demo-scoreboard-table thead th:nth-child(n+3),
.demo-scoreboard-table tbody td:nth-child(n+3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  width: 3.2rem;
}

.demo-scoreboard-table thead th:first-child,
.demo-scoreboard-table tbody td:first-child {
  width: 2rem;
  text-align: right;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.demo-scoreboard-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.demo-scoreboard-table tbody td {
  padding: 0.4rem 0.55rem;
  vertical-align: middle;
}

.demo-scoreboard-name {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

.demo-scoreboard-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.demo-scoreboard-kills {
  font-weight: 700;
  color: var(--hl2-orange);
}

.demo-scoreboard-kd {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.demo-scoreboard-ping {
  color: var(--text-dim);
}

.demo-scoreboard-content {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.demo-scoreboard-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.demo-scoreboard-team {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.demo-scoreboard-team[data-team="2"] {
  color: #93c5fd;
}

.demo-scoreboard-team[data-team="3"] {
  color: #fca5a5;
}

.demo-scoreboard-team-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.demo-scoreboard-team-name {
  flex: 1;
}

.demo-scoreboard-team-total {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.85;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .hero-visual { display: none; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .level-legend-grid { grid-template-columns: repeat(3, 1fr); }
  .stats-bar-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card:nth-child(2)::after { display: none; }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-hud);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border-hud);
  }

  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }

  .nav-auth .nav-cta {
    padding: 0.5rem 0.75rem;
    font-size: 0.62rem;
  }

  .nav-user-name { display: none; }

  .features-grid { grid-template-columns: 1fr; }
  .player-row {
    grid-template-columns: 36px 1fr 60px;
    font-size: 0.85rem;
  }
  .player-row .hide-mobile { display: none; }
  .podium { grid-template-columns: 1fr; max-width: 320px; }
  .podium-slot--1 { order: -1; }
  .level-legend-grid { grid-template-columns: repeat(2, 1fr); }
  .medal-legend-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .filter-tabs { margin-left: 0; width: 100%; }
  .modal-layout {
    grid-template-columns: 1fr;
  }

  .modal-col--stats {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .modal-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-weapon-stats { grid-template-columns: 1fr; }
  .modal { max-height: 96vh; }
  .leaderboard-table { display: block; overflow-x: auto; }
  .demo-layout { grid-template-columns: 1fr; }
  .demo-sidebar { order: 2; }
}

/* —— Admin —— */
.admin-gate {
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.admin-gate a {
  color: var(--hl2-orange);
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.admin-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.25);
  transition: var(--transition);
}

.admin-card:hover {
  border-color: var(--border-hud);
  color: inherit;
}

.admin-card-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hl2-orange);
  margin-bottom: 0.5rem;
}

.admin-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0 1.25rem;
  flex-wrap: wrap;
}

.admin-status {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.admin-status.is-error {
  color: #e63946;
}

.admin-form-card {
  border: 1px solid var(--border-subtle);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  background: rgba(0, 0, 0, 0.25);
}

.admin-form-card h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem 1rem;
}

.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.admin-form input {
  font: inherit;
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  padding: 0.55rem 0.65rem;
}

.admin-form input:focus {
  outline: none;
  border-color: var(--border-hud);
}

.admin-form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.25rem;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.admin-table th {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.3);
}

.admin-table code {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.admin-mod-input {
  width: 6rem;
  font: inherit;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.5rem;
}

.admin-mod-input:focus {
  outline: none;
  border-color: var(--border-hud);
}

.admin-form select {
  font: inherit;
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  padding: 0.55rem 0.65rem;
}

.admin-form--users {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.admin-perm-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-top: 0.25rem;
}

.admin-perm-page {
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 0.85rem;
  background: rgba(0, 0, 0, 0.2);
}

.admin-perm-page-title {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hl2-orange);
  margin-bottom: 0.55rem;
}

.admin-perm-checks {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-perm-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-primary);
  cursor: pointer;
}

.admin-perm-grid.is-locked {
  opacity: 0.65;
}

.admin-perm-summary {
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: 280px;
}

.admin-form-span {
  grid-column: 1 / -1;
}

.admin-form textarea {
  width: 100%;
  min-height: 10rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.admin-form textarea:focus {
  outline: none;
  border-color: rgba(255, 107, 26, 0.55);
}

.admin-form--community {
  grid-template-columns: 1fr;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.admin-link-btn {
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--hl2-orange);
  font-family: inherit;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}

.admin-link-btn:hover {
  border-color: rgba(255, 107, 26, 0.45);
  background: rgba(255, 107, 26, 0.08);
}

.admin-link-btn.is-danger {
  color: #ff8a7a;
}

/* ─── Community announcements ─── */
.community-compose {
  margin-bottom: 1.5rem;
  padding: 1rem 1.1rem 1.15rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.community-compose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.community-compose-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--hl2-orange);
}

.community-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.community-form-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.community-form-label input,
.community-form-label textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  text-transform: none;
  letter-spacing: normal;
}

.community-form-label textarea {
  min-height: 10rem;
  resize: vertical;
  line-height: 1.45;
}

.community-form-label input:focus,
.community-form-label textarea:focus {
  outline: none;
  border-color: rgba(255, 107, 26, 0.55);
}

.community-pin {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  width: fit-content;
}

.community-bb-help {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.community-bb-help code {
  font-size: 0.72rem;
  color: var(--hl2-orange);
  background: rgba(255, 107, 26, 0.08);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
}

.community-form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.community-status {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.community-status.is-error {
  color: #ff8a7a;
}

.community-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 4rem;
}

.community-empty {
  margin: 0;
  padding: 1.25rem 1rem;
  color: var(--text-dim);
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.community-empty.is-error {
  color: #ff8a7a;
}

.community-post {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1rem 1.15rem 1.2rem;
}

.community-post.is-pinned {
  border-color: rgba(255, 107, 26, 0.35);
  box-shadow: inset 3px 0 0 var(--hl2-orange);
}

.community-post-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.community-pin-badge {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hl2-orange);
  background: rgba(255, 107, 26, 0.1);
  border: 1px solid rgba(255, 107, 26, 0.35);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.community-post-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.25;
}

.community-post-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.community-post-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.community-action {
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--hl2-orange);
  font-family: inherit;
  font-size: 0.75rem;
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
}

.community-action:hover {
  border-color: rgba(255, 107, 26, 0.45);
  background: rgba(255, 107, 26, 0.08);
}

.community-action.is-danger {
  color: #ff8a7a;
}

.community-post-body.bb-content {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.bb-content a {
  color: var(--hl2-orange);
}

.bb-content .bb-center {
  text-align: center;
}

.bb-content .bb-quote {
  margin: 0.75rem 0;
  padding: 0.65rem 0.85rem;
  border-left: 3px solid var(--hl2-orange);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
}

.bb-content .bb-quote cite {
  display: block;
  margin-bottom: 0.35rem;
  font-style: normal;
  font-weight: 600;
  color: var(--text-primary);
}

.bb-content .bb-code {
  margin: 0.75rem 0;
  padding: 0.75rem 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.4;
}

.bb-content .bb-list {
  margin: 0.5rem 0 0.5rem 1.25rem;
  padding: 0;
}

.bb-content .bb-img {
  max-width: 100%;
  height: auto;
  margin: 0.5rem 0;
  border-radius: 4px;
}

