/* ═══════════════════════════════════════════════
   GRUDGE ARENA — WCS Fantasy MMO Theme
   Fonts: Cinzel Decorative, Spectral SC, IM Fell English SC
   Palette: Gold/obsidian/warm candlelight
   ═══════════════════════════════════════════════ */

/* ── Reset & Base ──────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* WCS Core Palette */
  --bg-obsidian: hsl(225 30% 8%);
  --bg-card: hsl(225 25% 12%);
  --bg-card-hover: hsl(225 25% 15%);
  --bg-input: hsl(225 25% 15%);
  --fg: hsl(45 30% 90%);
  --fg-muted: hsl(45 15% 60%);

  /* Gold System */
  --gold: hsl(43 85% 55%);
  --gold-light: hsl(43 90% 70%);
  --gold-dark: hsl(43 70% 35%);
  --gold-border: hsl(43 60% 30%);
  --bronze: hsl(30 60% 40%);

  /* Accents */
  --crimson: hsl(0 65% 40%);
  --royal-blue: hsl(220 60% 35%);
  --stone: hsl(220 15% 25%);
  --parchment: hsl(40 35% 75%);

  /* Faction */
  --alliance-blue: hsl(215 70% 45%);
  --alliance-light: hsl(215 80% 65%);
  --horde-red: hsl(0 70% 40%);
  --horde-light: hsl(0 80% 60%);

  /* Class Colors (WoW) */
  --class-warrior: #C79C6E;
  --class-paladin: #F58CBA;
  --class-hunter: #ABD473;
  --class-rogue: #FFF569;
  --class-priest: #FFFFFF;
  --class-shaman: #0070DE;
  --class-mage: #69CCF0;
  --class-warlock: #9482C9;
  --class-druid: #FF7D0A;

  /* Fonts */
  --font-heading: 'Cinzel Decorative', 'Cinzel', serif;
  --font-sans: 'Spectral SC', 'Inter', serif;
  --font-body: 'IM Fell English SC', serif;
  --font-display: 'MedievalSharp', cursive;
  --font-uncial: 'Uncial Antiqua', cursive;

  --radius: 4px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--fg);
  min-height: 100vh;
  background: var(--bg-obsidian);
  background-image:
    linear-gradient(180deg, rgba(10, 12, 25, 0.55) 0%, rgba(10, 12, 25, 0.7) 100%),
    url('bg.png');
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

/* ── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-obsidian); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, hsl(43 50% 35%) 0%, hsl(35 45% 25%) 100%);
  border: 1px solid hsl(43 40% 40%);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, hsl(43 60% 45%) 0%, hsl(35 50% 30%) 100%);
}

/* ── Utility ───────────────────────────────────── */
.hidden { display: none !important; }
.full-width { width: 100%; }

.gold-text {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 40%, hsl(35 70% 40%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Reusable Panels (from WCS) ────────────────── */
.fantasy-panel {
  position: relative;
  background: linear-gradient(180deg, hsl(225 25% 14%) 0%, hsl(225 28% 10%) 50%, hsl(225 25% 8%) 100%);
  border: 2px solid var(--gold-border);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 4px 12px rgba(0,0,0,0.5),
    0 0 0 1px rgba(0,0,0,0.3);
}

.fantasy-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 2px;
  padding: 1px;
  background: linear-gradient(180deg, rgba(212,175,55,0.3) 0%, rgba(160,120,40,0.1) 50%, rgba(100,80,30,0.2) 100%);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.stone-panel {
  background: linear-gradient(180deg, rgba(40,45,55,0.95) 0%, rgba(30,35,45,0.98) 100%);
  border: 2px solid var(--stone);
  border-radius: 2px;
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.4),
    inset 0 -1px 0 rgba(255,255,255,0.03),
    0 4px 8px rgba(0,0,0,0.4);
}

/* ── Buttons ───────────────────────────────────── */
.gilded-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(180deg, hsl(43 70% 45%) 0%, hsl(38 65% 35%) 50%, hsl(35 60% 28%) 100%);
  border: 2px solid hsl(43 50% 50%);
  border-radius: var(--radius);
  color: hsl(225 30% 10%);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    inset 0 -2px 4px rgba(0,0,0,0.2),
    0 2px 4px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: all 0.15s ease;
}

.gilded-button:hover {
  background: linear-gradient(180deg, hsl(43 80% 55%) 0%, hsl(43 70% 45%) 50%, hsl(38 65% 35%) 100%);
  border-color: hsl(43 60% 60%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -2px 4px rgba(0,0,0,0.2),
    0 0 12px rgba(212,175,55,0.4),
    0 4px 8px rgba(0,0,0,0.4);
}

.gilded-button:active {
  background: linear-gradient(180deg, hsl(35 60% 30%) 0%, hsl(38 65% 35%) 100%);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
}

.dark-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(180deg, hsl(225 25% 22%) 0%, hsl(225 28% 15%) 100%);
  border: 2px solid hsl(43 50% 35%);
  border-radius: var(--radius);
  color: hsl(43 70% 65%);
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: 0.03em;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 2px 4px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dark-button:hover {
  background: linear-gradient(180deg, hsl(225 25% 26%) 0%, hsl(225 28% 18%) 100%);
  border-color: hsl(43 60% 45%);
  color: hsl(43 80% 70%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 0 8px rgba(212,175,55,0.2),
    0 4px 8px rgba(0,0,0,0.4);
}

.dark-button.selected {
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow:
    0 0 12px rgba(212,175,55,0.3),
    inset 0 0 8px rgba(212,175,55,0.1);
}

.btn-icon { font-size: 1.1em; }

.btn-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 0.25rem;
}

.login-status {
  text-align: center;
  padding: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--gold);
  margin-top: 0.75rem;
}

/* ── Inputs ────────────────────────────────────── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.input-group label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fantasy-input {
  padding: 0.75rem 1rem;
  background: hsl(225 28% 8%);
  border: 2px solid var(--gold-border);
  border-radius: var(--radius);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.fantasy-input::placeholder { color: var(--fg-muted); opacity: 0.6; }
.fantasy-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.15), inset 0 2px 4px rgba(0,0,0,0.3);
}

/* ── Header ────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, hsl(225 28% 12%) 0%, hsl(225 30% 8%) 100%);
  border-bottom: 2px solid var(--gold-border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(212,175,55,0.5));
}

/* ── Intro Overlay ─────────────────────────────── */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease;
}

.intro-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.intro-overlay.gone {
  display: none;
}

.intro-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.splash-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.splash-img.visible {
  opacity: 1;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 50%, hsl(35 70% 45%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5));
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--fg-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--gold-light);
  background: rgba(212,175,55,0.08);
}

.nav-link.active {
  color: var(--gold);
  background: rgba(212,175,55,0.12);
  border-bottom: 2px solid var(--gold);
}

.server-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  color: var(--fg-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #555;
}

.status-dot.online {
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
}

.status-dot.offline {
  background: #f87171;
  box-shadow: 0 0 6px #f87171;
}

/* ── Main Content ──────────────────────────────── */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: calc(100vh - 140px);
}

.view { display: none; }
.view.active { display: block; }

.view-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 50%, hsl(35 70% 45%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5));
  margin-bottom: 0.5rem;
}

.section-desc {
  font-family: var(--font-body);
  color: var(--fg-muted);
  font-size: 1rem;
}

.subsection-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: 1rem;
}

.step-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--gold);
  text-align: center;
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* ── Hero Section ──────────────────────────────── */
.hero-section {
  position: relative;
  text-align: center;
  padding: 3rem 1rem;
}

.hero-ornament {
  position: absolute;
  font-size: 1rem;
  color: var(--gold-dark);
  opacity: 0.6;
  text-shadow: 0 0 6px rgba(212,175,55,0.4);
}

.hero-ornament.top-left { top: 0; left: 0; }
.hero-ornament.top-right { top: 0; right: 0; }
.hero-ornament.bottom-left { bottom: 0; left: 0; }
.hero-ornament.bottom-right { bottom: 0; right: 0; }

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 900;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 40%, hsl(35 70% 40%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.6));
  margin-bottom: 0.25rem;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.hero-desc {
  font-family: var(--font-body);
  color: var(--fg-muted);
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto 2rem;
}

/* ── Login Box ─────────────────────────────────── */
.login-box {
  max-width: 420px;
  margin: 0 auto 3rem;
  padding: 2rem;
  text-align: left;
}

.login-box .section-title {
  text-align: center;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.login-info {
  font-family: var(--font-body);
  color: var(--fg-muted);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* ── Feature Cards ─────────────────────────────── */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  max-width: 700px;
  margin: 0 auto;
}

.feature-card {
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.5), 0 0 8px rgba(212,175,55,0.1);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.feature-card h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.feature-card p {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--fg-muted);
}

/* ── Character Creation ────────────────────────── */
.creation-step {
  max-width: 700px;
  margin: 0 auto 2rem;
}

/* Existing Characters */
.existing-chars {
  max-width: 700px;
  margin: 0 auto 2rem;
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.char-card {
  padding: 1rem;
  text-align: center;
  cursor: default;
}

.char-card .char-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.char-card .char-info {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.char-card .char-level {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--gold);
  margin-top: 0.25rem;
}

.divider-ornate {
  text-align: center;
  position: relative;
  margin: 2rem 0;
}

.divider-ornate::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
}

.divider-ornate span {
  position: relative;
  background: var(--bg-obsidian);
  padding: 0 1rem;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--gold-dark);
  letter-spacing: 0.1em;
}

/* Faction Pick */
.faction-pick {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.faction-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 2.5rem;
  background: linear-gradient(180deg, hsl(225 25% 14%) 0%, hsl(225 28% 10%) 100%);
  border: 3px solid var(--stone);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s;
}

.faction-btn.alliance:hover, .faction-btn.alliance.selected {
  border-color: var(--alliance-blue);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3), inset 0 0 12px rgba(59, 130, 246, 0.1);
}

.faction-btn.horde:hover, .faction-btn.horde.selected {
  border-color: var(--horde-red);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3), inset 0 0 12px rgba(239, 68, 68, 0.1);
}

.faction-crest { font-size: 3rem; }

.faction-crest-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--gold-border);
  box-shadow: 0 0 12px rgba(0,0,0,0.5);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.faction-btn.alliance:hover .faction-crest-img,
.faction-btn.alliance.selected .faction-crest-img {
  border-color: var(--alliance-blue);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.4);
}

.faction-btn.horde:hover .faction-crest-img,
.faction-btn.horde.selected .faction-crest-img {
  border-color: var(--horde-red);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

.faction-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--fg);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.faction-vs {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--crimson);
  text-shadow: 0 0 10px rgba(200, 50, 50, 0.4);
}

/* Race/Class Grid */
.rc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.rc-label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: hsl(225 25% 14%);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.option-btn img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--stone);
  flex-shrink: 0;
}

.option-btn.selected img {
  border-color: var(--gold);
  box-shadow: 0 0 6px rgba(212,175,55,0.3);
}

.option-btn:hover {
  background: hsl(225 25% 18%);
  border-color: var(--gold-border);
}

.option-btn.selected {
  background: hsl(225 25% 18%);
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: 0 0 8px rgba(212,175,55,0.15);
}

.option-btn .option-role {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-left: 0.5rem;
}

/* Name Step */
.name-form {
  max-width: 420px;
  margin: 0 auto;
  padding: 2rem;
}

.char-summary {
  text-align: center;
  margin-bottom: 1.5rem;
  font-family: var(--font-body);
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.char-summary strong {
  color: var(--gold);
}

/* Success */
.success-panel {
  max-width: 500px;
  margin: 2rem auto;
  text-align: center;
  padding: 2rem;
  background: linear-gradient(180deg, hsl(225 25% 14%) 0%, hsl(225 28% 10%) 100%);
  border: 2px solid hsl(142 60% 35%);
  border-radius: var(--radius);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.15);
}

.success-panel h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: hsl(142 70% 55%);
  margin-bottom: 1rem;
}

#createdCharInfo {
  font-family: var(--font-body);
  color: var(--fg);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

/* ── Queue ─────────────────────────────────────── */
.queue-modes {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.mode-btn {
  min-width: 140px;
  padding: 1.25rem 1.5rem;
}

.mode-size {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.mode-desc {
  display: block;
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}

.queue-status-panel {
  text-align: center;
  padding: 2rem;
  max-width: 500px;
  margin: 0 auto 2rem;
}

.queue-status-panel h3 {
  font-family: var(--font-heading);
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.queue-status-panel p {
  font-family: var(--font-body);
  color: var(--fg-muted);
}

.queue-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--stone);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.match-ready {
  max-width: 500px;
  margin: 0 auto;
}

.match-ready-inner {
  padding: 2rem;
  text-align: center;
}

.match-ready-inner h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

#matchInfo {
  font-family: var(--font-body);
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.play-instructions {
  margin-top: 1.5rem;
  padding: 1rem;
  background: hsl(225 28% 8%);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  text-align: left;
}

.play-instructions ol {
  list-style: none;
  counter-reset: steps;
}

.play-instructions li {
  counter-increment: steps;
  padding: 0.4rem 0;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.play-instructions li::before {
  content: counter(steps) '.';
  color: var(--gold);
  font-family: var(--font-heading);
  font-weight: 700;
  margin-right: 0.5rem;
}

/* ── Records ───────────────────────────────────── */
.records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  max-width: 800px;
  margin: 0 auto;
}

.record-card {
  padding: 1.5rem;
  text-align: center;
}

.record-card .record-mode {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.record-card .record-wl {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.record-card .wins {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: hsl(142 70% 55%);
}

.record-card .losses {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: hsl(0 70% 55%);
}

.record-card .record-label {
  display: block;
  font-size: 0.65rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.record-card .record-stats {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.empty-state {
  text-align: center;
  padding: 3rem;
  font-family: var(--font-body);
  color: var(--fg-muted);
  font-size: 1rem;
}

/* ── Error / Messages ──────────────────────────── */
.error-msg {
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  background: hsla(0, 65%, 35%, 0.2);
  border: 1px solid var(--crimson);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: hsl(0 80% 70%);
}

/* ── Footer ────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--gold-border);
  padding: 1rem 1.5rem;
  text-align: center;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  color: var(--fg-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-sep { color: var(--gold-dark); }

/* ── Game Canvas ────────────────────────────── */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, hsl(225 28% 12%) 0%, hsl(225 30% 8%) 100%);
  border: 2px solid var(--gold-border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}

.game-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
}

.game-status {
  color: var(--fg-muted);
  font-size: 0.75rem;
}

.game-controls {
  display: flex;
  gap: 0.5rem;
}

.game-controls .dark-button {
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  flex-direction: row;
}

.game-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 2px solid var(--gold-border);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.game-canvas canvas {
  width: 100% !important;
  height: 100% !important;
}

.game-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10;
}

.game-loading p {
  font-family: var(--font-body);
  color: var(--fg-muted);
  margin-top: 0.5rem;
}

.game-canvas:fullscreen {
  aspect-ratio: auto;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; justify-content: center; }
  .nav-links { order: 3; width: 100%; justify-content: center; }
  .hero-title { font-size: 2rem; }
  .faction-pick { flex-direction: column; gap: 1rem; }
  .faction-vs { transform: rotate(90deg); }
  .rc-grid { grid-template-columns: 1fr; }
  .queue-modes { flex-direction: column; align-items: center; }
  .mode-btn { width: 100%; max-width: 250px; }
  .feature-cards { grid-template-columns: 1fr; }
}
