:root {
      --primary: #6366f1;
      /* Indigo 500 */
      --primary-hover: #4f46e5;
      /* Indigo 600 */
      --bg: #0b0f19;
      /* Cosmic Dark */
      --card-bg: #151d30;
      /* Deep Navy Card */
      --text: #f1f5f9;
      /* Off-White Text */
      --text-muted: #94a3b8;
      /* Cool Grey */
      --success: #10b981;
      /* Emerald */
      --error: #f43f5e;
      /* Rose */
      --border: #223049;
      /* Deep Navy Border */
      --accent: #f59e0b;
      /* Streak Amber */
      --shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.4), 0 8px 16px -4px rgba(0, 0, 0, 0.4);
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    }

    body {
      background-color: var(--bg);
      color: var(--text);
      padding: 20px 15px;
      display: flex;
      flex-direction: column;
      align-items: center;
      min-height: 100vh;
      background-image: radial-gradient(circle at top center, rgba(99, 102, 241, 0.1) 0%, transparent 60%);
    }

    header {
      text-align: center;
      margin-bottom: 24px;
      max-width: 760px;
      width: 100%;
    }

    .header-logo-container {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      margin-bottom: 6px;
    }

    .header-logo {
      width: 44px;
      height: 44px;
      object-fit: cover;
      border-radius: 50%;
      border: 2px solid rgba(99, 102, 241, 0.4);
      box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
      background-color: #ffffff;
    }

    header h1 {
      font-size: 2.2rem;
      background: linear-gradient(135deg, #a5b4fc, #6366f1);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      font-weight: 800;
      letter-spacing: -0.5px;
      line-height: 1.2;
    }

    header p {
      font-size: 1.08rem;
      color: #e2e8f0;
      font-weight: 500;
    }

    .header-banner {
      margin-top: 12px;
      font-size: 0.82rem;
      color: #a5b4fc;
      font-weight: 700;
      background: rgba(99, 102, 241, 0.1);
      display: inline-block;
      padding: 6px 14px;
      border-radius: 20px;
      border: 1px solid rgba(99, 102, 241, 0.2);
    }

    /* ✅ Navigation Tabs */
    .tabs-nav {
      display: flex;
      background: rgba(11, 15, 25, 0.4);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 4px;
      margin-bottom: 20px;
      width: 100%;
    }

    .tab-btn {
      flex: 1;
      background: transparent;
      border: none;
      color: #cbd5e1;
      padding: 11px 10px;
      border-radius: 10px;
      font-weight: 700;
      font-size: 0.85rem;
      cursor: pointer;
      transition: all 0.2s;
    }

    .tab-btn:hover:not(.active) {
      color: white;
      background: rgba(255, 255, 255, 0.05);
    }

    .tab-btn.active {
      background: var(--primary);
      color: white;
      font-weight: 800;
      border-bottom: 3px solid #a5b4fc;
      box-shadow: inset 0 -3px 0 0 #a5b4fc;
    }

    /* ✅ Level Progress Bar Container */
    .level-progress-bar-container {
      background: rgba(11, 15, 25, 0.4);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 12px 16px;
      margin-bottom: 15px;
      width: 100%;
    }

    .level-info-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
    }

    .level-badge-tag {
      background: linear-gradient(135deg, #a5b4fc, #6366f1);
      color: white;
      font-size: 0.75rem;
      font-weight: 800;
      padding: 4px 10px;
      border-radius: 20px;
      text-transform: uppercase;
      letter-spacing: 0.3px;
    }

    .level-xp-text {
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--text-muted);
    }

    .level-bar-bg {
      background: var(--border);
      height: 8px;
      border-radius: 4px;
      overflow: hidden;
      width: 100%;
    }

    .level-bar-fill {
      background: linear-gradient(90deg, var(--primary), #10b981);
      height: 100%;
      width: 0%;
      transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* ✅ Timed / Classic Selector */
    .drill-mode-selector {
      display: flex;
      background: rgba(11, 15, 25, 0.4);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 3px;
      margin-bottom: 18px;
      width: 100%;
    }

    .mode-toggle-btn {
      flex: 1;
      background: transparent;
      border: none;
      color: var(--text-muted);
      padding: 8px;
      border-radius: 9px;
      font-weight: 700;
      font-size: 0.8rem;
      cursor: pointer;
      transition: all 0.2s;
    }

    .mode-toggle-btn.active {
      background: rgba(99, 102, 241, 0.15);
      color: var(--primary);
      border: 1px solid rgba(99, 102, 241, 0.25);
    }

    /* ✅ Leaderboard Row Styles */
    .leaderboard-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      width: 100%;
    }

    .leaderboard-row {
      display: flex;
      align-items: center;
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 12px 16px;
      justify-content: space-between;
      transition: all 0.2s;
    }

    .leaderboard-row.user-row {
      background: rgba(99, 102, 241, 0.08);
      border-color: var(--primary);
      box-shadow: 0 0 12px rgba(99, 102, 241, 0.12);
    }

    .leaderboard-left {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .leaderboard-rank {
      width: 24px;
      font-weight: 800;
      font-size: 0.9rem;
      color: var(--text-muted);
    }

    .leaderboard-rank.top-1 {
      color: #f59e0b;
    }

    .leaderboard-rank.top-2 {
      color: #94a3b8;
    }

    .leaderboard-rank.top-3 {
      color: #b45309;
    }

    .leaderboard-name {
      font-weight: 700;
      font-size: 0.9rem;
      color: var(--text);
    }

    .leaderboard-xp {
      font-weight: 800;
      font-size: 0.9rem;
      color: var(--primary);
    }

    .leaderboard-row.user-row .leaderboard-xp {
      color: #818cf8;
    }

    /* ✅ Badges Grid Styles */
    .badges-grid {
      display: flex;
      flex-direction: column;
      gap: 12px;
      width: 100%;
    }

    .badge-item {
      display: flex;
      align-items: center;
      background: rgba(255, 255, 255, 0.015);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 14px 16px;
      gap: 16px;
      transition: all 0.2s;
    }

    .badge-item.unlocked {
      background: rgba(99, 102, 241, 0.06);
      border-color: var(--primary);
      box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
    }

    .badge-icon {
      font-size: 2.2rem;
      transition: transform 0.3s;
    }

    .badge-item.unlocked:hover .badge-icon {
      transform: rotate(15deg) scale(1.1);
    }

    .badge-item.locked {
      opacity: 0.4;
      filter: grayscale(1);
    }

    .badge-name {
      font-weight: 800;
      font-size: 0.95rem;
      margin-bottom: 2px;
      color: var(--text);
    }

    .badge-desc {
      font-size: 0.78rem;
      color: var(--text-muted);
    }

    /* ✅ Timer Bar */
    .timer-container {
      width: 100%;
      height: 6px;
      background: var(--border);
      border-radius: 3px;
      margin-bottom: 8px;
      overflow: hidden;
    }

    .timer-bar {
      height: 100%;
      width: 100%;
      background: linear-gradient(90deg, #10b981, #f43f5e);
      transition: width 1s linear;
    }

    /* Floating Toast Alerts */
    .toast-notification {
      position: fixed;
      top: 20px;
      left: 50%;
      transform: translateX(-50%) translateY(-100px);
      background: linear-gradient(135deg, #f59e0b, #d97706);
      color: white;
      padding: 14px 24px;
      border-radius: 30px;
      box-shadow: 0 10px 25px rgba(217, 119, 6, 0.4);
      z-index: 10000;
      font-weight: 800;
      text-align: center;
      transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
      opacity: 0;
    }

    .toast-notification.show {
      transform: translateX(-50%) translateY(0);
      opacity: 1;
    }

    /* ✅ AdSense Ad Units */
    .ad-unit {
      width: 100%;
      max-width: 760px;
      margin-bottom: 15px;
      min-height: 90px;
      display: block;
    }

    .ad-label {
      font-size: 0.65rem;
      color: #5b7194;
      text-align: center;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 2px;
    }

    /* ✅ Gamification Dashboard Grid */
    .dashboard-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
      margin-bottom: 20px;
      width: 100%;
    }

    .dashboard-card {
      background: rgba(11, 15, 25, 0.6);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 14px 8px;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      position: relative;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Distinct Accent Colors for Stats Cards */
    #goal-card {
      background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(15, 23, 42, 0.6));
      border: 1.5px solid rgba(99, 102, 241, 0.35);
    }

    #goal-card:hover {
      border-color: #818cf8;
      box-shadow: 0 6px 16px rgba(99, 102, 241, 0.2);
    }

    #streak-card {
      background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(15, 23, 42, 0.6));
      border: 1.5px solid rgba(245, 158, 11, 0.35);
    }

    #streak-card:hover {
      border-color: #fbbf24;
      box-shadow: 0 6px 16px rgba(245, 158, 11, 0.2);
    }

    #stats-card {
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(15, 23, 42, 0.6));
      border: 1.5px solid rgba(16, 185, 129, 0.35);
    }

    #stats-card:hover {
      border-color: #34d399;
      box-shadow: 0 6px 16px rgba(16, 185, 129, 0.2);
    }

    .goal-progress-container {
      position: relative;
      width: 68px;
      height: 68px;
      margin-bottom: 6px;
    }

    .progress-ring {
      width: 68px;
      height: 68px;
    }

    .progress-ring-fill {
      transition: stroke-dashoffset 0.4s ease;
    }

    .goal-text-overlay {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      font-size: 0.78rem;
      font-weight: 800;
      color: var(--text);
    }

    .streak-badge-large,
    .accuracy-badge {
      font-size: 1.45rem;
      font-weight: 800;
      height: 68px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 6px;
    }

    .card-title {
      font-size: 0.72rem;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 2px;
    }

    .card-sub {
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--text);
    }

    .edit-link {
      color: var(--primary);
      cursor: pointer;
      text-decoration: underline;
      margin-left: 2px;
      font-weight: 600;
    }

    .edit-link:hover {
      color: #818cf8;
    }

    /* ✅ Quiz Container */
    .quiz-container {
      background: var(--card-bg);
      width: 100%;
      max-width: 760px;
      border-radius: 24px;
      padding: 28px 36px;
      box-shadow: var(--shadow);
      border: 1px solid var(--border);
      position: relative;
    }

    .meta-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
      width: 100%;
      gap: 12px;
    }

    .tag-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: rgba(244, 63, 94, 0.1);
      color: var(--error);
      padding: 6px 13px;
      border-radius: 20px;
      font-size: 0.78rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .streak-counter {
      font-size: 0.85rem;
      color: var(--accent);
      font-weight: 700;
      background: rgba(245, 158, 11, 0.12);
      padding: 6px 14px;
      border-radius: 20px;
    }

    .question-text {
      font-size: 1.15rem;
      font-weight: 700;
      margin-bottom: 20px;
      line-height: 1.5;
      color: var(--text);
      white-space: pre-line;
    }

    .options-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .option-btn {
      background: rgba(255, 255, 255, 0.02);
      border: 1.5px solid var(--border);
      border-radius: 14px;
      padding: 18px 22px;
      min-height: 52px;
      text-align: left;
      font-size: 0.96rem;
      cursor: pointer;
      font-weight: 600;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      width: 100%;
      color: #cbd5e1;
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .option-btn:hover:not([disabled]) {
      border-color: var(--primary);
      background: rgba(99, 102, 241, 0.08);
      transform: translateX(4px);
    }

    .option-indicator {
      background: var(--border);
      color: var(--text-muted);
      width: 24px;
      height: 24px;
      border-radius: 50%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 0.78rem;
      font-weight: 800;
      flex-shrink: 0;
      transition: all 0.2s;
    }

    .option-btn:hover:not([disabled]) .option-indicator {
      background: var(--primary);
      color: white;
    }

    .option-btn.selected {
      border-color: var(--primary) !important;
      background: rgba(99, 102, 241, 0.15) !important;
    }

    .option-btn.selected .option-indicator {
      background: var(--primary) !important;
      color: white !important;
    }

    .option-btn.correct {
      background: rgba(16, 185, 129, 0.15) !important;
      border-color: var(--success) !important;
      color: #a7f3d0 !important;
    }

    .option-btn.correct .option-indicator {
      background: var(--success) !important;
      color: white !important;
    }

    .option-btn.wrong {
      background: rgba(244, 63, 94, 0.15) !important;
      border-color: var(--error) !important;
      color: #fecdd3 !important;
    }

    .option-btn.wrong .option-indicator {
      background: var(--error) !important;
      color: white !important;
    }

    .explanation-box {
      margin-top: 20px;
      background: rgba(99, 102, 241, 0.08);
      border-left: 4px solid var(--primary);
      padding: 16px;
      border-radius: 4px 14px 14px 4px;
      font-size: 0.92rem;
      display: none;
      line-height: 1.6;
      color: #c7d2fe;
      font-weight: 500;
      animation: slideIn 0.3s ease;
    }

    @keyframes slideIn {
      from {
        opacity: 0;
        transform: translateY(10px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    #daily-new-highlight:hover {
      transform: translateY(-2px) scale(1.01);
      box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
      background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(16, 185, 129, 0.25)) !important;
    }

    /* Wrong Answers Review styling */
    .review-screen-view {
      display: none;
      animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
      width: 100%;
    }

    @keyframes slideUp {
      from {
        transform: translateY(60px);
        opacity: 0;
      }

      to {
        transform: translateY(0);
        opacity: 1;
      }
    }

    .review-card {
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid var(--border);
      border-radius: 18px;
      padding: 20px;
      margin-bottom: 20px;
    }

    .review-card-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 14px;
    }

    .review-q-num {
      font-weight: 800;
      font-size: 0.95rem;
      color: var(--accent);
    }

    .review-q-text {
      font-size: 1.05rem;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 18px;
      line-height: 1.5;
    }

    .review-opts-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-bottom: 18px;
    }

    .review-opt {
      padding: 14px 16px;
      border-radius: 12px;
      font-size: 0.92rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 12px;
      transition: all 0.2s;
      border: 1.5px solid var(--border);
      background: rgba(255, 255, 255, 0.01);
      color: var(--text-muted);
    }

    .review-opt.correct-highlight {
      border: 1.5px solid #0F6E56 !important;
      background-color: #E1F5EE !important;
      color: #0F6E56 !important;
    }

    .review-opt.wrong-highlight {
      border: 1.5px solid #A32D2D !important;
      background-color: #FCEBEB !important;
      color: #A32D2D !important;
    }

    .review-opt .status-icon {
      font-size: 1.1rem;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      width: 24px;
      height: 24px;
    }

    .review-explanation {
      background: rgba(99, 102, 241, 0.06);
      border-left: 4px solid var(--primary);
      padding: 14px 16px;
      border-radius: 4px 12px 12px 4px;
      font-size: 0.92rem;
      color: #c7d2fe;
      font-weight: 500;
      line-height: 1.6;
    }

    .review-divider {
      border: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, var(--border), transparent);
      margin: 16px 0;
    }

    .action-buttons {
      display: flex;
      gap: 10px;
      margin-top: 20px;
    }

    .next-btn {
      flex: 2;
      background: var(--primary);
      color: white;
      border: none;
      padding: 16px;
      border-radius: 12px;
      font-size: 1rem;
      font-weight: 700;
      cursor: pointer;
      display: none;
      transition: all 0.2s;
    }

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

    .end-btn {
      flex: 1;
      background: rgba(255, 255, 255, 0.05);
      color: var(--text);
      border: 1px solid var(--border);
      padding: 16px;
      border-radius: 12px;
      font-size: 0.95rem;
      font-weight: 700;
      cursor: pointer;
      display: none;
      transition: all 0.2s;
    }

    .end-btn:hover {
      background: rgba(255, 255, 255, 0.08);
    }

    /* Results summary */
    .results-view {
      display: none;
      text-align: center;
      padding: 10px 0;
    }

    .results-view h2 {
      color: var(--primary);
      font-size: 1.5rem;
      margin-bottom: 18px;
      font-weight: 800;
    }

    .stats-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-bottom: 20px;
    }

    .stat-card {
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid var(--border);
      padding: 16px;
      border-radius: 14px;
    }

    .stat-card p {
      font-size: 0.75rem;
      color: var(--text-muted);
      font-weight: 700;
      text-transform: uppercase;
      margin-bottom: 6px;
      letter-spacing: 0.5px;
    }

    .stat-card h3 {
      font-size: 1.4rem;
      color: var(--text);
      font-weight: 800;
    }

    .restart-btn {
      width: 100%;
      background: var(--success);
      color: white;
      border: none;
      padding: 16px;
      border-radius: 12px;
      font-size: 1.05rem;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.2s;
    }

    .restart-btn:hover {
      background: #059669;
    }

    /* Notification settings banner */
    .notification-banner {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: 18px;
      padding: 14px 18px;
      width: 100%;
      max-width: 760px;
      margin-top: 15px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      box-shadow: var(--shadow);
    }

    .notif-btn {
      background: var(--primary);
      color: white;
      border: none;
      padding: 8px 14px;
      border-radius: 20px;
      font-size: 0.8rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
    }

    .notif-btn:hover {
      background: var(--primary-hover);
    }

    .notif-btn.secondary {
      background: transparent;
      border: 1px solid var(--border);
      color: var(--text);
      margin-right: 6px;
    }

    .notif-btn.secondary:hover {
      background: rgba(255, 255, 255, 0.05);
    }

    /* Share Section */
    .share-section {
      width: 100%;
      max-width: 760px;
      margin-top: 20px;
      text-align: center;
    }

    .share-section p {
      font-size: 0.75rem;
      color: var(--text-muted);
      margin-bottom: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .share-btns {
      display: flex;
      gap: 10px;
      justify-content: center;
    }

    .share-btn {
      padding: 10px 18px;
      border-radius: 20px;
      font-size: 0.82rem;
      font-weight: 700;
      border: none;
      cursor: pointer;
      text-decoration: none;
      display: inline-block;
      transition: opacity 0.2s;
    }

    .share-btn:hover {
      opacity: 0.85;
    }

    .share-btn.whatsapp {
      background: #128c7e;
      color: white;
    }

    .share-btn.telegram {
      background: #0088cc;
      color: white;
    }

    .share-btn.twitter {
      background: #151d30;
      border: 1px solid var(--border);
      color: white;
    }

    /* SEO Block */
    .seo-content {
      width: 100%;
      max-width: 760px;
      margin-top: 24px;
      background: var(--card-bg);
      border-radius: 20px;
      padding: 20px 24px;
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
    }

    .seo-content h2 {
      font-size: 1.1rem;
      color: var(--primary);
      font-weight: 800;
      margin-bottom: 10px;
    }

    .seo-content p {
      font-size: 0.88rem;
      color: var(--text-muted);
      line-height: 1.6;
      margin-bottom: 10px;
    }

    .exam-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 12px;
    }

    .exam-tag {
      background: rgba(99, 102, 241, 0.06);
      color: var(--primary);
      padding: 5px 12px;
      border-radius: 20px;
      font-size: 0.78rem;
      font-weight: 700;
      border: 1px solid rgba(99, 102, 241, 0.15);
    }

    /* Footer */
    footer {
      width: 100%;
      max-width: 760px;
      margin-top: 24px;
      padding: 20px 16px;
      text-align: center;
      font-size: 0.78rem;
      color: var(--text-muted);
      border-top: 1px solid var(--border);
    }

    footer a {
      color: var(--text-muted);
      text-decoration: none;
      margin: 0 8px;
      font-weight: 600;
    }

    footer a:hover {
      color: var(--primary);
    }

    footer .copyright {
      margin-top: 8px;
      font-size: 0.72rem;
    }

    /* Study Guides & Resources in Footer */
    .footer-resources {
      margin-bottom: 24px;
      padding: 18px 16px;
      background: rgba(21, 29, 48, 0.4);
      border: 1px solid var(--border);
      border-radius: 12px;
      text-align: left;
    }

    .footer-resources h3 {
      font-size: 0.88rem;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 6px;
      border-bottom: 1px solid rgba(34, 48, 73, 0.5);
      padding-bottom: 6px;
    }

    .resources-grid {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .resources-group h4 {
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--primary);
      margin-bottom: 6px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .resources-group ul {
      list-style: none;
      padding: 0;
      margin: 0;
    }

    .resources-group li {
      margin-bottom: 4px;
      line-height: 1.4;
    }

    .resources-group a {
      font-size: 0.76rem;
      color: var(--text-muted) !important;
      text-decoration: none;
      transition: all 0.2s ease;
      display: inline-block;
      font-weight: 500 !important;
      margin: 0 !important;
    }

    .resources-group a:hover {
      color: var(--primary) !important;
      transform: translateX(3px);
    }

    /* Responsive Helpers and Clean Classes */
    .notif-info-wrapper {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .notif-icon {
      font-size: 1.4rem;
    }

    .notif-text-wrapper {
      text-align: left;
    }

    .notif-title {
      font-weight: 700;
      font-size: 0.85rem;
    }

    .notif-desc {
      font-size: 0.72rem;
      color: var(--text-muted);
    }

    .notif-actions-wrapper {
      display: flex;
      align-items: center;
    }

    .leaderboard-name-prompt {
      display: none;
      background: rgba(99, 102, 241, 0.08);
      border: 1px solid var(--primary);
      padding: 18px;
      border-radius: 18px;
      margin-bottom: 20px;
      text-align: center;
    }

    .rank-status-container {
      display: none;
      margin-bottom: 15px;
      background: rgba(16, 185, 129, 0.08);
      border: 1px solid var(--success);
      padding: 12px;
      border-radius: 12px;
      text-align: center;
      font-size: 0.82rem;
      font-weight: 700;
      color: #a7f3d0;
    }

    .user-rank-val {
      color: var(--accent);
    }

    .name-prompt-title {
      margin-bottom: 6px;
      font-size: 0.95rem;
      font-weight: 800;
    }

    .name-prompt-desc {
      font-size: 0.78rem;
      color: var(--text-muted);
      margin-bottom: 12px;
      font-weight: 600;
    }

    .name-prompt-input-row {
      display: flex;
      gap: 8px;
    }

    .name-prompt-input {
      flex: 1;
      padding: 10px 14px;
      border-radius: 10px;
      border: 1.5px solid var(--border);
      background: var(--bg);
      color: var(--text);
      font-weight: 700;
      font-size: 0.95rem;
    }

    .name-prompt-btn {
      background: var(--primary);
      color: white;
      border: none;
      padding: 10px 18px;
      border-radius: 10px;
      font-weight: 800;
      cursor: pointer;
      transition: background 0.2s;
    }

    .speed-drill-info {
      display: flex;
      justify-content: space-between;
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--text-muted);
    }

    #speed-score-text {
      color: var(--primary);
    }

    .speed-drill-start-container {
      text-align: center;
      padding: 20px 0;
    }

    .speed-drill-icon {
      font-size: 3rem;
      margin-bottom: 12px;
    }

    .speed-drill-title {
      margin-bottom: 8px;
    }

    .speed-drill-desc {
      font-size: 0.88rem;
      color: var(--text-muted);
      margin-bottom: 20px;
      line-height: 1.5;
    }

    .speed-drill-highscore-badge {
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 12px;
      margin-bottom: 20px;
      font-size: 0.85rem;
      font-weight: 700;
    }

    .speed-drill-high-score-val {
      color: var(--accent);
    }

    .speed-drill-end-icon {
      font-size: 3rem;
      margin-bottom: 8px;
    }

    .speed-drill-end-grid {
      margin-top: 15px;
    }

    /* Mobile Responsive Media Queries */
    @media (max-width: 520px) {
      body {
        padding: 12px 10px;
      }

      header {
        margin-bottom: 16px;
      }

      .header-logo-container {
        gap: 8px;
        margin-bottom: 4px;
      }

      .header-logo {
        width: 36px;
        height: 36px;
        border-width: 1.5px;
      }

      header h1 {
        font-size: 1.75rem;
      }

      header p {
        font-size: 0.95rem;
      }

      .header-banner {
        font-size: 0.75rem;
        padding: 4px 10px;
        margin-top: 8px;
      }

      .quiz-container {
        padding: 20px 22px;
        border-radius: 20px;
      }

      .level-progress-bar-container {
        padding: 8px 12px;
        margin-bottom: 12px;
        border-radius: 12px;
      }

      .level-badge-tag {
        font-size: 0.7rem;
        padding: 2px 8px;
      }

      .level-xp-text {
        font-size: 0.72rem;
      }

      .tabs-nav {
        border-radius: 10px;
        padding: 4px;
        margin-bottom: 14px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
      }

      .tabs-nav::-webkit-scrollbar {
        display: none;
      }

      .tab-btn {
        padding: 8px 12px;
        font-size: 0.78rem;
        border-radius: 7px;
        flex: 1 0 auto;
        white-space: nowrap;
      }

      .drill-mode-selector {
        margin-bottom: 14px;
        border-radius: 10px;
      }

      .mode-toggle-btn {
        padding: 6px;
        font-size: 0.75rem;
        border-radius: 7px;
      }

      /* Dashboard cards optimization */
      .dashboard-grid {
        gap: 6px;
        margin-bottom: 14px;
      }

      .dashboard-card {
        padding: 10px 4px;
        border-radius: 12px;
      }

      .goal-progress-container {
        width: 52px;
        height: 52px;
        margin-bottom: 4px;
      }

      .progress-ring {
        width: 52px;
        height: 52px;
      }

      .goal-text-overlay {
        font-size: 0.65rem;
      }

      .streak-badge-large,
      .accuracy-badge {
        font-size: 1.2rem;
        height: 52px;
        margin-bottom: 4px;
      }

      .card-title {
        font-size: 0.6rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
      }

      .card-sub {
        font-size: 0.65rem;
      }

      /* Active question optimization */
      .question-text {
        font-size: 1rem;
        margin-bottom: 16px;
      }

      .option-btn {
        padding: 16px 18px;
        min-height: 48px;
        font-size: 0.9rem;
        border-radius: 10px;
        gap: 10px;
      }

      .option-indicator {
        width: 22px;
        height: 22px;
        font-size: 0.72rem;
      }

      .explanation-box {
        padding: 12px;
        font-size: 0.82rem;
        margin-top: 15px;
      }

      .action-buttons {
        margin-top: 15px;
        gap: 8px;
      }

      .next-btn,
      .end-btn {
        padding: 12px;
        font-size: 0.88rem;
        border-radius: 10px;
      }

      /* Notification banner stacking */
      .notification-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 15px;
        text-align: center;
        border-radius: 14px;
      }

      .notif-info-wrapper {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 6px;
      }

      .notif-text-wrapper {
        text-align: center;
      }

      .notif-actions-wrapper {
        justify-content: center;
        width: 100%;
      }

      .notif-btn {
        flex: 1;
        padding: 10px;
        font-size: 0.82rem;
      }

      /* Share buttons layout */
      .share-btns {
        flex-wrap: wrap;
        gap: 8px;
      }

      .share-btn {
        flex: 1 1 calc(50% - 8px);
        padding: 10px;
        font-size: 0.8rem;
        border-radius: 16px;
      }

      .share-btn.twitter {
        flex: 1 1 100%;
      }

      /* Leaderboard name prompt */
      .leaderboard-name-prompt {
        padding: 14px;
        border-radius: 14px;
      }

      .name-prompt-input-row {
        flex-direction: column;
        gap: 10px;
      }

      .name-prompt-input {
        width: 100%;
        font-size: 0.88rem;
      }

      .name-prompt-btn {
        width: 100%;
        padding: 12px;
        font-size: 0.88rem;
      }

      /* Performance grids */
      .stats-grid {
        gap: 8px;
      }

      .stat-card {
        padding: 12px 8px;
        border-radius: 10px;
      }

      .stat-card h3 {
        font-size: 1.15rem;
      }

      .stat-card p {
        font-size: 0.68rem;
      }

      .results-view h2 {
        font-size: 1.3rem;
      }

      /* Toast alerts */
      .toast-notification {
        width: 90%;
        padding: 10px 16px;
        font-size: 0.82rem;
      }
    }

    /* Filter screen custom styling */
    .filter-screen {
      animation: slideIn 0.3s ease;
    }

    .filter-step-title {
      font-size: 1rem;
      font-weight: 800;
      margin-bottom: 12px;
      color: var(--text);
      border-left: 3px solid var(--primary);
      padding-left: 8px;
    }

    .filter-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
      margin-bottom: 15px;
    }

    .filter-card {
      background: rgba(255, 255, 255, 0.02);
      border: 1.5px solid var(--border);
      border-radius: 12px;
      padding: 12px 8px;
      text-align: center;
      font-size: 0.85rem;
      font-weight: 700;
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      width: 100%;
    }

    .filter-card:hover {
      border-color: var(--primary);
      background: rgba(99, 102, 241, 0.08);
      transform: translateY(-2px);
      color: var(--text);
    }

    .filter-card.selected {
      background: rgba(99, 102, 241, 0.15) !important;
      border-color: var(--primary) !important;
      color: white !important;
      box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
    }

    .question-count-badge {
      text-align: center;
      font-size: 0.85rem;
      font-weight: 700;
      color: var(--accent);
      background: rgba(245, 158, 11, 0.1);
      border: 1px dashed rgba(245, 158, 11, 0.3);
      padding: 10px;
      border-radius: 12px;
      margin: 16px 0;
      animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
      }

      to {
        opacity: 1;
      }
    }

    .loader-spinner {
      width: 16px;
      height: 16px;
      border: 2px solid rgba(255, 255, 255, 0.1);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
      display: inline-block;
    }

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

    /* --- Notification Banner Styles --- */
    .update-banner {
      position: fixed;
      top: -120px;
      /* Start hidden off-screen */
      left: 0;
      right: 0;
      width: 100%;
      background-color: #f59e0b;
      color: #1e293b;
      font-weight: 700;
      z-index: 10000;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
      transition: top 0.4s cubic-bezier(0.16, 1, 0.3, 1);
      display: none;
      /* controlled by JS */
      align-items: center;
      justify-content: space-between;
      padding: 12px 20px;
      cursor: pointer;
      box-sizing: border-box;
      font-size: 0.92rem;
      text-align: center;
    }

    .update-banner.show {
      top: 0;
    }

    .update-banner-content {
      flex: 1;
      padding-right: 16px;
      line-height: 1.4;
    }

    .update-banner-close-btn {
      background: transparent;
      border: none;
      color: #1e293b;
      font-size: 1.6rem;
      font-weight: 800;
      cursor: pointer;
      padding: 0 8px;
      line-height: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      user-select: none;
      transition: opacity 0.2s, transform 0.2s;
    }

    .update-banner-close-btn:hover {
      opacity: 0.7;
      transform: scale(1.1);
    }

    @media (max-width: 480px) {
      .update-banner {
        padding: 10px 14px;
        font-size: 0.85rem;
      }

      .update-banner-content {
        text-align: left;
        padding-right: 12px;
      }

      .update-banner-close-btn {
        font-size: 1.4rem;
        padding: 0 4px;
      }
    }

    /* --- Feedback Modal Styles --- */
    .feedback-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 20000;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .feedback-overlay.show {
      display: flex;
      opacity: 1;
    }

    .feedback-modal {
      background: #ffffff;
      border-radius: 16px;
      width: 100%;
      max-width: 380px;
      padding: 28px 24px;
      box-sizing: border-box;
      position: relative;
      transform: scale(0.95);
      transition: transform 0.3s ease;
      box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
      margin: 20px;
    }

    .feedback-overlay.show .feedback-modal {
      transform: scale(1);
    }

    .feedback-close-btn {
      position: absolute;
      top: 16px;
      right: 16px;
      background: none;
      border: none;
      font-size: 1.5rem;
      color: #94a3b8;
      cursor: pointer;
      line-height: 1;
      padding: 4px;
      transition: color 0.2s ease;
    }

    .feedback-close-btn:hover {
      color: #475569;
    }

    .feedback-header {
      margin-bottom: 20px;
      text-align: left;
    }

    .feedback-title {
      font-size: 1.1rem;
      font-weight: 700;
      color: #1e293b;
      margin-bottom: 6px;
      line-height: 1.3;
    }

    .feedback-subtitle {
      font-size: 0.85rem;
      color: #64748b;
      line-height: 1.4;
    }

    .feedback-form .form-group {
      margin-bottom: 16px;
      text-align: left;
    }

    .feedback-form label {
      display: block;
      font-size: 0.85rem;
      font-weight: 600;
      color: #475569;
      margin-bottom: 6px;
    }

    .feedback-form input[type="text"],
    .feedback-form textarea {
      width: 100%;
      box-sizing: border-box;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      padding: 10px 12px;
      font-size: 0.9rem;
      font-family: inherit;
      color: #1e293b;
      outline: none;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .feedback-form input[type="text"]:focus,
    .feedback-form textarea:focus {
      border-color: #4f46e5;
      box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    }

    .feedback-contact-note {
      font-size: 0.78rem;
      color: #64748b;
      margin-top: 4px;
      margin-bottom: 12px;
      text-align: center;
      line-height: 1.4;
    }

    .feedback-contact-note a {
      color: #4f46e5;
      text-decoration: underline;
      font-weight: 500;
      transition: color 0.2s ease;
    }

    .feedback-contact-note a:hover {
      color: #4338ca;
    }

    .feedback-submit-btn {
      background: #4f46e5;
      color: #ffffff;
      width: 100%;
      border: none;
      border-radius: 8px;
      padding: 12px;
      font-size: 0.95rem;
      font-weight: 700;
      cursor: pointer;
      transition: background-color 0.2s ease;
      margin-top: 8px;
      margin-bottom: 16px;
    }

    .feedback-submit-btn:hover {
      background: #4338ca;
    }

    .feedback-skip-link {
      display: block;
      text-align: center;
      color: #94a3b8;
      font-size: 0.82rem;
      cursor: pointer;
      font-weight: 500;
      transition: color 0.2s ease;
    }

    .feedback-skip-link:hover {
      color: #64748b;
    }

    /* Toast override for green success toast */
    .toast-notification.feedback-toast {
      background: #10b981;
      box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
    }

    /* Validation Errors & Shake Animation */
    @keyframes shake {

      0%,
      100% {
        transform: translateX(0);
      }

      25% {
        transform: translateX(-6px);
      }

      75% {
        transform: translateX(6px);
      }
    }

    .feedback-form .shake-error {
      animation: shake 0.2s ease-in-out 0s 2;
      border-color: #ef4444 !important;
    }

    /* ✅ Bookmark System Styles */
    .bookmark-btn {
      background: none;
      border: none;
      cursor: pointer;
      padding: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: transform 0.2s ease;
    }
    .bookmark-btn:hover {
      transform: scale(1.15);
    }
    .bookmark-btn-svg {
      fill: none;
      stroke: #6B7280; /* muted gray */
      stroke-width: 2.2;
      transition: all 0.2s ease;
    }
    .bookmark-btn-svg.bookmarked {
      fill: #F59E0B; /* gold color */
      stroke: #F59E0B;
      stroke-width: 0;
    }
    .bookmark-count-badge {
      background: #4f46e5; /* purple background */
      color: white;
      font-size: 0.7rem;
      font-weight: 800;
      padding: 2px 6px;
      border-radius: 10px;
      margin-left: 6px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
      vertical-align: middle;
    }
    @keyframes bookmarkPulse {
      0% { transform: scale(1); }
      50% { transform: scale(1.3); }
      100% { transform: scale(1); }
    }
    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.5; }
    }
    .pulse-anim {
      animation: bookmarkPulse 0.3s ease-in-out;
    }
    .bookmark-filter-chip {
      background: rgba(255, 255, 255, 0.02);
      border: 1.5px solid var(--border);
      border-radius: 20px;
      padding: 8px 16px;
      font-size: 0.85rem;
      font-weight: 700;
      color: var(--text-muted);
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      flex-shrink: 0;
    }
    .bookmark-filter-chip:hover {
      border-color: var(--primary);
      background: rgba(99, 102, 241, 0.08);
      color: var(--text);
    }
    .bookmark-filter-chip.active {
      background: rgba(99, 102, 241, 0.15) !important;
      border-color: var(--primary) !important;
      color: white !important;
      box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
    }
    .q-block {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 20px;
      margin-bottom: 16px;
      box-shadow: var(--shadow);
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
    }
    .q-block:hover {
      border-color: var(--primary);
      box-shadow: 0 6px 16px rgba(99, 102, 241, 0.12);
    }
    /* Study Mode UI */
    .study-card {
      background: white;
      border: 1px solid #e2e8f0;
      border-radius: 14px;
      padding: 18px 20px;
      margin-bottom: 14px;
      width: 100%;
    }

    .study-card-meta {
      font-size: 0.72rem;
      color: #94a3b8;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-bottom: 10px;
    }

    .study-card-question {
      font-weight: 700;
      color: #1e293b;
      font-size: 0.95rem;
      margin-bottom: 12px;
      line-height: 1.5;
    }

    .study-option {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 7px 10px;
      border-radius: 8px;
      font-size: 0.88rem;
      color: #475569;
      margin-bottom: 6px;
      border: 1px solid #e2e8f0;
      background: #f8fafc;
    }

    .study-option.correct {
      background: #f0fdf4;
      border-color: #10b981;
      color: #166534;
      font-weight: 700;
    }

    .study-option-letter {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      border: 2px solid #e2e8f0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.72rem;
      font-weight: 800;
      flex-shrink: 0;
    }

    .study-option.correct .study-option-letter {
      background: #10b981;
      border-color: #10b981;
      color: white;
    }

    .study-takeaway {
      background: #eff6ff;
      border-left: 3px solid #4f46e5;
      padding: 10px 14px;
      border-radius: 0 8px 8px 0;
      font-size: 0.83rem;
      color: #475569;
      margin-top: 12px;
    }

    .study-takeaway strong {
      color: #1e293b;
      display: block;
      margin-bottom: 3px;
      font-size: 0.78rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    /* Mode Toggle */
    .mode-toggle-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-bottom: 15px;
    }

    .mode-pill-container {
      background: #1e293b;
      border-radius: 12px;
      padding: 4px;
      display: flex;
      width: fit-content;
    }

    .mode-pill-btn {
      background: transparent;
      color: #94a3b8;
      padding: 8px 20px;
      border: none;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      font-size: 0.9rem;
      border-radius: 8px;
    }

    .mode-pill-btn.active {
      background: #4f46e5;
      color: white;
      font-weight: 700;
    }

    .mode-desc-text {
      text-align: center;
      font-size: 0.82rem;
      color: #94a3b8;
      margin-top: 8px;
      font-weight: 600;
    }