/* ============================================
   CSS Variables & Design System
   ============================================ */

:root {
  /* Color Palette - Dark Theme */
  --bg-primary: #0a0e14;
  --bg-secondary: #151a23;
  --bg-tertiary: #1e2430;
  --bg-elevated: #252d3d;
  --bg-elevated-hover: #2d3548;
  
  --text-primary: #e6edf3;
  --text-secondary: #adbac7;
  --text-muted: #768390;
  --text-disabled: #545d68;
  
  --brand-primary: #00d4aa;
  --brand-secondary: #00b894;
  --brand-hover: #00e6bf;
  
  --accent-blue: #539bf5;
  --accent-purple: #b083f0;
  --accent-red: #f47067;
  --accent-orange: #ff9500;
  --accent-yellow: #ffc043;
  
  --border-default: #373e47;
  --border-muted: #2d333b;
  --border-subtle: #21262d;
  
  /* Elevation/Shadows */
  --elevation-0: none;
  --elevation-1: 0 1px 3px rgba(0, 0, 0, 0.3);
  --elevation-2: 0 4px 12px rgba(0, 0, 0, 0.4);
  --elevation-3: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --elevation-4: 0 16px 48px rgba(0, 0, 0, 0.6);
  
  /* Spacing Scale (4px base) */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-7: 1.75rem;   /* 28px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 2rem;      /* 32px */
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  --letter-spacing-tight: -0.01em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.02em;
  
  /* Transitions */
  --transition-fast: 100ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Layout */
  --sidebar-width: 300px;
  --navbar-height: 64px;
  --content-max-width: 1600px;
}

/* Light Theme */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f6f8fa;
  --bg-tertiary: #eaeef2;
  --bg-elevated: #ffffff;
  --bg-elevated-hover: #f6f8fa;
  
  --text-primary: #1f2328;
  --text-secondary: #57606a;
  --text-muted: #656d76;
  --text-disabled: #8c959f;
  
  --brand-primary: #00a88e;
  --brand-secondary: #008f7a;
  --brand-hover: #00c9a8;
  
  --accent-blue: #0969da;
  --accent-purple: #8250df;
  --accent-red: #cf222e;
  --accent-orange: #d15704;
  --accent-yellow: #9a6700;
  
  --border-default: #d0d7de;
  --border-muted: #d8dee4;
  --border-subtle: #eaeef2;
  
  --elevation-1: 0 1px 3px rgba(0, 0, 0, 0.08);
  --elevation-2: 0 4px 12px rgba(0, 0, 0, 0.12);
  --elevation-3: 0 8px 24px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --elevation-4: 0 16px 48px rgba(0, 0, 0, 0.18);
}

/* ============================================
   Base Styles
   ============================================ */

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Accessibility
   ============================================ */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand-primary);
  color: var(--bg-primary);
  padding: var(--space-3) var(--space-6);
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-md);
  z-index: 1000;
}

.skip-link:focus {
  top: var(--space-4);
  left: var(--space-4);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

*:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* ============================================
   Navigation styles moved to nav-styles.css
   ============================================ */

/* ============================================
   Layout
   ============================================ */

.highscores-main {
  min-height: calc(100vh - var(--navbar-height));
}

.container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.hero-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.hero-title {
  font-size: clamp(var(--font-size-2xl), 4vw, var(--font-size-3xl));
  font-weight: var(--font-weight-bold);
  color: var(--brand-primary);
  letter-spacing: var(--letter-spacing-tight);
  line-height: var(--line-height-tight);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.hero-subtitle {
  color: var(--text-secondary);
  font-weight: var(--font-weight-normal);
  font-size: var(--font-size-lg);
}

.monster-highscores-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: var(--space-8);
  align-items: start;
}

/* ============================================
   Sidebar
   ============================================ */

.monster-sidebar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: sticky;
  top: calc(var(--navbar-height) + var(--space-4));
  max-height: calc(100vh - var(--navbar-height) - var(--space-8));
  overflow-y: auto;
  box-shadow: var(--elevation-1);
  transition: all var(--transition-base);
}

/* Custom Scrollbar */
.monster-sidebar::-webkit-scrollbar {
  width: 8px;
}

.monster-sidebar::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}

.monster-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: var(--radius-full);
}

.monster-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--brand-primary);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.sidebar-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  letter-spacing: var(--letter-spacing-tight);
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: var(--font-size-xl);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.sidebar-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.sidebar-search {
  position: relative;
  margin-bottom: var(--space-6);
}

.sidebar-search-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  padding-left: var(--space-10);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  transition: all var(--transition-base);
}

.sidebar-search-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.sidebar-search-input::placeholder {
  color: var(--text-muted);
}

.sidebar-search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--font-size-base);
  pointer-events: none;
}

.sidebar-section {
  margin-bottom: var(--space-6);
}

.sidebar-section:last-child {
  margin-bottom: 0;
}

.sidebar-section-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  margin-bottom: var(--space-3);
}

.monster-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.monster-kill-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.monster-kill-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--brand-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.monster-kill-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-muted);
}

.monster-kill-item:hover .monster-icon {
  transform: scale(1.1);
}

.monster-kill-item.active {
  background: rgba(0, 212, 170, 0.1);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.monster-kill-item.active::before {
  transform: scaleX(1);
}

.monster-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  position: relative;
  transition: transform var(--transition-base);
}

.monster-image {
  width: 24px;
  height: 24px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.monster-emoji-fallback {
  font-size: var(--font-size-lg);
}

.monster-kill-item.active .monster-icon {
  background: rgba(0, 212, 170, 0.2);
}

.monster-name {
  flex: 1;
  text-align: left;
  line-height: var(--line-height-tight);
}

/* ============================================
   Podium Section
   ============================================ */

.podium-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
  box-shadow: var(--elevation-2);
}

.podium-container {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: var(--space-6);
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.podium-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: all var(--transition-base);
}

.podium-player:hover {
  transform: translateY(-4px);
}

.podium-first {
  order: 2;
  z-index: 3;
}

.podium-second {
  order: 1;
  z-index: 2;
}

.podium-third {
  order: 3;
  z-index: 1;
}

.podium-rank {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  color: white;
  box-shadow: var(--elevation-2);
  z-index: 10;
}

.podium-first .podium-rank {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #1a1a1a;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4);
}

.podium-second .podium-rank {
  background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
  color: #1a1a1a;
  box-shadow: 0 4px 16px rgba(192, 192, 192, 0.4);
}

.podium-third .podium-rank {
  background: linear-gradient(135deg, #cd7f32, #daa520);
  color: white;
  box-shadow: 0 4px 16px rgba(205, 127, 50, 0.4);
}

.podium-player-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.podium-username {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  line-height: var(--line-height-tight);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.podium-first .podium-username {
  color: #ffd700;
  text-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
}

.podium-second .podium-username {
  color: #e8e8e8;
  text-shadow: 0 2px 8px rgba(192, 192, 192, 0.5);
}

.podium-third .podium-username {
  color: #daa520;
  text-shadow: 0 2px 8px rgba(205, 127, 50, 0.5);
}

/* Podium Player Links */
.podium-player-link {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  margin: calc(-1 * var(--space-1)) calc(-1 * var(--space-2));
}

.podium-player-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.podium-player-link:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  background-color: rgba(0, 212, 170, 0.1);
}

.podium-first .podium-player-link:hover {
  background-color: rgba(255, 215, 0, 0.2);
  text-shadow: 0 4px 16px rgba(255, 215, 0, 0.6);
}

.podium-second .podium-player-link:hover {
  background-color: rgba(192, 192, 192, 0.2);
  text-shadow: 0 4px 16px rgba(192, 192, 192, 0.6);
}

.podium-third .podium-player-link:hover {
  background-color: rgba(205, 127, 50, 0.2);
  text-shadow: 0 4px 16px rgba(205, 127, 50, 0.6);
}

.podium-kills {
  font-size: var(--font-size-base);
  color: var(--brand-primary);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-mono);
  background: rgba(0, 212, 170, 0.1);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 212, 170, 0.2);
}

.podium-pedestal {
  width: 100px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.podium-first .podium-pedestal {
  height: 140px;
  box-shadow: 0 12px 40px rgba(255, 215, 0, 0.4);
}

.podium-second .podium-pedestal {
  height: 110px;
  box-shadow: 0 10px 36px rgba(192, 192, 192, 0.4);
}

.podium-third .podium-pedestal {
  height: 90px;
  box-shadow: 0 8px 32px rgba(205, 127, 50, 0.4);
}

.podium-pedestal.gold {
  background: linear-gradient(135deg, #ffd700, #ffed4e, #ffd700);
  border-color: rgba(255, 215, 0, 0.3);
}

.podium-pedestal.silver {
  background: linear-gradient(135deg, #c0c0c0, #e8e8e8, #c0c0c0);
  border-color: rgba(192, 192, 192, 0.3);
}

.podium-pedestal.bronze {
  background: linear-gradient(135deg, #cd7f32, #daa520, #cd7f32);
  border-color: rgba(205, 127, 50, 0.3);
}

.podium-pedestal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.2));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.podium-pedestal::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: -6px;
  right: -6px;
  height: 12px;
  background: var(--bg-tertiary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 0, 0, 0.2);
}

/* ============================================
   Selected Monster Header
   ============================================ */

.selected-monster-header {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--elevation-1);
}

.selected-monster-info {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.selected-monster-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-2xl);
}

.selected-monster-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.selected-monster-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.selected-monster-name {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  line-height: var(--line-height-tight);
}

.selected-monster-stats {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: var(--font-weight-normal);
}

#totalKills {
  color: var(--brand-primary);
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
}

.btn-icon {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: var(--font-size-xl);
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.btn-icon:hover {
  background: var(--bg-elevated);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.btn-icon:active .refresh-icon {
  animation: spin 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ============================================
   Controls Toolbar
   ============================================ */

.controls-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.controls-left,
.controls-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  min-width: 280px;
  flex: 1;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  padding-left: var(--space-10);
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  transition: all var(--transition-base);
  height: 40px;
}

.search-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--font-size-base);
  pointer-events: none;
}

.clear-search {
  position: absolute;
  right: var(--space-10);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-elevated);
  border: none;
  border-radius: var(--radius-full);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  transition: all var(--transition-fast);
}

.clear-search:hover {
  background: var(--accent-red);
  color: white;
}

.search-count {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: var(--font-weight-medium);
  pointer-events: none;
}

.sort-dropdown-container,
.page-size-container {
  position: relative;
}

.sort-select,
.page-size-select {
  padding: var(--space-3) var(--space-8) var(--space-3) var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  height: 40px;
  font-family: var(--font-family);
}

.sort-select:hover,
.page-size-select:hover {
  border-color: var(--brand-primary);
}

.sort-select:focus,
.page-size-select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.quick-filters {
  display: flex;
  gap: var(--space-2);
}

.quick-filter-chip {
  padding: var(--space-2) var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-base);
  height: 32px;
}

.quick-filter-chip:hover {
  background: var(--bg-elevated);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.quick-filter-chip.active {
  background: rgba(0, 212, 170, 0.15);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.density-toggle {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.density-btn {
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.density-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.density-btn.active {
  background: var(--brand-primary);
  color: var(--bg-primary);
}

.density-btn:not(:last-child) {
  border-right: 1px solid var(--border-default);
}

/* ============================================
   Table
   ============================================ */

.table-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--elevation-2);
  border: 1px solid var(--border-default);
  overflow: hidden;
}

.table-header {
  padding: var(--space-4) var(--space-6);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-default);
}

.table-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.last-updated,
.result-count {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.meta-label {
  font-weight: var(--font-weight-normal);
}

#lastUpdatedTime {
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}

.result-count {
  font-weight: var(--font-weight-medium);
}

.table-container {
  overflow-x: auto;
  position: relative;
}

.highscores-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.table-sticky-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-tertiary);
}

.highscores-table th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  text-align: center;
  padding: 0;
  border-bottom: 2px solid var(--border-default);
  position: sticky;
  top: 0;
  z-index: 10;
}

.sort-btn {
  width: 100%;
  background: none;
  border: none;
  color: inherit;
  font-weight: inherit;
  font-size: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  transition: all var(--transition-base);
  font-family: var(--font-family);
}

.sort-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.sort-btn.active {
  color: var(--brand-primary);
}

.sort-chevron {
  font-size: var(--font-size-xs);
  opacity: 0.5;
  transition: all var(--transition-base);
}

.sort-chevron.active {
  opacity: 1;
  color: var(--brand-primary);
}

.highscores-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-base);
}

.highscores-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.01);
}

[data-theme="light"] .highscores-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

.highscores-table tbody tr:hover {
  background: rgba(0, 212, 170, 0.05);
}

.highscores-table td {
  padding: var(--space-4);
  font-size: var(--font-size-sm);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Compact density */
body[data-density="compact"] .highscores-table td {
  padding: var(--space-3);
  font-size: var(--font-size-xs);
}

body[data-density="compact"] .selected-monster-header {
  padding: var(--space-4);
}

/* Column widths */
.rank-col {
  width: 100px;
}

.player-col {
  width: auto;
  text-align: left !important;
}

.kills-col {
  width: 180px;
}

/* Rank badges */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 32px;
  padding: 0 var(--space-3);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  font-family: var(--font-mono);
}

.rank-badge.rank-gold {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #1a1a1a;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.rank-badge.rank-silver {
  background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
  color: #1a1a1a;
  box-shadow: 0 2px 8px rgba(192, 192, 192, 0.3);
}

.rank-badge.rank-bronze {
  background: linear-gradient(135deg, #cd7f32, #daa520);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(205, 127, 50, 0.3);
}

/* Player cell */
.player-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.player-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--brand-primary);
  border: 1px solid var(--border-default);
}

.player-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-fast);
}

.player-link:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}

.player-link:visited {
  color: var(--text-secondary);
}

/* Kills cell */
.kills-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

.kills-value {
  font-family: var(--font-mono);
  font-weight: var(--font-weight-semibold);
  color: var(--brand-primary);
  min-width: 80px;
  text-align: right;
}

.kills-progress {
  flex: 1;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  max-width: 60px;
}

.kills-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-secondary), var(--brand-primary));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* Row actions */
.row-actions {
  display: flex;
  gap: var(--space-2);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.highscores-table tbody tr:hover .row-actions {
  opacity: 1;
}

.row-action-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  transition: all var(--transition-fast);
}

.row-action-btn:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
}

/* ============================================
   Pagination
   ============================================ */

.pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-default);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.pagination-bottom {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-top: var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.pagination-info {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.pagination-btn {
  padding: var(--space-2) var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-elevated-hover);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-indicator {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  font-variant-numeric: tabular-nums;
}

/* ============================================
   Loading, Empty, Error States
   ============================================ */

/* Skeleton Loader */
.skeleton-row {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 0%,
    var(--bg-tertiary) 50%,
    var(--bg-elevated) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
  height: 20px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.empty-state,
.error-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  margin-top: var(--space-6);
}

.empty-state.hidden,
.error-state.hidden {
  display: none;
}

.empty-content,
.error-content {
  max-width: 400px;
  margin: 0 auto;
}

.empty-icon,
.error-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  display: block;
}

.empty-state h2,
.error-state h2 {
  color: var(--text-primary);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-3);
}

.empty-state p,
.error-state p {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  line-height: var(--line-height-relaxed);
}

.error-details {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-red);
  margin-bottom: var(--space-6);
}

.error-state {
  border-color: var(--accent-red);
}

/* Buttons */
.btn-primary,
.btn-secondary {
  padding: var(--space-3) var(--space-6);
  border: none;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-family);
}

.btn-primary {
  background: var(--brand-primary);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: var(--elevation-2);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: var(--bg-elevated-hover);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

/* ============================================
   Mobile Responsiveness
   ============================================ */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
  backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
  display: block;
}

@media (max-width: 1024px) {
  .monster-highscores-layout {
    grid-template-columns: 1fr;
  }

  /* Navigation responsive styles moved to nav-styles.css */

  .monster-sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    z-index: 1000;
    transition: left var(--transition-slow);
    max-height: 100vh;
    border-radius: 0;
    padding-top: var(--space-4);
  }

  .monster-sidebar.active {
    left: 0;
  }

  .sidebar-close {
    display: flex;
  }

  .selected-monster-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }
}

@media (max-width: 768px) {
  .container {
    padding: var(--space-4);
  }

  .nav-container {
    padding: 0 var(--space-4);
  }

  .nav-links {
    display: none;
  }

  .hero-title {
    font-size: var(--font-size-xl);
    flex-direction: column;
    gap: var(--space-2);
  }

  .hero-subtitle {
    font-size: var(--font-size-base);
  }

  .controls-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .controls-left,
  .controls-right {
    width: 100%;
    flex-direction: column;
  }

  .search-box {
    max-width: none;
  }

  .pagination-container {
    flex-direction: column;
    text-align: center;
  }

  /* Podium mobile styles */
  .podium-section {
    padding: var(--space-6);
  }

  .podium-container {
    gap: var(--space-4);
    max-width: 100%;
  }

  .podium-player-info {
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    padding: var(--space-3);
  }

  .podium-username {
    font-size: var(--font-size-lg);
  }

  .podium-kills {
    font-size: var(--font-size-sm);
    padding: var(--space-1) var(--space-2);
  }

  .podium-pedestal {
    width: 80px;
  }

  .podium-first .podium-pedestal {
    height: 120px;
  }

  .podium-second .podium-pedestal {
    height: 95px;
  }

  .podium-third .podium-pedestal {
    height: 75px;
  }

  .podium-rank {
    width: 32px;
    height: 32px;
    font-size: var(--font-size-base);
    top: -16px;
  }

  /* Convert table to cards on mobile */
  .table-container {
    font-size: var(--font-size-sm);
  }

  .highscores-table th,
  .highscores-table td {
    padding: var(--space-3);
  }

  .kills-progress {
    display: none;
  }

  .pagination-bottom {
    position: sticky;
    bottom: var(--space-4);
    z-index: 10;
  }
}

@media (max-width: 480px) {
  .rank-col {
    width: 60px;
  }

  .kills-col {
    width: 100px;
  }

  .player-avatar {
    display: none;
  }

  .hero-title {
    font-size: var(--font-size-lg);
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .navbar,
  .controls-toolbar,
  .pagination-container,
  .selected-monster-header button,
  .monster-sidebar {
    display: none;
  }

  .table-card {
    box-shadow: none;
    border: 1px solid #000;
  }
}

/* ============================================
   Utility Classes
   ============================================ */

.hidden {
  display: none !important;
}

.loading {
  cursor: wait;
  pointer-events: none;
}

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

.mt-4 {
  margin-top: var(--space-4);
}

.mb-4 {
  margin-bottom: var(--space-4);
}
