/* ==========================================================================
   BQ24 LIVE QUIZ — EXACT REFERENCE IMPLEMENTATION STYLES (css/live-quiz.css)
   Matches the 9 reference screens:
     1. Waiting Room (Mobile Light)
     2. Waiting Room (Mobile Dark)
     3. Countdown 3s (Mobile)
     4. Countdown 2s (Mobile)
     5. Countdown 1s (Mobile)
     6. Quiz In Progress (Mobile)
     7. Waiting Room (Desktop Light)
     8. Countdown (Desktop)
     9. Quiz In Progress (Desktop)
   ========================================================================== */

/* ---------- Scoped Design Tokens (Dark Default, Light Override) ---------- */
#quiz {
  --lq-primary: #2563EB;
  --lq-primary-hover: #1D4ED8;
  --lq-primary-press: #1E40AF;
  --lq-primary-light: rgba(37, 99, 235, 0.12);
  --lq-primary-faint: rgba(37, 99, 235, 0.05);

  --lq-accent: #60A5FA;
  --lq-success: #10B981;
  --lq-success-bg: rgba(16, 185, 129, 0.12);
  --lq-success-border: rgba(16, 185, 129, 0.25);

  --lq-starting: #3B82F6;
  --lq-starting-bg: rgba(59, 130, 246, 0.12);
  --lq-starting-border: rgba(59, 130, 246, 0.3);

  /* Dark theme palette (project default) */
  --lq-bg: #0B1220;
  --lq-surface: #111C2E;
  --lq-surface-2: #17243A;
  --lq-card: #111C2E;
  --lq-text: #F8FAFC;
  --lq-text-muted: #A7B4C8;
  --lq-border: #293A53;
  --lq-border-subtle: #1E2D42;
  --lq-ring-track: rgba(59, 130, 246, 0.16);
  --lq-pill-bg: #17243A;

  /* Sizing & radius */
  --lq-r-sm: 8px;
  --lq-r-md: 12px;
  --lq-r-lg: 16px;
  --lq-r-xl: 20px;
  --lq-r-pill: 9999px;

  /* Typography */
  --lq-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --lq-mono: 'JetBrains Mono', monospace;

  /* Reset layout constraints for full viewport */
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--lq-bg);
  color: var(--lq-text);
  font-family: var(--lq-font);
  box-sizing: border-box;
}

/* Light theme overrides */
[data-theme="light"] #quiz {
  --lq-bg: #F8FAFC;
  --lq-surface: #FFFFFF;
  --lq-surface-2: #F1F5F9;
  --lq-card: #FFFFFF;
  --lq-text: #0F172A;
  --lq-text-muted: #64748B;
  --lq-border: #E2E8F0;
  --lq-border-subtle: #EDF2F7;
  --lq-ring-track: rgba(37, 99, 235, 0.10);
  --lq-pill-bg: #EFF6FF;
}

/* ---------- Wrapper & Desktop Layout ---------- */
.lq-wrapper {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

/* Desktop Sidebar */
.lq-sidebar {
  width: 240px;
  flex: 0 0 240px;
  background: var(--lq-surface);
  border-right: 1px solid var(--lq-border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  box-sizing: border-box;
}

.lq-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  padding-left: 8px;
}

.lq-sidebar-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.lq-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lq-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--lq-r-md);
  border: none;
  background: transparent;
  color: var(--lq-text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.lq-nav-item:hover {
  background: var(--lq-surface-2);
  color: var(--lq-text);
}

.lq-nav-item.active {
  background: var(--lq-primary-light);
  color: var(--lq-primary);
  font-weight: 700;
}

.lq-nav-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

/* Main Content Area */
.lq-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--lq-bg);
  box-sizing: border-box;
}

/* Top Navigation Bar */
.lq-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--lq-border);
  background: var(--lq-surface);
}

.lq-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lq-mobile-logo {
  display: none;
}

.lq-mobile-logo img {
  height: 28px;
  width: auto;
}

.lq-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
  font-family: inherit;
  color: var(--lq-text);
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}

.lq-back-link:hover {
  color: var(--lq-primary);
}

.lq-back-link svg {
  width: 18px;
  height: 18px;
}

/* Status Badges: WAITING | STARTING | IN PROGRESS */
.lq-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--lq-r-pill);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.lq-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* WAITING: Green */
.lq-status-badge.badge-waiting {
  background: var(--lq-success-bg);
  color: var(--lq-success);
  border: 1px solid var(--lq-success-border);
}
.lq-status-badge.badge-waiting .lq-badge-dot {
  background: var(--lq-success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* STARTING: Vibrant Blue with pulse */
.lq-status-badge.badge-starting {
  background: var(--lq-starting-bg);
  color: var(--lq-starting);
  border: 1px solid var(--lq-starting-border);
}
.lq-status-badge.badge-starting .lq-badge-dot {
  background: var(--lq-starting);
  animation: lqDotPulse 1s infinite alternate;
}

/* IN PROGRESS: Green */
.lq-status-badge.badge-in-progress {
  background: var(--lq-success-bg);
  color: var(--lq-success);
  border: 1px solid var(--lq-success-border);
}
.lq-status-badge.badge-in-progress .lq-badge-dot {
  background: var(--lq-success);
}

@keyframes lqDotPulse {
  from { opacity: 0.6; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1.2); }
}

/* ---------- Screens Container ---------- */
.lq-screen {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 32px 20px 48px;
  box-sizing: border-box;
  animation: lqFadeIn 0.2s ease both;
}

.lq-screen.hidden {
  display: none !important;
}

@keyframes lqFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   1. WAITING ROOM SCREEN (Screens 1, 2, 7)
   ========================================================================== */
.lq-waiting-screen {
  max-width: 540px;
  margin: 0 auto;
  width: 100%;
}

/* Art with floating badges */
.lq-waiting-art {
  position: relative;
  width: 260px;
  height: 180px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lq-art-svg-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lq-art-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.lq-art-badge {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: var(--lq-r-md);
  background: var(--lq-surface);
  border: 1px solid var(--lq-border);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lq-primary);
  z-index: 2;
  transition: transform 0.3s ease;
}

.lq-art-badge svg {
  width: 22px;
  height: 22px;
}

.lq-art-badge-left {
  left: 6px;
  top: 36px;
}

.lq-art-badge-right {
  right: 6px;
  top: 36px;
}

/* Titles */
.lq-waiting-title {
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  color: var(--lq-text);
  margin: 0 0 10px;
  line-height: 1.3;
}

.lq-waiting-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--lq-text-muted);
  text-align: center;
  max-width: 440px;
  margin: 0 auto 24px;
}

/* Success Card */
.lq-success-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: var(--lq-surface);
  border: 1px solid var(--lq-border);
  border-radius: var(--lq-r-lg);
  padding: 14px 18px;
  box-sizing: border-box;
  margin-bottom: 28px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.lq-success-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: var(--lq-success);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lq-success-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}

.lq-success-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lq-success-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--lq-text);
}

.lq-success-sub {
  font-size: 12px;
  color: var(--lq-text-muted);
}

/* ---------- 3-Step Stepper (Horizontal) ---------- */
.lq-stepper {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 32px;
  padding: 0 10px;
  box-sizing: border-box;
}

.lq-stepper-track {
  position: absolute;
  top: 14px;
  left: 45px;
  right: 45px;
  height: 2px;
  background: var(--lq-border);
  z-index: 1;
}

.lq-stepper-track-countdown {
  background: linear-gradient(90deg, var(--lq-primary) 50%, var(--lq-primary) 100%);
}

.lq-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 90px;
}

.lq-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.2s ease;
  background: var(--lq-surface);
  border: 2px solid var(--lq-border);
  color: var(--lq-text-muted);
}

.lq-step-circle svg {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

/* Done: Solid Blue with Check */
.lq-step-done .lq-step-circle {
  background: var(--lq-primary);
  border-color: var(--lq-primary);
  color: #FFFFFF;
}

/* Active: Blue outer ring with inner blue dot */
.lq-step-active .lq-step-circle {
  border-color: var(--lq-primary);
  background: var(--lq-surface);
}

.lq-step-inner-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lq-primary);
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.5);
}

/* Upcoming: Subtle Gray ring */
.lq-step-upcoming .lq-step-circle {
  border-color: var(--lq-border);
  color: var(--lq-text-muted);
}

.lq-step-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--lq-text);
  margin-bottom: 2px;
}

.lq-step-sub {
  font-size: 11px;
  color: var(--lq-text-muted);
}

/* ---------- Info Banners ---------- */
.lq-info-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--lq-surface-2);
  border: 1px solid var(--lq-border);
  border-radius: var(--lq-r-md);
  padding: 12px 16px;
  box-sizing: border-box;
}

.lq-info-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--lq-starting);
}

.lq-info-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--lq-text-muted);
}

.lq-speaker-banner {
  background: var(--lq-primary-light);
  border-color: rgba(37, 99, 235, 0.2);
}

.lq-speaker-banner .lq-info-icon {
  color: var(--lq-primary);
}

.lq-speaker-banner .lq-info-text {
  color: var(--lq-primary);
  font-weight: 600;
}

/* ==========================================================================
   2. COUNTDOWN SCREEN (Screens 3, 4, 5, 8)
   ========================================================================== */
.lq-countdown-screen {
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.lq-countdown-ring-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 12px auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.lq-ring-bg {
  fill: none;
  stroke: var(--lq-ring-track);
  stroke-width: 10;
}

.lq-ring-bar {
  fill: none;
  stroke: var(--lq-primary);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.9s linear;
}

.lq-countdown-number {
  position: absolute;
  font-size: 68px;
  font-weight: 900;
  color: var(--lq-primary);
  line-height: 1;
  user-select: none;
}

.lq-countdown-caption {
  font-size: 13.5px;
  color: var(--lq-text-muted);
  text-align: center;
  margin-bottom: 20px;
  font-weight: 500;
}

.lq-countdown-title {
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  color: var(--lq-text);
  margin: 0 0 10px;
}

.lq-countdown-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--lq-text-muted);
  text-align: center;
  max-width: 420px;
  margin: 0 auto 28px;
}

/* ==========================================================================
   3. QUIZ SCREEN (Screens 6, 9)
   ========================================================================== */
.lq-quiz-screen {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.lq-quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 20px;
}

.lq-qnum {
  font-size: 18px;
  font-weight: 800;
  color: var(--lq-text);
  letter-spacing: -0.01em;
}

.lq-timer-wrap {
  display: flex;
  align-items: center;
}

.lq-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--lq-r-pill);
  background: var(--lq-pill-bg);
  border: 1px solid var(--lq-border);
  color: var(--lq-primary);
  font-family: var(--lq-mono);
  font-size: 14.5px;
  font-weight: 700;
}

.lq-timer-pill svg {
  width: 16px;
  height: 16px;
}

.lq-timer-pill.warning {
  color: #F59E0B;
  border-color: rgba(245, 158, 11, 0.4);
}

.lq-timer-pill.urgent {
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.4);
  animation: lqPulseTimer 0.8s infinite alternate;
}

@keyframes lqPulseTimer {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}

/* Quiz Card */
.lq-quiz-card {
  width: 100%;
  background: var(--lq-card);
  border: 1px solid var(--lq-border);
  border-radius: var(--lq-r-xl);
  padding: 28px 24px;
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.lq-question-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--lq-text);
  margin: 0 0 24px;
}

/* Options */
.lq-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.lq-options .option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--lq-r-lg);
  background: var(--lq-surface);
  border: 1.5px solid var(--lq-border);
  color: var(--lq-text);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.lq-options .option:hover:not(:disabled) {
  border-color: var(--lq-accent);
  background: var(--lq-surface-2);
}

.lq-options .option .letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  border: 1.5px solid var(--lq-border);
  color: var(--lq-text-muted);
  font-weight: 700;
  font-size: 13.5px;
  transition: all 0.15s ease;
}

.lq-options .option .option-text {
  flex: 1;
  line-height: 1.35;
}

/* Selected state (Matches reference screen 6 & 9) */
.lq-options .option.selected {
  border-color: var(--lq-primary) !important;
  background: var(--lq-primary-faint) !important;
}

.lq-options .option.selected .letter {
  background: var(--lq-primary) !important;
  border-color: var(--lq-primary) !important;
  color: #FFFFFF !important;
}

/* Correct / Wrong feedback states */
.lq-options .option.correct-answer {
  border-color: var(--lq-success) !important;
  background: rgba(16, 185, 129, 0.08) !important;
}
.lq-options .option.correct-answer .letter {
  background: var(--lq-success) !important;
  border-color: var(--lq-success) !important;
  color: #FFFFFF !important;
}

.lq-options .option.wrong-answer {
  border-color: #EF4444 !important;
  background: rgba(239, 68, 68, 0.08) !important;
}
.lq-options .option.wrong-answer .letter {
  background: #EF4444 !important;
  border-color: #EF4444 !important;
  color: #FFFFFF !important;
}

/* Actions footer */
.lq-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.lq-save-status {
  font-size: 12.5px;
  color: var(--lq-text-muted);
  font-weight: 600;
}

.lq-next-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--lq-r-md);
  background: var(--lq-primary);
  color: #FFFFFF;
  font-size: 14.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lq-next-btn:hover:not(:disabled) {
  background: var(--lq-primary-hover);
}

.lq-next-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lq-next-btn svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Mobile < 900px)
   ========================================================================== */
@media (max-width: 900px) {
  .lq-sidebar {
    display: none !important;
  }

  .lq-wrapper {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
  }

  .lq-main {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
  }

  /* Single-row mobile top navigation bar */
  .lq-topbar {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
    min-height: 52px;
    gap: 12px;
    background: var(--lq-surface);
    border-bottom: 1px solid var(--lq-border);
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
  }

  .lq-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .lq-mobile-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .lq-mobile-logo img {
    height: 22px;
    width: auto;
    object-fit: contain;
  }

  .lq-back-link {
    order: unset;
    width: auto;
    margin-top: 0;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    color: var(--lq-text);
  }

  .lq-back-link svg {
    width: 18px;
    height: 18px;
  }

  .lq-topbar-right {
    order: unset;
    margin-left: auto;
    flex-shrink: 0;
  }

  .lq-status-badge {
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
  }

  /* Screen containers */
  .lq-screen {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    margin: 0 auto;
    overflow-x: hidden;
  }

  /* WAITING SCREEN ON MOBILE */
  .lq-waiting-screen {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
  }

  .lq-waiting-art {
    position: relative;
    width: min(220px, 60vw);
    height: 125px;
    margin: 6px auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .lq-art-badge {
    width: 36px;
    height: 36px;
    border-radius: var(--lq-r-md);
  }

  .lq-art-badge svg {
    width: 18px;
    height: 18px;
  }

  .lq-art-badge-left {
    left: -4px;
    top: 18px;
  }

  .lq-art-badge-right {
    right: -4px;
    top: 18px;
  }

  .lq-waiting-title {
    font-size: clamp(19px, 5.2vw, 22px);
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    color: var(--lq-text);
    margin: 0 0 6px;
    padding: 0 4px;
    width: 100%;
  }

  .lq-waiting-desc {
    font-size: 13px;
    line-height: 1.45;
    color: var(--lq-text-muted);
    text-align: center;
    max-width: 100%;
    margin: 0 auto 16px;
    padding: 0 6px;
  }

  .lq-success-card {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: var(--lq-r-md);
    background: var(--lq-surface);
    border: 1px solid var(--lq-border);
  }

  .lq-success-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
  }

  .lq-success-title {
    font-size: 13.5px;
    font-weight: 700;
  }

  .lq-success-sub {
    font-size: 12px;
  }

  .lq-stepper {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto 16px;
    padding: 0 4px;
  }

  .lq-stepper-track {
    top: 13px;
    left: 14%;
    right: 14%;
    height: 2px;
  }

  .lq-step {
    flex: 1;
    max-width: 33%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .lq-step-circle {
    width: 26px;
    height: 26px;
    margin-bottom: 6px;
    font-size: 11px;
  }

  .lq-step-title {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
  }

  .lq-step-sub {
    font-size: 10px;
    line-height: 1.2;
    margin-top: 2px;
  }

  .lq-info-banner {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.45;
    border-radius: var(--lq-r-md);
  }

  /* COUNTDOWN SCREEN ON MOBILE */
  .lq-countdown-screen {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .lq-countdown-ring-wrap {
    width: min(140px, 40vw);
    height: min(140px, 40vw);
    margin-bottom: 10px;
  }

  .lq-countdown-number {
    font-size: clamp(48px, 14vw, 56px);
  }

  .lq-countdown-caption {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .lq-countdown-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
  }

  .lq-countdown-desc {
    font-size: 13px;
    line-height: 1.45;
    margin: 0 auto 18px;
    padding: 0 8px;
  }

  /* ACTIVE QUIZ SCREEN ON MOBILE */
  .lq-quiz-screen {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 14px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .lq-quiz-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    box-sizing: border-box;
  }

  .lq-quiz-card {
    width: 100%;
    box-sizing: border-box;
    padding: 18px 16px;
    border-radius: var(--lq-r-lg);
    background: var(--lq-card);
    border: 1px solid var(--lq-border);
  }

  .lq-question-title {
    font-size: clamp(16px, 4.4vw, 18.5px);
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 16px;
  }

  .lq-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
    width: 100%;
  }

  .lq-options .option {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 14px;
    gap: 12px;
    border-radius: var(--lq-r-md);
    min-height: 48px;
  }

  .lq-options .option .letter {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    font-size: 12px;
  }

  .lq-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    width: 100%;
  }

  .lq-next-btn {
    width: 100%;
    height: 48px;
    font-size: 14.5px;
    font-weight: 700;
    border-radius: var(--lq-r-md);
  }

  .lq-save-status {
    text-align: center;
  }
}

/* Small phones (<= 360px: e.g. Galaxy S / small Androids / iPhone SE 1st gen) */
@media (max-width: 360px) {
  .lq-topbar {
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  }
  .lq-screen {
    padding: 12px 10px calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .lq-waiting-art {
    width: 180px;
    height: 110px;
    margin: 4px auto 10px;
  }
  .lq-waiting-title {
    font-size: 18px;
  }
  .lq-waiting-desc {
    font-size: 12px;
    margin-bottom: 12px;
  }
  .lq-success-card {
    padding: 10px 12px;
    margin-bottom: 12px;
  }
  .lq-success-title {
    font-size: 12.5px;
  }
  .lq-stepper {
    margin-bottom: 12px;
    padding: 0 2px;
  }
  .lq-step-title {
    font-size: 10px;
  }
  .lq-step-sub {
    font-size: 9px;
  }
  .lq-info-banner {
    padding: 10px 12px;
    font-size: 11px;
  }
  .lq-quiz-card {
    padding: 14px 12px;
  }
  .lq-question-title {
    font-size: 15.5px;
  }
  .lq-options .option {
    padding: 10px 12px;
    font-size: 13px;
  }
}
