/* ================================
   FabGames - Main Stylesheet
   Nigerian Youth Gaming Portal
   ================================ */

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

/* ── CSS Variables ── */
:root {
  --primary:       #c1121f;
  --primary-dark:  #7a1020;
  --primary-light: #ffd6db;
  --accent:        #1d4ed8;
  --accent2:       #60a5fa;
  --accent3:       #0f172a;
  --neon-blue:     #2563eb;
  --neon-green:    #0f4c81;
  --neon-pink:     #e11d48;
  --neon-orange:   #3b82f6;

  --bg-dark:       #f8fbff;
  --bg-card:       #ffffff;
  --bg-card2:      #eef4ff;
  --glass-bg:      rgba(255, 255, 255, 0.9);
  --glass-bg-strong: rgba(250, 252, 255, 0.97);
  --border:        rgba(29, 78, 216, 0.12);
  --glass-border:  rgba(29, 78, 216, 0.16);

  --text:          #14213d;
  --text-muted:    #5c6b85;
  --text-dim:      #90a0ba;

  --radius:        16px;
  --radius-sm:     10px;
  --radius-lg:     24px;
  --shadow:        0 18px 48px rgba(18, 52, 104, 0.12);
  --shadow-glow:   0 18px 40px rgba(29, 78, 216, 0.16);
  --transition:    0.3s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Sora', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(191, 219, 254, 0.85), transparent 28%),
    radial-gradient(circle at top right, rgba(193, 18, 31, 0.1), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, #f7faff 52%, #eef4ff 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ── Typography ── */
h1,h2,h3,h4,h5 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; }
h1 { font-size: clamp(2rem, 6vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.8rem); }

/* ── Gradient Text ── */
.gradient-text {
  background: linear-gradient(135deg, #0f172a 0%, #c1121f 45%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text-2 {
  background: linear-gradient(135deg, #c1121f, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.34), rgba(255,255,255,0.02));
  opacity: 0;
  transition: var(--transition);
}
.btn:hover::before { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, #c1121f, #8d1020);
  color: #fff;
  box-shadow: 0 14px 28px rgba(140, 16, 32, 0.24);
}
.btn-primary:hover { box-shadow: 0 18px 34px rgba(140, 16, 32, 0.28); transform: translateY(-2px); }

.btn-accent {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}
.btn-accent:hover { box-shadow: 0 18px 34px rgba(37, 99, 235, 0.28); transform: translateY(-2px); }

.btn-outline {
  background: rgba(255,255,255,0.78);
  border: 2px solid rgba(29, 78, 216, 0.2);
  color: var(--accent3);
}
.btn-outline:hover { background: #eff6ff; border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: linear-gradient(135deg, #EF4444, #B91C1C);
  color: #fff;
  box-shadow: 0 4px 20px rgba(239,68,68,0.4);
}

.btn-sm { padding: 8px 18px; font-size: 0.875rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 18px 40px; font-size: 1.1rem; border-radius: var(--radius-lg); }
.btn-block { width: 100%; justify-content: center; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
  box-shadow: var(--shadow);
}
.card:hover { border-color: rgba(193, 18, 31, 0.24); box-shadow: var(--shadow-glow); transform: translateY(-4px); }
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── Inputs ── */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-control {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255,255,255,0.94);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(193,18,31,0.12);
}
.form-control::placeholder { color: var(--text-dim); }

/* ── Navigation ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 26px rgba(18, 52, 104, 0.06);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 900;
}
.navbar-brand .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #c1121f, #2563eb);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* ── Bottom Nav (Mobile) ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
  box-shadow: 0 -8px 24px rgba(18, 52, 104, 0.06);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  padding: 8px 4px;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.bottom-nav a.active,
.bottom-nav a:hover { color: var(--primary); }
.bottom-nav a .nav-icon { font-size: 1.4rem; }

/* ── Page Layout ── */
.page-wrapper {
  min-height: 100vh;
  padding-top: 80px;
  padding-bottom: 80px;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.section { padding: 60px 0; }
.section-title {
  text-align: center;
  margin-bottom: 48px;
}
.section-title p {
  color: var(--text-muted);
  margin-top: 12px;
  font-size: 1.1rem;
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-purple { background: rgba(219, 234, 254, 0.9); color: #1e3a8a; border: 1px solid rgba(29,78,216,0.16); }
.badge-green  { background: rgba(254, 226, 226, 0.92); color: #9f1239; border: 1px solid rgba(193,18,31,0.14); }
.badge-orange { background: rgba(239, 246, 255, 0.95); color: #1d4ed8; border: 1px solid rgba(37,99,235,0.16); }
.badge-red    { background: rgba(193, 18, 31, 0.12); color: #a4161a; border: 1px solid rgba(193,18,31,0.22); }

/* ── Game Cards Grid ── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.game-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(37,99,235,0.14) 0%, transparent 70%);
  opacity: 0;
  transition: var(--transition);
}
.game-card:hover::before { opacity: 1; }
.game-card:hover { border-color: var(--primary); transform: translateY(-6px); box-shadow: var(--shadow-glow); }
.game-card .game-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
  transition: transform 0.3s ease;
}
.game-card:hover .game-icon { transform: scale(1.2) rotate(-5deg); }
.game-card .game-name { font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.game-card .game-meta { font-size: 0.75rem; color: var(--text-muted); }
.game-card .game-score { 
  font-size: 0.8rem; font-weight: 700; 
  color: var(--accent); margin-top: 8px;
}

/* ── Stats Bar ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-box .stat-value { font-size: 1.5rem; font-weight: 900; color: var(--primary); }
.stat-box .stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

/* ── Leaderboard ── */
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.88);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: var(--transition);
}
.leaderboard-item:hover { background: #eef5ff; }
.leaderboard-table {
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.leaderboard-table th,
.leaderboard-table td {
  background: transparent;
}
.leaderboard-highlight {
  background: rgba(37,99,235,0.1);
}
.rank-badge {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.rank-1 { background: linear-gradient(135deg, #F59E0B, #FCD34D); color: #78350F; }
.rank-2 { background: linear-gradient(135deg, #9CA3AF, #D1D5DB); color: #374151; }
.rank-3 { background: linear-gradient(135deg, #B45309, #D97706); color: #fff; }
.rank-other { background: #f8fbff; color: var(--text-muted); border: 1px solid var(--border); }

/* ── Alerts / Toast ── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success { background: rgba(239,246,255,0.95); border: 1px solid rgba(37,99,235,0.16); color: #1d4ed8; }
.alert-error   { background: rgba(255,230,232,0.95); border: 1px solid rgba(193,18,31,0.22); color: #9f1239; }
.alert-info    { background: rgba(248,250,252,0.96); border: 1px solid rgba(29,78,216,0.14); color: #1e3a8a; }
.alert-warning { background: rgba(255,241,242,0.95); border: 1px solid rgba(193,18,31,0.16); color: #be123c; }

/* ── Toast Notification ── */
.toast-container {
  position: fixed;
  top: 90px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  pointer-events: all;
  backdrop-filter: blur(10px);
}
.toast-success { background: rgba(29, 78, 216, 0.94); color: #fff; }
.toast-error   { background: rgba(208, 0, 0, 0.94);  color: #fff; }
.toast-info    { background: rgba(20, 33, 61, 0.94);  color: #fff; }

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateX(120%); }
}

/* ── Loader ── */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248, 251, 255, 0.98);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.loader-spinner {
  width: 60px; height: 60px;
  border: 4px solid rgba(193,18,31,0.12);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Table ── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th {
  background: #eef5ff;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 16px;
  text-align: left;
  white-space: nowrap;
}
td {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text);
}
tr:hover td { background: rgba(37,99,235,0.05); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.26);
  backdrop-filter: blur(8px);
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.modal-overlay.open .modal { transform: translateY(0); }

/* ── Progress Bar ── */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-card2);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, #c1121f, #2563eb);
  transition: width 0.5s ease;
}

/* ── Avatar ── */
.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c1121f, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}

/* ── Skeleton loader ── */
.skeleton {
  background: linear-gradient(90deg, #eff6ff 25%, rgba(37,99,235,0.08) 50%, #eff6ff 75%);
  background-size: 400% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f3f7ff; }
::-webkit-scrollbar-thumb { background: #2563eb; border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: #1d4ed8; }

/* ── Animations ── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(37,99,235,0.18); }
  50%       { box-shadow: 0 0 30px rgba(37,99,235,0.34); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-float     { animation: float 3s ease-in-out infinite; }
.animate-pulse-glow{ animation: pulse-glow 2s ease-in-out infinite; }
.animate-fade-up   { animation: fadeInUp 0.6s ease forwards; }

.hover-lift {
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.hover-lift:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-glow);
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 120px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.92);
  color: var(--text);
  font-weight: 700;
  transition: var(--transition);
}
.share-btn:hover {
  transform: translateY(-2px);
  background: #eff6ff;
}
.share-btn[data-platform="whatsapp"] { color: #15803d; }
.share-btn[data-platform="facebook"] { color: #1d4ed8; }
.share-btn[data-platform="twitter"] { color: #1e3a8a; }

.presence-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.92);
  font-size: 0.78rem;
  font-weight: 700;
}
.presence-chip.online {
  color: #1d4ed8;
  border-color: rgba(37,99,235,0.3);
}
.presence-chip.offline {
  color: var(--text-muted);
}

.mini-leaderboard {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.mini-leaderboard-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.9);
  font-size: 0.72rem;
}
.mini-leaderboard-row strong {
  color: var(--text);
}

.postgame-panel {
  display: grid;
  gap: 16px;
}
.postgame-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.postgame-stat {
  padding: 14px 10px;
  text-align: center;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(29,78,216,0.08);
}
.postgame-stat .label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.postgame-stat .value {
  display: block;
  margin-top: 4px;
  font-size: 1.15rem;
  font-weight: 900;
}

/* ── Landing Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 120px 24px 80px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('../images/hero_bg.png');
  background-size: cover;
  background-position: center;
  opacity: 0.15;
}
.hero-glow {
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(37,99,235,0.16) 0%, transparent 70%);
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(29,78,216,0.16);
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e3a8a;
  margin-bottom: 24px;
}
.hero h1 { margin-bottom: 20px; }
.hero p  { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 36px; line-height: 1.7; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── Game Preview Cards (Landing) ── */
.game-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.game-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow);
}
.game-preview-card:hover { transform: translateY(-8px); border-color: var(--primary); box-shadow: var(--shadow-glow); }
.game-preview-card .game-emoji { font-size: 4rem; margin-bottom: 14px; display: block; }
.game-preview-card h3 { font-size: 1rem; margin-bottom: 8px; }
.game-preview-card p  { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
.game-preview-card .card-glow {
  position: absolute;
  bottom: -30px; right: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  opacity: 0.3;
}

/* ── Features Section ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.feature-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 18px;
}
.feature-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.feature-card p  { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* ── Admin Sidebar ── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}
.admin-page {
  overflow-x: hidden;
}
.admin-page.admin-nav-open {
  overflow: hidden;
}
.mobile-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  box-shadow: 0 10px 24px rgba(18, 52, 104, 0.12);
}
.admin-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(3px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.admin-sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.admin-sidebar {
  width: 260px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
  box-shadow: 10px 0 30px rgba(18, 52, 104, 0.05);
}
.admin-sidebar .sidebar-brand {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.admin-sidebar .sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.admin-sidebar .sidebar-nav a:hover,
.admin-sidebar .sidebar-nav a.active {
  color: var(--accent);
  background: rgba(37,99,235,0.08);
  border-left-color: var(--accent);
}
.admin-sidebar .sidebar-nav a span { font-size: 1.2rem; }
.admin-sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.admin-content {
  margin-left: 260px;
  flex: 1;
  padding: 32px;
  min-height: 100vh;
}

/* ── Admin Top Bar ── */
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.admin-topbar h1 { font-size: 1.8rem; }

/* ── Stat Cards (Admin) ── */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-stat-card::after {
  content: '';
  position: absolute;
  right: -20px; bottom: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.2;
}
.admin-stat-card.purple::after { background: var(--primary); }
.admin-stat-card.green::after  { background: var(--accent2); }
.admin-stat-card.orange::after { background: var(--accent); }
.admin-stat-card.red::after    { background: var(--accent3); }
.admin-stat-value { font-size: 2rem; font-weight: 900; margin-bottom: 4px; }
.admin-stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.admin-stat-icon  { font-size: 2rem; margin-bottom: 12px; }

/* ── Chart Container ── */
.chart-container { position: relative; height: 280px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-content { margin-left: 0; padding: 20px 16px 28px; }
  .admin-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-left: 56px;
  }
  .admin-sidebar-footer {
    position: static !important;
    width: auto !important;
  }
  .admin-content .table-wrapper {
    margin-left: -4px;
    margin-right: -4px;
  }
  .admin-content .card {
    padding: 16px;
  }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .hero-buttons { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
  .mobile-toggle {
    top: 12px;
    left: 12px;
    padding: 9px 12px;
  }
  .admin-topbar {
    padding-left: 52px;
    margin-bottom: 24px;
    padding-bottom: 18px;
  }
  .admin-topbar h1 { font-size: 1.45rem; }
  .admin-stats { grid-template-columns: 1fr; gap: 14px; }
  .admin-stat-card { padding: 18px; }
  .chart-container { height: 220px; }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .game-preview-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-box .stat-value { font-size: 1.2rem; }
}

/* ── Canvas Game Wrapper ── */
.game-wrapper {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(191, 219, 254, 0.72), transparent 28%),
    radial-gradient(circle at top right, rgba(254, 226, 226, 0.65), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, #f3f7ff 100%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.game-hud {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.game-canvas-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
}
.game-controls {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(255,255,255,0.96);
  border-top: 1px solid var(--border);
  width: 100%;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: center;
}
.control-btn {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ctrl-move {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.ctrl-btn {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  background: #f8fbff;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: var(--transition);
  touch-action: none;
}
.ctrl-btn:active { background: #dbeafe; transform: scale(0.92); }

/* ── Game Over Screen ── */
.game-over-screen {
  position: absolute;
  inset: 0;
  background: rgba(250, 252, 255, 0.94);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 50;
  padding: 24px;
  text-align: center;
}
.game-over-screen h2 { font-size: 2.5rem; }
.score-display { 
  font-size: 4rem; font-weight: 900;
  background: linear-gradient(135deg, #c1121f, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Misc Utilities ── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex  { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }
