/**
 * Wordnus Quiz - World-Class Crystal Design
 * Glass-morphism, animations, split-screen layout
 * ALWAYS whitish background (ignores OS dark mode)
 */

/* ============================================
   FORCE LIGHT MODE - WHITISH BACKGROUND
   ============================================ */

:root {
  color-scheme: light only;

  /* Core palette */
  --wn-bg: #f8fafc;
  --wn-bg-secondary: #f1f5f9;
  --wn-surface: rgba(255, 255, 255, 0.95);
  --wn-surface-glass: rgba(255, 255, 255, 0.7);
  --wn-surface-hover: rgba(99, 102, 241, 0.05);
  --wn-surface-active: rgba(99, 102, 241, 0.1);

  /* Text */
  --wn-text: #1e293b;
  --wn-text-secondary: #475569;
  --wn-text-muted: #64748b;

  /* Borders */
  --wn-border: rgba(226, 232, 240, 0.8);
  --wn-border-light: rgba(255, 255, 255, 0.5);

  /* Primary (Purple-Indigo) */
  --wn-primary: #6366f1;
  --wn-primary-hover: #5558e3;
  --wn-primary-light: rgba(99, 102, 241, 0.1);

  /* Semantic */
  --wn-green: #22c55e;
  --wn-green-light: rgba(34, 197, 94, 0.15);
  --wn-red: #ef4444;
  --wn-red-light: rgba(239, 68, 68, 0.15);
  --wn-amber: #f59e0b;
  --wn-amber-light: rgba(245, 158, 11, 0.15);

  /* Spacing */
  --wn-space-1: 4px;
  --wn-space-2: 8px;
  --wn-space-3: 12px;
  --wn-space-4: 16px;
  --wn-space-5: 20px;
  --wn-space-6: 24px;
  --wn-space-8: 32px;
  --wn-space-10: 40px;

  /* Typography - Fluid with clamp() for perfect scaling */
  --wn-text-xs: clamp(0.65rem, 0.6rem + 0.25vw, 0.75rem);
  --wn-text-sm: clamp(0.75rem, 0.7rem + 0.3vw, 0.875rem);
  --wn-text-base: clamp(0.875rem, 0.8rem + 0.4vw, 1rem);
  --wn-text-lg: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
  --wn-text-xl: clamp(1.1rem, 1rem + 0.5vw, 1.25rem);
  --wn-text-2xl: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  --wn-text-3xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);

  /* Radius */
  --wn-radius-sm: 8px;
  --wn-radius-md: 12px;
  --wn-radius-lg: 16px;
  --wn-radius-xl: 24px;
  --wn-radius-full: 100px;

  /* Shadows */
  --wn-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --wn-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --wn-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
  --wn-shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.1);

  /* Layout */
  --wn-header-height: 60px;
  --wn-sidebar-width: 280px;
  --wn-nav-height: 72px;
}

/* Force light mode regardless of OS preference */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light only;
  }
}

[data-theme="dark"] {
  --wn-bg: #f8fafc;
  --wn-bg-secondary: #f1f5f9;
  --wn-surface: rgba(255, 255, 255, 0.95);
  --wn-text: #1e293b;
  --wn-text-secondary: #475569;
  --wn-text-muted: #64748b;
  --wn-border: rgba(226, 232, 240, 0.8);
}

/* ============================================
   BASE STYLES
   ============================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--wn-text-base);
  line-height: 1.5;
  color: var(--wn-text);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wn-hidden {
  display: none !important;
}

/* ============================================
   FIXED HEADER
   ============================================ */

.wn-fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--wn-header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--wn-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--wn-space-4);
  z-index: 1000;
  transition: all 0.3s ease;
}

.wn-header__brand {
  display: flex;
  align-items: center;
  gap: var(--wn-space-2);
}

.wn-logo-link {
  display: flex;
  align-items: center;
}

.wn-logo-img {
  width: 36px;
  height: 36px;
  border-radius: var(--wn-radius-sm);
  object-fit: cover;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--wn-shadow-sm);
}

.wn-logo-img:hover {
  transform: scale(1.08) rotate(5deg);
}

.wn-brand-text {
  font-weight: 700;
  font-size: var(--wn-text-xl);
  letter-spacing: 0.05em;
  color: var(--wn-text);
  text-decoration: none;
  margin-left: var(--wn-space-2);
}

.wn-brand-text .wn-n { color: #22c55e !important; }
.wn-brand-text .wn-u { color: #ef4444 !important; }
.wn-brand-text .wn-s { color: #22c55e !important; }

.wn-header__nav {
  display: flex;
  align-items: center;
  gap: var(--wn-space-3);
}

.wn-nav-link {
  display: flex;
  align-items: center;
  gap: var(--wn-space-2);
  padding: var(--wn-space-2) var(--wn-space-3);
  border-radius: var(--wn-radius-sm);
  color: var(--wn-text-muted);
  text-decoration: none;
  font-size: var(--wn-text-sm);
  font-weight: 500;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  cursor: pointer;
}

.wn-nav-link:hover {
  background: var(--wn-surface-hover);
  color: var(--wn-text);
}

.wn-nav-link--mobile {
  display: none;
}

/* Progress Mini in Header */
.wn-quiz-progress-mini {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: var(--wn-space-2) var(--wn-space-3);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.1));
  border-radius: var(--wn-radius-full);
  font-size: var(--wn-text-sm);
  font-weight: 700;
  color: var(--wn-green);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Settings Dropdown */
.wn-settings-dropdown {
  position: relative;
}

.wn-nav-link--settings {
  padding: var(--wn-space-2);
}

.wn-dropdown-arrow {
  transition: transform 0.2s ease;
}

.wn-settings-dropdown.open .wn-dropdown-arrow {
  transform: rotate(180deg);
}

.wn-settings-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--wn-surface);
  border: 1px solid var(--wn-border);
  border-radius: var(--wn-radius-md);
  padding: var(--wn-space-3);
  min-width: 180px;
  box-shadow: var(--wn-shadow-lg);
  z-index: 1001;
}

.wn-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wn-space-2);
}

.wn-settings-label {
  font-size: var(--wn-text-sm);
  color: var(--wn-text-muted);
}

.wn-settings-group {
  display: flex;
  gap: var(--wn-space-1);
}

.wn-icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--wn-border);
  border-radius: var(--wn-radius-sm);
  background: var(--wn-bg);
  color: var(--wn-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.wn-icon-btn:hover,
.wn-icon-btn.active {
  background: var(--wn-primary);
  color: white;
  border-color: var(--wn-primary);
}

/* ============================================
   QUIZ APP LAYOUT - VIEWPORT LOCKED
   ============================================ */

.wn-quiz-app {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wn-quiz-layout {
  display: flex;
  flex: 1;
  padding-top: var(--wn-header-height);
  min-height: calc(100vh - var(--wn-header-height));
  overflow: visible;
}

/* ============================================
   LEFT SIDEBAR (Desktop Only)
   ============================================ */

.wn-quiz-sidebar {
  display: none;
  width: var(--wn-sidebar-width);
  flex-shrink: 0;
  padding: var(--wn-space-6);
  background: var(--wn-surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--wn-border);
  flex-direction: column;
  gap: var(--wn-space-6);
  position: sticky;
  top: var(--wn-header-height);
  height: calc(100vh - var(--wn-header-height));
  overflow-y: auto;
}

.wn-sidebar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Progress Ring */
.wn-sidebar-section--progress {
  padding: var(--wn-space-4) 0;
}

.wn-progress-ring {
  position: relative;
  width: 140px;
  height: 140px;
}

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

.wn-progress-ring__bg {
  fill: none;
  stroke: rgba(99, 102, 241, 0.1);
  stroke-width: 8;
}

.wn-progress-ring__fill {
  fill: none;
  stroke: url(#progressGradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
}

.wn-progress-ring__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.wn-progress-ring__score {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.wn-progress-ring__label {
  font-size: var(--wn-text-sm);
  color: var(--wn-text-muted);
  font-weight: 500;
}

/* Pulse animation for progress ring */
.wn-progress-ring--pulse .wn-progress-ring__fill {
  animation: ringPulse 0.6s ease;
}

@keyframes ringPulse {
  0%, 100% { stroke-width: 8; filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4)); }
  50% { stroke-width: 12; filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.8)); }
}

/* Stats Section */
.wn-sidebar-section--stats {
  width: 100%;
  gap: var(--wn-space-3);
}

.wn-stat-row {
  display: flex;
  align-items: center;
  gap: var(--wn-space-3);
  padding: var(--wn-space-3) var(--wn-space-4);
  background: var(--wn-bg);
  border-radius: var(--wn-radius-md);
  transition: all 0.3s ease;
}

.wn-stat-row:hover {
  transform: translateX(4px);
}

.wn-stat-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--wn-radius-sm);
}

.wn-stat-row--correct .wn-stat-icon {
  background: var(--wn-green-light);
  color: var(--wn-green);
}

.wn-stat-row--wrong .wn-stat-icon {
  background: var(--wn-red-light);
  color: var(--wn-red);
}

.wn-stat-label {
  flex: 1;
  font-size: var(--wn-text-sm);
  color: var(--wn-text-muted);
}

.wn-stat-value {
  font-size: var(--wn-text-lg);
  font-weight: 700;
}

.wn-stat-row--correct .wn-stat-value {
  color: var(--wn-green);
}

.wn-stat-row--wrong .wn-stat-value {
  color: var(--wn-red);
}

/* Session Info */
.wn-sidebar-section--info {
  width: 100%;
  margin-top: auto;
}

.wn-session-info__link {
  display: flex;
  align-items: center;
  gap: var(--wn-space-3);
  padding: var(--wn-space-3) var(--wn-space-4);
  background: var(--wn-surface-hover);
  border-radius: var(--wn-radius-md);
  color: var(--wn-text);
  text-decoration: none;
  font-size: var(--wn-text-sm);
  font-weight: 500;
  transition: all 0.3s ease;
}

.wn-session-info__link:hover {
  background: var(--wn-surface-active);
  transform: translateX(4px);
}

.wn-session-info__link svg {
  color: var(--wn-primary);
}

/* Exit Button */
.wn-sidebar-section--exit {
  width: 100%;
}

.wn-exit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--wn-space-2);
  width: 100%;
  padding: var(--wn-space-3) var(--wn-space-4);
  background: transparent;
  border: 1px solid var(--wn-border);
  border-radius: var(--wn-radius-md);
  color: var(--wn-text-muted);
  font-size: var(--wn-text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.wn-exit-btn:hover {
  background: var(--wn-red-light);
  border-color: var(--wn-red);
  color: var(--wn-red);
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

.wn-quiz-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: var(--wn-space-4);
  padding-top: var(--wn-space-6);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  /* Smooth scrolling */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Sound Toggle Button */
.wn-sound-toggle:not(.active) {
  opacity: 0.5;
}

.wn-settings-row + .wn-settings-row {
  margin-top: var(--wn-space-2);
}

/* ============================================
   XP HUB - STICKY STATS BAR
   ============================================ */

.wn-xp-hub {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--wn-space-4);
  padding: var(--wn-space-3) var(--wn-space-4);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--wn-radius-lg);
  border: 1px solid var(--wn-border);
  box-shadow: var(--wn-shadow-sm);
  margin-bottom: var(--wn-space-4);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.wn-xp-hub__total {
  display: flex;
  align-items: center;
  gap: var(--wn-space-1);
}

.wn-xp-hub__icon {
  font-size: 1.1rem;
}

.wn-xp-hub__value {
  font-weight: 700;
  font-size: var(--wn-text-lg);
  color: var(--wn-primary);
}

.wn-xp-hub__label {
  font-size: var(--wn-text-sm);
  color: var(--wn-text-muted);
  font-weight: 500;
}

.wn-xp-hub__divider {
  width: 1px;
  height: 20px;
  background: var(--wn-border);
}

.wn-xp-hub__streak {
  display: flex;
  align-items: center;
  gap: var(--wn-space-1);
  font-weight: 600;
  color: var(--wn-amber);
}

.wn-xp-hub__fire {
  font-size: 1rem;
}

.wn-xp-hub__score {
  display: flex;
  align-items: center;
  gap: var(--wn-space-3);
}

.wn-xp-hub__correct,
.wn-xp-hub__wrong {
  display: flex;
  align-items: center;
  gap: var(--wn-space-1);
  font-weight: 600;
  font-size: var(--wn-text-sm);
}

.wn-xp-hub__correct {
  color: var(--wn-green);
}

.wn-xp-hub__wrong {
  color: var(--wn-red);
}

/* ============================================
   QUESTION CARD - PREMIUM ANIMATED FRAME
   ============================================ */

/* Custom property for rotating border animation */
@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.wn-question-container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  /* Natural height based on content */
  display: flex;
  flex-direction: column;
  /* 3D perspective for tilt effects */
  perspective: 1000px;
  perspective-origin: center;
  /* Add scroll clearance at bottom */
  padding-bottom: var(--wn-space-8);
  margin-bottom: var(--wn-space-6);
}

.wn-question-card {
  position: relative;
  background:
    linear-gradient(var(--wn-surface), var(--wn-surface)) padding-box,
    conic-gradient(from var(--border-angle),
      #6366f1, #8b5cf6, #a855f7, #ec4899, #6366f1) border-box;
  border: 3px solid transparent;
  border-radius: var(--wn-radius-xl);
  padding: var(--wn-space-6);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 10px 15px -3px rgba(0, 0, 0, 0.08),
    0 20px 25px -5px rgba(0, 0, 0, 0.05),
    0 0 30px rgba(99, 102, 241, 0.15);
  overflow: visible;
  animation: cardEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), rotateBorder 4s linear infinite;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Rotating border animation */
@keyframes rotateBorder {
  to { --border-angle: 360deg; }
}

/* Ornate corner decorations - top left */
.wn-question-card::before {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  top: -3px;
  left: -3px;
  border: 3px solid var(--wn-primary);
  border-right: none;
  border-bottom: none;
  border-top-left-radius: var(--wn-radius-xl);
  pointer-events: none;
  z-index: 1;
}

/* Ornate corner decorations - bottom right */
.wn-question-card::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  bottom: -3px;
  right: -3px;
  border: 3px solid var(--wn-primary);
  border-left: none;
  border-top: none;
  border-bottom-right-radius: var(--wn-radius-xl);
  pointer-events: none;
  z-index: 1;
}

@keyframes cardEnter {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    filter: blur(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes shimmer {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

/* Card states with 3D tilt */
.wn-question-card--success {
  animation: cardSuccess3D 0.8s ease;
}

@keyframes cardSuccess3D {
  0%, 100% {
    transform: perspective(1000px) rotateX(0) rotateY(0);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.08);
  }
  50% {
    transform: perspective(1000px) rotateX(-5deg) rotateY(5deg) scale(1.02);
    box-shadow: 0 20px 30px rgba(34, 197, 94, 0.3), 0 0 60px rgba(34, 197, 94, 0.4);
  }
}

.wn-question-card--error {
  animation: cardError3D 0.6s ease;
}

@keyframes cardError3D {
  0%, 100% {
    transform: perspective(1000px) rotateY(0);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.08);
  }
  25% {
    transform: perspective(1000px) rotateY(-10deg);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
  }
  75% {
    transform: perspective(1000px) rotateY(10deg);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
  }
}

.wn-shake {
  animation: cardShake 0.5s ease;
}

@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
  20%, 40%, 60%, 80% { transform: translateX(8px); }
}

/* ============================================
   QUESTION TYPE BADGES - HOLOGRAPHIC PREMIUM
   ============================================ */

.wn-type-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--wn-space-2);
  padding: var(--wn-space-2) var(--wn-space-4);
  border-radius: var(--wn-radius-full);
  font-size: var(--wn-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--wn-space-4);
  animation: badgeSlide 0.4s ease-out;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.3);
  border: 1px solid rgba(255,255,255,0.2);
  overflow: hidden;
}

/* Holographic shimmer effect */
.wn-type-badge::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.4) 50%, transparent 60%);
  animation: holographicShimmer 3s infinite;
  pointer-events: none;
}

@keyframes holographicShimmer {
  from { transform: translateX(-100%) rotate(45deg); }
  to { transform: translateX(100%) rotate(45deg); }
}

@keyframes badgeSlide {
  0% { transform: translateX(-20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* Type-specific colors */
.wn-type-badge--synonym,
.wn-type-badge[data-type="S"] {
  background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
  color: #7c3aed;
}

.wn-type-badge--antonym,
.wn-type-badge[data-type="A"] {
  background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
  color: #dc2626;
}

.wn-type-badge--definition,
.wn-type-badge[data-type="D"] {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #2563eb;
}

.wn-type-badge--fill,
.wn-type-badge[data-type="F"] {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #059669;
}

.wn-type-badge--context,
.wn-type-badge[data-type="H"] {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #d97706;
}

.wn-type-badge--meaning,
.wn-type-badge[data-type="L"] {
  background: linear-gradient(135deg, #fbcfe8 0%, #f9a8d4 100%);
  color: #db2777;
}

.wn-type-badge--application,
.wn-type-badge[data-type="P"] {
  background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%);
  color: #0891b2;
}

/* Default badge */
.wn-type-badge {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #4f46e5;
}

/* ============================================
   QUESTION BODY - 5 RANDOM PREMIUM DESIGNS
   ============================================ */

.wn-question-body {
  font-family: 'Playfair Display', 'Inter', serif;
  font-size: var(--wn-text-lg);
  font-weight: 500;
  line-height: 1.8;
  color: var(--wn-text);
  margin-bottom: var(--wn-space-6);
  text-align: justify;
  text-justify: inter-word;
  /* Prevent text overflow */
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  /* Base transition for design changes */
  transition: all 0.3s ease;
}

/* Design 1: Gradient Border Left */
.wn-question-stem--design-1 {
  border-left: 4px solid;
  border-image: linear-gradient(to bottom, #6366f1, #a855f7) 1;
  padding-left: var(--wn-space-4);
}

/* Design 2: Quote Style with Large Quote Mark */
.wn-question-stem--design-2 {
  position: relative;
  padding: 24px 32px;
}
.wn-question-stem--design-2::before {
  content: '"';
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  color: var(--wn-primary);
  opacity: 0.3;
  position: absolute;
  top: -10px;
  left: 0;
  line-height: 1;
}

/* Design 3: Subtle Gradient Background */
.wn-question-stem--design-3 {
  background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(168,85,247,0.05));
  border-radius: var(--wn-radius-lg);
  padding: 20px;
}

/* Design 4: Underline Accent */
.wn-question-stem--design-4 {
  border-bottom: 2px dashed var(--wn-primary);
  padding-bottom: 16px;
}

/* Design 5: Elevated Card */
.wn-question-stem--design-5 {
  background: white;
  border-radius: var(--wn-radius-md);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1), inset 0 0 0 1px rgba(99,102,241,0.1);
  padding: 20px;
}

/* Fill-in-the-blank styling */
.wn-blank {
  display: inline-block;
  border-bottom: 2px dashed var(--wn-primary);
  padding: 0 var(--wn-space-2);
  color: var(--wn-primary);
  font-weight: 600;
}

/* ============================================
   ANSWER OPTIONS - GLASS PILLS
   ============================================ */

.wn-answer-options {
  display: flex;
  flex-direction: column;
  gap: var(--wn-space-3);
  /* Prevent layout overflow */
  max-height: 40vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: var(--wn-space-1);
  scrollbar-width: thin;
  scrollbar-color: var(--wn-border) transparent;
}

.wn-answer-options::-webkit-scrollbar {
  width: 4px;
}

.wn-answer-options::-webkit-scrollbar-track {
  background: transparent;
}

.wn-answer-options::-webkit-scrollbar-thumb {
  background: var(--wn-border);
  border-radius: 2px;
}

.wn-option {
  display: flex;
  align-items: center;
  gap: var(--wn-space-4);
  padding: var(--wn-space-4) var(--wn-space-5);
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(248, 250, 252, 0.8) 100%
  );
  border: 2px solid transparent;
  border-radius: var(--wn-radius-lg);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--wn-shadow-sm);
  text-align: left;
  width: 100%;
  font-size: var(--wn-text-base);
  color: var(--wn-text);
  /* Staggered entry animation */
  animation: optionEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

/* Staggered delays for each option */
.wn-option:nth-child(1) { animation-delay: 0.1s; }
.wn-option:nth-child(2) { animation-delay: 0.15s; }
.wn-option:nth-child(3) { animation-delay: 0.2s; }
.wn-option:nth-child(4) { animation-delay: 0.25s; }
.wn-option:nth-child(5) { animation-delay: 0.3s; }

@keyframes optionEnter {
  0% {
    opacity: 0;
    transform: translateX(-20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.wn-option:hover:not(:disabled):not(.wn-option--correct):not(.wn-option--wrong) {
  transform: translateX(8px) scale(1.02);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow:
    0 4px 12px rgba(99, 102, 241, 0.15),
    0 0 0 4px rgba(99, 102, 241, 0.05);
}

.wn-option:active:not(:disabled) {
  transform: scale(0.98);
}

.wn-option:disabled {
  cursor: default;
}

/* Letter Badge */
.wn-option__key {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  font-weight: 700;
  font-size: var(--wn-text-lg);
  border-radius: var(--wn-radius-md);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.wn-option:hover:not(:disabled):not(.wn-option--correct):not(.wn-option--wrong) .wn-option__key {
  transform: rotate(-5deg) scale(1.1);
}

.wn-option__text {
  flex: 1;
  line-height: 1.5;
  /* Handle long text gracefully */
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  /* Prevent text from pushing layout */
  min-width: 0;
}

/* CORRECT State with 3D tilt */
.wn-option--correct {
  background: linear-gradient(135deg,
    rgba(34, 197, 94, 0.15) 0%,
    rgba(16, 185, 129, 0.1) 100%
  );
  border-color: var(--wn-green);
  animation: correctTilt3D 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wn-option--correct .wn-option__key {
  background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
  animation: letterPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wn-option--correct::after {
  content: '✓';
  position: absolute;
  right: 20px;
  font-size: 1.5rem;
  color: var(--wn-green);
  animation: checkmarkBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes correctTilt3D {
  0%   { transform: rotateX(0) rotateY(0) scale(1); }
  25%  { transform: rotateX(-15deg) rotateY(10deg) scale(1.05); }
  50%  { transform: rotateX(10deg) rotateY(-5deg) scale(1.08); }
  75%  { transform: rotateX(-5deg) rotateY(3deg) scale(1.03); }
  100% { transform: rotateX(0) rotateY(0) scale(1); }
}

@keyframes letterPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes checkmarkBounce {
  0% { transform: scale(0) rotate(-45deg); opacity: 0; }
  50% { transform: scale(1.2) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* WRONG State with 3D tilt */
.wn-option--wrong {
  background: linear-gradient(135deg,
    rgba(239, 68, 68, 0.15) 0%,
    rgba(220, 38, 38, 0.1) 100%
  );
  border-color: var(--wn-red);
  animation: wrongTilt3D 0.5s ease-out;
}

.wn-option--wrong .wn-option__key {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.wn-option--wrong::after {
  content: '✗';
  position: absolute;
  right: 20px;
  font-size: 1.5rem;
  color: var(--wn-red);
  animation: xmarkAppear 0.3s ease-out;
}

@keyframes wrongTilt3D {
  0%   { transform: rotateY(0) translateX(0); }
  20%  { transform: rotateY(-20deg) translateX(-15px); }
  40%  { transform: rotateY(15deg) translateX(10px); }
  60%  { transform: rotateY(-10deg) translateX(-8px); }
  80%  { transform: rotateY(5deg) translateX(4px); }
  100% { transform: rotateY(0) translateX(0); }
}

@keyframes xmarkAppear {
  0% { transform: scale(0) rotate(45deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* SELECTED State - Pre-submit highlighting */
.wn-option--selected {
  background: linear-gradient(135deg,
    rgba(99, 102, 241, 0.15) 0%,
    rgba(139, 92, 246, 0.1) 100%
  );
  border-color: var(--wn-primary);
  transform: translateX(8px) scale(1.02);
  box-shadow:
    0 4px 12px rgba(99, 102, 241, 0.2),
    0 0 0 4px rgba(99, 102, 241, 0.08);
  animation: selectedPulse 0.4s ease-out;
}

.wn-option--selected .wn-option__key {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  transform: rotate(-5deg) scale(1.1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

@keyframes selectedPulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2), 0 0 0 4px rgba(99, 102, 241, 0.08); }
}

/* Ripple effect on click */
.wn-option::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(99, 102, 241, 0.3) 0%, transparent 70%);
  opacity: 0;
  transform: scale(0);
  transition: transform 0.5s ease, opacity 0.3s ease;
  pointer-events: none;
}

.wn-option:active::before {
  opacity: 1;
  transform: scale(2);
  transition: transform 0s, opacity 0s;
}

/* ============================================
   10 DYNAMIC OPTION DESIGNS - GAME STYLE
   ============================================ */

/* Design 1: Gradient Border */
.wn-option--design-1 {
  background: linear-gradient(white, white) padding-box,
              linear-gradient(135deg, #6366f1, #ec4899) border-box;
  border: 2px solid transparent;
}

/* Design 2: Neon Glow */
.wn-option--design-2 {
  box-shadow: 0 0 0 1px rgba(99,102,241,0.3), 0 0 15px rgba(99,102,241,0.1);
}

/* Design 3: Holographic */
.wn-option--design-3 {
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(168,85,247,0.1), rgba(236,72,153,0.1));
}

/* Design 4: Embossed */
.wn-option--design-4 {
  box-shadow: inset 2px 2px 4px rgba(255,255,255,0.8), inset -2px -2px 4px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.1);
}

/* Design 5: Stacked Cards */
.wn-option--design-5 {
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 4px 0 -2px white, 0 4px 3px -2px rgba(0,0,0,0.1);
}

/* Design 6: Pill Shape */
.wn-option--design-6 {
  border-radius: 100px;
  padding-left: 32px;
}

/* Design 7: Left Accent Border */
.wn-option--design-7 {
  border-left: 4px solid var(--wn-primary);
  border-radius: 0 16px 16px 0;
}

/* Design 8: Dotted Outline */
.wn-option--design-8 {
  border: 2px dotted var(--wn-primary);
  background: transparent;
}

/* Design 9: Glass Card */
.wn-option--design-9 {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.3);
}

/* Design 10: Gold Game Card */
.wn-option--design-10 {
  background: linear-gradient(white, white) padding-box,
              linear-gradient(45deg, #ffd700, #ffb347, #ffd700) border-box;
  border: 3px solid transparent;
  box-shadow: 0 4px 15px rgba(255,215,0,0.3);
}

/* ============================================
   LOCKED STYLE - PREVIOUSLY ANSWERED QUESTIONS
   ============================================ */

.wn-option--locked {
  background: var(--wn-bg-secondary);
  border: 1px solid var(--wn-border);
  opacity: 0.85;
  cursor: default;
}

.wn-option--locked:hover {
  transform: none;
  box-shadow: var(--wn-shadow-sm);
}

.wn-option--locked .wn-option__text {
  color: var(--wn-text-muted);
}

/* ============================================
   SOLUTION CARD - REVEAL ANIMATION
   ============================================ */

.wn-solution-card {
  background: linear-gradient(135deg,
    rgba(99, 102, 241, 0.08) 0%,
    rgba(139, 92, 246, 0.05) 100%
  );
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--wn-radius-lg);
  padding: var(--wn-space-5);
  margin-top: var(--wn-space-4);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.wn-solution-card.visible,
.wn-solution-card:not(.wn-hidden) {
  max-height: none;
  opacity: 1;
  animation: solutionReveal 0.5s ease-out;
  margin-bottom: var(--wn-space-6);
}

@keyframes solutionReveal {
  0% {
    transform: translateY(20px);
    opacity: 0;
    clip-path: inset(0 0 100% 0);
  }
  100% {
    transform: translateY(0);
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

.wn-solution-header {
  display: flex;
  align-items: center;
  gap: var(--wn-space-2);
  font-weight: 600;
  color: var(--wn-primary);
  margin-bottom: var(--wn-space-3);
  font-size: var(--wn-text-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wn-solution-icon {
  font-size: 1.2rem;
}

.wn-solution-text {
  font-size: var(--wn-text-sm);
  line-height: 1.7;
  color: var(--wn-text);
}

/* ============================================
   LOCKED BADGE
   ============================================ */

.wn-locked-badge {
  position: absolute;
  top: var(--wn-space-3);
  right: var(--wn-space-3);
  display: flex;
  align-items: center;
  gap: var(--wn-space-2);
  padding: var(--wn-space-2) var(--wn-space-3);
  background: rgba(100, 116, 139, 0.1);
  border-radius: var(--wn-radius-full);
  font-size: var(--wn-text-xs);
  font-weight: 600;
  color: var(--wn-text-muted);
}

/* ============================================
   NAVIGATION FOOTER
   ============================================ */

.wn-quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 560px;
  padding: var(--wn-space-4) 0;
  gap: var(--wn-space-4);
}

.wn-nav-btn {
  display: flex;
  align-items: center;
  gap: var(--wn-space-2);
  padding: var(--wn-space-3) var(--wn-space-5);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  border-radius: var(--wn-radius-md);
  font-weight: 600;
  font-size: var(--wn-text-sm);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.wn-nav-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.wn-nav-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.wn-nav-btn:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
}

.wn-nav-btn--prev {
  background: var(--wn-surface);
  color: var(--wn-text);
  border: 1px solid var(--wn-border);
  box-shadow: var(--wn-shadow-sm);
}

.wn-nav-btn--prev:hover:not(:disabled) {
  background: var(--wn-surface-hover);
  border-color: var(--wn-primary);
  box-shadow: var(--wn-shadow-md);
}

.wn-nav-counter {
  display: flex;
  align-items: center;
  gap: var(--wn-space-1);
  font-size: var(--wn-text-sm);
  font-weight: 600;
  color: var(--wn-text-muted);
  background: rgba(99, 102, 241, 0.1);
  padding: var(--wn-space-2) var(--wn-space-4);
  border-radius: var(--wn-radius-full);
}

/* ============================================
   CELEBRATION SCREEN - FIREWORKS FINALE
   ============================================ */

.wn-celebration {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,
    rgba(248, 250, 252, 0.98) 0%,
    rgba(241, 245, 249, 0.98) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 200;
  animation: celebrationFadeIn 0.6s ease-out;
  overflow-y: auto;
  padding: var(--wn-space-6);
}

@keyframes celebrationFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.wn-celebration__content {
  text-align: center;
  max-width: 420px;
  width: 100%;
  animation: celebrationBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes celebrationBounce {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.wn-celebration__icon {
  font-size: 80px;
  line-height: 1;
  animation: trophyBounce 1s infinite;
}

@keyframes trophyBounce {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-15px) rotate(5deg); }
}

.wn-celebration__title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: var(--wn-space-5) 0;
  animation: titleGlow 2s infinite alternate;
}

@keyframes titleGlow {
  0% { filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5)); }
  100% { filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.5)); }
}

.wn-celebration__subtitle {
  font-size: var(--wn-text-lg);
  color: var(--wn-text-secondary);
  margin-bottom: var(--wn-space-6);
}

.wn-celebration__subtitle strong {
  color: var(--wn-primary);
}

/* Final Ring */
.wn-final-ring {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto var(--wn-space-6);
}

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

.wn-final-ring__bg {
  fill: none;
  stroke: rgba(34, 197, 94, 0.1);
  stroke-width: 10;
}

.wn-final-ring__fill {
  fill: none;
  stroke: url(#finalGradient);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 439.82;
  stroke-dashoffset: 439.82;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 10px rgba(34, 197, 94, 0.5));
}

.wn-final-ring__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.wn-final-ring__score {
  font-size: 3rem;
  font-weight: 800;
  color: var(--wn-text);
  line-height: 1;
}

.wn-final-ring__label {
  font-size: var(--wn-text-base);
  color: var(--wn-text-muted);
}

/* Celebration Stats */
.wn-celebration__stats {
  display: flex;
  justify-content: center;
  gap: var(--wn-space-10);
  margin-bottom: var(--wn-space-8);
}

.wn-celebration__stat {
  text-align: center;
}

.wn-celebration__stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--wn-text);
}

.wn-celebration__stat-value--correct {
  color: var(--wn-green);
}

.wn-celebration__stat-value--wrong {
  color: var(--wn-red);
}

.wn-celebration__stat-label {
  font-size: var(--wn-text-sm);
  color: var(--wn-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Celebration Actions */
.wn-celebration__actions {
  display: flex;
  flex-direction: column;
  gap: var(--wn-space-3);
  max-width: 300px;
  margin: 0 auto;
}

/* ============================================
   BUTTONS
   ============================================ */

.wn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--wn-space-2);
  padding: var(--wn-space-3) var(--wn-space-5);
  border: none;
  border-radius: var(--wn-radius-md);
  font-size: var(--wn-text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.wn-btn--primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.wn-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.wn-btn--secondary {
  background: var(--wn-surface);
  color: var(--wn-text);
  border: 1px solid var(--wn-border);
}

.wn-btn--secondary:hover {
  background: var(--wn-surface-hover);
  border-color: var(--wn-primary);
}

.wn-btn--ghost {
  background: transparent;
  color: var(--wn-text-muted);
}

.wn-btn--ghost:hover {
  background: var(--wn-surface-hover);
  color: var(--wn-text);
}

.wn-btn--danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.wn-btn--danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.wn-btn--lg {
  padding: var(--wn-space-4) var(--wn-space-6);
  font-size: var(--wn-text-base);
}

/* ============================================
   EXIT DIALOG (Clean Implementation)
   ============================================ */

.wn-exit-dialog {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.6);
  animation: exitDialogFadeIn 0.2s ease-out;
}

.wn-exit-dialog.wn-hidden {
  display: none;
}

@keyframes exitDialogFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.wn-exit-dialog__card {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px;
  width: calc(100% - 32px);
  max-width: 360px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: exitDialogSlideUp 0.25s ease-out;
}

@keyframes exitDialogSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.wn-exit-dialog__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fef2f2;
  border-radius: 50%;
  color: #dc2626;
}

.wn-exit-dialog__title {
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 8px;
}

.wn-exit-dialog__text {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 24px;
  line-height: 1.5;
}

.wn-exit-dialog__actions {
  display: flex;
  gap: 12px;
}

.wn-exit-dialog__btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.wn-exit-dialog__btn--cancel {
  background: #f1f5f9;
  color: #475569;
}

.wn-exit-dialog__btn--cancel:hover {
  background: #e2e8f0;
}

.wn-exit-dialog__btn--confirm {
  background: #dc2626;
  color: #ffffff;
}

.wn-exit-dialog__btn--confirm:hover {
  background: #b91c1c;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.wn-toast-container {
  position: fixed;
  bottom: var(--wn-space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: var(--wn-space-2);
}

.wn-toast {
  padding: var(--wn-space-3) var(--wn-space-5);
  border-radius: var(--wn-radius-lg);
  background: var(--wn-surface);
  color: var(--wn-text);
  font-size: var(--wn-text-sm);
  font-weight: 500;
  box-shadow: var(--wn-shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.wn-toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.wn-toast--info {
  border-left: 3px solid var(--wn-primary);
}

.wn-toast--success {
  border-left: 3px solid var(--wn-green);
  background: var(--wn-green-light);
}

.wn-toast--error {
  border-left: 3px solid var(--wn-red);
  background: var(--wn-red-light);
}

.wn-toast--warning {
  border-left: 3px solid var(--wn-amber);
  background: var(--wn-amber-light);
}

/* ============================================
   LOADING OVERLAY
   ============================================ */

.wn-loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
  z-index: 500;
}

.wn-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--wn-space-4);
}

.wn-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--wn-border);
  border-top-color: var(--wn-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.wn-spinner--lg {
  width: 48px;
  height: 48px;
  border-width: 3px;
}

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

.wn-loading-text {
  color: var(--wn-text-muted);
  font-size: var(--wn-text-sm);
}

/* ============================================
   CONFETTI & EMOJI RAIN
   ============================================ */

.wn-confetti-canvas,
.wn-fireworks-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 299;
}

.wn-emoji-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 299;
  overflow: hidden;
}

.wn-emoji-drop {
  position: absolute;
  top: -50px;
  font-size: 2rem;
  animation: emojiDrop 2s ease-in forwards;
  opacity: 0.8;
}

@keyframes emojiDrop {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.8;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* ============================================
   DESKTOP LAYOUT (min-width: 1024px)
   ============================================ */

@media (min-width: 1024px) {
  .wn-quiz-sidebar {
    display: flex;
  }

  .wn-mobile-progress {
    display: none;
  }

  .wn-quiz-main {
    padding: var(--wn-space-2) var(--wn-space-6);
    padding-bottom: 64px;
    justify-content: flex-start;
    align-items: center;
    height: calc(100vh - var(--wn-header-height));
    overflow: hidden;
  }

  .wn-question-container {
    max-width: 540px;
    margin: 0 auto;
    padding-bottom: 0;
    margin-bottom: 0;
    max-height: calc(100vh - var(--wn-header-height) - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--wn-border) transparent;
  }

  .wn-question-container::-webkit-scrollbar {
    width: 5px;
  }

  .wn-question-container::-webkit-scrollbar-track {
    background: transparent;
  }

  .wn-question-container::-webkit-scrollbar-thumb {
    background: var(--wn-border);
    border-radius: 3px;
  }

  .wn-question-card {
    padding: var(--wn-space-4);
  }

  .wn-type-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    margin-bottom: var(--wn-space-2);
  }

  .wn-question-body {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: var(--wn-space-3);
  }

  .wn-answer-options {
    max-height: none;
    overflow: visible;
    gap: 6px;
  }

  .wn-option {
    padding: 10px 14px;
    font-size: 0.875rem;
  }

  .wn-option__text {
    font-size: 0.875rem;
  }

  .wn-quiz-nav {
    position: fixed;
    bottom: 0;
    left: var(--wn-sidebar-width);
    right: 0;
    max-width: none;
    transform: none;
    margin-top: auto;
    padding: 10px var(--wn-space-6);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 0;
    border-top: 1px solid var(--wn-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    justify-content: center;
    gap: var(--wn-space-4);
  }

  .wn-nav-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .wn-nav-counter {
    font-size: 0.85rem;
  }

  .wn-xp-hub {
    position: relative;
    top: auto;
    margin-bottom: var(--wn-space-1);
    padding: 6px 12px;
    font-size: 0.8rem;
    gap: var(--wn-space-2);
  }

  .wn-xp-hub__value {
    font-size: 0.9rem;
  }

  .wn-xp-hub__divider {
    height: 14px;
  }

  .wn-nav-link--mobile {
    display: none;
  }
}

/* ============================================
   TABLET LAYOUT (768px - 1023px)
   ============================================ */

@media (min-width: 768px) and (max-width: 1023px) {
  .wn-quiz-main {
    padding: var(--wn-space-6);
  }

  .wn-question-container {
    max-width: 600px;
  }

  .wn-question-card {
    padding: var(--wn-space-6);
  }
}

/* ============================================
   MOBILE LAYOUT (max-width: 767px)
   ============================================ */

@media (max-width: 767px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }

  .wn-quiz-app {
    overflow: visible;
    height: auto;
    min-height: 100vh;
  }

  .wn-quiz-layout {
    overflow: visible;
    height: auto;
  }

  .wn-quiz-main {
    overflow: visible;
    min-height: auto;
  }

  .wn-question-container {
    overflow: visible;
    max-height: none;
    /* Extra bottom padding for fixed nav clearance */
    padding-bottom: var(--wn-space-10);
    margin-bottom: var(--wn-space-8);
  }

  .wn-xp-hub {
    position: relative;
    top: auto;
    margin-bottom: var(--wn-space-4);
  }

  .wn-fixed-header {
    padding: 0 var(--wn-space-3);
  }

  .wn-brand-text {
    font-size: var(--wn-text-lg);
  }

  .wn-nav-link--mobile {
    display: flex;
  }

  .wn-quiz-layout {
    flex-direction: column;
  }

  .wn-quiz-main {
    padding: var(--wn-space-4);
    padding-top: var(--wn-space-6);
    /* Extra padding at bottom for fixed nav + scroll clearance */
    padding-bottom: calc(var(--wn-nav-height) + var(--wn-space-10) + 40px);
  }

  .wn-question-card {
    padding: var(--wn-space-5);
    border-radius: var(--wn-radius-lg);
  }

  .wn-type-badge {
    font-size: 0.65rem;
    padding: var(--wn-space-1) var(--wn-space-3);
  }

  .wn-question-body {
    font-size: var(--wn-text-base);
    margin-bottom: var(--wn-space-5);
  }

  .wn-option {
    padding: var(--wn-space-3) var(--wn-space-4);
    gap: var(--wn-space-3);
  }

  .wn-option__key {
    width: 36px;
    height: 36px;
    font-size: var(--wn-text-base);
  }

  .wn-option__text {
    font-size: var(--wn-text-sm);
  }

  .wn-quiz-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--wn-space-3) var(--wn-space-4);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--wn-border);
    max-width: none;
    border-radius: 0;
  }

  .wn-nav-btn {
    padding: var(--wn-space-2) var(--wn-space-4);
    font-size: var(--wn-text-xs);
  }

  .wn-nav-btn span {
    display: none;
  }

  .wn-celebration__title {
    font-size: 2rem;
  }

  .wn-celebration__stats {
    gap: var(--wn-space-6);
  }

  .wn-celebration__stat-value {
    font-size: 1.5rem;
  }

  .wn-final-ring {
    width: 120px;
    height: 120px;
  }

  .wn-final-ring__score {
    font-size: 2rem;
  }
}

/* ============================================
   LANDSCAPE MOBILE
   ============================================ */

@media (orientation: landscape) and (max-height: 500px) {
  .wn-quiz-main {
    padding-top: var(--wn-space-4);
    justify-content: flex-start;
  }

  .wn-mobile-progress {
    position: static;
    transform: none;
    margin-bottom: var(--wn-space-2);
  }

  .wn-question-card {
    padding: var(--wn-space-4);
  }

  .wn-question-body {
    font-size: var(--wn-text-sm);
    margin-bottom: var(--wn-space-3);
  }

  .wn-answer-options {
    gap: var(--wn-space-2);
  }

  .wn-option {
    padding: var(--wn-space-2) var(--wn-space-3);
  }

  .wn-celebration {
    padding: var(--wn-space-4);
  }

  .wn-celebration__icon {
    font-size: 50px;
    margin-bottom: var(--wn-space-2);
  }

  .wn-celebration__title {
    font-size: 1.75rem;
    margin: var(--wn-space-2) 0;
  }
}

/* ============================================
   iOS SAFE AREAS
   ============================================ */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .wn-quiz-main {
    padding-bottom: calc(var(--wn-nav-height) + env(safe-area-inset-bottom) + var(--wn-space-10) + 40px);
  }

  .wn-quiz-nav {
    padding-bottom: calc(var(--wn-space-3) + env(safe-area-inset-bottom));
  }

  .wn-toast-container {
    bottom: calc(var(--wn-space-6) + env(safe-area-inset-bottom));
  }

  .wn-celebration {
    padding-bottom: calc(var(--wn-space-6) + env(safe-area-inset-bottom));
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .wn-question-card::before {
    animation: none;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  body {
    background: white;
  }

  .wn-fixed-header,
  .wn-quiz-sidebar,
  .wn-quiz-nav,
  .wn-mobile-progress,
  .wn-loading-overlay,
  .wn-confetti-canvas,
  .wn-fireworks-canvas {
    display: none !important;
  }

  .wn-quiz-layout {
    padding-top: 0;
  }

  .wn-question-card {
    box-shadow: none;
    border: 1px solid #e2e8f0;
  }
}
