/* ============================================================
   AetherClash - Browser-Based 3D MOBA
   Master Stylesheet
   ============================================================ */

/* ---------------------------------------------------------------
   0. CSS CUSTOM PROPERTIES (Design Tokens)
   --------------------------------------------------------------- */

:root {
  /* Backgrounds */
  --bg-deep: #0a0a12;
  --bg-mid: #12121e;
  --bg-surface: #1a1a2e;
  --bg-elevated: #22223a;
  --bg-overlay: rgba(10, 10, 18, 0.85);

  /* Accent Colors */
  --accent-cyan: #00e5ff;
  --accent-purple: #a855f7;
  --accent-gold: #fbbf24;
  --accent-red: #ef4444;
  --accent-green: #22c55e;
  --accent-blue: #3b82f6;

  /* Hero Role Colors */
  --hero-tank: #ef4444;
  --hero-mage: #00e5ff;
  --hero-assassin: #a855f7;
  --hero-support: #fbbf24;
  --hero-fighter: #22c55e;

  /* Text */
  --text-primary: #f0f0f5;
  --text-muted: #8888a0;
  --text-dim: #55556a;

  /* Fonts */
  --font-heading: 'Syne', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;

  /* Borders & Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-round: 50%;

  /* Shadows & Glows */
  --glow-cyan: 0 0 20px rgba(0, 229, 255, 0.4);
  --glow-purple: 0 0 20px rgba(168, 85, 247, 0.4);
  --glow-gold: 0 0 20px rgba(251, 191, 36, 0.4);
  --glow-red: 0 0 20px rgba(239, 68, 68, 0.4);
  --glow-green: 0 0 20px rgba(34, 197, 94, 0.4);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.6);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Z-Index Scale */
  --z-canvas: 0;
  --z-hud: 10;
  --z-overlay: 20;
  --z-modal: 30;
  --z-tooltip: 40;
  --z-loading: 50;
}


/* ---------------------------------------------------------------
   1. RESET & BASE STYLES
   --------------------------------------------------------------- */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

/* Screen visibility management — JS toggles .active class */
.screen {
  display: none !important;
}

.screen.active {
  display: flex !important;
}

/* Game screen uses block — children (canvas, HUD) are independently fixed-positioned */
#game-screen.active {
  display: block !important;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-purple);
}

img {
  max-width: 100%;
  display: block;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
}

ul, ol {
  list-style: none;
}

::selection {
  background: var(--accent-cyan);
  color: var(--bg-deep);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--text-dim);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}


/* ---------------------------------------------------------------
   2. GENERAL BUTTON STYLES
   --------------------------------------------------------------- */

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: var(--bg-deep);
  box-shadow: var(--glow-cyan);
}

.btn-primary:hover {
  box-shadow:
    var(--glow-cyan),
    0 0 40px rgba(0, 229, 255, 0.3);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--glow-cyan);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.15);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Button ripple effect */
.btn-primary::after,
.btn-secondary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255, 255, 255, 0.3), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn-primary:active::after,
.btn-secondary:active::after {
  opacity: 1;
}

/* Small button variant */
.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
}

/* Large button variant */
.btn-lg {
  padding: 16px 40px;
  font-size: 1.1rem;
}

/* Icon-only button */
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-round);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


/* ---------------------------------------------------------------
   3. TOOLTIPS
   --------------------------------------------------------------- */

.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 12px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-card);
  pointer-events: none;
  opacity: 0;
  z-index: var(--z-tooltip);
  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast);
}

.tooltip::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--bg-elevated);
  pointer-events: none;
  opacity: 0;
  z-index: var(--z-tooltip);
  transition: opacity var(--transition-fast);
}

.tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tooltip:hover::before {
  opacity: 1;
}

/* Bottom tooltip variant */
.tooltip-bottom::after {
  bottom: auto;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(-4px);
}

.tooltip-bottom::before {
  bottom: auto;
  top: calc(100% + 2px);
  border-top-color: transparent;
  border-bottom-color: var(--bg-elevated);
}

.tooltip-bottom:hover::after {
  transform: translateX(-50%) translateY(0);
}


/* ---------------------------------------------------------------
   4. AUTH SCREEN (#auth-screen)
   --------------------------------------------------------------- */

#auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  z-index: var(--z-modal);
}

#auth-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(0, 229, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
  background: var(--bg-mid);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-elevated);
}

.auth-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-purple), transparent);
  border-radius: 1px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo h1 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-logo p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tab {
  flex: 1;
  padding: 12px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.auth-tab:hover {
  color: var(--text-primary);
}

.auth-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

/* Auth Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-form-group input {
  padding: 12px 16px;
  background: var(--bg-deep);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.auth-form-group input::placeholder {
  color: var(--text-dim);
}

.auth-form-group input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}

.auth-form-group input:invalid:not(:placeholder-shown) {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.auth-submit {
  margin-top: 8px;
  width: 100%;
}

.auth-error {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: var(--accent-red);
  font-size: 0.85rem;
  text-align: center;
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--accent-cyan);
  font-weight: 600;
}


/* ---------------------------------------------------------------
   5. CHARACTER SELECT SCREEN (#select-screen)
   --------------------------------------------------------------- */

#select-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  z-index: var(--z-modal);
  overflow-y: auto;
}

#select-screen::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(0, 229, 255, 0.06) 0%, transparent 40%),
    radial-gradient(ellipse at 80% 90%, rgba(168, 85, 247, 0.06) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(251, 191, 36, 0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* Select Header */
.select-header {
  padding: 24px 40px;
  text-align: center;
  flex-shrink: 0;
}

.select-header h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.select-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* Select Content Layout */
.select-content {
  display: flex;
  flex: 1;
  padding: 0 40px 40px;
  gap: 40px;
  min-height: 0;
}

/* Hero Grid */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  align-content: start;
  flex: 1;
}

/* Hero Card */
.hero-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 20px;
  background: var(--bg-mid);
  border: 2px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-base),
    background var(--transition-base);
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.hero-card:hover {
  transform: translateY(-4px);
  background: var(--bg-surface);
}

.hero-card:hover::before {
  opacity: 1;
}

.hero-card.selected {
  transform: translateY(-4px);
  background: var(--bg-surface);
}

.hero-card.selected::before {
  opacity: 1;
}

/* Hero Card - Vanguard (Tank / Red) */
.hero-card[data-hero="vanguard"]::before {
  background: linear-gradient(90deg, transparent, var(--hero-tank), transparent);
}

.hero-card[data-hero="vanguard"]:hover,
.hero-card[data-hero="vanguard"].selected {
  border-color: var(--hero-tank);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.2), var(--shadow-card);
}

.hero-card[data-hero="vanguard"] .hero-card-icon {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--hero-tank);
}

.hero-card[data-hero="vanguard"] .hero-card-role {
  color: var(--hero-tank);
}

/* Hero Card - Torrent (Mage / Cyan) */
.hero-card[data-hero="torrent"]::before {
  background: linear-gradient(90deg, transparent, var(--hero-mage), transparent);
}

.hero-card[data-hero="torrent"]:hover,
.hero-card[data-hero="torrent"].selected {
  border-color: var(--hero-mage);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.2), var(--shadow-card);
}

.hero-card[data-hero="torrent"] .hero-card-icon {
  background: rgba(0, 229, 255, 0.15);
  border-color: rgba(0, 229, 255, 0.3);
  color: var(--hero-mage);
}

.hero-card[data-hero="torrent"] .hero-card-role {
  color: var(--hero-mage);
}

/* Hero Card - Spectre (Assassin / Purple) */
.hero-card[data-hero="spectre"]::before {
  background: linear-gradient(90deg, transparent, var(--hero-assassin), transparent);
}

.hero-card[data-hero="spectre"]:hover,
.hero-card[data-hero="spectre"].selected {
  border-color: var(--hero-assassin);
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.2), var(--shadow-card);
}

.hero-card[data-hero="spectre"] .hero-card-icon {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.3);
  color: var(--hero-assassin);
}

.hero-card[data-hero="spectre"] .hero-card-role {
  color: var(--hero-assassin);
}

/* Hero Card - Solaris (Support / Gold) */
.hero-card[data-hero="solaris"]::before {
  background: linear-gradient(90deg, transparent, var(--hero-support), transparent);
}

.hero-card[data-hero="solaris"]:hover,
.hero-card[data-hero="solaris"].selected {
  border-color: var(--hero-support);
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.2), var(--shadow-card);
}

.hero-card[data-hero="solaris"] .hero-card-icon {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.3);
  color: var(--hero-support);
}

.hero-card[data-hero="solaris"] .hero-card-role {
  color: var(--hero-support);
}

/* Hero Card - Ironbark (Fighter / Green) */
.hero-card[data-hero="ironbark"]::before {
  background: linear-gradient(90deg, transparent, var(--hero-fighter), transparent);
}

.hero-card[data-hero="ironbark"]:hover,
.hero-card[data-hero="ironbark"].selected {
  border-color: var(--hero-fighter);
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.2), var(--shadow-card);
}

.hero-card[data-hero="ironbark"] .hero-card-icon {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--hero-fighter);
}

.hero-card[data-hero="ironbark"] .hero-card-role {
  color: var(--hero-fighter);
}

/* Hero Card Inner Elements */
.hero-card-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 14px;
  transition:
    background var(--transition-base),
    border-color var(--transition-base);
}

.hero-card-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.hero-card-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.hero-card-role {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* Selected indicator */
.hero-card-selected-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-round);
  background: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--bg-deep);
  font-weight: 700;
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity var(--transition-base),
    transform var(--transition-base);
}

.hero-card.selected .hero-card-selected-badge {
  opacity: 1;
  transform: scale(1);
}

/* Hero Details Panel */
.hero-details {
  width: 360px;
  flex-shrink: 0;
  padding: 28px;
  background: var(--bg-mid);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-self: start;
  position: sticky;
  top: 20px;
}

.hero-details-header {
  text-align: center;
}

.hero-details-header h2 {
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-details-header .hero-details-role {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.hero-details-lore {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
}

/* Hero Stats */
.hero-details-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--bg-deep);
  border-radius: var(--radius-md);
}

.hero-stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

/* Abilities Section */
.hero-abilities {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-abilities-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.hero-ability {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-deep);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: border-color var(--transition-fast);
}

.hero-ability:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.hero-ability-key {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.hero-ability-info {
  flex: 1;
  min-width: 0;
}

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

.hero-ability-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Start Battle Button */
.select-footer {
  padding: 20px 40px 32px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.btn-start-battle {
  padding: 18px 60px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: var(--bg-deep);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    box-shadow var(--transition-base),
    transform var(--transition-base);
  box-shadow:
    0 0 30px rgba(0, 229, 255, 0.3),
    0 0 60px rgba(168, 85, 247, 0.15);
  font-family: var(--font-heading);
}

.btn-start-battle::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), var(--accent-cyan));
  background-size: 200% 200%;
  animation: shimmer 3s linear infinite;
  z-index: -1;
  opacity: 0.6;
  filter: blur(8px);
}

.btn-start-battle:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 0 40px rgba(0, 229, 255, 0.4),
    0 0 80px rgba(168, 85, 247, 0.2);
}

.btn-start-battle:active {
  transform: translateY(0) scale(0.99);
}

.btn-start-battle:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-start-battle:disabled::before {
  animation: none;
  opacity: 0;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}


/* ---------------------------------------------------------------
   6. GAME CANVAS (#game-canvas)
   --------------------------------------------------------------- */

#game-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-canvas);
  display: block;
  background: var(--bg-deep);
}


/* ---------------------------------------------------------------
   7. GAME HUD (#game-hud)
   --------------------------------------------------------------- */

#game-hud {
  position: fixed;
  inset: 0;
  z-index: var(--z-hud);
  pointer-events: none;
}

#game-hud > * {
  pointer-events: auto;
}

/* --- 7a. Player Info (Top Left) --- */

.hud-player-info {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-overlay);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  min-width: 260px;
}

.hud-player-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 2px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  overflow: hidden;
}

.hud-player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hud-player-details {
  flex: 1;
  min-width: 0;
}

.hud-player-name {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hud-player-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-round);
  background: var(--accent-gold);
  color: var(--bg-deep);
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 800;
  margin-left: 6px;
  vertical-align: middle;
}

/* Health Bar */
.hud-bar-container {
  width: 100%;
  margin-top: 6px;
}

.hud-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hud-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.hud-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width var(--transition-base);
  position: relative;
}

.hud-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2));
  border-radius: 0 4px 4px 0;
}

/* Health bar color coding */
.hud-bar-health .hud-bar-fill {
  background: linear-gradient(90deg, var(--accent-green), #4ade80);
}

.hud-bar-health.health-high .hud-bar-fill {
  background: linear-gradient(90deg, var(--accent-green), #4ade80);
}

.hud-bar-health.health-medium .hud-bar-fill {
  background: linear-gradient(90deg, #eab308, var(--accent-gold));
}

.hud-bar-health.health-low .hud-bar-fill {
  background: linear-gradient(90deg, var(--accent-red), #f87171);
  animation: health-pulse 1s ease-in-out infinite;
}

@keyframes health-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Mana bar */
.hud-bar-mana .hud-bar-fill {
  background: linear-gradient(90deg, var(--accent-blue), #60a5fa);
}

/* Experience bar */
.hud-bar-exp .hud-bar-fill {
  background: linear-gradient(90deg, var(--accent-gold), #fcd34d);
}

.hud-bar-exp .hud-bar-track {
  height: 4px;
}


/* --- 7b. Game Timer & Enemy Info (Top Right) --- */

.hud-top-right {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.hud-game-timer {
  padding: 10px 20px;
  background: var(--bg-overlay);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  text-align: center;
}

.hud-timer-value {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.hud-timer-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hud-enemy-info {
  padding: 12px 16px;
  background: var(--bg-overlay);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  min-width: 200px;
}

.hud-enemy-name {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-red);
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.hud-enemy-bar .hud-bar-fill {
  background: linear-gradient(90deg, var(--accent-red), #f87171);
}


/* --- 7c. Ability Bar (Bottom Center) --- */

.hud-ability-bar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 14px 20px;
  background: var(--bg-overlay);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(12px);
}

.ability-slot {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
  overflow: hidden;
}

.ability-slot:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}

.ability-slot:active {
  transform: translateY(0);
}

.ability-slot.on-cooldown {
  cursor: default;
  opacity: 0.6;
}

.ability-slot.on-cooldown:hover {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  transform: none;
}

.ability-slot-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.ability-slot-key {
  position: absolute;
  bottom: 3px;
  right: 4px;
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  z-index: 2;
}

/* Mana cost display */
.ability-slot-cost {
  position: absolute;
  bottom: 3px;
  left: 4px;
  font-size: 0.55rem;
  font-weight: 600;
  color: #60a5fa;
  z-index: 2;
}

/* Cooldown Overlay - Circular sweep */
.ability-cooldown-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.ability-cooldown-overlay svg {
  width: 100%;
  height: 100%;
}

.ability-cooldown-sweep {
  fill: rgba(0, 0, 0, 0.7);
  transform-origin: center;
}

.ability-cooldown-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  z-index: 4;
}

/* Ability ready flash */
@keyframes ability-ready {
  0% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(0, 229, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); }
}

.ability-slot.just-ready {
  animation: ability-ready 0.6s ease-out;
}

/* Ability level-up pips */
.ability-slot-level {
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  z-index: 2;
}

.ability-level-pip {
  width: 6px;
  height: 3px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.ability-level-pip.filled {
  background: var(--accent-gold);
}

/* Ultimate ability slot (R) */
.ability-slot.ultimate {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  border-width: 2px;
}

.ability-slot.ultimate:not(.on-cooldown):hover {
  border-color: var(--accent-gold);
  box-shadow: var(--glow-gold);
}


/* --- 7d. Minimap (Bottom Left) --- */

.hud-minimap {
  position: absolute;
  bottom: 16px;
  left: 16px;
}

.minimap-container {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-deep);
  box-shadow: var(--shadow-card);
  position: relative;
}

.minimap-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.minimap-frame {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.minimap-ping {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-round);
  transform: translate(-50%, -50%);
  animation: minimap-ping 1.5s ease-out infinite;
}

@keyframes minimap-ping {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}


/* --- 7e. Kill Feed (Top Right, below timer) --- */

.hud-kill-feed {
  position: absolute;
  top: 100px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 320px;
  pointer-events: none;
}

.kill-feed-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-overlay);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  backdrop-filter: blur(8px);
  animation: kill-feed-in 0.3s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.kill-feed-entry.fade-out {
  animation: kill-feed-out 0.5s ease-in forwards;
}

@keyframes kill-feed-in {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes kill-feed-out {
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

.kill-feed-killer {
  font-weight: 600;
  color: var(--accent-cyan);
}

.kill-feed-icon {
  width: 16px;
  height: 16px;
  opacity: 0.6;
  flex-shrink: 0;
}

.kill-feed-victim {
  font-weight: 600;
  color: var(--accent-red);
}

.kill-feed-assist {
  font-size: 0.7rem;
  color: var(--text-dim);
}


/* --- 7f. Gold & CS Counter --- */

.hud-gold-cs {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 8px 20px;
  background: var(--bg-overlay);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

.hud-gold {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-gold-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-gold);
}

.hud-gold-value {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.hud-cs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-cs-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.hud-cs-value {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hud-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
}

/* Gold earned animation */
.hud-gold-earned {
  position: absolute;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold);
  pointer-events: none;
  animation: gold-float 1.2s ease-out forwards;
}

@keyframes gold-float {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-30px);
  }
}


/* ---------------------------------------------------------------
   8. LOADING SCREEN (#loading-screen)
   --------------------------------------------------------------- */

#loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  z-index: var(--z-loading);
  gap: 32px;
}

#loading-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(0, 229, 255, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 60%, rgba(168, 85, 247, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.loading-logo {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}

.loading-tip {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 400px;
  text-align: center;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.loading-progress-container {
  width: 360px;
  max-width: 80vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.loading-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.loading-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  transition: width var(--transition-slow);
  position: relative;
}

.loading-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
  animation: loading-shine 1.5s ease-in-out infinite;
}

@keyframes loading-shine {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.loading-progress-text {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.loading-status {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  z-index: 1;
}

/* Loading spinner (alternative to progress bar) */
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-cyan);
  border-radius: var(--radius-round);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ---------------------------------------------------------------
   9. RESULTS SCREEN (#results-screen)
   --------------------------------------------------------------- */

#results-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  z-index: var(--z-modal);
  padding: 40px;
  overflow-y: auto;
}

#results-screen::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
}

/* Victory variant */
#results-screen.victory::before {
  background:
    radial-gradient(ellipse at 50% 20%, rgba(0, 229, 255, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 30% 70%, rgba(34, 197, 94, 0.06) 0%, transparent 40%),
    radial-gradient(ellipse at 70% 70%, rgba(251, 191, 36, 0.06) 0%, transparent 40%);
}

/* Defeat variant */
#results-screen.defeat::before {
  background:
    radial-gradient(ellipse at 50% 20%, rgba(239, 68, 68, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 30% 70%, rgba(168, 85, 247, 0.06) 0%, transparent 40%);
}

/* Victory/Defeat Banner */
.results-banner {
  position: relative;
  z-index: 1;
  margin-bottom: 36px;
  text-align: center;
}

.results-banner h1 {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: banner-reveal 0.8s ease-out;
}

#results-screen.victory .results-banner h1 {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 30px rgba(0, 229, 255, 0.3));
}

#results-screen.defeat .results-banner h1 {
  background: linear-gradient(135deg, var(--accent-red), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 30px rgba(239, 68, 68, 0.3));
}

@keyframes banner-reveal {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.results-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 8px;
  animation: banner-reveal 0.8s ease-out 0.15s backwards;
}

/* Stats Table */
.results-stats {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 700px;
  margin-bottom: 32px;
  animation: banner-reveal 0.8s ease-out 0.3s backwards;
}

.results-stats-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-mid);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.results-stats-table thead th {
  padding: 14px 20px;
  background: var(--bg-surface);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.results-stats-table tbody td {
  padding: 14px 20px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.results-stats-table tbody tr:last-child td {
  border-bottom: none;
}

.results-stats-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.results-stat-label {
  color: var(--text-muted);
  font-weight: 500;
}

.results-stat-value {
  font-family: var(--font-heading);
  font-weight: 700;
  text-align: right;
}

.results-stat-value.highlight {
  color: var(--accent-cyan);
}

/* KDA display */
.results-kda {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 700;
  justify-content: flex-end;
}

.results-kda-kills {
  color: var(--accent-green);
}

.results-kda-deaths {
  color: var(--accent-red);
}

.results-kda-assists {
  color: var(--accent-gold);
}

.results-kda-separator {
  color: var(--text-dim);
  font-weight: 400;
}

/* Results Actions */
.results-actions {
  display: flex;
  gap: 16px;
  position: relative;
  z-index: 1;
  animation: banner-reveal 0.8s ease-out 0.45s backwards;
}


/* ---------------------------------------------------------------
   10. PROFILE / STATS SCREEN (#stats-screen)
   --------------------------------------------------------------- */

#stats-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  z-index: var(--z-modal);
  overflow-y: auto;
  padding: 40px;
}

#stats-screen::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(0, 229, 255, 0.04) 0%, transparent 40%),
    radial-gradient(ellipse at 80% 90%, rgba(168, 85, 247, 0.04) 0%, transparent 40%);
  pointer-events: none;
  z-index: -1;
}

.stats-header {
  text-align: center;
  margin-bottom: 36px;
}

.stats-header h1 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stats-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* Player Profile Card */
.stats-profile-card {
  padding: 28px;
  background: var(--bg-mid);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  align-self: start;
  position: sticky;
  top: 40px;
}

.stats-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-round);
  background: var(--bg-surface);
  border: 3px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  overflow: hidden;
  box-shadow: var(--glow-cyan);
}

.stats-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stats-profile-name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stats-profile-level {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stats-profile-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-round);
  background: var(--accent-gold);
  color: var(--bg-deep);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
}

/* Win/Loss Stats */
.stats-winloss {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stats-winloss-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-winloss-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stats-winloss-value {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
}

.stats-winloss-value.wins {
  color: var(--accent-green);
}

.stats-winloss-value.losses {
  color: var(--accent-red);
}

.stats-winloss-value.winrate {
  color: var(--accent-cyan);
}

.stats-winloss-bar {
  width: 100%;
  height: 6px;
  background: var(--accent-red);
  border-radius: 3px;
  overflow: hidden;
}

.stats-winloss-bar-fill {
  height: 100%;
  background: var(--accent-green);
  border-radius: 3px;
  transition: width var(--transition-slow);
}

/* Stats Right Column */
.stats-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Hero Stats Table */
.stats-hero-table-container {
  background: var(--bg-mid);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.stats-section-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.stats-hero-table thead th {
  padding: 12px 20px;
  background: var(--bg-surface);
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.stats-hero-table thead th:not(:first-child) {
  text-align: center;
}

.stats-hero-table tbody td {
  padding: 12px 20px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  text-align: center;
}

.stats-hero-table tbody td:first-child {
  text-align: left;
}

.stats-hero-table tbody tr:last-child td {
  border-bottom: none;
}

.stats-hero-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.stats-hero-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-hero-cell-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.stats-hero-cell-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
}

/* Recent Match History */
.stats-match-history {
  background: var(--bg-mid);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.stats-match-list {
  display: flex;
  flex-direction: column;
}

.stats-match-entry {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background var(--transition-fast);
}

.stats-match-entry:last-child {
  border-bottom: none;
}

.stats-match-entry:hover {
  background: rgba(255, 255, 255, 0.02);
}

.stats-match-result {
  width: 4px;
  height: 40px;
  border-radius: 2px;
  flex-shrink: 0;
}

.stats-match-result.win {
  background: var(--accent-green);
}

.stats-match-result.loss {
  background: var(--accent-red);
}

.stats-match-hero {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.stats-match-info {
  flex: 1;
  min-width: 0;
}

.stats-match-info-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.stats-match-hero-name {
  font-family: var(--font-heading);
  font-weight: 600;
}

.stats-match-result-text {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stats-match-result-text.win {
  color: var(--accent-green);
}

.stats-match-result-text.loss {
  color: var(--accent-red);
}

.stats-match-info-bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.stats-match-kda {
  font-weight: 600;
}

.stats-match-duration {
  color: var(--text-dim);
}

.stats-match-date {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-dim);
  flex-shrink: 0;
}


/* ---------------------------------------------------------------
   11. SCREEN VISIBILITY UTILITIES
   --------------------------------------------------------------- */

.screen-hidden {
  display: none !important;
}

.screen-fade-in {
  animation: screen-fade-in 0.4s ease-out;
}

@keyframes screen-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.screen-fade-out {
  animation: screen-fade-out 0.3s ease-in forwards;
}

@keyframes screen-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.screen-slide-up {
  animation: screen-slide-up 0.5s ease-out;
}

@keyframes screen-slide-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ---------------------------------------------------------------
   12. RESPONSIVE DESIGN
   --------------------------------------------------------------- */

/* Tablets and smaller desktops */
@media (max-width: 1200px) {
  .hero-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .select-content {
    flex-direction: column;
    padding: 0 24px 24px;
  }

  .hero-details {
    width: 100%;
    position: static;
    order: -1;
  }

  .stats-layout {
    grid-template-columns: 1fr;
  }

  .stats-profile-card {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Tablets portrait */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .hero-card {
    padding: 18px 12px 16px;
  }

  .hero-card-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .hero-card-name {
    font-size: 0.85rem;
  }

  .hud-ability-bar {
    gap: 6px;
    padding: 10px 14px;
  }

  .ability-slot {
    width: 52px;
    height: 52px;
  }

  .ability-slot.ultimate {
    width: 58px;
    height: 58px;
  }

  .minimap-container {
    width: 160px;
    height: 160px;
  }

  .hud-player-info {
    min-width: 220px;
  }

  .hud-kill-feed {
    width: 260px;
  }

  .results-banner h1 {
    font-size: 2.5rem;
  }

  .results-stats {
    max-width: 100%;
  }
}

/* Mobile landscape / small tablets */
@media (max-width: 768px) {
  .select-header h1 {
    font-size: 1.5rem;
  }

  .select-content {
    padding: 0 16px 16px;
    gap: 20px;
  }

  .hero-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .hero-card {
    padding: 14px 8px 12px;
  }

  .hero-card-icon {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
    margin-bottom: 8px;
  }

  .hero-card-name {
    font-size: 0.75rem;
  }

  .hero-card-role {
    font-size: 0.65rem;
  }

  .hero-details {
    padding: 20px;
  }

  .hero-abilities {
    gap: 6px;
  }

  .hero-ability {
    padding: 8px 10px;
  }

  .btn-start-battle {
    padding: 14px 40px;
    font-size: 1rem;
  }

  .hud-player-info {
    top: 8px;
    left: 8px;
    padding: 10px 12px;
    min-width: 180px;
  }

  .hud-player-avatar {
    width: 36px;
    height: 36px;
  }

  .hud-player-name {
    font-size: 0.8rem;
  }

  .hud-bar-track {
    height: 6px;
  }

  .hud-top-right {
    top: 8px;
    right: 8px;
  }

  .hud-game-timer {
    padding: 8px 14px;
  }

  .hud-timer-value {
    font-size: 1rem;
  }

  .hud-ability-bar {
    bottom: 12px;
    gap: 5px;
    padding: 8px 12px;
  }

  .ability-slot {
    width: 48px;
    height: 48px;
  }

  .ability-slot.ultimate {
    width: 54px;
    height: 54px;
  }

  .ability-slot-key {
    font-size: 0.55rem;
  }

  .hud-minimap {
    bottom: 8px;
    left: 8px;
  }

  .minimap-container {
    width: 130px;
    height: 130px;
  }

  .hud-kill-feed {
    top: 70px;
    width: 220px;
  }

  .kill-feed-entry {
    padding: 6px 8px;
    font-size: 0.7rem;
  }

  .hud-gold-cs {
    bottom: 80px;
    padding: 6px 14px;
    gap: 16px;
  }

  .hud-gold-value,
  .hud-cs-value {
    font-size: 0.85rem;
  }

  .results-banner h1 {
    font-size: 2rem;
  }

  .results-stats-table thead th,
  .results-stats-table tbody td {
    padding: 10px 14px;
    font-size: 0.8rem;
  }

  .results-actions {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
  }

  .results-actions .btn-primary,
  .results-actions .btn-secondary {
    width: 100%;
  }

  .auth-card {
    padding: 28px 24px;
    margin: 16px;
  }

  #stats-screen {
    padding: 24px 16px;
  }

  .stats-hero-table thead th,
  .stats-hero-table tbody td {
    padding: 10px 12px;
    font-size: 0.78rem;
  }

  .stats-match-entry {
    padding: 10px 16px;
    gap: 10px;
  }
}

/* Mobile portrait */
@media (max-width: 480px) {
  .hero-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-card-icon {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  .hero-details-stats {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .ability-slot {
    width: 44px;
    height: 44px;
  }

  .ability-slot.ultimate {
    width: 50px;
    height: 50px;
  }

  .minimap-container {
    width: 110px;
    height: 110px;
  }

  .hud-kill-feed {
    display: none;
  }

  .hud-enemy-info {
    min-width: 160px;
  }

  .loading-logo {
    font-size: 1.6rem;
  }

  .results-banner h1 {
    font-size: 1.6rem;
  }

  .stats-hero-table-container {
    overflow-x: auto;
  }

  .stats-hero-table {
    min-width: 500px;
  }

  .stats-match-date {
    display: none;
  }
}


/* ---------------------------------------------------------------
   13. UTILITY CLASSES
   --------------------------------------------------------------- */

/* Display */
.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden;
}

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

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Text */
.text-cyan { color: var(--accent-cyan); }
.text-purple { color: var(--accent-purple); }
.text-gold { color: var(--accent-gold); }
.text-red { color: var(--accent-red); }
.text-green { color: var(--accent-green); }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-uppercase {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.font-heading { font-family: var(--font-heading); }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.font-bold { font-weight: 700; }

/* Spacing */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* Borders */
.border-subtle {
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.border-accent {
  border: 1px solid var(--accent-cyan);
}

/* Glow effects */
.glow-cyan { box-shadow: var(--glow-cyan); }
.glow-purple { box-shadow: var(--glow-purple); }
.glow-gold { box-shadow: var(--glow-gold); }
.glow-red { box-shadow: var(--glow-red); }
.glow-green { box-shadow: var(--glow-green); }

/* Background blur panel */
.glass-panel {
  background: var(--bg-overlay);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}


/* ---------------------------------------------------------------
   14. TRANSITIONS & ANIMATIONS
   --------------------------------------------------------------- */

/* Smooth entrance for HUD elements */
.hud-enter {
  animation: hud-enter 0.5s ease-out;
}

@keyframes hud-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pulse effect for important elements */
.pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Glow pulse for ready abilities */
.glow-pulse {
  animation: glow-pulse 1.5s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 229, 255, 0.2); }
  50% { box-shadow: 0 0 25px rgba(0, 229, 255, 0.5); }
}

/* Scale bounce on interaction */
.bounce-in {
  animation: bounce-in 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes bounce-in {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Shake for damage taken */
.shake {
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* Level up flash */
.level-up-flash {
  animation: level-up-flash 0.6s ease-out;
}

@keyframes level-up-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.8);
  }
  100% {
    box-shadow: 0 0 0 20px rgba(251, 191, 36, 0);
  }
}

/* Damage number float */
.damage-number {
  position: absolute;
  font-family: var(--font-heading);
  font-weight: 800;
  pointer-events: none;
  animation: damage-float 1s ease-out forwards;
  z-index: var(--z-overlay);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.damage-number.physical {
  color: var(--accent-red);
}

.damage-number.magic {
  color: var(--accent-purple);
}

.damage-number.heal {
  color: var(--accent-green);
}

.damage-number.critical {
  font-size: 1.4em;
  color: var(--accent-gold);
}

@keyframes damage-float {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  20% {
    transform: translateY(-10px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) scale(0.8);
  }
}


/* ---------------------------------------------------------------
   15. NOTIFICATION & ALERT OVERLAYS
   --------------------------------------------------------------- */

/* In-game notifications */
.game-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 16px 40px;
  background: var(--bg-overlay);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  z-index: var(--z-overlay);
  text-align: center;
  animation: notification-in 0.4s ease-out;
  pointer-events: none;
}

.game-notification h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.game-notification p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.game-notification.fade-out {
  animation: notification-out 0.5s ease-in forwards;
}

@keyframes notification-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes notification-out {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

/* First blood, double kill, etc. */
.game-notification.first-blood h2 {
  color: var(--accent-red);
}

.game-notification.double-kill h2 {
  color: var(--accent-gold);
}

.game-notification.ace h2 {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Respawn timer overlay */
.respawn-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 18, 0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: var(--z-overlay);
}

.respawn-timer {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 900;
  color: var(--text-primary);
  text-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
}

.respawn-label {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 8px;
}


/* ---------------------------------------------------------------
   16. CHAT / COMMUNICATION (Optional HUD Element)
   --------------------------------------------------------------- */

.hud-chat {
  position: absolute;
  bottom: 100px;
  left: 16px;
  width: 320px;
  max-height: 200px;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.hud-chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px;
}

.hud-chat-message {
  font-size: 0.78rem;
  padding: 2px 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.hud-chat-message-sender {
  font-weight: 600;
  margin-right: 4px;
}

.hud-chat-message-sender.ally {
  color: var(--accent-cyan);
}

.hud-chat-message-sender.enemy {
  color: var(--accent-red);
}

.hud-chat-message-sender.system {
  color: var(--accent-gold);
}

.hud-chat-input {
  pointer-events: auto;
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--bg-overlay);
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.hud-chat-input.active {
  opacity: 1;
}

.hud-chat-input input {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg-deep);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.hud-chat-input input:focus {
  border-color: var(--accent-cyan);
}


/* ---------------------------------------------------------------
   17. SCOREBOARD OVERLAY (Tab key)
   --------------------------------------------------------------- */

.scoreboard-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 18, 0.85);
  z-index: var(--z-overlay);
  padding: 40px;
  backdrop-filter: blur(4px);
}

.scoreboard {
  width: 100%;
  max-width: 800px;
  background: var(--bg-mid);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.scoreboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.scoreboard-team-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.scoreboard-team-name.ally {
  color: var(--accent-cyan);
}

.scoreboard-team-name.enemy {
  color: var(--accent-red);
}

.scoreboard-score {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
}

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

.scoreboard-table th {
  padding: 10px 16px;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.scoreboard-table th:first-child {
  text-align: left;
}

.scoreboard-table td {
  padding: 10px 16px;
  font-size: 0.85rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.scoreboard-table td:first-child {
  text-align: left;
}

.scoreboard-table tr:last-child td {
  border-bottom: none;
}

.scoreboard-table tr.self {
  background: rgba(0, 229, 255, 0.05);
}

.scoreboard-player {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scoreboard-player-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

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

.scoreboard-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}


/* ---------------------------------------------------------------
   18. ITEM SHOP OVERLAY
   --------------------------------------------------------------- */

.shop-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 18, 0.9);
  z-index: var(--z-overlay);
  padding: 40px;
  backdrop-filter: blur(8px);
}

.shop-panel {
  width: 100%;
  max-width: 900px;
  max-height: 80vh;
  background: var(--bg-mid);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.shop-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shop-gold {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--accent-gold);
}

.shop-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.shop-categories {
  width: 160px;
  padding: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow-y: auto;
  flex-shrink: 0;
}

.shop-category {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

.shop-category:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.shop-category.active {
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent-cyan);
}

.shop-items {
  flex: 1;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  align-content: start;
  overflow-y: auto;
}

.shop-item {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 2px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  position: relative;
}

.shop-item:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.15);
}

.shop-item.cannot-afford {
  opacity: 0.4;
}

.shop-item-icon {
  width: 32px;
  height: 32px;
}

.shop-item-cost {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent-gold);
}

/* Inventory slots on HUD */
.hud-inventory {
  position: absolute;
  bottom: 24px;
  right: 230px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
}

.inventory-slot {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.inventory-slot img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.inventory-slot.empty {
  opacity: 0.4;
}


/* ---------------------------------------------------------------
   19. PING / MAP INTERACTION INDICATORS
   --------------------------------------------------------------- */

.ping-indicator {
  position: absolute;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: var(--z-hud);
}

.ping-indicator::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-round);
  border: 2px solid var(--accent-gold);
  animation: ping-expand 1.5s ease-out infinite;
}

.ping-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border-radius: var(--radius-round);
  background: var(--accent-gold);
}

@keyframes ping-expand {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Danger ping variant */
.ping-indicator.danger::before {
  border-color: var(--accent-red);
}

.ping-indicator.danger::after {
  background: var(--accent-red);
}

/* Assist ping variant */
.ping-indicator.assist::before {
  border-color: var(--accent-cyan);
}

.ping-indicator.assist::after {
  background: var(--accent-cyan);
}


/* ---------------------------------------------------------------
   20. PRINT / ACCESSIBILITY
   --------------------------------------------------------------- */

@media print {
  body {
    background: white;
    color: black;
  }

  #game-canvas,
  #game-hud,
  #loading-screen {
    display: none !important;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .btn-start-battle::before {
    animation: none;
  }

  .loading-spinner {
    animation: none;
    border-top-color: var(--accent-cyan);
  }
}

/* High contrast mode support */
@media (forced-colors: active) {
  .hud-bar-fill {
    background: CanvasText;
  }

  .btn-primary,
  .btn-secondary {
    border: 2px solid ButtonText;
  }

  .ability-slot {
    border: 2px solid ButtonText;
  }
}

/* Focus visible styles for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}
