/* ── QUIZ STYLES ── */
    .quiz-hero {
      background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #0284c7 100%);
      border-radius: 16px;
      padding: 28px 28px 24px;
      margin-bottom: 22px;
      color: #fff;
      position: relative;
      overflow: hidden;
    }
    .quiz-hero::before {
      content: '';
      position: absolute;
      top: -40px; right: -40px;
      width: 180px; height: 180px;
      background: rgba(255,255,255,0.07);
      border-radius: 50%;
    }
    .quiz-hero::after {
      content: '';
      position: absolute;
      bottom: -50px; left: -20px;
      width: 140px; height: 140px;
      background: rgba(255,255,255,0.05);
      border-radius: 50%;
    }
    .quiz-hero-title { font-size: 24px; font-weight: 800; margin-bottom: 4px; position: relative; z-index: 1; }
    .quiz-hero-sub { font-size: 13px; opacity: 0.85; position: relative; z-index: 1; }

    .quiz-meta-bar {
      background: #fff;
      border-radius: 12px;
      padding: 14px 18px;
      margin-bottom: 18px;
      box-shadow: 0 1px 4px rgba(0,0,0,0.06);
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 12px;
    }
    .quiz-meta-item {
      display: flex;
      align-items: center;
      gap: 7px;
      font-size: 13px;
      color: #374151;
    }
    .quiz-meta-label {
      font-size: 11px;
      font-weight: 600;
      color: #9ca3af;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .quiz-meta-value {
      font-size: 13px;
      font-weight: 700;
      color: #1f2937;
    }
    .quiz-meta-sep {
      width: 1px;
      height: 28px;
      background: #e4e6ea;
      flex-shrink: 0;
    }
    .difficulty-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 4px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 700;
    }
    .difficulty-easy   { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
    .difficulty-medium { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
    .difficulty-hard   { background: #fff1f2; color: #e11d48; border: 1px solid #fecdd3; }

    .progress-bar-wrap {
      background: #f0f2f5;
      border-radius: 20px;
      height: 8px;
      flex: 1;
      min-width: 80px;
      overflow: hidden;
    }
    .progress-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, #4f46e5, #7c3aed);
      border-radius: 20px;
      transition: width 0.4s ease;
    }

    /* Question card */
    .quiz-card {
      background: #fff;
      border-radius: 14px;
      box-shadow: 0 1px 4px rgba(0,0,0,0.07);
      overflow: hidden;
      margin-bottom: 18px;
    }
    .quiz-card-header {
      background: linear-gradient(135deg, #f8f9ff 0%, #f0f9ff 100%);
      border-bottom: 1px solid #e8edf8;
      padding: 18px 22px;
      display: flex;
      align-items: flex-start;
      gap: 14px;
    }
    .quiz-q-number {
      width: 36px; height: 36px;
      border-radius: 50%;
      background: #4f46e5;
      color: #fff;
      font-size: 14px;
      font-weight: 800;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      margin-top: 2px;
    }
    .quiz-question-text {
      font-size: 17px;
      font-weight: 700;
      color: #1f2937;
      line-height: 1.5;
      flex: 1;
    }
    .quiz-options {
      padding: 20px 22px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .quiz-option-btn {
      display: flex;
      align-items: center;
      gap: 12px;
      width: 100%;
      padding: 14px 18px;
      background: #f9fafb;
      border: 2px solid #e4e6ea;
      border-radius: 10px;
      font-size: 14px;
      font-weight: 500;
      color: #374151;
      cursor: pointer;
      text-align: left;
      font-family: inherit;
      transition: border-color 0.15s, background 0.15s, transform 0.1s;
    }
    .quiz-option-btn:hover:not(:disabled) {
      border-color: #a5b4fc;
      background: #eef2ff;
      color: #4f46e5;
      transform: translateX(3px);
    }
    .quiz-option-btn:disabled { cursor: not-allowed; }
    .quiz-option-btn.correct {
      border-color: #059669;
      background: #ecfdf5;
      color: #065f46;
    }
    .quiz-option-btn.incorrect {
      border-color: #e11d48;
      background: #fff1f2;
      color: #9f1239;
    }
    .quiz-option-letter {
      width: 28px; height: 28px;
      border-radius: 50%;
      background: #e4e6ea;
      color: #6b7280;
      font-size: 12px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      transition: background 0.15s, color 0.15s;
    }
    .quiz-option-btn.correct .quiz-option-letter {
      background: #059669;
      color: #fff;
    }
    .quiz-option-btn.incorrect .quiz-option-letter {
      background: #e11d48;
      color: #fff;
    }
    .quiz-option-btn:hover:not(:disabled) .quiz-option-letter {
      background: #4f46e5;
      color: #fff;
    }
    .quiz-option-icon {
      margin-left: auto;
      font-size: 18px;
      flex-shrink: 0;
    }

    .quiz-card-footer {
      padding: 14px 22px 18px;
      border-top: 1px solid #f3f4f6;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .quiz-feedback {
      font-size: 13px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .quiz-feedback.correct { color: #059669; }
    .quiz-feedback.incorrect { color: #e11d48; }
    .quiz-feedback.hidden { visibility: hidden; }
    .btn-next {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 10px 22px;
      background: #4f46e5;
      color: #fff;
      border: none;
      border-radius: 9px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      transition: background 0.15s, transform 0.1s, opacity 0.2s;
      opacity: 0;
      pointer-events: none;
    }
    .btn-next.visible {
      opacity: 1;
      pointer-events: auto;
    }
    .btn-next:hover { background: #4338ca; transform: translateX(2px); }

    /* Summary card */
    .quiz-summary-card {
      background: #fff;
      border-radius: 16px;
      box-shadow: 0 2px 12px rgba(0,0,0,0.08);
      overflow: hidden;
      margin-bottom: 18px;
      display: none;
    }
    .quiz-summary-card.visible { display: block; }
    .quiz-summary-header {
      background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #0284c7 100%);
      padding: 32px 28px;
      text-align: center;
      color: #fff;
      position: relative;
      overflow: hidden;
    }
    .quiz-summary-header::before {
      content: '';
      position: absolute;
      top: -30px; right: -30px;
      width: 120px; height: 120px;
      background: rgba(255,255,255,0.08);
      border-radius: 50%;
    }
    .quiz-summary-emoji { font-size: 52px; margin-bottom: 10px; position: relative; z-index: 1; }
    .quiz-summary-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; position: relative; z-index: 1; }
    .quiz-summary-subtitle { font-size: 14px; opacity: 0.85; position: relative; z-index: 1; }
    .quiz-summary-stats {
      display: flex;
      justify-content: center;
      gap: 0;
      border-bottom: 1px solid #f3f4f6;
    }
    .quiz-summary-stat {
      flex: 1;
      text-align: center;
      padding: 22px 16px;
      border-right: 1px solid #f3f4f6;
    }
    .quiz-summary-stat:last-child { border-right: none; }
    .quiz-summary-stat-val {
      font-size: 28px;
      font-weight: 800;
      color: #1f2937;
      margin-bottom: 4px;
    }
    .quiz-summary-stat-val.green { color: #059669; }
    .quiz-summary-stat-val.indigo { color: #4f46e5; }
    .quiz-summary-stat-label {
      font-size: 11px;
      font-weight: 600;
      color: #9ca3af;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .quiz-summary-body {
      padding: 22px 24px;
    }
    .quiz-accuracy-bar-wrap {
      background: #f0f2f5;
      border-radius: 20px;
      height: 12px;
      overflow: hidden;
      margin-bottom: 6px;
    }
    .quiz-accuracy-bar-fill {
      height: 100%;
      border-radius: 20px;
      transition: width 0.8s ease;
    }
    .quiz-accuracy-label {
      display: flex;
      justify-content: space-between;
      font-size: 12px;
      color: #6b7280;
      margin-bottom: 20px;
    }
    .quiz-summary-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }
    .btn-restart {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 11px 24px;
      background: #4f46e5;
      color: #fff;
      border: none;
      border-radius: 9px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      transition: background 0.15s, box-shadow 0.15s;
    }
    .btn-restart:hover { background: #4338ca; box-shadow: 0 4px 12px rgba(79,70,229,0.3); }
    .btn-home {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 11px 24px;
      background: #f0f2f5;
      color: #374151;
      border: 1px solid #e4e6ea;
      border-radius: 9px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      text-decoration: none;
      transition: background 0.15s;
    }
    .btn-home:hover { background: #e4e6ea; }

    @media (max-width: 600px) {
      .quiz-meta-bar { flex-direction: column; align-items: flex-start; }
      .quiz-meta-sep { display: none; }
      .quiz-summary-stats { flex-direction: column; }
      .quiz-summary-stat { border-right: none; border-bottom: 1px solid #f3f4f6; }
      .quiz-summary-stat:last-child { border-bottom: none; }
      .quiz-card-footer { flex-direction: column; align-items: flex-start; }
    }

    /* ── QUIZ FLOW CONTROLS ── */
    .quiz-flow-bar {
      background: #fff;
      border-radius: 12px;
      padding: 14px 18px;
      margin-bottom: 18px;
      box-shadow: 0 1px 4px rgba(0,0,0,0.06);
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }
    .quiz-flow-label {
      font-size: 12px;
      font-weight: 600;
      color: #9ca3af;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      flex-shrink: 0;
    }
    .btn-flow {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 9px 20px;
      border: none;
      border-radius: 9px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    }
    .btn-flow:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
    .btn-flow:active { transform: translateY(0); }
    .btn-start  { background: #059669; color: #fff; }
    .btn-start:hover  { background: #047857; }
    .btn-pause  { background: #d97706; color: #fff; }
    .btn-pause:hover  { background: #b45309; }
    .btn-resume { background: #4f46e5; color: #fff; }
    .btn-resume:hover { background: #4338ca; }
    .btn-restart-sm {
      background: #f0f2f5;
      color: #374151;
      border: 1px solid #e4e6ea;
    }
    .btn-restart-sm:hover { background: #e4e6ea; }
    .quiz-status-pill {
      margin-left: auto;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 14px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 700;
    }
    .status-idle    { background: #f0f2f5; color: #6b7280; }
    .status-running { background: #ecfdf5; color: #059669; }
    .status-paused  { background: #fffbeb; color: #d97706; }
    .status-done    { background: #eef2ff; color: #4f46e5; }

    /* ── COUNTDOWN TIMER ── */
    .quiz-timer-wrap {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 22px 0;
    }
    .quiz-timer-label {
      font-size: 11px;
      font-weight: 600;
      color: #9ca3af;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      flex-shrink: 0;
    }
    .quiz-timer-bar-wrap {
      flex: 1;
      background: #f0f2f5;
      border-radius: 20px;
      height: 8px;
      overflow: hidden;
    }
    .quiz-timer-bar-fill {
      height: 100%;
      border-radius: 20px;
      background: linear-gradient(90deg, #059669, #10b981);
      transition: width 0.9s linear, background 0.3s;
    }
    .quiz-timer-bar-fill.warning { background: linear-gradient(90deg, #d97706, #f59e0b); }
    .quiz-timer-bar-fill.danger  { background: linear-gradient(90deg, #e11d48, #f43f5e); }
    .quiz-timer-count {
      font-size: 18px;
      font-weight: 800;
      color: #059669;
      min-width: 28px;
      text-align: center;
      transition: color 0.3s;
      flex-shrink: 0;
    }
    .quiz-timer-count.warning { color: #d97706; }
    .quiz-timer-count.danger  { color: #e11d48; }

    /* Paused overlay on options */
    .quiz-options.paused {
      position: relative;
    }
    .quiz-options.paused::after {
      content: '⏸ Quiz Paused — Resume to continue';
      position: absolute;
      inset: 0;
      background: rgba(255,255,255,0.92);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      font-weight: 700;
      color: #d97706;
      border-radius: 10px;
      backdrop-filter: blur(2px);
    }

    /* ── GAMIFICATION PANEL ── */
    .gamification-panel {
      background: #fff;
      border-radius: 14px;
      box-shadow: 0 1px 4px rgba(0,0,0,0.07);
      overflow: hidden;
      margin-bottom: 18px;
    }
    .gamification-header {
      background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
      padding: 16px 20px;
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .gamification-header-icon {
      width: 40px; height: 40px;
      border-radius: 50%;
      background: rgba(255,255,255,0.12);
      display: flex; align-items: center; justify-content: center;
      font-size: 20px;
      flex-shrink: 0;
    }
    .gamification-header-info { flex: 1; min-width: 0; }
    .gamification-header-name {
      font-size: 14px;
      font-weight: 700;
      color: #fff;
      margin-bottom: 2px;
    }
    .gamification-header-sub {
      font-size: 11px;
      color: rgba(255,255,255,0.6);
    }
    .gamification-total-pts {
      text-align: right;
      flex-shrink: 0;
    }
    .gamification-total-pts-val {
      font-size: 22px;
      font-weight: 800;
      color: #fbbf24;
      line-height: 1;
    }
    .gamification-total-pts-label {
      font-size: 10px;
      font-weight: 600;
      color: rgba(255,255,255,0.55);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .gamification-body {
      padding: 16px 20px;
    }
    .reward-tracker-title {
      font-size: 11px;
      font-weight: 600;
      color: #9ca3af;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-bottom: 12px;
    }
    .reward-tracker-card {
      background: linear-gradient(135deg, #fef9c3 0%, #fef3c7 100%);
      border: 1px solid #fde68a;
      border-radius: 10px;
      padding: 14px 16px;
    }
    .reward-tracker-top {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 12px;
    }
    .reward-icon {
      font-size: 28px;
      flex-shrink: 0;
    }
    .reward-info { flex: 1; min-width: 0; }
    .reward-name {
      font-size: 14px;
      font-weight: 700;
      color: #92400e;
      margin-bottom: 2px;
    }
    .reward-pts-needed {
      font-size: 12px;
      color: #b45309;
    }
    .reward-pts-needed strong { color: #92400e; }
    .reward-progress-wrap {
      background: rgba(0,0,0,0.08);
      border-radius: 20px;
      height: 10px;
      overflow: hidden;
      margin-bottom: 8px;
    }
    .reward-progress-fill {
      height: 100%;
      border-radius: 20px;
      background: linear-gradient(90deg, #d97706, #f59e0b);
      transition: width 0.6s ease;
      position: relative;
    }
    .reward-progress-fill::after {
      content: '';
      position: absolute;
      right: 0; top: 0; bottom: 0;
      width: 6px;
      background: rgba(255,255,255,0.5);
      border-radius: 0 20px 20px 0;
    }
    .reward-progress-labels {
      display: flex;
      justify-content: space-between;
      font-size: 11px;
      color: #92400e;
      font-weight: 600;
    }
    .reward-remaining-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: #fff;
      border: 1px solid #fde68a;
      border-radius: 20px;
      padding: 4px 12px;
      font-size: 12px;
      font-weight: 700;
      color: #d97706;
      margin-top: 10px;
    }