    /* QUIZ SYSTEM */
    .quiz {
      max-width: 960px;
      margin: auto;
    }

    .quizbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      margin-bottom: 14px;
      color: var(--muted);
      font-size: 15px;
      font-weight: 800;
    }

    .timer {
      color: var(--ink);
      font-family: 'JetBrains Mono', monospace;
      padding: 8px 18px;
      background: var(--card-bg);
      border: 2px solid var(--card-border);
      border-radius: 999px;
      font-size: 15px;
      font-weight: 800;
      letter-spacing: 1px;
    }

    .timer.warning {
      color: #fb7185;
      background: rgba(244, 63, 94, 0.15);
      border-color: rgba(244, 63, 94, 0.4);
      animation: pulse 1s infinite alternate;
    }

    @keyframes pulse {
      from {
        opacity: 0.85;
      }

      to {
        opacity: 1;
        transform: scale(1.02);
      }
    }

    .progress {
      height: 10px;
      background: var(--card-bg-subtle);
      border-radius: 999px;
      overflow: hidden;
      margin-bottom: 24px;
      border: 2px solid var(--card-border);
    }

    .progress i {
      display: block;
      height: 100%;
      width: 0;
      background: linear-gradient(90deg, #6366f1, #38bdf8, #a855f7);
      border-radius: 999px;
      transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .qtitle {
      font-family: 'Rubik', 'Inter', -apple-system, sans-serif;
      font-size: clamp(24px, 3.8vw, 36px);
      line-height: 1.3;
      font-weight: 800;
      letter-spacing: -0.5px;
      margin: 16px 0 24px;
      color: var(--ink);
    }

    .code {
      margin: 0;
      padding: 24px;
      background: #0b132b;
      color: #f1f5f9;
      border-radius: var(--radius-lg);
      overflow-x: auto;
      font-family: 'JetBrains Mono', Consolas, monospace;
      font-size: 15px;
      line-height: 1.7;
      border: 2px solid #1e293b;
      box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4);
    }

    .ln {
      color: #475569;
      display: inline-block;
      width: 32px;
      user-select: none;
    }

    .options {
      display: grid;
      gap: 16px;
      margin: 28px 0;
    }

    /* EYE-COMFORT EYE-FRIENDLY OPTION CARDS */
    .option {
      width: 100%;
      padding: 20px 24px;
      display: flex;
      align-items: center;
      gap: 18px;
      text-align: left;
      background: var(--card-bg);
      border: 2px solid var(--card-border);
      border-radius: var(--radius-lg);
      color: var(--ink);
      font-size: 16px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
      user-select: none;
      -webkit-user-select: none;
    }

    .option:nth-child(1) .letter {
      background: var(--option-a-bg);
      color: var(--option-a-text);
      border: 1px solid var(--option-a-border);
    }

    .option:nth-child(2) .letter {
      background: var(--option-b-bg);
      color: var(--option-b-text);
      border: 1px solid var(--option-b-border);
    }

    .option:nth-child(3) .letter {
      background: var(--option-c-bg);
      color: var(--option-c-text);
      border: 1px solid var(--option-c-border);
    }

    .option:nth-child(4) .letter {
      background: var(--option-d-bg);
      color: var(--option-d-text);
      border: 1px solid var(--option-d-border);
    }

    .option:hover {
      border-color: var(--brand-indigo);
      background: var(--brand-indigo-light);
      transform: translateY(-2px);
    }

    .option.selected {
      border-color: var(--brand-indigo);
      background: rgba(99, 102, 241, 0.18);
      box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
    }

    .option.correct-answer {
      border-color: var(--green);
      background: var(--green-light);
      color: var(--green-dark);
      box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
    }

    .option.wrong-answer {
      border-color: var(--red);
      background: var(--red-light);
      color: var(--red-dark);
      box-shadow: 0 0 15px rgba(244, 63, 94, 0.25);
    }

    .letter {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 900;
      font-size: 17px;
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 10px;
      flex-shrink: 0;
    }

    .option-text {
      line-height: 1.45;
      font-weight: 700;
      flex-grow: 1;
    }

    .actions {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      align-items: center;
      padding-top: 10px;
    }

    /* RESULT PAGE */
    .result {
      max-width: 920px;
      margin: 20px auto;
      text-align: center;
      background: var(--card-bg);
      border: 2px solid var(--card-border);
      box-shadow: var(--shadow-lg);
    }

    .score {
      font-family: 'Rubik', 'Inter', -apple-system, sans-serif;
      font-size: clamp(64px, 8vw, 100px);
      font-weight: 900;
      letter-spacing: -3px;
      background: linear-gradient(135deg, #818cf8, #38bdf8, #c084fc);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      margin: 10px 0;
      line-height: 1;
    }

    .stats {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
      gap: 16px;
      margin: 28px 0;
    }

    .stat {
      background: var(--card-bg-subtle);
      border: 2px solid var(--card-border);
      border-radius: var(--radius-lg);
      padding: 22px;
      text-align: center;
    }

    .stat b {
      display: block;
      font-size: 32px;
      font-weight: 900;
      margin-bottom: 4px;
      color: var(--ink);
    }

    .topic-results {
      display: grid;
      gap: 12px;
      text-align: left;
      margin: 24px 0;
    }

    .topic-row {
      padding: 16px 20px;
      background: var(--card-bg-subtle);
      border: 2px solid var(--card-border);
      border-radius: var(--radius-md);
    }

    .topic-head {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 10px;
      font-size: 14px;
      font-weight: 800;
      color: var(--ink);
    }

    .topic-bar {
      height: 10px;
      background: var(--card-border);
      border-radius: 999px;
      overflow: hidden;
    }

    .topic-bar i {
      display: block;
      height: 100%;
      background: linear-gradient(90deg, #6366f1, #38bdf8);
    }

    /* 20-QUESTION BREAKDOWN GRID */
    .q-grid-breakdown {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
      gap: 10px;
      margin: 20px 0 28px;
      text-align: center;
    }

    .q-chip {
      padding: 12px 8px;
      border-radius: 12px;
      background: var(--card-bg-subtle);
      border: 2px solid var(--card-border);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      font-size: 12px;
      font-weight: 800;
    }

    .q-chip.correct {
      background: var(--green-light);
      border-color: var(--green);
      color: var(--green-dark);
    }

    .q-chip.wrong {
      background: var(--red-light);
      border-color: var(--red);
      color: var(--red-dark);
    }


    /* STATUS OVERLAY */
    .quiz-overlay {
      position: absolute;
      inset: 0;
      z-index: 50;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background: rgba(15, 23, 42, 0.94);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-radius: var(--radius-xl);
      text-align: center;
      padding: 36px;
      gap: 16px;
      animation: overlayIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes overlayIn {
      from {
        opacity: 0;
        transform: scale(0.96);
      }

      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    .quiz-overlay .overlay-icon {
      font-size: 56px;
      line-height: 1;
      width: 88px;
      height: 88px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--brand-indigo-light);
      border: 2px solid rgba(99, 102, 241, 0.4);
      border-radius: 50%;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }

    .quiz-overlay .overlay-title {
      font-family: 'Rubik', 'Inter', -apple-system, sans-serif;
      font-size: 28px;
      font-weight: 900;
      letter-spacing: -0.5px;
      color: #ffffff;
    }

    .quiz-overlay .overlay-sub {
      font-size: 16px;
      color: #cbd5e1;
      font-weight: 700;
      max-width: 380px;
      line-height: 1.6;
    }

    .quiz-card-wrap {
      position: relative;
    }

    .option:disabled {
      cursor: default;
      transform: none !important;
      opacity: 0.6;
      pointer-events: none;
    }

    .resume-btn {
      color: #ffffff;
      background: linear-gradient(135deg, #059669, #10b981);
      box-shadow: 0 10px 25px -4px rgba(16, 185, 129, 0.4);
    }


    /* =========================================================
       LIVE QUIZ STUDENTS CONTAINER & LEADERBOARD STYLING
    ========================================================= */
    .live-quiz-students-container {
      max-height: 480px;
      overflow-y: auto;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      margin-top: 14px;
      position: relative;
      border: 1px solid var(--card-border, #1e293b);
      border-radius: var(--radius-md, 12px);
      background: var(--card-bg, #111827);
    }

    [data-theme="light"] .live-quiz-students-container {
      background: #ffffff !important;
      border-color: #e2e8f0;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    }

    .live-quiz-students-container thead th {
      position: sticky;
      top: 0;
      background: var(--card-bg, #111827);
      z-index: 4;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    [data-theme="light"] .live-quiz-students-container thead th {
      background: #f8fafc !important;
      border-bottom: 1px solid #e2e8f0;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
      color: #64748b !important;
    }

    [data-theme="light"] .live-quiz-students-container tbody tr td {
      background: #ffffff;
      border-bottom: 1px solid #f1f5f9;
      color: #0f172a;
    }

    [data-theme="light"] .live-quiz-students-container tbody tr:hover td {
      background: rgba(99, 102, 241, 0.04);
    }

    [data-theme="light"] .joincode {
      color: #0284c7 !important;
      text-shadow: none;
    }

    /* EMPTY LEADERBOARD STYLING (Compact Production Design 180-220px) */
    .empty-leaderboard-cell {
      padding: 24px 16px !important;
      text-align: center !important;
      background: transparent !important;
    }

    .empty-leaderboard-wrap {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 10px;
      max-width: 440px;
      min-height: 180px;
      max-height: 220px;
      margin: 0 auto;
    }

    .empty-icon-circle {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      background: rgba(56, 189, 248, 0.12);
      border: 1px solid rgba(56, 189, 248, 0.25);
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 2px;
      color: #0284c7;
    }

    [data-theme="dark"] .empty-icon-circle {
      background: rgba(56, 189, 248, 0.16);
      border-color: rgba(56, 189, 248, 0.3);
      color: #38bdf8;
    }

    .empty-icon-circle i,
    .empty-icon-circle svg {
      width: 24px;
      height: 24px;
    }

    .empty-leaderboard-title {
      font-size: 14.5px;
      font-weight: 800;
      color: var(--ink);
    }

    .empty-leaderboard-desc {
      font-size: 12.5px;
      color: var(--muted);
      line-height: 1.5;
      max-width: 380px;
    }

    .live-quiz-students-container::-webkit-scrollbar,
    #studentDetails.teacher-grid::-webkit-scrollbar {
      width: 6px;
      height: 6px;
    }

    .live-quiz-students-container::-webkit-scrollbar-track,
    #studentDetails.teacher-grid::-webkit-scrollbar-track {
      background: rgba(15, 23, 42, 0.6);
      border-radius: 4px;
    }

    .live-quiz-students-container::-webkit-scrollbar-thumb,
    #studentDetails.teacher-grid::-webkit-scrollbar-thumb {
      background: var(--card-border, #1e293b);
      border-radius: 4px;
    }

    .live-quiz-students-container::-webkit-scrollbar-thumb:hover,
    #studentDetails.teacher-grid::-webkit-scrollbar-thumb:hover {
      background: var(--muted, #64748b);
    }

    #studentDetails.teacher-grid {
      max-height: 380px;
      overflow-y: auto;
      margin-top: 14px;
      padding-right: 4px;
    }

    @media (max-width: 768px) {
      .live-quiz-students-container {
        max-height: 55vh;
      }

      .live-quiz-students-container .table {
        min-width: 560px;
      }

      .live-quiz-students-container .table th,
      .live-quiz-students-container .table td {
        padding: 10px 8px;
        font-size: 13px;
      }

      #studentDetails.teacher-grid {
        max-height: 50vh;
      }
    }

    /* RANK BADGES FOR LEADERBOARD */
    .rank-badge {
      display: inline-block;
      font-size: 12px;
      font-weight: 800;
      padding: 3px 8px;
      border-radius: 6px;
      letter-spacing: 0.5px;
    }

    .rank-badge.rank-1 {
      color: #fbbf24;
      background: rgba(251, 191, 36, 0.14);
      border: 1px solid rgba(251, 191, 36, 0.35);
      box-shadow: 0 0 10px rgba(251, 191, 36, 0.15);
    }

    .rank-badge.rank-2 {
      color: #e2e8f0;
      background: rgba(226, 232, 240, 0.12);
      border: 1px solid rgba(226, 232, 240, 0.3);
    }

    .rank-badge.rank-3 {
      color: #f97316;
      background: rgba(249, 115, 22, 0.14);
      border: 1px solid rgba(249, 115, 22, 0.35);
    }

    .rank-badge.rank-other {
      color: var(--muted, #94a3b8);
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* Phase 41: Mobile Quiz & Result Enhancements */
    @media (max-width: 640px) {
      .quiz {
        padding: 0 4px;
      }

      .quiz-card {
        padding: 20px 14px;
        border-radius: var(--radius-lg, 16px);
      }

      .qtitle {
        font-size: clamp(18px, 4.5vw, 24px);
        margin: 12px 0 16px;
      }

      .code {
        padding: 12px 14px;
        font-size: 13px;
        line-height: 1.55;
        border-radius: var(--radius-md, 12px);
      }

      .options {
        gap: 10px;
        margin: 18px 0;
      }

      .option {
        padding: 13px 14px;
        min-height: 48px;
        gap: 12px;
        font-size: 14px;
        border-radius: var(--radius-md, 12px);
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
      }

      .option .letter {
        width: 32px;
        height: 32px;
        font-size: 14px;
        border-radius: 8px;
      }

      .actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
      }

      .actions #next {
        width: 100%;
        justify-content: center;
      }

      .result {
        padding: 24px 16px;
        margin: 10px auto;
      }

      .stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin: 18px 0;
      }

      .stat {
        padding: 12px 6px;
        border-radius: var(--radius-md, 12px);
        font-size: 12px;
      }

      .stat b {
        font-size: 22px;
      }

      .score {
        font-size: clamp(52px, 14vw, 76px);
      }
    }

    @media (max-width: 400px) {
      .stats {
        grid-template-columns: 1fr;
        gap: 8px;
      }

      .stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 16px;
        text-align: left;
      }

      .stat b {
        font-size: 20px;
        margin-bottom: 0;
      }
    }


    /* ==========================================
   QUIZ QUESTION MEDIA & EXPLANATION
   Phase 42: Question Image, Code & Explanation
========================================== */
    .quiz-image-wrap {
      margin: 14px 0 20px;
      display: flex;
      justify-content: center;
      align-items: center;
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.02));
      border-radius: var(--radius-lg);
      border: 1.5px solid var(--card-border);
      padding: 14px;
      max-width: 100%;
      box-sizing: border-box;
    }

    .quiz-image-wrap.hidden {
      display: none !important;
    }

    .quiz-image {
      max-width: 100%;
      max-height: 380px;
      height: auto;
      border-radius: var(--radius-md);
      object-fit: contain;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    }

    .quiz-explanation-wrap {
      margin-top: 20px;
      animation: fadeIn 0.25s ease;
    }

    .quiz-explanation-wrap.hidden {
      display: none !important;
    }

    .quiz-explanation-box {
      padding: 14px 18px;
      border-radius: var(--radius-md);
      background: rgba(99, 102, 241, 0.08);
      border: 1.5px solid rgba(99, 102, 241, 0.25);
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .quiz-explanation-title {
      font-size: 12px;
      font-weight: 800;
      color: var(--brand-indigo, #818cf8);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .quiz-explanation-text {
      font-size: 14px;
      font-weight: 500;
      color: var(--ink);
      line-height: 1.55;
    }

    /* =========================================================
   PER-QUESTION TIMER & DUAL TIMER STYLES (Phase 34)
   ========================================================= */
    .quiz-timers {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .question-timer {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-family: 'JetBrains Mono', monospace;
      padding: 6px 14px;
      background: rgba(56, 189, 248, 0.12);
      border: 2px solid rgba(56, 189, 248, 0.4);
      border-radius: 999px;
      font-size: 14px;
      font-weight: 800;
      color: #38bdf8;
      letter-spacing: 0.5px;
      transition: all 0.2s ease;
    }

    .question-timer.warning {
      color: #f59e0b;
      background: rgba(245, 158, 11, 0.15);
      border-color: rgba(245, 158, 11, 0.4);
    }

    .question-timer.urgent {
      color: #f43f5e;
      background: rgba(244, 63, 94, 0.18);
      border-color: rgba(244, 63, 94, 0.5);
      animation: pulseUrgent 0.8s infinite alternate;
    }

    @keyframes pulseUrgent {
      from {
        transform: scale(1);
        opacity: 0.9;
      }

      to {
        transform: scale(1.04);
        opacity: 1;
      }
    }

    .question-timer-progress-wrap {
      height: 4px;
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.06));
      border-radius: 999px;
      overflow: hidden;
      margin-top: -18px;
      margin-bottom: 22px;
    }

    .question-timer-progress-bar {
      height: 100%;
      width: 100%;
      background: linear-gradient(90deg, #38bdf8, #6366f1);
      border-radius: 999px;
      transition: width 1s linear, background-color 0.3s ease;
    }

    .question-timer-progress-bar.warning {
      background: linear-gradient(90deg, #f59e0b, #ef4444);
    }

    .question-timer-progress-bar.urgent {
      background: #f43f5e;
    }

    .timeout-notice-box {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 12px 18px;
      border-radius: var(--radius-md);
      background: rgba(244, 63, 94, 0.12);
      border: 1.5px solid rgba(244, 63, 94, 0.35);
      color: #f43f5e;
      font-weight: 700;
      font-size: 14px;
      margin-bottom: 18px;
      animation: fadeIn 0.2s ease;
    }