/* ============================================================
   LEADERSHIP QUIZ — style.css
   Pure CSS, no build tools, Bootstrap-free, GoDaddy ready
   ============================================================ */

/* ── FONTS & RESET ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --neon: #38bdf8;
  --neon-glow: #7dd3fc;
  --bg-base: #0f172a;
  --bg-deep: #0a1120;
  --card-bg: rgba(30, 41, 59, 0.55);
  --card-strong: rgba(22, 34, 56, 0.72);
  --border-glow: rgba(56,189,248,0.25);
  --border-subtle: rgba(255,255,255,0.1);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --gradient-primary: linear-gradient(135deg, #3b82f6, #38bdf8);
  --shadow-neon: 0 0 0 1px rgba(56,189,248,0.3), 0 10px 40px -10px rgba(56,189,248,0.5), 0 0 60px -10px rgba(56,189,248,0.35);
  --shadow-glass: 0 8px 32px rgba(10,17,32,0.5);
  --radius: 1.25rem;
}

html, body { height: 100%; }
body {
  background: radial-gradient(circle at 20% 30%, rgba(59,130,246,0.35) 0, transparent 55%),
              radial-gradient(circle at 80% 70%, rgba(56,189,248,0.25) 0, transparent 55%),
              linear-gradient(180deg, #0d1630, #111827);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

h1,h2,h3,h4 { font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif; letter-spacing: -0.02em; }

/* ── PARTICLES ───────────────────────────────────────────── */
#particles-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ── HEADER ──────────────────────────────────────────────── */
#main-header {
  position: relative;
  z-index: 10;
  padding: 1.25rem 1.5rem;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--gradient-primary);
  box-shadow: var(--shadow-neon);
  display: flex; align-items: center; justify-content: center;
  color: #0f172a;
}
.brand-icon svg { width: 20px; height: 20px; }
.brand-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; color: var(--text); }
.brand-sub { font-size: 0.7rem; color: var(--muted); }
.live-badge {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.live-badge svg { color: var(--neon); width: 14px; height: 14px; }
@media(min-width:640px) { .live-badge { display: flex; } }

/* ── MAIN ────────────────────────────────────────────────── */
#main-content {
  position: relative;
  z-index: 5;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── SCREEN SYSTEM ───────────────────────────────────────── */
.screen { display: none; width: 100%; animation: fadeUp 0.45s cubic-bezier(0.22,1,0.36,1) both; }
.screen.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── GLASS CARDS ─────────────────────────────────────────── */
.card {
  border-radius: 1.5rem;
  padding: 2rem;
}
.glass {
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-glass);
}
.glass-strong {
  background: linear-gradient(135deg, rgba(30,42,74,0.65), rgba(18,28,54,0.5));
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--border-glow);
  box-shadow: var(--shadow-neon);
}

/* ── TEXT UTILITIES ──────────────────────────────────────── */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.neon-text { text-shadow: 0 0 20px rgba(56,189,248,0.6), 0 0 40px rgba(56,189,248,0.35); }
.muted { color: var(--muted); }
.sub-text { color: var(--muted); margin-top: 0.4rem; }
.text-right { text-align: right; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gradient-primary);
  color: #0f172a;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 1rem;
  padding: 0.9rem 2rem;
  cursor: pointer;
  box-shadow: var(--shadow-neon);
  transition: transform 0.15s, opacity 0.15s;
  font-family: inherit;
}
.btn-primary:hover:not(:disabled) { transform: scale(1.03); }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary.btn-full { width: 100%; justify-content: center; font-size: 1.1rem; padding: 1.1rem 2rem; margin-top: 1rem; }

.btn-glass {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 1rem;
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.btn-glass:hover { background: rgba(255,255,255,0.12); }

/* ── WELCOME SCREEN ──────────────────────────────────────── */
.welcome-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  width: 100%;
}
@media(min-width: 1024px) { .welcome-grid { grid-template-columns: 1.4fr 1fr; align-items: center; } }

.welcome-card { padding: 2.5rem 2rem; }
@media(min-width:640px) { .welcome-card { padding: 3rem; } }

.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(56,189,248,0.3);
  background: rgba(56,189,248,0.1);
  color: var(--neon);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.06;
  margin-bottom: 1.25rem;
}

.welcome-desc {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 540px;
  margin-bottom: 2rem;
}

.welcome-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2.5rem; }

.team-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 0.85rem 1.25rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.stat-box {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
}
.stat-val { font-size: 1.6rem; font-weight: 800; }
.stat-lbl { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-top: 0.2rem; }

/* QR Card */
.qr-card { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 2rem; }
.qr-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }
.qr-box { background: white; border-radius: 1rem; padding: 1rem; }
.qr-box canvas, .qr-box img { display: block; }
.qr-hint { font-size: 0.75rem; color: var(--muted); text-align: center; }

@keyframes pulse-glow {
  0%,100% { box-shadow: 0 0 20px rgba(56,189,248,0.4); }
  50%      { box-shadow: 0 0 40px rgba(56,189,248,0.8); }
}
.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }

/* ── REGISTER SCREEN ─────────────────────────────────────── */
.register-wrap { max-width: 640px; margin: 0 auto; }
.register-wrap .card { padding: 2.5rem; }
.register-wrap h2 { font-size: 2rem; margin-bottom: 0.25rem; }

.form-fields { margin-top: 2rem; display: flex; flex-direction: column; gap: 1.25rem; }

.field-group { display: flex; flex-direction: column; gap: 0.5rem; }
.field-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.field-label svg { color: var(--muted); }
.field-input-wrap {
  background: rgba(30,41,68,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field-input-wrap:focus-within {
  border-color: var(--neon);
  box-shadow: 0 0 0 4px rgba(56,189,248,0.12);
}
.field-input-wrap input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1.05rem;
  font-family: inherit;
}
.field-input-wrap input::placeholder { color: rgba(148,163,184,0.5); }

/* ── QUIZ SCREEN ─────────────────────────────────────────── */
.quiz-wrap { width: 100%; }
.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
.quiz-progress-group { display: flex; align-items: center; gap: 0.75rem; }
.q-counter {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.progress-bar-wrap {
  display: none;
  height: 8px;
  width: 200px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  overflow: hidden;
}
@media(min-width:640px) { .progress-bar-wrap { display: block; } }
.progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* question card */
.question-card { padding: 1.75rem; }
@media(min-width:640px) { .question-card { padding: 2.5rem; } }

.question-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; }
.question-text { font-size: clamp(1.25rem, 3vw, 2rem); font-weight: 700; line-height: 1.3; flex: 1; }

/* timer */
.timer-circle-wrap { position: relative; flex-shrink: 0; }
.timer-svg { display: block; transform: rotate(-90deg); }
.timer-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--neon);
}
.timer-inner svg { color: var(--neon); }
.timer-inner.danger { color: #f87171; }
.timer-inner.danger svg { color: #f87171; }

/* options */
.options-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 2rem; }
@media(min-width:640px) { .options-grid { grid-template-columns: 1fr 1fr; } }

.option-btn {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.3s, box-shadow 0.3s;
  ring-width: 2px;
  font-family: inherit;
  outline: 2px solid transparent;
}
.option-btn:hover:not(:disabled) { transform: scale(1.02); }
.option-btn:active:not(:disabled) { transform: scale(0.98); }
.option-btn:disabled { cursor: default; }

.option-btn.opt-0 { background: linear-gradient(135deg, rgba(244,63,94,0.85), rgba(220,38,38,0.85)); outline-color: rgba(253,164,175,0.3); }
.option-btn.opt-1 { background: linear-gradient(135deg, rgba(14,165,233,0.85), rgba(37,99,235,0.85)); outline-color: rgba(147,197,253,0.3); }
.option-btn.opt-2 { background: linear-gradient(135deg, rgba(245,158,11,0.85), rgba(234,88,12,0.85)); outline-color: rgba(253,211,77,0.3); }
.option-btn.opt-3 { background: linear-gradient(135deg, rgba(16,185,129,0.85), rgba(13,148,136,0.85)); outline-color: rgba(110,231,183,0.3); }

.option-btn.dimmed { opacity: 0.35; }
.option-btn.correct-ans { outline: 2px solid #6ee7b7; box-shadow: 0 0 40px -5px rgba(52,211,153,0.7); }
.option-btn.wrong-ans  { outline: 2px solid #fca5a5; box-shadow: 0 0 40px -5px rgba(248,113,113,0.7); }

.option-inner { display: flex; align-items: center; gap: 1rem; }
.option-shape {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: rgba(0,0,0,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.option-text { flex: 1; }
.option-icon { flex-shrink: 0; }
.option-icon svg { width: 22px; height: 22px; }

.shimmer-layer {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── FINAL SCREEN ────────────────────────────────────────── */
.final-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  width: 100%;
  align-items: start;
}
@media(min-width:1024px) { .final-grid { grid-template-columns: 1fr 1.2fr; } }

.final-score-card { text-align: center; padding: 2rem; }
.crown-icon { margin-bottom: 0.75rem; display: flex; justify-content: center; }
.crown-icon svg { width: 52px; height: 52px; color: var(--neon); filter: drop-shadow(0 0 10px rgba(56,189,248,0.6)); }
.final-heading { font-size: 2rem; font-weight: 800; }
.final-score-box {
  margin: 2rem 0;
  background: linear-gradient(135deg, rgba(30,50,100,0.4), rgba(22,40,80,0.3));
  border: 1px solid rgba(56,189,248,0.3);
  border-radius: 1.5rem;
  padding: 2rem;
}
.final-score-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted); }
.final-score-val { font-size: 4.5rem; font-weight: 800; margin-top: 0.25rem; line-height: 1; }
.final-score-meta { color: var(--muted); font-size: 1rem; margin-top: 0.75rem; }
.final-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }

/* Leaderboard */
.leaderboard-card { padding: 1.75rem; }
.lb-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.lb-header h3 { font-size: 1.4rem; }
.lb-table-wrap { border: 1px solid rgba(255,255,255,0.1); border-radius: 1rem; overflow: hidden; }
.lb-table-head {
  display: grid;
  grid-template-columns: 60px 1fr 120px 80px;
  background: rgba(255,255,255,0.05);
  padding: 0.75rem 1rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.lb-rows { max-height: 420px; overflow-y: auto; }
.lb-rows::-webkit-scrollbar { width: 4px; }
.lb-rows::-webkit-scrollbar-thumb { background: var(--neon); border-radius: 2px; }
.lb-row {
  display: grid;
  grid-template-columns: 60px 1fr 120px 80px;
  align-items: center;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  animation: fadeUp 0.3s ease both;
  transition: background 0.2s;
}
.lb-row:hover { background: rgba(255,255,255,0.04); }
.lb-row.lb-me { background: rgba(56,189,248,0.1); outline: 1px solid rgba(56,189,248,0.35); }
.lb-rank { display: flex; align-items: center; gap: 4px; font-weight: 700; }
.lb-rank svg { width: 16px; height: 16px; }
.lb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-me-tag { font-size: 0.65rem; color: var(--neon); margin-left: 6px; }
.lb-dept { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { text-align: right; font-weight: 700; background: var(--gradient-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hide-sm { display: none; }
@media(min-width:640px) { .hide-sm { display: block; } }
.lb-empty { padding: 2.5rem; text-align: center; color: var(--muted); }

/* ── THANKS SCREEN ───────────────────────────────────────── */
.thanks-wrap { max-width: 520px; margin: 0 auto; }
.thanks-card { text-align: center; padding: 3rem 2rem; }
.thanks-icon { margin-bottom: 1rem; }
.thanks-title { font-size: 3rem; font-weight: 800; }
.thanks-desc { color: var(--muted); font-size: 1.05rem; line-height: 1.7; margin: 1rem 0 2rem; }

/* ── ANSWER FEEDBACK OVERLAY (correct/wrong) ─────────────── */
#answer-feedback {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
}
#answer-feedback.show-correct { animation: flashCorrect 0.5s ease; }
#answer-feedback.show-wrong   { animation: flashWrong 0.5s ease; }
@keyframes flashCorrect {
  0%   { background: rgba(52,211,153,0.15); }
  100% { background: transparent; }
}
@keyframes flashWrong {
  0%   { background: rgba(248,113,113,0.15); }
  100% { background: transparent; }
}

/* ── CONFETTI CANVAS ─────────────────────────────────────── */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}

/* ── RESPONSIVE TWEAKS ───────────────────────────────────── */
@media(max-width:480px) {
  .card { padding: 1.25rem; }
  .welcome-card { padding: 1.5rem; }
  h1 { font-size: 2rem; }
  .final-score-val { font-size: 3.5rem; }
  .lb-table-head, .lb-row { grid-template-columns: 48px 1fr 70px; }
  .lb-dept { display: none; }
}