/* =====================================================
   KUIS ALKITAB — NeonQuiz-Inspired Dashboard Theme
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Rajdhani:wght@300;400;500;600;700&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Poppins:wght@300;400;600;700&display=swap');

:root {
  --bg-dark: #04070f;
  --bg-panel: rgba(5, 8, 18, 0.95);
  --bg-card: rgba(5, 8, 18, 0.8);
  --neon-cyan: #00ffff;
  --neon-purple: #c44dff;
  --neon-yellow: #ffee33;
  --neon-green: #00ff88;
  --neon-orange: #ff6600;
  --neon-red: #ff4444;
  --neon-pink: #d946ef;
  --text-main: rgba(200, 230, 255, 0.9);
  --text-sub: rgba(180, 220, 255, 0.5);
  --text-dim: rgba(180, 220, 255, 0.3);
  --border-subtle: rgba(0, 255, 255, 0.15);
  --border-active: rgba(0, 255, 255, 0.4);
  --correct: #00ff88;
  --wrong: #ff4444;
  --gold: #ffee33;
  --silver: #c0c0c0;
  --bronze: #ff8844;
  --sidebar-w: 220px;
}

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

body {
  font-family: 'Rajdhani', sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: 0.03em;
}

/* ── Scrollbar ─────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: rgba(0,255,255,0.05); }
::-webkit-scrollbar-thumb { background: rgba(0,255,255,0.3); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,255,255,0.6); }

/* ── Font Utilities ────────────────────────── */
.font-orbitron { font-family: 'Orbitron', monospace; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

/* ── Neon Text Glows ───────────────────────── */
.neon-text-cyan { color: var(--neon-cyan); text-shadow: 0 0 8px var(--neon-cyan), 0 0 20px var(--neon-cyan); }
.neon-text-purple { color: var(--neon-purple); text-shadow: 0 0 8px var(--neon-purple), 0 0 20px var(--neon-purple); }
.neon-text-yellow { color: var(--neon-yellow); text-shadow: 0 0 8px var(--neon-yellow), 0 0 20px var(--neon-yellow); }

/* =====================================================
   AUTH PAGE (Centered, no sidebar)
   ===================================================== */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: radial-gradient(ellipse at 50% 30%, rgba(196,77,255,0.08), transparent 70%),
              var(--bg-dark);
}

.auth-card {
  background: var(--bg-panel);
  border: 1px solid rgba(196,77,255,0.3);
  border-radius: 16px;
  padding: 40px 35px;
  width: 100%;
  max-width: 420px;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 40px rgba(196,77,255,0.1);
}

.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo .logo-icon {
  width: 56px; height: 56px;
  border: 2px solid var(--neon-purple);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff;
  box-shadow: 0 0 15px rgba(196,77,255,0.5), inset 0 0 15px rgba(196,77,255,0.2);
  margin: 0 auto 12px;
  font-family: 'Orbitron', sans-serif;
}

.auth-logo h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8em;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 0 10px rgba(196,77,255,0.5);
}

.auth-logo .subtitle {
  font-size: 0.75em;
  letter-spacing: 3px;
  color: var(--text-sub);
  text-transform: uppercase;
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 25px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 12px;
  font-size: 0.8em;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--text-sub);
  transition: 0.3s;
  position: relative;
  font-family: 'Rajdhani', sans-serif;
}

.auth-tab.active { color: #fff; }

.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 100%; height: 2px;
  background: var(--neon-purple);
  box-shadow: 0 -2px 10px rgba(196,77,255,0.5);
}

/* =====================================================
   FORMS & INPUTS
   ===================================================== */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75em;
  font-weight: 600;
  color: var(--text-sub);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  padding: 12px 15px;
  border-radius: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1em;
  transition: 0.3s;
}

.form-control:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0,255,255,0.2);
  background: rgba(0,0,0,0.6);
}

.form-control option { background: var(--bg-dark); }

select.form-control { cursor: pointer; }

textarea.form-control { resize: vertical; }

button.btn-primary {
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-pink, #d946ef));
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 1px;
  width: 100%;
  font-family: 'Orbitron', sans-serif;
  box-shadow: 0 4px 15px rgba(196,77,255,0.3);
  transition: all 0.2s;
  margin-top: 10px;
  text-transform: uppercase;
}

button.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 6px 25px rgba(196,77,255,0.5);
}

button.btn-outline {
  background: transparent;
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
  transition: 0.3s;
  font-size: 0.85em;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
}

button.btn-outline:hover { background: rgba(0,255,255,0.08); }

/* =====================================================
   DASHBOARD SHELL (Sidebar + Main)
   ===================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ── Sidebar ──────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 50;
  backdrop-filter: blur(20px);
  transition: transform 0.3s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo .logo-box {
  width: 32px; height: 32px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(196,77,255,0.1);
  border: 1px solid var(--neon-purple);
  color: var(--neon-purple);
  font-size: 14px;
  animation: neon-pulse 2s ease-in-out infinite;
}

.sidebar-logo .logo-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7em;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--neon-purple);
}

.sidebar-logo .logo-text span { color: var(--neon-cyan); }

/* User Card */
.sidebar-user {
  margin: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(196,77,255,0.05);
  border: 1px solid rgba(196,77,255,0.15);
}

.sidebar-user .user-info {
  display: flex; align-items: center; gap: 8px;
}

.sidebar-user .user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--neon-purple);
}

.sidebar-user .user-name {
  font-size: 0.8em;
  font-weight: 700;
  color: var(--neon-purple);
}

.sidebar-user .user-streak {
  font-size: 0.7em;
  color: var(--neon-orange);
  display: flex; align-items: center; gap: 4px;
}

.sidebar-user .xp-bar {
  margin-top: 8px;
}

.sidebar-user .xp-label {
  display: flex; justify-content: space-between;
  font-size: 0.65em; color: var(--text-dim); margin-bottom: 4px;
}

.sidebar-user .xp-label span { color: var(--neon-yellow); }

.xp-track {
  height: 5px;
  border-radius: 3px;
  background: rgba(196,77,255,0.1);
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
  box-shadow: 0 0 8px var(--neon-cyan);
  transition: width 0.6s ease;
}

/* Nav Items */
.sidebar-nav {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 600;
  color: var(--text-sub);
  border: 1px solid transparent;
  transition: all 0.2s;
  margin-bottom: 2px;
  position: relative;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.5px;
}

.nav-item .neon-icon {
  width: 18px; height: 18px;
  color: inherit;
  filter: none;
  transition: 0.2s;
}

.nav-item:hover {
  background: rgba(196,77,255,0.06);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(196,77,255,0.12);
  color: var(--neon-purple);
  border-color: rgba(196,77,255,0.3);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--neon-purple);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px var(--neon-purple);
}

.nav-item .nav-badge {
  margin-left: auto;
  font-size: 0.65em;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  animation: blink-led 1.2s step-end infinite;
}

/* Sidebar Bottom */
.sidebar-bottom {
  padding: 8px;
  border-top: 1px solid var(--border-subtle);
}

.nav-item.logout-btn {
  color: var(--neon-red);
}
.nav-item.logout-btn:hover {
  background: rgba(255,68,68,0.08);
}

/* Mobile hamburger */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 50px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 60;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
}

.hamburger {
  background: none; border: none;
  color: var(--neon-cyan);
  font-size: 24px;
  cursor: pointer;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 45;
}

/* ── Main Content ─────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 24px;
  overflow-y: auto;
}

/* Header bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.top-bar .breadcrumb {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7em;
  letter-spacing: 2px;
  color: var(--text-dim);
}

.top-bar .breadcrumb strong {
  color: var(--neon-cyan);
}

.top-bar .controls {
  display: flex; gap: 10px; align-items: center;
}

.control-btn {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-subtle);
  color: var(--text-sub);
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: 0.2s;
}

.control-btn:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 8px rgba(0,255,255,0.2);
}

/* =====================================================
   DASHBOARD PANELS
   ===================================================== */
.dash-panel {
  display: none;
  animation: slide-in-up 0.35s ease-out both;
}

.dash-panel.active { display: block; }

/* ── Section Headers ──────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.section-header h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1em;
  font-weight: 900;
  letter-spacing: 2px;
}

.section-header .desc {
  font-size: 0.8em;
  color: var(--text-sub);
  margin-left: 4px;
}

/* =====================================================
   STAT CARDS — Premium Horizontal Row
   ===================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.stat-card {
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.25s;
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.stat-card .stat-icon {
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  font-size: 1.1em;
}

.stat-card .stat-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.15em;
  font-weight: 900;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 0.6em;
  font-weight: 600;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =====================================================
   LEADERBOARD
   ===================================================== */
/* Period Toggle */
.period-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(0,255,255,0.05);
  border: 1px solid var(--border-subtle);
  width: fit-content;
  margin-bottom: 24px;
}

.period-btn {
  padding: 6px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-sub);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.period-btn.active {
  background: rgba(0,255,255,0.12);
  color: var(--neon-cyan);
  border-color: var(--border-active);
  box-shadow: 0 0 12px rgba(0,255,255,0.15);
}

/* Podium */
.podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
  padding: 20px 0;
}

.podium-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.podium-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 0.85em;
  position: relative;
}

.podium-crown {
  position: absolute;
  top: -14px;
  font-size: 18px;
}

.podium-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7em;
  font-weight: 700;
}

.podium-score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7em;
  color: var(--text-sub);
}

.podium-block {
  width: 80px;
  border-radius: 10px 10px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3em;
  font-weight: 900;
}

.podium-block.first { height: 110px; }
.podium-block.second { height: 80px; }
.podium-block.third { height: 60px; }

/* Rank table */
.rank-table {
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.rank-header {
  display: grid;
  grid-template-columns: 40px 1fr 80px 70px 60px;
  padding: 10px 16px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6em;
  color: rgba(0,255,255,0.4);
  border-bottom: 1px solid rgba(0,255,255,0.1);
}

.rank-row {
  display: grid;
  grid-template-columns: 40px 1fr 80px 70px 60px;
  padding: 12px 16px;
  align-items: center;
  border-bottom: 1px solid rgba(0,255,255,0.05);
  transition: all 0.2s;
}

.rank-row:nth-child(even) { background: rgba(0,255,255,0.015); }
.rank-row:hover { background: rgba(0,255,255,0.04); }

.rank-row.is-me {
  background: rgba(0,255,255,0.07);
  border-left: 2px solid var(--neon-cyan);
}

.rank-num {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7em;
  color: var(--text-sub);
}

.rank-num.top {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
}

.rank-player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rank-player .avatar-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65em;
  font-weight: 700;
  flex-shrink: 0;
}

.rank-player .player-info { min-width: 0; }

.rank-player .name {
  font-weight: 700;
  font-size: 0.85em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* XP bar under player name in leaderboard */
.rank-player .xp-bar-mini {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
  width: 100%;
  max-width: 120px;
}

.rank-player .xp-bar-mini .xp-fill-mini {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
}

.rank-score {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  font-weight: 700;
  color: var(--neon-yellow);
}

.rank-acc {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75em;
}

.rank-streak {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7em;
  color: var(--neon-orange);
}

/* =====================================================
   STATS PANEL
   ===================================================== */
.chart-card {
  border-radius: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.chart-card .chart-title {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75em;
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 1px;
}

.badges-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.badge {
  display: flex; align-items: center; gap: 10px;
  background: rgba(20,20,30,0.5);
  border: 1px solid rgba(100,100,100,0.2);
  border-radius: 10px;
  padding: 12px;
  opacity: 0.4;
  transition: 0.3s;
  filter: grayscale(1);
}

.badge.unlocked {
  opacity: 1;
  filter: grayscale(0);
}

.badge-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2em;
  flex-shrink: 0;
}

.badge-info .badge-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6em;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.badge-info .badge-desc {
  font-size: 0.65em;
  color: var(--text-sub);
}

/* =====================================================
   QUIZ COMPLETION SCREEN
   ===================================================== */
.quiz-complete-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,7,15,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fade-in 0.4s ease;
  padding: 20px;
}

.quiz-complete-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,238,51,0.3);
  border-radius: 20px;
  padding: 40px 32px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.quiz-complete-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background: radial-gradient(circle at 50% 30%, var(--neon-yellow), transparent 60%);
  pointer-events: none;
}

.quiz-complete-card .trophy-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: float-up 3s ease-in-out infinite;
}

.quiz-complete-card h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4em;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.quiz-complete-card .sub {
  font-size: 0.9em;
  color: var(--text-sub);
  margin-bottom: 24px;
}

/* Percentage Ring */
.pct-ring {
  width: 130px; height: 130px;
  margin: 0 auto 24px;
  position: relative;
}

.pct-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.pct-ring .ring-bg {
  fill: none;
  stroke: rgba(0,255,255,0.1);
  stroke-width: 8;
}

.pct-ring .ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s ease, stroke 0.5s;
}

.pct-ring .pct-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 2em;
  font-weight: 900;
}

/* Result grid */
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.result-box {
  border-radius: 12px;
  padding: 16px;
}

.result-box .val {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3em;
  font-weight: 900;
  margin-bottom: 2px;
}

.result-box .lbl {
  font-size: 0.65em;
  font-weight: 600;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Answer review dots */
.answer-review {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.review-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}

/* Complete buttons */
.complete-actions {
  display: flex; gap: 12px;
}

.complete-actions button {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7em;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.2s;
  letter-spacing: 1px;
}

.complete-actions button:hover { transform: scale(1.02); }

/* =====================================================
   QUIZ GAME VIEW
   ===================================================== */
.view-game-wrapper {
  max-width: 700px;
  margin: 0 auto;
}

/* Progress bar (gradient line under question count) */
.quiz-progress-track {
  height: 6px;
  background: rgba(0,255,255,0.08);
  border-radius: 3px;
  margin-bottom: 20px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple), var(--neon-pink));
  transition: width 0.5s ease;
  box-shadow: 0 0 8px rgba(0,255,255,0.4);
}

/* Timer Ring SVG */
.timer-ring-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.timer-ring-wrap {
  position: relative;
  width: 100px;
  height: 100px;
}

.timer-ring-wrap svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring-bg {
  fill: none;
  stroke: rgba(0,255,255,0.1);
  stroke-width: 6;
}

.timer-ring-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.5s;
}

.timer-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer-ring-center .timer-num {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5em;
  font-weight: 900;
  transition: color 0.3s;
}

.timer-ring-center .timer-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65em;
  color: var(--text-sub);
}

.timer-ring-center .timer-icon {
  font-size: 0.65em;
  margin-bottom: 2px;
}

/* Red screen flash on timeout */
@keyframes redBorderFlash {
  0%   { box-shadow: inset 0 0 0 0 transparent; }
  25%  { box-shadow: inset 0 0 40px rgba(255,68,68,0.4); }
  50%  { box-shadow: inset 0 0 20px rgba(255,68,68,0.2); }
  75%  { box-shadow: inset 0 0 40px rgba(255,68,68,0.4); }
  100% { box-shadow: inset 0 0 0 0 transparent; }
}

.timeout-flash {
  animation: redBorderFlash 0.8s ease-out;
  border: 2px solid rgba(255,68,68,0.6) !important;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75em;
  color: var(--text-sub);
  margin-bottom: 8px;
  font-family: 'Orbitron', sans-serif;
}

.time-warning {
  color: var(--wrong) !important;
  animation: pulse 0.5s infinite;
}

.question {
  font-size: 1.2em;
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.5;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  position: relative;
}

.question::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
}

.options { display: flex; flex-direction: column; gap: 10px; }

.option-label {
  background: rgba(5,8,18,0.6);
  border: 1px solid rgba(0,255,255,0.12);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s;
  font-size: 0.95em;
  font-weight: 600;
}

.option-label:hover {
  border-color: rgba(0,255,255,0.5);
  background: rgba(0,255,255,0.05);
  box-shadow: 0 0 16px rgba(0,255,255,0.15);
  transform: translateX(4px);
}

.option-label.selected {
  background: rgba(196,77,255,0.15);
  border-color: var(--neon-purple);
}

.option-label input { display: none; }

.opt-letter {
  display: inline-flex;
  justify-content: center; align-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(0,255,255,0.06);
  border: 1px solid rgba(0,255,255,0.15);
  font-weight: 700;
  margin-right: 14px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75em;
  color: var(--text-sub);
  transition: 0.2s;
  flex-shrink: 0;
}

.option-label:hover .opt-letter {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.correct {
  background: rgba(0,255,136,0.1) !important;
  border-color: var(--correct) !important;
  box-shadow: 0 0 16px rgba(0,255,136,0.3) !important;
  transform: none !important;
}

.correct .opt-letter {
  background: rgba(0,255,136,0.2) !important;
  color: var(--correct) !important;
  border-color: var(--correct) !important;
}

.wrong {
  background: rgba(255,68,68,0.1) !important;
  border-color: var(--wrong) !important;
  box-shadow: 0 0 16px rgba(255,68,68,0.3) !important;
  transform: none !important;
}

.wrong .opt-letter {
  background: rgba(255,68,68,0.2) !important;
  color: var(--wrong) !important;
  border-color: var(--wrong) !important;
}

/* Flashcard */
.flashcard-container { perspective: 1000px; margin-bottom: 20px; display: none; }
.flashcard {
  width: 100%; height: 250px;
  position: relative;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }
.card-face {
  position: absolute; width: 100%; height: 100%;
  backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
}
.card-front { color: #fff; font-size: 1.1em; font-weight: 700; }
.card-back { background: rgba(196,77,255,0.1); transform: rotateY(180deg); color: var(--neon-purple); font-size: 1.2em; font-weight: 700; }
.fc-controls { display: none; gap: 10px; margin-top: 15px; }

/* AI Insight Box */
.ai-insight-box {
  margin-top: 14px;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--neon-yellow);
  border-radius: 10px;
  padding: 16px;
  font-size: 0.85em;
  color: #fff;
  box-shadow: 0 0 12px rgba(255,238,51,0.15);
  animation: slide-in-up 0.4s;
  display: none;
  text-align: left;
  line-height: 1.6;
}

.ai-insight-title {
  color: var(--neon-yellow);
  font-weight: 700;
  margin-bottom: 6px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85em;
  display: flex; align-items: center; gap: 8px;
}

.ai-loader {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid var(--neon-yellow);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* PvP Status Bar */
#pvp-status-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
}

/* =====================================================
   AI PAUL CHAT
   ===================================================== */
#paul-chat-box {
  height: 400px;
  overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9em;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-paul {
  align-self: flex-start;
  background: rgba(0,255,136,0.1);
  border: 1px solid rgba(0,255,136,0.3);
  color: #fff;
  border-bottom-left-radius: 0;
}

.chat-user {
  align-self: flex-end;
  background: rgba(196,77,255,0.15);
  border: 1px solid rgba(196,77,255,0.3);
  color: #fff;
  border-bottom-right-radius: 0;
}

.chat-input-wrapper { display: flex; gap: 10px; }
.chat-input-wrapper input { flex: 1; }

/* =====================================================
   PROFILE
   ===================================================== */
.profile-section {
  background: var(--bg-card);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.profile-section label {
  display: block;
  font-size: 0.75em;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.avatar-sel {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(100,100,100,0.3);
  cursor: pointer;
  object-fit: cover;
  transition: 0.3s;
}

.avatar-sel:hover { border-color: var(--neon-cyan); }

.avatar-sel.active {
  border-color: var(--neon-yellow);
  box-shadow: 0 0 12px rgba(255,238,51,0.4);
  transform: scale(1.1);
}

.namebar {
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  color: #fff;
}

.namebar-sel {
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  font-weight: 700;
  font-size: 0.85em;
  transition: 0.3s;
}

.namebar-sel.active {
  transform: scale(1.05);
  border-color: var(--neon-yellow) !important;
  box-shadow: 0 0 10px rgba(255,238,51,0.4) !important;
}

/* Namebar themes */
.theme-cyber { background: linear-gradient(135deg, #1e1b4b, #4c1d95); box-shadow: 0 0 5px #8b5cf6; border-color: #8b5cf6; }
.theme-fire { background: linear-gradient(135deg, #450a0a, #991b1b); box-shadow: 0 0 5px #ef4444; border-color: #ef4444; }
.theme-nature { background: linear-gradient(135deg, #064e3b, #047857); box-shadow: 0 0 5px #10b981; border-color: #10b981; }
.theme-ocean { background: linear-gradient(135deg, #0c4a6e, #0369a1); box-shadow: 0 0 5px #0ea5e9; border-color: #0ea5e9; }
.theme-holy { background: linear-gradient(135deg, #422006, #b45309); box-shadow: 0 0 5px #f59e0b; border-color: #f59e0b; }
.theme-dark { background: linear-gradient(135deg, #171717, #404040); box-shadow: 0 0 5px #a3a3a3; border-color: #a3a3a3; }
.theme-blood { background: linear-gradient(135deg, #4c0519, #be123c); box-shadow: 0 0 5px #f43f5e; border-color: #f43f5e; }
.theme-venom { background: linear-gradient(135deg, #14532d, #15803d); box-shadow: 0 0 5px #22c55e; border-color: #22c55e; }
.theme-magic { background: linear-gradient(135deg, #312e81, #4338ca); box-shadow: 0 0 5px #6366f1; border-color: #6366f1; }
.theme-frost { background: linear-gradient(135deg, #164e63, #0e7490); box-shadow: 0 0 5px #06b6d4; border-color: #06b6d4; }

/* =====================================================
   QUESTION MANAGEMENT
   ===================================================== */
.scroll-list {
  max-height: 400px;
  overflow-y: auto;
  margin-top: 16px;
}

.list-item {
  background: var(--bg-card);
  border: 1px solid rgba(0,255,255,0.08);
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.2s;
}

.list-item:hover { border-color: rgba(0,255,255,0.2); }

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 1.1em;
  transition: 0.2s;
}

.icon-btn:hover { color: #fff; transform: scale(1.1); }

/* =====================================================
   PARTICLES
   ===================================================== */
.particles {
  position: fixed; bottom: 0; left: 0;
  width: 100%; height: 100%;
  overflow: hidden; z-index: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  bottom: -10px;
  width: 3px; height: 3px;
  background: var(--neon-purple);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--neon-purple);
  opacity: 0;
  animation: floatUp var(--duration) ease-in infinite;
}

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
  text-align: center;
  font-size: 0.7em;
  color: var(--text-dim);
  padding: 20px;
  letter-spacing: 1px;
}
.footer a { color: var(--neon-purple); text-decoration: none; font-weight: 700; }
.footer a:hover { text-decoration: underline; }

/* =====================================================
   LOADER
   ===================================================== */
.loader {
  position: fixed; inset: 0;
  background: rgba(4,7,15,0.9);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
  visibility: hidden;
  opacity: 0;
  transition: 0.3s;
}

.loader.active { visibility: visible; opacity: 1; }

.loader-core {
  width: 40px; height: 40px;
  border: 3px solid transparent;
  border-top-color: var(--neon-cyan);
  border-right-color: var(--neon-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* =====================================================
   TOAST
   ===================================================== */
#toast-container {
  position: fixed; top: 20px;
  left: 50%; transform: translateX(-50%);
  z-index: 9999;
  display: flex; flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-panel);
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  border: 1px solid var(--neon-cyan);
  font-weight: 700;
  font-size: 0.85em;
  text-align: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 16px rgba(0,255,255,0.3);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s;
}

.toast.show { opacity: 1; transform: translateY(0); }

/* Streak popup */
.streak-popup {
  position: fixed; top: 40%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-family: 'Orbitron', sans-serif;
  font-size: min(8vw, 3.5em);
  color: var(--neon-yellow);
  text-shadow: 0 0 20px #fff, 0 0 40px var(--neon-yellow);
  z-index: 250;
  pointer-events: none;
  opacity: 0;
  font-weight: 900;
  white-space: nowrap;
}

.streak-active { animation: streakZoom 2s ease-out forwards; }

/* Neon Icon base */
.neon-icon {
  filter: drop-shadow(0 0 3px currentColor);
  transition: all 0.2s;
}

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes floatUp {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  50% { opacity: 0.6; }
  100% { transform: translateY(-100vh) scale(0.4); opacity: 0; }
}

@keyframes spin { 100% { transform: rotate(360deg); } }

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

@keyframes neon-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px currentColor; }
  50% { opacity: 0.6; box-shadow: 0 0 4px currentColor; }
}

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

@keyframes blink-led {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes slide-in-up {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes streakZoom {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* ── STREAK OVERLAY — DIVINE ARCADE SYSTEM ───────── */
.streak-overlay {
  position: fixed; inset: 0;
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(255,215,0,0.15) 0%, rgba(4,7,15,0.92) 70%);
  opacity: 0; pointer-events: none;
  transition: opacity 0.1s;
}
.streak-overlay.active {
  opacity: 1; pointer-events: auto;
  animation: streak-bg-pulse 2s ease-out forwards;
}
@keyframes streak-bg-pulse {
  0% { background: radial-gradient(ellipse at center, rgba(255,215,0,0.4) 0%, rgba(4,7,15,0.95) 60%); }
  30% { background: radial-gradient(ellipse at center, rgba(255,215,0,0.25) 0%, rgba(4,7,15,0.92) 70%); }
  100% { background: radial-gradient(ellipse at center, rgba(255,215,0,0.08) 0%, rgba(4,7,15,0.92) 70%); }
}

/* Streak Gold Particles */
.streak-particles {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.streak-particle {
  position: absolute;
  width: var(--size, 6px); height: var(--size, 6px);
  border-radius: 50%;
  background: var(--color, #ffd700);
  box-shadow: 0 0 8px var(--color, #ffd700), 0 0 20px var(--color, #ffd70080);
  animation: streak-particle-fly var(--dur, 1.5s) ease-out forwards;
  opacity: 0;
}
@keyframes streak-particle-fly {
  0% { transform: translate(0, 0) scale(0); opacity: 1; }
  20% { opacity: 1; transform: translate(var(--tx, 50px), var(--ty, -100px)) scale(1); }
  100% { opacity: 0; transform: translate(calc(var(--tx, 50px) * 2.5), calc(var(--ty, -100px) * 2.5)) scale(0.2); }
}

/* Streak Content */
.streak-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  transform: scale(0);
  opacity: 0;
}
.streak-overlay.active .streak-content {
  animation: streak-content-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}
@keyframes streak-content-enter {
  0% { transform: scale(0) rotate(-10deg); opacity: 0; }
  50% { transform: scale(1.15) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Streak Icon */
.streak-icon {
  font-size: 4em;
  filter: drop-shadow(0 0 20px #ffd700) drop-shadow(0 0 40px #ff880060);
  animation: streak-icon-pulse 0.8s ease-in-out infinite alternate;
  margin-bottom: 8px;
}
@keyframes streak-icon-pulse {
  from { transform: scale(1); filter: drop-shadow(0 0 20px #ffd700) drop-shadow(0 0 40px #ff880060); }
  to { transform: scale(1.2); filter: drop-shadow(0 0 30px #ffd700) drop-shadow(0 0 60px #ff880090); }
}

/* Streak Glitch Text */
.streak-title {
  position: relative;
  margin-bottom: 8px;
}
.streak-glitch {
  font-family: 'Orbitron', sans-serif;
  font-size: 3.2em;
  font-weight: 900;
  letter-spacing: 6px;
  background: linear-gradient(135deg, #ffd700 0%, #fff6a0 25%, #ffd700 50%, #ffaa00 75%, #ffd700 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: streak-gold-shimmer 1.5s ease infinite;
  position: relative;
  text-shadow: none;
}
.streak-glitch::before,
.streak-glitch::after {
  content: attr(data-text);
  position: absolute; top: 0; left: 0;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.7;
}
.streak-glitch::before {
  animation: streak-glitch-1 0.3s infinite linear alternate-reverse;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}
.streak-glitch::after {
  animation: streak-glitch-2 0.3s infinite linear alternate-reverse;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}
@keyframes streak-glitch-1 {
  0% { transform: translate(0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(3px, -1px); }
  60% { transform: translate(-2px, 1px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}
@keyframes streak-glitch-2 {
  0% { transform: translate(0); }
  20% { transform: translate(3px, -2px); }
  40% { transform: translate(-3px, 1px); }
  60% { transform: translate(2px, -1px); }
  80% { transform: translate(-2px, 2px); }
  100% { transform: translate(0); }
}
@keyframes streak-gold-shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.streak-sub {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.4em;
  font-weight: 700;
  color: #ffd700;
  letter-spacing: 4px;
  text-shadow: 0 0 10px #ffd70080, 0 0 30px #ffd70040;
  opacity: 0;
}
.streak-overlay.active .streak-sub {
  animation: streak-sub-enter 0.5s ease-out 0.5s forwards;
}
@keyframes streak-sub-enter {
  0% { opacity: 0; transform: translateY(20px); letter-spacing: 12px; }
  100% { opacity: 1; transform: translateY(0); letter-spacing: 4px; }
}

/* Streak Flash Lines */
.streak-flash-lines {
  position: absolute; inset: -100px;
  pointer-events: none;
}
.streak-overlay.active .streak-flash-lines::before,
.streak-overlay.active .streak-flash-lines::after {
  content: '';
  position: absolute;
  background: linear-gradient(90deg, transparent 0%, #ffd70030 50%, transparent 100%);
  height: 2px; width: 100%;
  animation: streak-line-scan 1.5s ease-in-out infinite;
}
.streak-overlay.active .streak-flash-lines::before { top: 30%; animation-delay: 0s; }
.streak-overlay.active .streak-flash-lines::after { top: 70%; animation-delay: 0.5s; }
@keyframes streak-line-scan {
  0%, 100% { opacity: 0; transform: translateX(-100%); }
  50% { opacity: 1; transform: translateX(100%); }
}

/* ── DIVINE SCREEN EARTHQUAKE ──────────────── */
@keyframes screenShake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  10% { transform: translate(-4px, -3px) rotate(-0.3deg); }
  20% { transform: translate(5px, 2px) rotate(0.4deg); }
  30% { transform: translate(-3px, 4px) rotate(-0.2deg); }
  40% { transform: translate(4px, -2px) rotate(0.3deg); }
  50% { transform: translate(-5px, 1px) rotate(-0.4deg); }
  60% { transform: translate(3px, -4px) rotate(0.2deg); }
  70% { transform: translate(-2px, 3px) rotate(-0.3deg); }
  80% { transform: translate(4px, -1px) rotate(0.4deg); }
  90% { transform: translate(-3px, 2px) rotate(-0.2deg); }
}
.shake-effect { animation: screenShake 0.6s ease-out; }

/* Gold Flash for streak */
@keyframes goldFlash {
  0% { box-shadow: inset 0 0 0px #ffd700; }
  15% { box-shadow: inset 0 0 80px #ffd70060, 0 0 40px #ffd70030; }
  40% { box-shadow: inset 0 0 40px #ffd70030, 0 0 20px #ffd70015; }
  100% { box-shadow: inset 0 0 0px transparent; }
}
.gold-flash-effect { animation: goldFlash 0.8s ease-out; }

/* ── WRONG ANSWER — RED SHAKE & FLASH ──────── */
.wrong-flash-overlay {
  position: fixed; inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center, rgba(255,0,0,0.2) 0%, transparent 70%);
  border: 3px solid transparent;
}
.wrong-flash-overlay.active {
  animation: wrongFlash 0.5s ease-out forwards;
}
@keyframes wrongFlash {
  0% { opacity: 1; border-color: #ff4444; box-shadow: inset 0 0 60px rgba(255,0,0,0.3); }
  30% { opacity: 0.8; border-color: #ff000080; box-shadow: inset 0 0 30px rgba(255,0,0,0.15); }
  100% { opacity: 0; border-color: transparent; box-shadow: inset 0 0 0 transparent; }
}
@keyframes wrongShake {
  0%, 100% { transform: translate(0, 0); }
  10%, 50%, 90% { transform: translate(-6px, 0); }
  30%, 70% { transform: translate(6px, 0); }
}
.wrong-shake-effect { animation: wrongShake 0.4s ease-out; }

/* ── PROGRESS BAR STATE CHANGES ────────────── */
.quiz-progress-fill.gold-mode {
  background: linear-gradient(90deg, #ffd700, #ffaa00, #fff6a0, #ffd700) !important;
  box-shadow: 0 0 12px #ffd70080, 0 0 24px #ffd70040 !important;
  animation: progress-gold-pulse 1s ease-in-out infinite alternate;
}
@keyframes progress-gold-pulse {
  from { box-shadow: 0 0 8px #ffd70060, 0 0 16px #ffd70030; }
  to { box-shadow: 0 0 16px #ffd700a0, 0 0 32px #ffd70060; }
}
.quiz-progress-fill.red-flash {
  background: linear-gradient(90deg, #ff4444, #ff0000, #ff4444) !important;
  box-shadow: 0 0 12px #ff444480 !important;
  transition: all 0.2s ease;
}

/* Gold theme override during streak */
.streak-gold-theme .status-bar {
  border-bottom-color: #ffd70040 !important;
}
.streak-gold-theme .timer-ring-fill {
  stroke: #ffd700 !important;
  filter: drop-shadow(0 0 10px #ffd700) !important;
}
.streak-gold-theme .timer-num {
  color: #ffd700 !important;
}

/* =====================================================
   DASHBOARD HOME — 3-Column Social Layout
   ===================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 16px;
  min-height: calc(100vh - 120px);
}
.dash-col {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── PROFILE CARD (Discord-style) ────────── */
.profile-card-big {
  border-color: rgba(196,77,255,0.2);
}
.profile-card-header {
  padding: 20px;
  text-align: center;
  background: linear-gradient(135deg, rgba(196,77,255,0.1), rgba(0,255,255,0.05));
  border-bottom: 1px solid rgba(196,77,255,0.15);
}
.pc-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}
.pc-avatar-img {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 3px solid var(--neon-purple);
  box-shadow: 0 0 20px rgba(196,77,255,0.3);
  object-fit: cover;
  background: var(--bg-dark);
}
.pc-online-dot {
  position: absolute; bottom: 4px; right: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--neon-green);
  border: 3px solid var(--bg-panel);
  box-shadow: 0 0 8px rgba(0,255,136,0.6);
}
.pc-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.pc-username {
  font-family: 'Orbitron', sans-serif;
  font-size: 1em;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 1px;
}
.pc-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6em;
  background: rgba(0,255,136,0.15);
  color: var(--neon-green);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0,255,136,0.3);
  letter-spacing: 1px;
}

/* Bio Section */
.pc-bio-section {
  padding: 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.pc-bio-label, .pc-badges-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6em;
  color: var(--text-sub);
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.pc-bio-wrap {
  position: relative;
}
.pc-bio-input {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-main);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9em;
  padding: 8px 10px;
  resize: none;
  height: 60px;
  outline: none;
  transition: border-color 0.3s;
}
.pc-bio-input:focus { border-color: var(--neon-purple); }
.pc-bio-count {
  position: absolute;
  bottom: 4px; right: 8px;
  font-size: 0.65em;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}
.pc-bio-save {
  margin-top: 8px;
  background: rgba(196,77,255,0.15);
  border: 1px solid rgba(196,77,255,0.3);
  color: var(--neon-purple);
  padding: 5px 14px;
  border-radius: 6px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  transition: all 0.2s;
}
.pc-bio-save:hover {
  background: rgba(196,77,255,0.25);
  box-shadow: 0 0 10px rgba(196,77,255,0.2);
}

/* Badge section */
.pc-badges-section { padding: 14px; }
.pc-badges-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pc-badge {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3em;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.3s;
}
.pc-badge.locked {
  opacity: 0.3;
  filter: grayscale(1);
}
.pc-badge.unlocked {
  opacity: 1;
  filter: none;
  box-shadow: 0 0 10px rgba(255,238,51,0.2);
  border-color: rgba(255,238,51,0.3);
  background: rgba(255,238,51,0.08);
}

/* ── GLOBAL CHAT ──────────────────────────── */
.global-chat-container {
  border-color: rgba(0,255,136,0.2);
}
.gc-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7em;
  color: var(--neon-green);
  letter-spacing: 2px;
  border-bottom: 1px solid rgba(0,255,136,0.15);
  background: rgba(0,255,136,0.03);
}
.gc-online-count {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  color: var(--text-dim);
  letter-spacing: 0;
}
.gc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
  max-height: calc(100vh - 260px);
}
.gc-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-dim);
  font-size: 0.9em;
}

/* Chat Bubble */
.chat-bubble {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  animation: chatFadeIn 0.3s ease;
}
@keyframes chatFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.cb-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.2s;
}
.cb-avatar:hover { border-color: var(--neon-cyan); }
.cb-content { flex: 1; min-width: 0; }
.cb-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.cb-name {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 0.85em;
  color: var(--neon-cyan);
  cursor: pointer;
}
.cb-name:hover { text-decoration: underline; }
.cb-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6em;
  color: var(--text-dim);
}
.cb-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9em;
  color: var(--text-main);
  word-break: break-word;
  line-height: 1.35;
}
.cb-self .cb-name { color: var(--neon-purple); }

/* Input Row */
.gc-input-row {
  padding: 10px 12px;
  border-top: 1px solid rgba(0,255,136,0.15);
  display: flex;
  gap: 8px;
  background: rgba(0,255,136,0.02);
}
.gc-input {
  flex: 1;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-main);
  padding: 8px 12px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9em;
  outline: none;
  transition: border-color 0.3s;
}
.gc-input:focus { border-color: var(--neon-green); }
.gc-send-btn {
  background: rgba(0,255,136,0.15);
  border: 1px solid rgba(0,255,136,0.3);
  border-radius: 8px;
  color: var(--neon-green);
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center;
}
.gc-send-btn:hover {
  background: rgba(0,255,136,0.25);
  box-shadow: 0 0 10px rgba(0,255,136,0.3);
}

/* ── FRIEND LIST ──────────────────────────── */
.friend-list-container {
  border-color: rgba(196,77,255,0.2);
}
.fl-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7em;
  color: var(--neon-purple);
  letter-spacing: 2px;
  border-bottom: 1px solid rgba(196,77,255,0.15);
  background: rgba(196,77,255,0.03);
}
.fl-count {
  margin-left: auto;
  background: rgba(196,77,255,0.2);
  color: var(--neon-purple);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  padding: 1px 8px;
  border-radius: 10px;
  letter-spacing: 0;
}
.fl-search-row {
  padding: 10px 12px;
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
}
.fl-search-input {
  flex: 1;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-main);
  padding: 7px 10px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85em;
  outline: none;
  transition: border-color 0.3s;
}
.fl-search-input:focus { border-color: var(--neon-purple); }
.fl-add-btn {
  background: rgba(196,77,255,0.15);
  border: 1px solid rgba(196,77,255,0.3);
  border-radius: 6px;
  color: var(--neon-purple);
  padding: 6px 10px;
  cursor: pointer;
  display: flex; align-items: center;
  transition: all 0.2s;
}
.fl-add-btn:hover {
  background: rgba(196,77,255,0.25);
  box-shadow: 0 0 8px rgba(196,77,255,0.2);
}

/* Add Friend Dialog */
.fl-add-dialog {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(196,77,255,0.03);
}
.fl-action-btn {
  flex: 1;
  padding: 5px 10px;
  border-radius: 5px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.8em;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.2s;
}
.fl-action-btn.accept {
  background: rgba(0,255,136,0.15);
  border-color: rgba(0,255,136,0.3);
  color: var(--neon-green);
}
.fl-action-btn.accept:hover { background: rgba(0,255,136,0.25); }
.fl-action-btn.reject {
  background: rgba(255,68,68,0.15);
  border-color: rgba(255,68,68,0.3);
  color: var(--neon-red);
}
.fl-action-btn.reject:hover { background: rgba(255,68,68,0.25); }

/* Friend List Sections */
.fl-section { padding: 8px 12px; }
.fl-section-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.55em;
  color: var(--text-dim);
  letter-spacing: 2px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.fl-list {
  overflow-y: auto;
  max-height: calc(100vh - 400px);
}
.fl-empty {
  text-align: center;
  padding: 20px 0;
  color: var(--text-dim);
  font-size: 0.85em;
}

/* Friend Item */
.friend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  border-radius: 6px;
  transition: background 0.2s;
  cursor: pointer;
}
.friend-item:hover {
  background: rgba(196,77,255,0.05);
}
.fi-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.fi-name {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.9em;
  color: var(--text-main);
  flex: 1;
}
.fi-actions {
  display: flex; gap: 4px;
}
.fi-action-btn {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7em;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.2s;
}

/* ── VISIT PROFILE MODAL ──────────────────── */
.visit-modal-overlay {
  position: fixed; inset: 0;
  z-index: 8000;
  background: rgba(4,7,15,0.85);
  display: flex; align-items: center; justify-content: center;
  animation: fadeInOverlay 0.3s ease;
}
@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}
.visit-modal-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-active);
  border-radius: 16px;
  width: 400px;
  max-width: 90vw;
  padding: 0;
  position: relative;
  box-shadow: 0 0 40px rgba(0,255,255,0.1);
  animation: modalSlideUp 0.4s cubic-bezier(0.16,1,0.3,1);
}
@keyframes modalSlideUp {
  from { transform: translateY(30px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.visit-close-btn {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(255,68,68,0.15);
  border: 1px solid rgba(255,68,68,0.3);
  color: var(--neon-red);
  border-radius: 6px;
  padding: 4px;
  cursor: pointer;
  display: flex; z-index: 2;
  transition: all 0.2s;
}
.visit-close-btn:hover { background: rgba(255,68,68,0.3); }

.vm-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 20px 16px;
  background: linear-gradient(135deg, rgba(0,255,255,0.08), rgba(196,77,255,0.08));
  border-bottom: 1px solid var(--border-subtle);
}
.vm-avatar {
  width: 70px; height: 70px;
  border-radius: 50%;
  border: 3px solid var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0,255,255,0.2);
  object-fit: cover;
  background: var(--bg-dark);
}
.vm-info { flex: 1; }
.vm-username {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1em;
  font-weight: 700;
  color: var(--neon-cyan);
  margin-bottom: 4px;
}
.vm-bio {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85em;
  color: var(--text-sub);
  line-height: 1.3;
}

.vm-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.vm-stat {
  text-align: center;
  padding: 8px;
  background: rgba(0,255,255,0.03);
  border: 1px solid rgba(0,255,255,0.1);
  border-radius: 8px;
}
.vm-stat-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 1em;
  font-weight: 700;
  color: var(--neon-cyan);
}
.vm-stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6em;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-top: 2px;
}

.vm-badges-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6em;
  color: var(--text-dim);
  letter-spacing: 2px;
  padding: 12px 20px 6px;
}
.vm-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 20px 16px;
}
.vm-friend-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: calc(100% - 40px);
  margin: 0 20px 20px;
  padding: 10px;
  background: rgba(0,255,255,0.1);
  border: 1px solid rgba(0,255,255,0.3);
  color: var(--neon-cyan);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.95em;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
}
.vm-friend-btn:hover {
  background: rgba(0,255,255,0.2);
  box-shadow: 0 0 12px rgba(0,255,255,0.2);
}
.vm-friend-btn.already-friends {
  background: rgba(0,255,136,0.1);
  border-color: rgba(0,255,136,0.3);
  color: var(--neon-green);
  cursor: default;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay.open { display: block; }

  .mobile-header { display: flex; }

  .main-content {
    margin-left: 0;
    padding-top: 66px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .gc-messages {
    max-height: 350px;
  }
  .fl-list {
    max-height: 300px;
  }

  .stat-grid { grid-template-columns: repeat(3, 1fr); }

  .podium-container { gap: 8px; }
  .podium-block { width: 60px; }
  .podium-avatar { width: 44px; height: 44px; font-size: 0.7em; }

  .rank-header,
  .rank-row { grid-template-columns: 40px 1fr 70px; }
  .rank-acc, .rank-streak { display: none; }

  .timer-ring-wrap { width: 80px; height: 80px; }
  .timer-ring-center .timer-num { font-size: 1.2em; }

  .vm-stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .badges-container { grid-template-columns: 1fr; }
}
