/* --- 1. THEME & VARIABLES (SCOPED) --- */
.equiz-wrapper {
  --eq-bg-dark: #0f172a;
  --eq-text: #f8fafc;
  --eq-text-muted: #94a3b8;

  /* Dynamic Theme Color (Default) */
  --eq-theme: #6366f1;
  --eq-theme-glow: rgba(99, 102, 241, 0.4);

  --eq-glass-bg: rgba(30, 41, 59, 0.7);
  --eq-glass-border: 1px solid rgba(255, 255, 255, 0.08);
  --eq-surface: #1e293b;

  --eq-correct: #10b981;
  --eq-wrong: #ef4444;
  --eq-gold: #fbbf24;

  --eq-font: 'Outfit', sans-serif;

  /* Reset for wrapper only */
  font-family: var(--eq-font);
  background: var(--eq-bg-dark);
  color: var(--eq-text);
  position: relative;
  width: 100%;
  height: 600px;
  /* Default fixed height */
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  margin: 20px 0;
  box-sizing: border-box;
}

/* Fullscreen Overrides */
.equiz-wrapper:fullscreen,
.equiz-wrapper:-webkit-full-screen,
.equiz-wrapper:-moz-full-screen {
  width: 100vw;
  height: 100vh;
  margin: 0;
  border-radius: 0;
  background: var(--eq-bg-dark);
}

.equiz-wrapper * {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Animated Background */
.equiz-bg-grad {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: radial-gradient(circle at 10% 20%, rgba(30, 50, 100, 0.4) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(80, 20, 60, 0.2) 0%, transparent 40%);
  pointer-events: none;
}

/* --- 2. COMMON UI --- */
.equiz-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 2;
  transition: opacity 0.3s ease, transform 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.equiz-screen.hidden {
  display: none !important;
}

.equiz-screen.fade-out {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.equiz-screen.fade-in {
  animation: equizEnter 0.4s forwards;
}

@keyframes equizEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.equiz-btn-push {
  cursor: pointer;
  transition: transform 0.1s;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.equiz-btn-push:active {
  transform: scale(0.96);
}

/* Header */
.equiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.equiz-logo {
  font-weight: 900;
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.equiz-logo i {
  color: var(--eq-theme);
}

.equiz-stats {
  display: flex;
  gap: 10px;
  align-items: center;
}

.equiz-chip {
  background: rgba(255, 255, 255, 0.05);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  border: var(--eq-glass-border);
}

/* --- 3. DASHBOARD --- */
.equiz-welcome {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 5px;
  line-height: 1.2;
}

.equiz-sub {
  opacity: 0.6;
  font-size: 14px;
  margin-bottom: 25px;
}

.equiz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  padding-bottom: 50px;
}

@media(max-width: 480px) {
  .equiz-grid {
    grid-template-columns: 1fr;
  }
}

.equiz-card {
  background: var(--eq-surface);
  border: var(--eq-glass-border);
  border-radius: 20px;
  padding: 20px 15px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: 0.2s;
  cursor: pointer;
}

.equiz-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

.equiz-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--card-color, #fff);
  border-radius: 20px 20px 0 0;
}

.equiz-exam-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--card-color);
}

.equiz-exam-title {
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 4px;
}

.equiz-exam-meta {
  font-size: 11px;
  opacity: 0.5;
}

/* --- 4. LEVEL LIST --- */
.equiz-section-header {
  background: linear-gradient(90deg, var(--eq-surface), transparent);
  padding: 15px;
  border-radius: 15px;
  margin-bottom: 20px;
  display: flex;
  gap: 15px;
  align-items: center;
  border-left: 4px solid var(--eq-theme);
}

.equiz-lvl-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 80px;
}

.equiz-lvl-item {
  background: var(--eq-glass-bg);
  padding: 16px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 15px;
  border: var(--eq-glass-border);
  cursor: pointer;
}

.equiz-lvl-num {
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--eq-theme);
}

.locked .equiz-lvl-num {
  color: #555;
}

.locked {
  opacity: 0.7;
  filter: grayscale(1);
}

/* --- 5. GAME PLAY --- */
.equiz-game-hud {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  align-items: center;
}

.equiz-timer-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  margin-bottom: 30px;
  overflow: hidden;
}

.equiz-timer-fill {
  height: 100%;
  width: 100%;
  background: var(--eq-correct);
  transition: width 1s linear;
}

.equiz-q-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 24px;
  padding: 25px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  border: var(--eq-glass-border);
}

.equiz-q-badge {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--eq-theme);
  letter-spacing: 1px;
}

.equiz-q-text {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.5;
}

.equiz-opt-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.equiz-opt-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.2s;
}

.equiz-opt-card:hover {
  background: rgba(255, 255, 255, 0.1);
}

.equiz-opt-card.correct {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--eq-correct);
}

.equiz-opt-card.wrong {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--eq-wrong);
}

/* --- 6. REVIEW MODE (NEW) --- */
.equiz-review-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.equiz-review-status {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  align-self: flex-start;
}

.equiz-review-status.correct {
  background: rgba(16, 185, 129, 0.2);
  color: var(--eq-correct);
}

.equiz-review-status.wrong {
  background: rgba(239, 68, 68, 0.2);
  color: var(--eq-wrong);
}

.equiz-review-status.skipped {
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
}

.equiz-review-q {
  font-weight: 700;
  font-size: 15px;
}

.equiz-review-ans-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px;
  border-radius: 6px;
}

/* --- 7. MODALS & FORMS --- */
.equiz-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.equiz-card-popup {
  background: #1e293b;
  width: 85%;
  max-width: 350px;
  padding: 30px;
  border-radius: 24px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: equizPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes equizPop {
  from {
    transform: scale(0.8);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.equiz-btn-main {
  background: var(--eq-theme);
  color: white;
  border: none;
  width: 100%;
  cursor: pointer;
  padding: 15px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  margin-top: 15px;
  box-shadow: 0 4px 15px var(--eq-theme-glow);
  transition: 0.2s;
}

.equiz-btn-main:hover {
  filter: brightness(1.1);
}

/* Auth Forms */
.equiz-auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  opacity: 0.6;
  transition: 0.3s;
}

.auth-tab.active {
  background: var(--eq-surface);
  opacity: 1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.equiz-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 15px;
  border-radius: 10px;
  color: #fff;
  margin-bottom: 10px;
  font-family: var(--eq-font);
  font-size: 14px;
  outline: none;
  transition: 0.2s;
}

.equiz-input:focus {
  border-color: var(--eq-theme);
  background: rgba(255, 255, 255, 0.1);
}

/* Confetti */
.equiz-confetti {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 100;
  width: 100%;
  height: 100%;
}

/* --- 8. GAMIFICATION (NEW) --- */

/* FAB Button */
.equiz-fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: 12px 20px;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  cursor: pointer;
  z-index: 90;
  transition: transform 0.2s;
  animation: bounceIn 1s;
}

.equiz-fab:hover {
  transform: scale(1.05);
}

.equiz-fab-icon {
  font-size: 20px;
}

@keyframes bounceIn {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

/* Wheel */
.equiz-wheel-container {
  position: relative;
  width: 250px;
  height: 250px;
  margin: 0 auto;
}

.equiz-wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 5px solid #fff;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  background: conic-gradient(#ef4444 0deg 72deg,
      #3b82f6 72deg 144deg,
      #10b981 144deg 216deg,
      #f59e0b 216deg 288deg,
      #8b5cf6 288deg 360deg);
  transition: transform 4s cubic-bezier(0.15, 0.80, 0.10, 1.0);
  /* Smoother Easing */
  position: relative;
  transform: rotate(0deg);
  overflow: hidden;
}

.wheel-text {
  position: absolute;
  width: 50%;
  height: 50%;
  top: 50%;
  left: 50%;
  transform-origin: 0% 0%;
  transform: rotate(calc(72deg * var(--i) + 36deg)) skew(0deg);
  /* Center text in 72deg segment */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.wheel-text span {
  position: absolute;
  left: 45px;
  transform: rotate(0deg);
  /* Adjust text orientation */
  white-space: nowrap;
}

.wheel-text {
  position: absolute;
  width: 50%;
  height: 50%;
  top: 50%;
  left: 50%;
  transform-origin: 0% 0%;
  transform: rotate(calc(72deg * var(--i) + 36deg)) skew(0deg);
  /* Center text in 72deg segment */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.wheel-text span {
  position: absolute;
  left: 45px;
  transform: rotate(0deg);
  /* Adjust text orientation if needed */
  white-space: nowrap;
}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.equiz-wheel-marker {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 20px solid #fff;
  z-index: 5;
}

/* Daily Login */
.daily-day {
  width: 40px;
  height: 50px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  gap: 5px;
}

.daily-day.active {
  background: var(--eq-theme);
  color: #fff;
}

/* Profile Modal */
.equiz-avatar-circle {
  width: 80px;
  height: 80px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.equiz-badge-pill {
  display: inline-block;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.stat-box {
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
  border-radius: 10px;
  text-align: center;
}

.stat-box .val {
  font-size: 18px;
  font-weight: 800;
}

.stat-box .lbl {
  font-size: 11px;
  opacity: 0.6;
}

/* --- 9. SIDEBAR MENU (NEW) --- */
.equiz-sidebar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 190;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s;
}

.equiz-sidebar {
  position: absolute;
  top: 0;
  left: 0;
  width: 75%;
  max-width: 300px;
  height: 100%;
  background: #1e293b;
  z-index: 200;
  transform: translateX(-105%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.equiz-sidebar.open {
  transform: translateX(0);
}

.equiz-sidebar-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-weight: 800;
  font-size: 18px;
  background: rgba(0, 0, 0, 0.2);
}

.equiz-sidebar-menu {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
}

.equiz-sidebar-item {
  padding: 12px 15px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  transition: 0.2s;
}

.equiz-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.equiz-sidebar-item i {
  color: var(--eq-theme);
  opacity: 0.8;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}