/* ========================================
   MOUSSABAKA - Feuille de styles complète
   MODE CLAIR AVEC IMAGE DE FOND
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&family=Tajawal:wght@400;700;800;900&family=Amiri:wght@700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #f0f4f8;
  --bg2:      #e8edf5;
  --bg3:      #d5dce6;
  --card:     #ffffff;
  --card2:    #f5f8fc;
  --accent:   #5b2ed4;
  --accent2:  #0099aa;
  --gold:     #d4891a;
  --green:    #00a066;
  --red:      #c0392b;
  --orange:   #e0500c;
  --text:     #1a2332;
  --muted:    #5a6a85;
  --border:   #b8c5d6;
  --r:        12px;
  --r2:       18px;
  --shadow:   0 8px 32px rgba(0,0,0,0.1);
  --glow:     0 0 24px rgba(91,46,212,0.15);
  --overlay:  rgba(255,255,255,0);
}

html { scroll-behavior: smooth; }

/* ── BACKGROUND IMAGE LOCALE ── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Tajawal', sans-serif;
  min-height: 100vh;
  direction: rtl;
  line-height: 1.6;
  position: relative;
}

/* Image de fond fixe (image locale) */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  background-image: url('/assets/images/background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Overlay clair pour lisibilité */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: var(--overlay);
}

/* Effet de grain subtil (optionnel) */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
}

/* ── VERSET CORANIQUE ── */
.quran-header {
  text-align: center;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(91,46,212,0.08), rgba(0,153,170,0.08));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 199;
}
.quran-header .quran-text {
  font-family: 'Amiri', 'Times New Roman', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #384bfb;
  text-shadow: 0 0 30px rgba(212,137,26,0.15);
  letter-spacing: 2px;
}
@media (max-width: 640px) {
  .quran-header .quran-text {
    font-size: 1rem;
    letter-spacing: 1px;
  }
}

h1, h2, h3, h4, h5 { font-family: 'Cairo', sans-serif; font-weight: 900; line-height: 1.2; }
a { color: var(--accent2); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }
img { max-width: 100%; }

/* ── CARTES AVEC EFFET VITRE (glassmorphism) ── */
.card, .quiz-row, .question-card, .stat-card, .rank-card, .lobby-team-row, .lb-row, .q-stat-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.card:hover, .quiz-row:hover, .question-card:hover, .stat-card:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 32px rgba(91,46,212,0.15);
  border-color: rgba(91,46,212,0.4);
}

/* ── INPUTS ── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 7px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
input, select, textarea {
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--r);
  font-family: inherit;
  font-size: 15px;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,46,212,0.15);
}
textarea { resize: vertical; min-height: 90px; }
select option { background: var(--bg2); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px;
  border: none;
  border-radius: var(--r);
  font-family: 'Cairo', sans-serif; font-weight: 700; font-size: 15px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.07);
  opacity: 0;
  transition: opacity .2s;
}
.btn:hover::after { opacity: 1; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

.btn-primary  { background: linear-gradient(135deg, #5b2ed4, #7c4ce0); color: #fff; box-shadow: 0 4px 15px rgba(91,46,212,.35); }
.btn-cyan     { background: linear-gradient(135deg, #0099aa, #007788); color: #fff; }
.btn-green    { background: linear-gradient(135deg, #00a066, #008855); color: #fff; }
.btn-red      { background: linear-gradient(135deg, #c0392b, #a93226); color: #fff; }
.btn-orange   { background: linear-gradient(135deg, #e0500c, #c0400a); color: #fff; }
.btn-gold     { background: linear-gradient(135deg, #d4891a, #b87814); color: #fff; }
.btn-ghost    { background: rgba(255,255,255,0.7); color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: rgba(255,255,255,0.9); }

.btn-sm  { padding: 7px 14px; font-size: 13px; }
.btn-lg  { padding: 15px 32px; font-size: 17px; }
.btn-xl  { padding: 18px 40px; font-size: 19px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }

/* ── CARD ── */
.card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.card-sm { padding: 16px; }

/* ── NAVBAR ── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 200;
}
.navbar-brand {
  font-family: 'Cairo', sans-serif;
  font-weight: 900;
  font-size: 22px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar-brand span { color: var(--accent); }
.navbar-nav { display: flex; align-items: center; gap: 10px; }

/* ── CONTAINER ── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 680px; margin: 0 auto; padding: 0 20px; }
.container-xs { max-width: 480px; margin: 0 auto; padding: 0 20px; }

/* ── PAGE WRAPPER ── */
.page { padding: 36px 0; }

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

/* ── FLEX UTILS ── */
.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-col      { display: flex; flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.gap-xs { gap: 6px; }  .gap-sm { gap: 10px; }
.gap-md { gap: 16px; } .gap-lg { gap: 24px; }

/* ── SPACING ── */
.mt-xs { margin-top: 6px; }  .mt-sm { margin-top: 12px; }
.mt-md { margin-top: 20px; } .mt-lg { margin-top: 32px; }
.mt-xl { margin-top: 48px; }
.mb-sm { margin-bottom: 12px; } .mb-md { margin-bottom: 20px; }

/* ── TEXT UTILS ── */
.text-center { text-align: center; }
.text-sm  { font-size: 13px; } .text-xs { font-size: 11px; }
.text-lg  { font-size: 18px; } .text-xl { font-size: 22px; }
.text-muted { color: var(--muted); }
.text-accent  { color: var(--accent); }
.text-accent2 { color: var(--accent2); }
.text-gold    { color: var(--gold); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.fw-bold  { font-weight: 700; }
.fw-black { font-weight: 900; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}
.badge-draft    { background: rgba(91,46,212,.12); color: var(--accent); }
.badge-waiting  { background: rgba(212,137,26,.12); color: var(--gold); }
.badge-active   { background: rgba(0,160,102,.12); color: var(--green); }
.badge-finished { background: rgba(90,106,133,.12); color: var(--muted); }
.badge-dot::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.badge-active.badge-dot::before { animation: blink 1.2s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ── ALERTS ── */
.alert {
  padding: 14px 18px;
  border-radius: var(--r);
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success { background: rgba(0,160,102,.10); border: 1px solid rgba(0,160,102,.25); color: var(--green); }
.alert-error   { background: rgba(192,57,43,.10); border: 1px solid rgba(192,57,43,.25); color: var(--red); }
.alert-info    { background: rgba(0,153,170,.10); border: 1px solid rgba(0,153,170,.25); color: var(--accent2); }
.alert-warning { background: rgba(212,137,26,.10); border: 1px solid rgba(212,137,26,.25); color: var(--gold); }

/* ── SECTION HEADER ── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.section-title  { font-size: 1.4rem; font-family: 'Cairo', sans-serif; font-weight: 900; }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ═══════════════════════════════════
   PAGES SPÉCIFIQUES
   ═══════════════════════════════════ */

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: transparent;
  text-align: center;
}
.hero-icon { font-size: 72px; margin-bottom: 16px; filter: drop-shadow(0 0 24px rgba(91,46,212,.3)); }
.hero h1 { font-size: 3.2rem; line-height: 1.1; margin-bottom: 14px; color: var(--text); }
.hero p  { color: var(--muted); font-size: 16px; margin-bottom: 32px; }

/* ── WAITING PAGE ── */
.waiting-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-14px)} }
.float-icon { animation: float 3s ease-in-out infinite; display: inline-block; }
.counter-big {
  font-size: 5rem;
  font-weight: 900;
  font-family: 'Cairo', sans-serif;
  color: var(--accent);
  line-height: 1;
}
.teams-cloud { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 560px; margin: 0 auto; }
.team-chip {
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  animation: chipIn .4s ease;
}
@keyframes chipIn { from{opacity:0;transform:scale(.8)} to{opacity:1;transform:scale(1)} }
.chip-boys  { background: rgba(0,153,170,.12); color: var(--accent2); border: 1px solid rgba(0,153,170,.2); }
.chip-girls { background: rgba(212,137,26,.12); color: var(--gold); border: 1px solid rgba(212,137,26,.2); }

/* ── PLAY PAGE ── */
.play-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.play-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.play-qnum { font-size: 13px; color: var(--muted); font-weight: 600; }
.play-score { font-family: 'Cairo', sans-serif; font-weight: 900; color: var(--gold); font-size: 20px; }
.play-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow: auto;
}
.question-text {
  font-size: 1.35rem;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  text-align: center;
  max-width: 700px;
  line-height: 1.5;
  margin-bottom: 28px;
  color: var(--text);
}
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; max-width: 680px; }
.opt-btn {
  border: none;
  border-radius: 16px;
  padding: 20px 18px;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: right;
  position: relative;
  overflow: hidden;
  color: #fff;
}
.opt-btn:hover:not(:disabled) { transform: scale(1.03); filter: brightness(1.1); }
.opt-btn:disabled { cursor: not-allowed; opacity: .65; }
.opt-A { background: #c0392b; }
.opt-B { background: #2980b9; }
.opt-C { background: #27ae60; }
.opt-D { background: #d68910; }
.opt-letter {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 17px;
  font-weight: 900;
  color: #fff;
}

/* ── TIMER CIRCLE ── */
.timer-wrap { position: relative; width: 62px; height: 62px; }
.timer-svg { transform: rotate(-90deg); }
.timer-bg { fill: none; stroke: var(--border); stroke-width: 5; }
.timer-fg { fill: none; stroke: var(--accent2); stroke-width: 5; stroke-dasharray: 163; stroke-dashoffset: 0; transition: stroke-dashoffset .9s linear, stroke .3s; stroke-linecap: round; }
.timer-num {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 20px;
  font-family: 'Cairo', sans-serif;
  color: var(--text);
}

/* ── FEEDBACK OVERLAY ── */
.feedback-overlay {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 500;
  backdrop-filter: blur(6px);
}
.feedback-icon { font-size: 96px; animation: popIn .4s; }
.feedback-title { font-size: 2rem; font-family: 'Cairo', sans-serif; font-weight: 900; margin-top: 14px; color: #fff; }
.feedback-pts { font-size: 3.5rem; font-family: 'Cairo', sans-serif; font-weight: 900; color: var(--gold); }
.feedback-correct { font-size: 14px; color: rgba(255,255,255,.8); margin-top: 8px; }
@keyframes popIn { from{transform:scale(.3);opacity:0} to{transform:scale(1);opacity:1} }
.wait-next { display: none; text-align: center; padding: 40px; color: var(--muted); }

/* ── RESULTS PAGE ── */
.results-hero {
  min-height: 100vh;
  background: transparent;
  padding: 40px 20px;
}
.rank-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  transition: all .2s;
}
.rank-card:hover { border-color: var(--accent); transform: translateX(-4px); }
.rank-card.me { border-color: var(--accent2); background: rgba(0,153,170,.12); }
.rank-medal { font-size: 26px; width: 34px; }
.rank-name  { flex: 1; font-weight: 700; margin: 0 12px; color: var(--text); }
.rank-score { font-family: 'Cairo', sans-serif; font-weight: 900; color: var(--gold); font-size: 20px; }

/* ── DASHBOARD ── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 20px;
  text-align: center;
  transition: all .2s;
}
.stat-card:hover { border-color: var(--accent); transform: translateY(-3px); background: rgba(255, 255, 255, 0.95); }
.stat-num { font-size: 4rem; font-weight: 900; font-family: 'Cairo', sans-serif; color: var(--accent2); }
.stat-label { font-size: 18px; color: var(--accent); margin-top: 4px; }
.quiz-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  margin-bottom: 12px;
  transition: all .2s;
  flex-wrap: wrap;
  gap: 12px;
}
.quiz-row:hover { border-color: rgba(91,46,212,.3); box-shadow: 0 4px 20px rgba(91,46,212,.08); background: rgba(255, 255, 255, 0.95); }
.quiz-info h3 { font-size: 1.05rem; margin-bottom: 4px; color: var(--text); }
.quiz-meta { font-size: 13px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.quiz-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── LOBBY ── */
.lobby-layout { display: grid; grid-template-columns: 1fr 380px; gap: 28px; padding: 28px 0; }
.lobby-code-box { text-align: center; padding: 40px; }
.big-code {
  font-family: 'Cairo', sans-serif;
  font-size: 4.5rem;
  font-weight: 900;
  letter-spacing: .35em;
  color: var(--accent2);
  text-shadow: 0 0 30px rgba(0,153,170,.2);
  margin: 10px 0;
}
.lobby-teams-list { display: flex; flex-direction: column; gap: 8px; }
.lobby-team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  animation: slideInRight .35s ease;
}
@keyframes slideInRight { from{opacity:0;transform:translateX(20px)} to{opacity:1;transform:translateX(0)} }

/* ── CONTROL PAGE ── */
.control-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; padding: 24px 0; }
.q-display-box { font-family: 'Cairo', sans-serif; font-size: 1.5rem; font-weight: 800; line-height: 1.4; min-height: 70px; color: var(--text); }
.bar-row   { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bar-letter { width: 26px; font-weight: 900; font-size: 15px; }
.bar-bg { flex: 1; background: var(--border); border-radius: 6px; height: 32px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; transition: width .6s ease; display: flex; align-items: center; padding: 0 12px; font-size: 13px; font-weight: 700; color: #fff; min-width: 10px; }
.bar-A { background: #c0392b; } .bar-B { background: #2980b9; }
.bar-C { background: #27ae60; } .bar-D { background: #d68910; }
.answer-progress { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.answer-progress-fill { height: 100%; background: var(--accent2); border-radius: 4px; transition: width .5s; }
.lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all .2s;
}
.lb-medal { font-size: 22px; width: 30px; text-align: center; }
.lb-name  { flex: 1; font-weight: 700; color: var(--text); }
.lb-score { font-family: 'Cairo', sans-serif; font-weight: 900; color: var(--gold); font-size: 19px; }

/* ── EDIT QUIZ ── */
.question-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 22px;
  margin-bottom: 16px;
  transition: border-color .2s;
}
.question-card:hover { border-color: rgba(91,46,212,.3); background: rgba(255, 255, 255, 0.95); }
.qcard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.opts-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.opt-input-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.opt-dot { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 900; flex-shrink: 0; }
.opt-dot-A { background: rgba(192,57,43,.15); color: #c0392b; }
.opt-dot-B { background: rgba(41,128,185,.15); color: #2980b9; }
.opt-dot-C { background: rgba(39,174,96,.15); color: #27ae60; }
.opt-dot-D { background: rgba(214,137,16,.15); color: #d68910; }
.correct-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; margin-top: 6px; }
.correct-label input[type=radio] { width: auto; accent-color: var(--green); }

/* ── RESULTS PROF ── */
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.q-stat-card { padding: 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(10px); border: 1px solid var(--border); margin-bottom: 10px; }
.q-stat-bar { height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; margin: 8px 0; }
.q-stat-fill { height: 100%; border-radius: 5px; transition: width 1s ease; }

/* ── LOGIN PAGE ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: transparent;
}
.login-card { width: 100%; max-width: 440px; }
.login-icon { font-size: 60px; text-align: center; margin-bottom: 12px; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .control-layout, .lobby-layout { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .opts-2col { grid-template-columns: 1fr; }
  .options-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.2rem; }
  .navbar { padding: 10px 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .quiz-row { flex-direction: column; align-items: flex-start; }
  .results-grid { grid-template-columns: 1fr; }
  .big-code { font-size: 3rem; }
}
@media (max-width: 400px) {
  .stats-row { grid-template-columns: 1fr; }
}
