/* ============================================
   ProHub — Design System & Global Styles
   Dark professional theme with purple accents
   ============================================ */

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

/* ── CSS Custom Properties ── */
:root {
  /* Colors — Core */
  --bg-primary: #09090b;
  --bg-secondary: #111114;
  --bg-tertiary: #18181b;
  --bg-elevated: #1c1c22;

  /* Colors — Purple Accent */
  --purple-50: #f5f3ff;
  --purple-100: #ede9fe;
  --purple-200: #ddd6fe;
  --purple-300: #c4b5fd;
  --purple-400: #a78bfa;
  --purple-500: #8b5cf6;
  --purple-600: #7c3aed;
  --purple-700: #6d28d9;
  --purple-800: #5b21b6;
  --purple-900: #4c1d95;

  /* Colors — Text */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-purple: #a78bfa;

  /* Colors — Borders */
  --border-subtle: rgba(139, 92, 246, 0.12);
  --border-default: rgba(139, 92, 246, 0.2);
  --border-hover: rgba(139, 92, 246, 0.4);
  --border-muted: rgba(255, 255, 255, 0.06);

  /* Colors — Status */
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);
  --shadow-glow-lg: 0 0 40px rgba(139, 92, 246, 0.2);

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --nav-height: 72px;
  --max-width: 1200px;
}

/* ── Light Mode Overrides ── */
.light-mode {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-elevated: #e2e8f0;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --border-subtle: rgba(139, 92, 246, 0.15);
  --border-default: rgba(139, 92, 246, 0.3);
  --border-hover: rgba(139, 92, 246, 0.5);
  --border-muted: rgba(0, 0, 0, 0.08);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.light-mode body::before {
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.08) 1px, transparent 1px);
}

.light-mode body::after {
  background: radial-gradient(ellipse, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
}

.light-mode .navbar {
  background: rgba(255, 255, 255, 0.85);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Background Grid Overlay (matches reference) ── */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* Top glow effect */
body::after {
  content: '';
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--purple-800);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--purple-600);
}

/* ── Links ── */
a {
  color: var(--text-purple);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--purple-400);
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; }

/* ── Navigation ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  z-index: 1000;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-fast);
}

.nav-brand:hover {
  color: var(--purple-400);
}

.nav-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link.active {
  background: rgba(139, 92, 246, 0.1);
  color: var(--purple-400);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 24px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple-600), var(--purple-700));
  color: white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.5);
  transform: translateY(-1px);
}

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

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

.btn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.05);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 16px;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-lg {
  padding: 14px 36px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ── Cards ── */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple-500), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

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

/* ── Game Cards ── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-xl);
  width: 100%;
}

.game-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--purple-500), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

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

.game-card-image {
  width: 100%;
  height: 200px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}

.game-card-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--bg-secondary));
}

.game-card-body {
  padding: var(--space-lg);
}

.game-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.game-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-md);
}

.game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-muted);
}

.game-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: var(--radius-full);
  color: var(--purple-400);
  font-size: 0.75rem;
  font-weight: 500;
}

.game-card-play {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--purple-400);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.game-card:hover .game-card-play {
  color: var(--purple-300);
  gap: 8px;
}

/* ── Page Layout ── */
.page {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - var(--nav-height));
  padding-top: calc(var(--nav-height) + var(--space-2xl));
  padding-bottom: var(--space-3xl);
}

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

/* ── Hero Section ── */
.hero {
  text-align: center;
  padding: var(--space-3xl) 0;
  margin-bottom: var(--space-2xl);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 16px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: var(--radius-full);
  color: var(--purple-400);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: var(--space-lg);
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--purple-300) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Section Headers ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
  margin-left: var(--space-lg);
}

/* ── Forms ── */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

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

.form-error {
  font-size: 0.8rem;
  color: var(--error);
  margin-top: var(--space-xs);
}

.form-card {
  max-width: 420px;
  margin: var(--space-3xl) auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
}

.form-card h2 {
  text-align: center;
  margin-bottom: var(--space-sm);
}

.form-card-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-xl);
}

.form-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* ── Leaderboard Table ── */
.leaderboard {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard th {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.leaderboard td {
  padding: var(--space-md) var(--space-lg);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-muted);
}

.leaderboard tr:hover td {
  background: rgba(139, 92, 246, 0.03);
}

.leaderboard .rank {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
  width: 50px;
}

.leaderboard .rank-1 { color: #fbbf24; }
.leaderboard .rank-2 { color: #94a3b8; }
.leaderboard .rank-3 { color: #cd7f32; }

.leaderboard .player {
  font-weight: 600;
  color: var(--text-primary);
}

.leaderboard .score {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--purple-400);
}

.leaderboard .date {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0;
}

.tab {
  padding: var(--space-md) var(--space-lg);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition-fast);
}

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

.tab.active {
  color: var(--purple-400);
  border-bottom-color: var(--purple-500);
}

/* ── Game Screen Layout ── */
.game-screen {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.game-title-screen {
  padding: var(--space-2xl) 0;
}

.game-title-screen h1 {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.game-title-screen .game-icon {
  font-size: 5rem;
  margin-bottom: var(--space-lg);
  display: block;
}

.how-to-play {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin: var(--space-xl) auto;
  max-width: 600px;
  text-align: left;
}

.how-to-play h3 {
  color: var(--purple-400);
  margin-bottom: var(--space-md);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.how-to-play ul {
  list-style: none;
  padding: 0;
}

.how-to-play li {
  padding: var(--space-sm) 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.how-to-play li::before {
  content: '›';
  color: var(--purple-500);
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.game-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

/* ── Game Settings Panel ── */
.settings-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin: var(--space-lg) auto;
  max-width: 600px;
}

.settings-panel h3 {
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: var(--space-lg);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.setting-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.setting-options {
  display: flex;
  gap: var(--space-xs);
}

.setting-option {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}

.setting-option:hover {
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

.setting-option.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--purple-500);
  color: var(--purple-400);
}

/* ── Game Play Area ── */
.game-area {
  margin: var(--space-lg) auto;
  position: relative;
}

.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hud-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.hud-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--purple-400);
}

/* ── Hangman Specific ── */
.hangman-canvas {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: block;
  margin: 0 auto;
}

.word-display {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin: var(--space-xl) 0;
  flex-wrap: wrap;
}

.letter-slot {
  width: 44px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 3px solid var(--purple-500);
  transition: all var(--transition-fast);
}

.letter-slot.revealed {
  color: var(--purple-400);
  border-bottom-color: var(--success);
}

.keyboard {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  max-width: 600px;
  margin: 0 auto;
}

.key {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.key:hover:not(.disabled) {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--purple-500);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.key.correct {
  background: rgba(34, 197, 94, 0.2);
  border-color: var(--success);
  color: var(--success);
  cursor: default;
}

.key.wrong {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--error);
  opacity: 0.5;
  cursor: default;
}

.key.disabled {
  opacity: 0.3;
  cursor: default;
}

/* ── Snake Canvas ── */
.snake-canvas {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: block;
  margin: 0 auto;
}

/* ── Game Over Overlay ── */
.game-over-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn var(--transition-base) ease;
}

.game-over-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl) var(--space-3xl);
  text-align: center;
  box-shadow: var(--shadow-glow-lg);
  animation: slideUp var(--transition-slow) ease;
  max-width: 420px;
  width: 90%;
}

.game-over-card h2 {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.game-over-card .final-score {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 800;
  color: var(--purple-400);
  margin: var(--space-lg) 0;
}

.game-over-card .score-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Toast Notification ── */
.toast {
  position: fixed;
  top: calc(var(--nav-height) + var(--space-md));
  right: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  animation: slideInRight var(--transition-base) ease;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.toast.success { border-color: rgba(34, 197, 94, 0.3); }
.toast.error { border-color: rgba(239, 68, 68, 0.3); }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin-bottom: var(--space-sm);
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

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

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

.animate-fadeIn {
  animation: fadeIn var(--transition-base) ease;
}

.animate-slideUp {
  animation: slideUp var(--transition-slow) ease;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  h1 { font-size: 1.875rem; }
  .hero h1 { font-size: 2rem; }
  .game-grid { grid-template-columns: 1fr; }
  .container { padding: 0 var(--space-md); }
  .navbar { padding: 0 var(--space-md); }
  .nav-links { display: none; }
  .form-card { margin: var(--space-xl) auto; padding: var(--space-lg); }
  .game-over-card { padding: var(--space-xl); }
  .game-card-image { height: 160px; }
  .word-display { gap: var(--space-xs); }
  .letter-slot { width: 36px; height: 46px; font-size: 1.2rem; }
  .key { width: 36px; height: 36px; font-size: 0.8rem; }
  .keyboard { gap: 4px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.625rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .game-actions { flex-direction: column; align-items: center; }
  .game-actions .btn { width: 100%; max-width: 280px; }
}

/* ─── Analytics / Stats ───────────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  transition: transform 200ms ease, border-color 200ms ease;
}
.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--purple-400);
}

.stat-card-value {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--purple-400);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.stat-card-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-game-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding: var(--space-xl);
}

.stat-game-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.stat-game-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 44px;
  text-align: center;
}

.stat-game-info {
  flex: 1;
  min-width: 0;
}

.stat-game-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.stat-bar-wrap {
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
}

.stat-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 2px;
}

.stat-game-count {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
  min-width: 3ch;
  text-align: right;
}

/* ─── Mute button ─────────────────────────────────────────────────────────── */

.mute-btn {
  font-size: 1.2rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 6px 8px;
  border-radius: var(--radius-md);
  transition: opacity 200ms ease, transform 150ms ease;
  line-height: 1;
}
.mute-btn:hover {
  opacity: 0.7;
  transform: scale(1.1);
}

