/* ========================================
   SPACE CHESS - DESIGN SYSTEM
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Space Colors */
  --space-black: #0a0a0f;
  --space-deep: #0d0d1a;
  --nebula-purple: #6c3ce0;
  --nebula-blue: #3b82f6;
  --nebula-pink: #ec4899;
  --nebula-cyan: #06d6a0;
  --star-white: #e8e8f0;
  --star-gold: #fbbf24;
  --comet-orange: #f97316;

  /* Gradients */
  --gradient-nebula: linear-gradient(135deg, #6c3ce0 0%, #3b82f6 50%, #06d6a0 100%);
  --gradient-fire: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
  --gradient-glass: linear-gradient(135deg, rgba(108,60,224,0.1) 0%, rgba(59,130,246,0.05) 100%);
  --gradient-dark: linear-gradient(180deg, #0a0a0f 0%, #1a1a2e 50%, #0d0d1a 100%);

  /* Glass */
  --glass-bg: rgba(15, 15, 30, 0.7);
  --glass-border: rgba(108, 60, 224, 0.3);
  --glass-hover: rgba(108, 60, 224, 0.15);

  /* Shadows */
  --shadow-neon: 0 0 20px rgba(108, 60, 224, 0.3), 0 0 40px rgba(59, 130, 246, 0.1);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow-purple: 0 0 30px rgba(108, 60, 224, 0.5);
  --shadow-glow-cyan: 0 0 30px rgba(6, 214, 160, 0.5);

  /* Typography */
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--space-black);
  color: var(--star-white);
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: var(--nebula-cyan); text-decoration: none; transition: all 0.3s; }
a:hover { color: var(--nebula-purple); text-shadow: 0 0 10px var(--nebula-purple); }

/* ========================================
   STARFIELD CANVAS
   ======================================== */
#starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ========================================
   NAVBAR
   ======================================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--gradient-nebula);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-brand .logo-icon {
  font-size: 1.8rem;
  -webkit-text-fill-color: initial;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navbar-links a {
  color: rgba(232, 232, 240, 0.7);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s;
  position: relative;
}

.navbar-links a:hover {
  color: var(--star-white);
  -webkit-text-fill-color: initial;
  text-shadow: 0 0 10px var(--nebula-purple);
}

.navbar-links .user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-xl);
  font-size: 0.85rem;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: var(--radius-xl);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s;
}
.btn:hover::before { left: 100%; }

.btn-primary {
  background: var(--gradient-nebula);
  color: white;
  box-shadow: var(--shadow-glow-purple);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(108, 60, 224, 0.6);
}

.btn-secondary {
  background: transparent;
  color: var(--star-white);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}
.btn-secondary:hover {
  background: var(--glass-hover);
  border-color: var(--nebula-purple);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.75rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1rem; }

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
}

.hero-content {
  max-width: 800px;
  animation: fadeInUp 1s ease;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(108, 60, 224, 0.15);
  border: 1px solid rgba(108, 60, 224, 0.3);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-xl);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--nebula-cyan);
  margin-bottom: 2rem;
  animation: pulse 2s ease-in-out infinite;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: var(--gradient-nebula);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: rgba(232, 232, 240, 0.7);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 3rem;
  justify-content: center;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(108, 60, 224, 0.15);
}

.stat {
  text-align: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-nebula);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(232, 232, 240, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.25rem;
}

/* ========================================
   FEATURES SECTION
   ======================================== */
.section {
  position: relative;
  z-index: 1;
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: var(--gradient-nebula);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-header p {
  color: rgba(232, 232, 240, 0.6);
  font-size: 1.1rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-nebula);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.feature-card:hover::before { transform: scaleX(1); }
.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-neon);
  border-color: var(--nebula-purple);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  display: block;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--star-white);
}

.feature-card p {
  color: rgba(232, 232, 240, 0.6);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ========================================
   MODALS
   ======================================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--space-deep);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-neon);
  animation: slideUp 0.4s ease;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none;
  border: none;
  color: rgba(232, 232, 240, 0.5);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s;
}
.modal-close:hover { color: var(--nebula-pink); }

.modal h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: var(--gradient-nebula);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal .subtitle {
  color: rgba(232, 232, 240, 0.5);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(232, 232, 240, 0.7);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 15, 30, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--star-white);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all 0.3s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--nebula-purple);
  box-shadow: 0 0 15px rgba(108, 60, 224, 0.2);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.modal-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
}

.modal-tab {
  flex: 1;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid var(--glass-border);
  color: rgba(232, 232, 240, 0.5);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
}

.modal-tab:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.modal-tab:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.modal-tab.active {
  background: var(--gradient-nebula);
  color: white;
  border-color: transparent;
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* ========================================
   COMMENTS SECTION (Persistent XSS)
   ======================================== */
.comments-section {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.comment-box {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

.comment-input-area {
  display: flex;
  gap: 1rem;
}

.comment-input-area input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: rgba(15, 15, 30, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--star-white);
  font-size: 0.9rem;
  outline: none;
}

.comment-input-area input:focus {
  border-color: var(--nebula-purple);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-item {
  background: rgba(15, 15, 30, 0.5);
  border: 1px solid rgba(108, 60, 224, 0.1);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  transition: all 0.3s;
}

.comment-item:hover {
  border-color: var(--glass-border);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.comment-username {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--nebula-cyan);
}

.comment-time {
  font-size: 0.75rem;
  color: rgba(232, 232, 240, 0.3);
}

.comment-body {
  font-size: 0.9rem;
  color: rgba(232, 232, 240, 0.7);
  line-height: 1.5;
}

/* ========================================
   DOM XSS WELCOME
   ======================================== */
#dom-xss-target {
  text-align: center;
  padding: 1rem;
  margin: 1rem auto;
  max-width: 600px;
  font-size: 0.95rem;
  color: var(--nebula-cyan);
}

/* ========================================
   LOBBY
   ======================================== */
.lobby-container {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 7rem 2rem 4rem;
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.lobby-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  background: var(--gradient-nebula);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.game-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.3s;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-neon);
  border-color: var(--nebula-purple);
}

.game-card .game-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(232, 232, 240, 0.4);
  margin-bottom: 0.5rem;
}

.game-card .game-players {
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.game-card .game-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-xl);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-waiting {
  background: rgba(251, 191, 36, 0.15);
  color: var(--star-gold);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-active {
  background: rgba(6, 214, 160, 0.15);
  color: var(--nebula-cyan);
  border: 1px solid rgba(6, 214, 160, 0.3);
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: rgba(232, 232, 240, 0.4);
}

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { font-size: 1rem; }

/* ========================================
   CHESS BOARD
   ======================================== */
.game-container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 300px;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 2rem 2rem;
  min-height: 100vh;
}

.game-info-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.game-info-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.game-info-card h3 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 1px;
  color: rgba(232, 232, 240, 0.5);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

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

.player-avatar { font-size: 1.5rem; }
.player-name { font-weight: 600; font-size: 0.95rem; }
.player-turn {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background: rgba(6, 214, 160, 0.2);
  color: var(--nebula-cyan);
  border-radius: var(--radius-xl);
  margin-left: auto;
}

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

.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 70px);
  grid-template-rows: repeat(8, 70px);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-neon), 0 0 60px rgba(108, 60, 224, 0.15);
}

.chess-square {
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  user-select: none;
}

.chess-square.light {
  background: rgba(59, 130, 246, 0.08);
}

.chess-square.dark {
  background: rgba(108, 60, 224, 0.15);
}

.chess-square:hover {
  background: rgba(108, 60, 224, 0.3) !important;
}

.chess-square.selected {
  background: rgba(6, 214, 160, 0.3) !important;
  box-shadow: inset 0 0 20px rgba(6, 214, 160, 0.3);
}

.chess-square.valid-move::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(6, 214, 160, 0.4);
}

.chess-square.valid-move.has-piece::after {
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: rgba(239, 68, 68, 0.2);
  border: 3px solid rgba(239, 68, 68, 0.5);
}

.chess-piece {
  filter: drop-shadow(0 0 8px rgba(108, 60, 224, 0.5));
  transition: all 0.15s;
  pointer-events: none;
}

.chess-square.last-move {
  background: rgba(251, 191, 36, 0.15) !important;
}

/* ========================================
   CHAT PANEL
   ======================================== */
.chat-panel {
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 580px;
}

.chat-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--glass-border);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(232, 232, 240, 0.5);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-message {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(15, 15, 30, 0.5);
  font-size: 0.85rem;
}

.chat-message .msg-user {
  font-weight: 600;
  color: var(--nebula-cyan);
  font-size: 0.75rem;
}

.chat-message .msg-text {
  color: rgba(232, 232, 240, 0.8);
  margin-top: 0.25rem;
  word-break: break-word;
}

.chat-input-area {
  display: flex;
  padding: 0.75rem;
  border-top: 1px solid var(--glass-border);
  gap: 0.5rem;
}

.chat-input-area input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  background: rgba(15, 15, 30, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--star-white);
  font-size: 0.85rem;
  outline: none;
}

.chat-input-area input:focus { border-color: var(--nebula-purple); }
.chat-input-area button { padding: 0.6rem 1rem; }

/* ========================================
   SHARE LINK
   ======================================== */
.share-link-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 15, 30, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  margin-top: 0.75rem;
}

.share-link-box input {
  flex: 1;
  background: none;
  border: none;
  color: var(--nebula-cyan);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  outline: none;
}

.share-link-box button {
  padding: 0.4rem 0.75rem;
  font-size: 0.7rem;
}

/* ========================================
   SEARCH PAGE
   ======================================== */
.search-container {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 7rem 2rem 4rem;
}

.search-results h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

.search-box {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.search-box input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--star-white);
  font-size: 0.9rem;
  outline: none;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  transition: all 0.3s;
}

.user-item:hover {
  border-color: var(--nebula-purple);
  transform: translateX(4px);
}

/* ========================================
   ADMIN PANEL
   ======================================== */
.admin-container {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 7rem 2rem 4rem;
}

.admin-container h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  background: var(--gradient-nebula);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2rem;
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.admin-table th {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(232, 232, 240, 0.5);
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

.admin-table td {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(108, 60, 224, 0.1);
}

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

.admin-table tr:hover td {
  background: rgba(108, 60, 224, 0.05);
}

.user-bio-cell {
  max-width: 200px;
  word-break: break-word;
}

/* ========================================
   LEADERBOARD
   ======================================== */
.leaderboard-container {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
  padding: 7rem 2rem 4rem;
}

.leaderboard-container h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  text-align: center;
  background: var(--gradient-nebula);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: all 0.3s;
}

.leaderboard-item:hover {
  border-color: var(--nebula-purple);
  transform: translateX(4px);
}

.lb-rank {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  width: 40px;
  text-align: center;
  color: var(--star-gold);
}

.lb-name { flex: 1; font-weight: 600; }
.lb-stats {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: rgba(232, 232, 240, 0.5);
}

/* ========================================
   GAME OVER OVERLAY
   ======================================== */
.game-over-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}

.game-over-overlay.active { display: flex; }

.game-over-content {
  text-align: center;
  animation: slideUp 0.5s ease;
}

.game-over-content h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  background: var(--gradient-nebula);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.game-over-content p {
  font-size: 1.2rem;
  color: rgba(232, 232, 240, 0.7);
  margin-bottom: 2rem;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  color: rgba(232, 232, 240, 0.3);
  font-size: 0.8rem;
  border-top: 1px solid rgba(108, 60, 224, 0.1);
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ========================================
   SCROLLBAR
   ======================================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--space-black); }
::-webkit-scrollbar-thumb {
  background: var(--nebula-purple);
  border-radius: 3px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 900px) {
  .game-container {
    grid-template-columns: 1fr;
  }
  .chess-board {
    grid-template-columns: repeat(8, 50px);
    grid-template-rows: repeat(8, 50px);
  }
  .chess-square { width: 50px; height: 50px; font-size: 1.8rem; }
  .chat-panel { height: 300px; }
  .hero-stats { gap: 1.5rem; }
}

@media (max-width: 600px) {
  .chess-board {
    grid-template-columns: repeat(8, 42px);
    grid-template-rows: repeat(8, 42px);
  }
  .chess-square { width: 42px; height: 42px; font-size: 1.5rem; }
  .navbar { padding: 0.75rem 1rem; }
  .hero h1 { font-size: 2rem; }
  .hero-stats { flex-direction: column; gap: 1rem; }
}
