/* ==========================================================================
   CLASSIC MODERN SNAKE GAME - DESIGN SYSTEM
   Refined Retro-Arcade, Slate & Charcoal Palette, Natural Emerald & Apple Red
   ========================================================================== */

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

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;

  /* Classic Modern Palette */
  --bg-slate-950: #090d16;
  --bg-slate-900: #0f172a;
  --bg-slate-800: #1e293b;
  --bg-slate-700: #334155;
  --bg-card: rgba(30, 41, 59, 0.82);
  --bg-card-hover: rgba(51, 65, 85, 0.85);

  /* Accents */
  --accent-green: #22c55e;
  --accent-green-dark: #16a34a;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --accent-blue: #3b82f6;

  /* Ranking Colors */
  --gold: #f59e0b;
  --silver: #cbd5e1;
  --bronze: #d97706;

  /* Borders & Shadows */
  --border-light: rgba(255, 255, 255, 0.08);
  --border-card: rgba(148, 163, 184, 0.14);
  --border-accent: rgba(34, 197, 94, 0.35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.45);

  /* Text */
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  /* Dimensions */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;
  --transition: all 0.2s ease-in-out;
}

/* Base Reset & Core Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-slate-900);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    linear-gradient(to bottom, #0f172a 0%, #090d16 100%);
  background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-slate-950);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-slate-700);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-green);
}

/* High-Contrast Readable Typography Classes */
h1, h2, h3, h4, h5, h6, .font-display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Override Bootstrap's low-contrast dark-mode colors */
.text-muted {
  color: #94a3b8 !important; /* Crisp Slate 400 - high contrast, clear & easy to read */
}

.text-subtle {
  color: #cbd5e1 !important;
}

.text-lime, .text-green {
  color: #4ade80 !important; /* Vibrant Emerald Green */
}

.text-cyan, .text-blue, .text-primary {
  color: #38bdf8 !important; /* Vibrant Sky Cyan - highly readable on dark backgrounds */
}

.text-purple {
  color: #c084fc !important;
}

.text-red, .text-danger {
  color: #f87171 !important;
}

.text-warning, .text-gold {
  color: #fbbf24 !important;
}

.text-silver {
  color: #e2e8f0 !important;
}

.text-bronze {
  color: #fb923c !important;
}

.text-gradient {
  background: linear-gradient(135deg, #ffffff 30%, #4ade80 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Modern Matte Panels (Replacing intense glow) */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.glass-panel:hover {
  border-color: rgba(148, 163, 184, 0.22);
}

.glass-panel-glow {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* Navbar */
.navbar-custom {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.navbar-brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.navbar-brand .brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(145deg, #22c55e, #16a34a);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.45rem 1rem !important;
  border-radius: var(--radius-pill);
  transition: var(--transition);
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: #fff !important;
  background: rgba(34, 197, 94, 0.15) !important;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Tactile Classic Modern Buttons */
.btn-lime {
  background: #22c55e;
  color: #ffffff;
  font-weight: 700;
  font-family: var(--font-display);
  border-radius: var(--radius-md);
  padding: 0.65rem 1.6rem;
  border: 1px solid #16a34a;
  border-bottom: 3px solid #15803d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: all 0.15s ease;
  text-decoration: none;
  cursor: pointer;
}

.btn-lime:hover {
  background: #16a34a;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32);
}

.btn-lime:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-outline-glass {
  background: rgba(30, 41, 59, 0.7);
  color: var(--text-primary);
  border: 1px solid var(--border-card);
  border-bottom: 2px solid #334155;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 0.65rem 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
  text-decoration: none;
  cursor: pointer;
}

.btn-outline-glass:hover {
  background: #334155;
  border-color: rgba(148, 163, 184, 0.35);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline-glass:active {
  transform: translateY(1px);
}

/* Badges */
.badge-lime {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-cyan {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Forms */
.form-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.form-control-custom {
  background: #0b1120;
  border: 1px solid var(--border-card);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-control-custom:focus {
  background: #0f172a;
  border-color: var(--accent-green);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
  outline: none;
}

.form-control-custom::placeholder {
  color: #94a3b8;
  opacity: 0.8;
}

/* Dropdown Menu - High Contrast Dark Mode */
.dropdown-menu {
  background: #1e293b !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5) !important;
}

.dropdown-item {
  color: #f1f5f9 !important;
  padding: 0.5rem 1rem !important;
  font-weight: 500;
  transition: all 0.15s ease;
}

.dropdown-item:hover, .dropdown-item:focus {
  background-color: #334155 !important;
  color: #ffffff !important;
}

.dropdown-item.text-danger {
  color: #f87171 !important;
}

.dropdown-item.text-danger:hover {
  background-color: rgba(239, 68, 68, 0.2) !important;
  color: #fca5a5 !important;
}

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

.input-icon-wrapper i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.input-icon-wrapper .form-control-custom {
  padding-left: 2.8rem;
}

/* User Avatar */
.avatar-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  background: #1e293b;
  border: 2px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.avatar-circle.avatar-lg {
  width: 76px;
  height: 76px;
  font-size: 2rem;
  border-width: 3px;
  box-shadow: var(--shadow-md);
}

/* Stat Cards */
.stat-card {
  padding: 1.3rem;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Leaderboard Podium */
.podium-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1.2rem;
  padding: 1.5rem 0;
  margin-bottom: 1.5rem;
}

.podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: var(--transition);
  flex: 1;
  max-width: 220px;
}

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

.podium-crown {
  font-size: 1.6rem;
  margin-bottom: 0.3rem;
}

.podium-avatar {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 3px solid;
  margin-bottom: 0.6rem;
  box-shadow: var(--shadow-sm);
}

.podium-step.rank-1 .podium-avatar {
  width: 78px;
  height: 78px;
  border-color: var(--gold);
}

.podium-step.rank-2 .podium-avatar {
  border-color: var(--silver);
}

.podium-step.rank-3 .podium-avatar {
  border-color: var(--bronze);
}

.podium-pillar {
  width: 100%;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.5rem;
  margin-top: 0.6rem;
}

.podium-step.rank-1 .podium-pillar {
  height: 140px;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.2) 0%, rgba(30, 41, 59, 0.9) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.podium-step.rank-2 .podium-pillar {
  height: 110px;
  background: linear-gradient(180deg, rgba(203, 213, 225, 0.15) 0%, rgba(30, 41, 59, 0.9) 100%);
  border: 1px solid rgba(203, 213, 225, 0.25);
}

.podium-step.rank-3 .podium-pillar {
  height: 85px;
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.15) 0%, rgba(30, 41, 59, 0.9) 100%);
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.podium-rank-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
}

.podium-score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}

/* Leaderboard Table */
.table-leaderboard {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

.table-leaderboard tr {
  background: rgba(30, 41, 59, 0.65);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.table-leaderboard tr:hover {
  background: rgba(51, 65, 85, 0.8);
  transform: translateX(3px);
}

.table-leaderboard tr.user-highlight {
  background: rgba(34, 197, 94, 0.14) !important;
  border: 1px solid rgba(34, 197, 94, 0.4) !important;
  border-left: 4px solid #22c55e !important;
}

.table-leaderboard td, .table-leaderboard th {
  padding: 0.9rem 1.1rem;
  vertical-align: middle;
  border: none;
}

.table-leaderboard th {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.table-leaderboard tr td:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.table-leaderboard tr td:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Footer */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  background: var(--bg-slate-950);
  padding: 1.8rem 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
