/* ═══════════════════════════════════════════════════════════════════════════════
   FMLY Bot Dashboard — Premium Dark Theme
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg-primary: #05060a;
  --bg-secondary: #0c0d14;
  --bg-card: rgba(14, 15, 24, 0.65);
  --bg-card-hover: rgba(20, 22, 34, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-hover: rgba(255, 255, 255, 0.12);
  --text-primary: #eef0f6;
  --text-secondary: #6b7394;
  --text-muted: #3e4360;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.25);
  --success: #22c55e;
  --success-glow: rgba(34, 197, 94, 0.25);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.25);
  --gold: #fbbf24;
  --silver: #94a3b8;
  --bronze: #d97706;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.3);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 40px var(--accent-glow);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

::selection {
  background: var(--accent);
  color: white;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15);
}

/* ─── Base ──────────────────────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Particle Canvas ──────────────────────────────────────────────────────── */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ─── Animated Mesh Background ─────────────────────────────────────────────── */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.mesh-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  will-change: transform;
}

.mesh-orb-1 {
  width: 600px;
  height: 600px;
  background: conic-gradient(from 0deg, #6366f1, #8b5cf6, #a78bfa, #6366f1);
  top: -15%;
  left: -10%;
  animation: meshFloat1 25s ease-in-out infinite;
}

.mesh-orb-2 {
  width: 500px;
  height: 500px;
  background: conic-gradient(from 120deg, #ef4444, #f97316, #fbbf24, #ef4444);
  bottom: -10%;
  right: -10%;
  animation: meshFloat2 30s ease-in-out infinite;
}

.mesh-orb-3 {
  width: 400px;
  height: 400px;
  background: conic-gradient(from 240deg, #22c55e, #06b6d4, #3b82f6, #22c55e);
  top: 50%;
  left: 50%;
  animation: meshFloat3 20s ease-in-out infinite;
}

.mesh-orb-4 {
  width: 350px;
  height: 350px;
  background: conic-gradient(from 60deg, #ec4899, #8b5cf6, #6366f1, #ec4899);
  top: 20%;
  right: 20%;
  animation: meshFloat4 28s ease-in-out infinite;
}

@keyframes meshFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  33% { transform: translate(80px, 60px) scale(1.15) rotate(120deg); }
  66% { transform: translate(-40px, 100px) scale(0.95) rotate(240deg); }
}

@keyframes meshFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  33% { transform: translate(-60px, -80px) scale(1.1) rotate(-120deg); }
  66% { transform: translate(50px, -40px) scale(0.9) rotate(-240deg); }
}

@keyframes meshFloat3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-30%, -60%) scale(1.2); }
}

@keyframes meshFloat4 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(-80px, 50px) scale(1.1) rotate(180deg); }
}

/* Grid lines background */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* ─── Top Bar ──────────────────────────────────────────────────────────────── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  background: rgba(5, 6, 10, 0.7);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--transition-smooth);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-bar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.top-bar-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

.top-bar-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.top-bar-divider {
  width: 1px;
  height: 24px;
  background: var(--glass-border);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Live indicator */
.live-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--success); }
  50% { opacity: 0.5; box-shadow: 0 0 4px var(--success); }
}

/* Countdown Timer */
.refresh-timer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.refresh-timer svg {
  width: 16px;
  height: 16px;
}

.timer-ring {
  stroke: var(--accent);
  stroke-dasharray: 44;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
  transform: rotate(-90deg);
  transform-origin: center;
}

/* Theme Toggle */
.theme-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-smooth);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
}

/* ─── Main Layout ──────────────────────────────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ─── Hero Header ──────────────────────────────────────────────────────────── */
.hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.guild-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.guild-icon-wrapper {
  position: relative;
}

.guild-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  background-size: cover;
  background-position: center;
  border: 2px solid var(--glass-border);
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.guild-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

.guild-icon-status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: var(--success);
  border-radius: 50%;
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 8px var(--success-glow);
}

.guild-text h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 30%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.guild-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* ─── Stat Chips ───────────────────────────────────────────────────────────── */
.stat-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  transition: all var(--transition-smooth);
  cursor: default;
}

.stat-chip:hover {
  border-color: var(--glass-border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.stat-chip-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.stat-chip-icon.accent {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-light);
}

.stat-chip-icon.warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}

.stat-chip-icon.danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.stat-chip-icon.success {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.stat-chip-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-chip-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
}

.stat-chip-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* ─── Navigation Tabs ──────────────────────────────────────────────────────── */
.nav-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.3rem;
  overflow-x: auto;
  position: relative;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  position: relative;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-smooth);
  white-space: nowrap;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.tab-btn.active {
  color: white;
  background: var(--accent-gradient);
  box-shadow: 0 4px 15px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}

.tab-btn .tab-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.1);
  min-width: 20px;
  text-align: center;
}

.tab-btn.active .tab-count {
  background: rgba(255,255,255,0.2);
}

/* ─── Content Sections ─────────────────────────────────────────────────────── */
.content-wrapper {
  position: relative;
}

.tab-content {
  display: none;
  animation: contentFadeIn 0.45s var(--transition-spring) forwards;
}

.tab-content.active {
  display: block;
}

@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Section Header ───────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

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

/* ─── Search Bar ───────────────────────────────────────────────────────────── */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0 1rem;
  transition: all var(--transition-smooth);
  min-width: 280px;
  overflow: hidden;
}

.search-container::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: linear-gradient(135deg, var(--accent-glow), transparent);
  transition: opacity var(--transition-smooth);
  pointer-events: none;
}

.search-container:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-glow);
}

.search-container:focus-within::before {
  opacity: 0.05;
}

.search-icon {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-right: 0.75rem;
  transition: color var(--transition-smooth);
}

.search-container:focus-within .search-icon {
  color: var(--accent-light);
}

.search-container input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.75rem 0;
  width: 100%;
}

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

.search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.35rem;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.search-clear:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Keyboard shortcut hint */
.search-shortcut {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.search-shortcut kbd {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
}

/* ─── Search Results Dropdown ──────────────────────────────────────────────── */
.search-results {
  position: relative;
  background: rgba(12, 13, 20, 0.97);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  overflow: hidden;
  animation: dropdownSlide 0.3s var(--transition-spring) forwards;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(99, 102, 241, 0.05);
}

@keyframes dropdownSlide {
  from { opacity: 0; transform: translateY(-8px) scaleY(0.97); }
  to { opacity: 1; transform: translateY(0) scaleY(1); }
}

.search-results-header {
  padding: 0.6rem 1.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  position: relative;
}

.search-result-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.search-result-item:hover {
  background: rgba(99, 102, 241, 0.06);
}

.search-result-item:hover::before {
  opacity: 1;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-result-pos {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 36px;
}

.search-result-pos.top3 {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.search-result-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.search-result-username {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 400;
}

.search-result-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-result-elo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.search-no-results {
  padding: 2.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-no-results-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
  opacity: 0.5;
}

/* ─── Table Card ───────────────────────────────────────────────────────────── */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: border-color var(--transition-smooth);
}

.table-card:hover {
  border-color: var(--glass-border-hover);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 0.85rem 1.25rem;
  white-space: nowrap;
}

th {
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.015);
  position: sticky;
  top: 0;
  z-index: 5;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

th:hover {
  color: var(--text-secondary);
}

th.sortable::after {
  content: '↕';
  margin-left: 0.4rem;
  opacity: 0.3;
  font-size: 0.65rem;
}

th.sort-asc::after {
  content: '↑';
  opacity: 1;
  color: var(--accent-light);
}

th.sort-desc::after {
  content: '↓';
  opacity: 1;
  color: var(--accent-light);
}

tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.025);
  transition: all var(--transition-fast);
}

tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(99, 102, 241, 0.03);
}

tbody tr.clickable-row {
  cursor: pointer;
}

tbody tr.clickable-row:hover {
  background: rgba(99, 102, 241, 0.06);
}

tbody tr.clickable-row:active {
  background: rgba(99, 102, 241, 0.1);
}

/* Row entrance animation */
tbody tr {
  animation: rowSlideIn 0.35s ease-out backwards;
}

@keyframes rowSlideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ─── Player Cell ──────────────────────────────────────────────────────────── */
.player-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.player-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  object-fit: cover;
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.player-name-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.player-display-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.player-username {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ─── Rank Badge ───────────────────────────────────────────────────────────── */
.rank-badge {
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  position: relative;
  overflow: hidden;
}

.rank-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.1));
  pointer-events: none;
}

/* Animated shimmer for top ranks */
.rank-badge.rank-archnemesis::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255,255,255,0.15) 50%,
    transparent 60%
  );
  animation: rankShimmer 3s infinite;
}

@keyframes rankShimmer {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

/* Position badges (1st, 2nd, 3rd) */
.position-badge {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85rem;
  min-width: 42px;
  text-align: center;
}

.position-badge.pos-1 {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
  font-size: 1rem;
}

.position-badge.pos-2 {
  color: var(--silver);
  text-shadow: 0 0 8px rgba(148, 163, 184, 0.3);
}

.position-badge.pos-3 {
  color: var(--bronze);
  text-shadow: 0 0 8px rgba(217, 119, 6, 0.3);
}

/* ELO cell */
.elo-cell {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
}

/* Banned tag */
.banned-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: 0.6rem;
  font-weight: 800;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
  margin-left: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: bannedPulse 3s infinite;
}

@keyframes bannedPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}

/* ─── Player Modal ─────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-smooth);
  padding: 1rem;
}

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

.player-modal {
  background: rgba(14, 15, 24, 0.97);
  backdrop-filter: blur(40px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg), 0 0 100px rgba(99, 102, 241, 0.05);
  position: relative;
}

.modal-overlay.active .player-modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.modal-header {
  padding: 3rem 2rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.modal-rank-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  height: 250px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.2;
  pointer-events: none;
  animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.15; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.25; transform: translateX(-50%) scale(1.1); }
}

.modal-position {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.5rem;
  position: relative;
}

.modal-player-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  position: relative;
}

.modal-player-username {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.3rem;
  position: relative;
}

.modal-body {
  padding: 0 2rem 2rem;
}

.modal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.modal-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 1rem 0.75rem;
  text-align: center;
  transition: all var(--transition-smooth);
}

.modal-stat-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
}

/* ELO bar */
.elo-bar-container {
  margin-top: 0.6rem;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.elo-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--accent-gradient);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* Ban Info */
.modal-ban-info {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  animation: fadeSlideUp 0.3s ease;
}

.ban-header {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--danger);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ban-details {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.ban-details strong {
  color: var(--text-primary);
}

/* Roblox Link */
.modal-roblox-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition-smooth);
}

.modal-roblox-link:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}

/* Status colors */
.status-active { color: var(--success); }
.status-banned { color: var(--danger); }

/* ─── Loaders ──────────────────────────────────────────────────────────────── */
.loading-spinner {
  width: 36px;
  height: 36px;
  margin: 3rem auto;
  position: relative;
}

.loading-spinner::before,
.loading-spinner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
}

.loading-spinner::before {
  border-top-color: var(--accent);
  animation: spinCW 1s ease-in-out infinite;
}

.loading-spinner::after {
  border-bottom-color: var(--accent-light);
  animation: spinCCW 1.5s ease-in-out infinite;
}

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

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

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
  opacity: 0.4;
}

.empty-state-text {
  font-size: 0.9rem;
  max-width: 300px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ─── Skeleton ─────────────────────────────────────────────────────────────── */
.skeleton-circle {
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-text {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  background-size: 200% 100%;
  border-radius: 6px;
  animation: shimmer 1.5s infinite;
  width: 220px;
  height: 2.2rem;
}

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

/* ─── Toast Notifications ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(14, 15, 24, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  animation: toastIn 0.4s var(--transition-spring) forwards;
  max-width: 360px;
}

.toast.toast-out {
  animation: toastOut 0.3s ease forwards;
}

.toast-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(10px) scale(0.95); }
}

/* ─── Scroll to Top FAB ───────────────────────────────────────────────────── */
.scroll-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-md), 0 0 25px var(--accent-glow);
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-smooth);
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 40px var(--accent-glow);
}

/* ─── Footer ───────────────────────────────────────────────────────────────── */
.page-footer {
  text-align: center;
  padding: 3rem 1rem 2rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.page-footer a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.page-footer a:hover {
  color: var(--accent);
}

/* ─── Tooltip ──────────────────────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(14, 15, 24, 0.95);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--transition-fast);
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ─── Animations ───────────────────────────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeSlideUp 0.5s ease-out forwards;
}

/* Stagger children */
.stagger-children > * {
  animation: fadeSlideUp 0.4s ease-out backwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }

/* Number counter animation */
.counter-animate {
  display: inline-block;
  transition: transform 0.3s ease;
}

.counter-animate.bump {
  transform: scale(1.15);
}

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .top-bar {
    padding: 0.6rem 1rem;
  }

  .top-bar-divider,
  .refresh-timer,
  .search-shortcut {
    display: none;
  }

  .page-wrapper {
    padding: 1.5rem 1rem 3rem;
  }

  .hero-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-stats {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
  }

  .stat-chip {
    flex-shrink: 0;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .search-container {
    min-width: unset;
  }

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

  .player-modal {
    max-width: 100%;
    border-radius: var(--radius-lg);
  }

  .modal-position {
    font-size: 2.5rem;
  }

  th, td {
    padding: 0.7rem 0.85rem;
  }
}

@media (max-width: 480px) {
  .page-wrapper {
    padding: 1rem 0.75rem 3rem;
  }

  .guild-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
  }

  .nav-tabs {
    border-radius: var(--radius-sm);
  }

  .tab-btn {
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .stat-chip {
    padding: 0.5rem 0.85rem;
  }

  .scroll-top-btn {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
}

/* ─── Print Styles ─────────────────────────────────────────────────────────── */
@media print {
  .mesh-bg,
  .grid-bg,
  #particle-canvas,
  .top-bar,
  .scroll-top-btn,
  .toast-container {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }
}
