/* =========================================================================
   QWIK CALCULATE — MASTER STYLESHEET (Aligned with Qwik Study Brand System)
   ========================================================================= */

:root {
    --primary: #FF007A;
    --primary-light: #FF5E5E;
    --primary-grad: linear-gradient(135deg, #FF007A 0%, #FF7A00 100%);
    --primary-soft: rgba(255, 0, 122, 0.1);
    --dark-blue: #0A0F1C;

    --emerald: #10B981;
    --emerald-soft: rgba(16, 185, 129, 0.12);
    --amber: #F59E0B;
    --amber-soft: rgba(245, 158, 11, 0.14);
    --rose: #EF4444;
    --rose-soft: rgba(239, 68, 68, 0.12);
    --violet: #8B5CF6;
    --violet-soft: rgba(139, 92, 246, 0.12);
    --sky: #0EA5E9;
    --sky-soft: rgba(14, 165, 233, 0.12);

    --bg-page: #F4F7FA;
    --bg-card: #FFFFFF;
    --bg-card-subtle: #EDF2F7;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border-subtle: #E5E7EB;
    --border-hover: #D1D5DB;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 20px -3px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 18px 28px -5px rgba(255, 0, 122, 0.16);
    --shadow-nav: 0 4px 20px rgba(0, 0, 0, 0.06);

    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-pill: 9999px;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-page: #0A0F1C;
    --bg-card: #151F32;
    --bg-card-subtle: #1E293B;
    --text-main: #F9FAFB;
    --text-muted: #9CA3AF;
    --border-subtle: #1E293B;
    --border-hover: #334155;
    --shadow-nav: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* 1. GLOBAL RESET & RESPONSIVE GUARDRAILS */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    min-width: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.55;
    padding-top: 68px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-user-select: none;
    user-select: none;
    transition: background-color 0.3s, color 0.3s;
}

@media (min-width: 768px) {
    body { padding-top: 84px; }
}

input, select, textarea {
    font-family: inherit;
    -webkit-user-select: text !important;
    user-select: text !important;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    letter-spacing: -0.025em;
}

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 14px;
}

@media (min-width: 640px) { .container { padding: 0 20px; } }
@media (min-width: 1024px) { .container { padding: 0 24px; } }

.main-viewport {
    flex: 1;
    padding-top: 18px;
    padding-bottom: 56px;
}

/* 2. TOP NAVBAR & MOBILE SIDEBAR (Aligned with index.html) */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 66px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-nav);
    z-index: 1000;
    display: flex;
    align-items: center;
}

[data-theme="dark"] .navbar {
    background: rgba(10, 15, 28, 0.92);
}

@media (min-width: 768px) {
    .navbar { height: 82px; }
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

@media (min-width: 768px) {
    .header-logo { height: 42px; }
}

.nav-text-container {
    display: flex;
    flex-direction: column;
}

.nav-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.nav-title span {
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (min-width: 768px) {
    .nav-title { font-size: 1.35rem; }
}

.nav-subtitle {
    display: none;
    font-size: 0.73rem;
    color: var(--text-muted);
    font-weight: 600;
}

@media (min-width: 1140px) {
    .nav-subtitle { display: block; }
}

.main-nav-links {
    display: none;
}

@media (min-width: 1024px) {
    .main-nav-links {
        display: flex;
        gap: 12px;
        align-items: center;
    }
}

.nav-link {
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: var(--primary-soft);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-timer-pill {
    display: none;
    align-items: center;
    gap: 7px;
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid rgba(255, 0, 122, 0.25);
    padding: 7px 13px;
    border-radius: var(--radius-pill);
    font-weight: 800;
    font-size: 0.82rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: var(--transition);
}

@media (min-width: 640px) {
    .btn-timer-pill { display: inline-flex; }
}

.btn-timer-pill:hover {
    background: var(--primary);
    color: #FFF;
}

.btn-streak {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #FEF3C7;
    color: #D97706;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-weight: 800;
    font-size: 0.85rem;
}

[data-theme="dark"] .btn-streak {
    background: #451A03;
    color: #FBBF24;
}

.btn-icon-circle, .mobile-menu-btn {
    background: var(--bg-card-subtle);
    border: none;
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

@media (min-width: 768px) {
    .btn-icon-circle { width: 40px; height: 40px; font-size: 1rem; }
}

.btn-icon-circle:hover {
    background: var(--border-hover);
    color: var(--primary);
}

@media (min-width: 1024px) {
    .mobile-menu-btn { display: none; }
}

/* Mobile Sidebar */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-sidebar {
    position: fixed;
    top: 0; right: 0;
    width: 290px;
    max-width: 84vw;
    height: 100dvh;
    background: var(--bg-card);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-title { font-weight: 800; font-size: 1.1rem; }

.close-sidebar-btn {
    background: var(--bg-card-subtle);
    border: none;
    width: 34px; height: 34px;
    border-radius: 50%;
    color: var(--text-main);
    cursor: pointer;
}

.sidebar-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-link {
    text-decoration: none;
    font-size: 0.93rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.sidebar-link:hover, .sidebar-link.active {
    background: var(--bg-card-subtle);
    color: var(--primary);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    color: var(--primary);
}

.sidebar-divider {
    height: 1px;
    background: var(--border-subtle);
    border: none;
    margin: 8px 0;
}

.sidebar-subtitle {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 800;
    padding: 4px 12px;
}

/* 3. HERO BANNER & DAILY PRACTICE TIMER SCORECARD */
.calc-hero-card {
    background: var(--primary-grad);
    border-radius: var(--radius-md);
    padding: 22px 18px;
    color: #FFFFFF;
    box-shadow: var(--shadow-md);
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 18px;
}

@media (min-width: 960px) {
    .calc-hero-card {
        grid-template-columns: 1.35fr 1fr;
        padding: 32px 34px;
        border-radius: var(--radius-lg);
        align-items: center;
    }
}

.hero-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.hero-pill {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.calc-hero-left h1 {
    font-size: clamp(1.45rem, 3.8vw, 2.25rem);
    font-weight: 800;
    line-height: 1.18;
    margin-bottom: 10px;
}

.calc-hero-left p {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 18px;
    max-width: 600px;
}

.hero-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-hero-white {
    background: #FFFFFF;
    color: var(--primary);
    border: none;
    padding: 12px 22px;
    border-radius: var(--radius-pill);
    font-weight: 800;
    font-size: 0.92rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
    transition: var(--transition);
}

.btn-hero-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.22);
}

.btn-hero-glass {
    background: rgba(255, 255, 255, 0.16);
    color: #FFFFFF;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    padding: 11px 18px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: var(--transition);
}

.btn-hero-glass:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: #FFF;
}

/* Daily Timer Box inside Hero */
.daily-timer-box {
    background: rgba(10, 15, 28, 0.28);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-md);
    padding: 18px;
}

.timer-box-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.timer-box-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.8);
}

.timer-box-header h3 {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 800;
}

.timer-box-header h3 small {
    font-size: 0.82rem;
    font-weight: 600;
    opacity: 0.85;
}

.btn-edit-goal {
    background: rgba(255, 255, 255, 0.2);
    color: #FFF;
    border: none;
    padding: 6px 11px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.goal-progress-track {
    width: 100%;
    height: 9px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-bottom: 6px;
}

.goal-progress-fill {
    height: 100%;
    background: #10B981;
    border-radius: var(--radius-pill);
    transition: width 0.4s ease;
}

.goal-sub-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 14px;
    font-weight: 600;
}

.hero-mini-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.mini-kpi {
    text-align: center;
}

.mini-kpi-val {
    display: block;
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 0.95rem;
}

.mini-kpi-lbl {
    font-size: 0.66rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

/* 4. DIAGNOSTIC PLACEMENT TEST BANNER */
.placement-banner {
    background: var(--bg-card);
    border: 2px dashed var(--primary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
    .placement-banner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.placement-banner-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.placement-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.placement-banner-info h3 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 3px;
}

.placement-banner-info p {
    font-size: 0.83rem;
    color: var(--text-muted);
}

.placement-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* 5. MAIN 4-PILLAR TABS BAR */
.academy-tabs-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 22px;
}

@media (min-width: 820px) {
    .academy-tabs-bar {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}

.academy-tab {
    background: var(--bg-card);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-weight: 800;
    font-size: 0.86rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.academy-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.academy-tab.active {
    background: var(--primary-grad);
    color: #FFFFFF;
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

.tab-badge {
    background: rgba(239, 68, 68, 0.16);
    color: var(--rose);
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-family: var(--font-mono);
}

.academy-tab.active .tab-badge {
    background: #FFFFFF;
    color: var(--primary);
}

.tab-view {
    display: none;
}

.tab-view.active {
    display: block;
    animation: fadeInView 0.22s ease-out;
}

@keyframes fadeInView {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 6. TAB 1: 5 CAREER ZONES & LEVEL NODES MAP */
.zones-selector-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

@media (min-width: 640px) {
    .zones-selector-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1080px) {
    .zones-selector-grid { grid-template-columns: repeat(5, 1fr); }
}

.zone-card {
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.zone-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-light);
}

.zone-card.active {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(255, 0, 122, 0.04) 100%);
}

.zone-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.zone-tier-badge {
    font-size: 0.66rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.tier-beginner { background: var(--emerald-soft); color: var(--emerald); }
.tier-pro { background: var(--sky-soft); color: var(--sky); }
.tier-star { background: var(--violet-soft); color: var(--violet); }
.tier-superstar { background: var(--amber-soft); color: var(--amber); }
.tier-champ { background: var(--primary-soft); color: var(--primary); }

.zone-lock-status {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
}

.zone-card h3 {
    font-size: 1.08rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.zone-card p {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.4;
}

.zone-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 5px;
    font-family: var(--font-mono);
}

.zone-progress-bar {
    height: 7px;
    background: var(--bg-card-subtle);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.zone-progress-fill {
    height: 100%;
    background: var(--primary-grad);
    border-radius: var(--radius-pill);
    transition: width 0.3s ease;
}

/* Level Map Container */
.zone-map-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.zone-map-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

@media (min-width: 820px) {
    .zone-map-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.zone-map-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.zone-map-title-row h2 {
    font-size: 1.3rem;
    font-weight: 800;
}

.zone-rule-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--bg-card-subtle);
    color: var(--text-muted);
}

.zone-rule-badge.boss-badge {
    background: var(--amber-soft);
    color: var(--amber);
}

.zone-map-subtitle {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.zone-map-filters, .gym-filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.filter-chip {
    background: var(--bg-card-subtle);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-chip.active {
    background: var(--primary-grad);
    color: #FFF;
    border-color: transparent;
}

/* Step-by-Step Level Cards Grid */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 600px) {
    .levels-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
    .levels-grid { grid-template-columns: repeat(5, 1fr); gap: 14px; }
}

.level-node-card {
    background: var(--bg-page);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: var(--transition);
    cursor: pointer;
}

.level-node-card:hover:not(.locked) {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.level-node-card.current-target {
    border: 2px solid var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.level-node-card.completed {
    border-color: rgba(16, 185, 129, 0.45);
    background: var(--bg-card);
}

.level-node-card.master-boss {
    border: 2px solid var(--amber);
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(245, 158, 11, 0.06) 100%);
}

.level-node-card.locked {
    opacity: 0.58;
    cursor: not-allowed;
}

.level-node-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.level-num-tag {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 0.78rem;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--bg-card-subtle);
}

.level-node-card.master-boss .level-num-tag {
    background: var(--amber-soft);
    color: var(--amber);
}

.level-stars {
    font-size: 0.72rem;
    color: #FBBF24;
    letter-spacing: 1px;
}

.level-topic-name {
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
    line-height: 1.3;
}

.level-meta-info {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* 7. TAB 2: TOPIC & DIGIT PRACTICE GYM */
.completed-mix-card {
    background: linear-gradient(135deg, #0A0F1C 0%, #1E293B 100%);
    color: #FFFFFF;
    border-radius: var(--radius-md);
    padding: 22px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 820px) {
    .completed-mix-card {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.badge-pill-grad {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-grad);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.completed-mix-info h3 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.completed-mix-info p {
    font-size: 0.84rem;
    color: #9CA3AF;
    max-width: 640px;
}

.completed-mix-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.gym-select {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1.5px solid var(--border-subtle);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.84rem;
}

.gym-chapters-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 16px;
}

@media (min-width: 720px) {
    .gym-chapters-grid { grid-template-columns: repeat(2, 1fr); }
}

.gym-chapter-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
}

.gym-chapter-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.gym-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.gym-submodes-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.submode-pill {
    background: var(--bg-page);
    border: 1.5px solid var(--border-subtle);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.submode-pill:hover, .submode-pill.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

/* 8. TAB 3: TRICKS, TABLES & FORMULA VAULT */
.vault-header {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 18px;
}

.vault-header h2 { font-size: 1.25rem; margin-bottom: 4px; }
.vault-header p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 14px; }

.vault-subtabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.vault-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 720px) {
    .vault-content-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .vault-content-grid { grid-template-columns: repeat(3, 1fr); }
}

.vault-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.vault-card h4 {
    font-size: 0.96rem;
    color: var(--primary);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vault-mono-table {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.65;
    color: var(--text-main);
    white-space: pre-line;
}

/* 9. ACTIVE 2-MINUTE ARENA VIEW */
.arena-wrapper {
    max-width: 760px;
    margin: 0 auto;
}

.arena-hud-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}

.arena-hud-left, .arena-hud-right {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.hud-badge {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
}

.hud-badge-primary { background: var(--primary-soft); color: var(--primary); }
.hud-badge-subtle { background: var(--bg-card-subtle); color: var(--text-main); }
.hud-badge-recall { background: var(--amber-soft); color: var(--amber); }

.arena-hud-center {
    flex: 1;
    min-width: 140px;
    max-width: 220px;
}

.arena-timer-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 1rem;
    color: var(--emerald);
    margin-bottom: 4px;
}

.arena-timer-track {
    height: 6px;
    background: var(--bg-card-subtle);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.arena-timer-fill {
    height: 100%;
    background: var(--emerald);
    transition: width 0.15s linear;
}

.hud-stat-pill {
    background: var(--bg-page);
    border: 1px solid var(--border-subtle);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-family: var(--font-mono);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.stat-correct { color: var(--emerald); }
.stat-streak { color: var(--amber); }

.btn-hud-icon, .btn-hud-exit {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
}

.btn-hud-exit:hover {
    background: var(--rose-soft);
    color: var(--rose);
    border-color: var(--rose);
}

.arena-trick-strip {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
}

.trick-strip-title {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.trick-strip-title i { color: var(--amber); }

.btn-Bookmark-q {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

/* Question Card */
.arena-question-card {
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px 18px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: border-color 0.2s ease;
}

.arena-question-card.flash-correct { border-color: var(--emerald); }
.arena-question-card.flash-wrong { border-color: var(--rose); }

.question-meta-top {
    display: flex;
    justify-content: space-between;
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 600;
}

.micro-timer { font-family: var(--font-mono); }

.arena-prompt {
    font-family: var(--font-mono);
    font-size: clamp(1.65rem, 4.8vw, 2.5rem);
    font-weight: 800;
    margin: 20px 0;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
    word-break: break-word;
}

.arena-prompt.word-mode {
    font-family: var(--font-sans);
    font-size: clamp(1.1rem, 2.8vw, 1.4rem);
    font-weight: 700;
}

.arena-input-wrap {
    max-width: 320px;
    margin: 0 auto 14px;
}

.arena-math-input {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 800;
    text-align: center;
    background: var(--bg-page);
    color: var(--text-main);
    border: 2px solid var(--border-hover);
    border-radius: var(--radius-sm);
    outline: none;
}

.arena-math-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.input-hint-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* MCQ Options Grid */
.arena-mcq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 10px;
    max-width: 600px;
    margin: 14px auto;
}

.arena-mcq-btn {
    background: var(--bg-page);
    border: 2px solid var(--border-subtle);
    color: var(--text-main);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.96rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.arena-mcq-btn:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.arena-controls-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.btn-arena-primary, .btn-primary-grad {
    background: var(--primary-grad);
    color: #FFFFFF;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-weight: 800;
    font-size: 0.86rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: var(--transition);
}

.btn-arena-secondary, .btn-outline-secondary {
    background: var(--bg-page);
    color: var(--text-main);
    border: 1.5px solid var(--border-subtle);
    padding: 9px 16px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.84rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-outline-danger {
    background: var(--rose-soft);
    color: var(--rose);
    border: 1px solid var(--rose);
    padding: 9px 16px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.84rem;
    cursor: pointer;
}

/* Virtual Numpad */
.arena-numpad-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-width: 320px;
    margin: 18px auto 0;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.numpad-key {
    height: 48px;
    border-radius: 10px;
    background: var(--bg-page);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.08s ease, background-color 0.15s;
}

.numpad-key:active {
    transform: scale(0.95);
    background: var(--border-hover);
}

.numpad-key.key-clr { color: var(--rose); font-size: 0.88rem; }
.numpad-key.key-enter {
    grid-column: span 2;
    background: var(--primary-grad);
    color: #FFF;
    border: none;
    font-size: 0.95rem;
}

.arena-explanation-box {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-page);
    border: 1px solid var(--border-subtle);
    text-align: left;
    font-size: 0.84rem;
}

/* 10. RESULTS & SCORECARD SCREEN */
.results-wrapper {
    max-width: 820px;
    margin: 0 auto;
}

.results-hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px 20px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.results-status-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.76rem;
    font-weight: 800;
    background: var(--emerald-soft);
    color: var(--emerald);
    margin-bottom: 10px;
}

.res-stars-row {
    font-size: 2rem;
    color: #D1D5DB;
    margin: 12px 0 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.res-stars-row .star-earned {
    color: #FBBF24;
    filter: drop-shadow(0 4px 10px rgba(251, 191, 36, 0.4));
}

.res-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

@media (min-width: 640px) {
    .res-kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

.res-kpi-box {
    background: var(--bg-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 14px 10px;
}

.res-kpi-lbl {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 4px;
}

.res-kpi-val {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 800;
}

.text-emerald { color: var(--emerald); }
.text-pink { color: var(--primary); }
.text-amber { color: var(--amber); }

.res-actions-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.results-audit-card, .mistakes-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 18px;
}

.mistakes-header-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@media (min-width: 768px) {
    .mistakes-header-card {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.mistakes-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.audit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.audit-list, .mistakes-list-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 11. MODALS & TOAST */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 28, 0.72);
    backdrop-filter: blur(4px);
    z-index: 2200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.active { display: flex; }

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    max-width: 520px;
    width: 100%;
    padding: 22px;
    box-shadow: var(--shadow-md);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.btn-modal-close {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
}

.placement-tiers-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-page);
    padding: 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.tier-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.timer-goal-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.goal-option-btn {
    background: var(--bg-page);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
}

.goal-option-btn.active, .goal-option-btn:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 0.86rem;
}

.settings-row p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.backup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.toast-notification {
    visibility: hidden;
    min-width: 260px;
    background: var(--dark-blue);
    color: #FFF;
    text-align: center;
    border-radius: var(--radius-pill);
    padding: 12px 22px;
    position: fixed;
    z-index: 2500;
    left: 50%;
    transform: translateX(-50%);
    bottom: 24px;
    font-weight: 700;
    font-size: 0.88rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast-notification.show {
    visibility: visible;
    opacity: 1;
    bottom: 38px;
}

.main-footer {
    background: #0A0F1C;
    color: #9CA3AF;
    text-align: center;
    padding: 28px 14px;
    font-size: 0.82rem;
    border-top: 1px solid #1E293B;
}

.footer-links {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-links a {
    color: #9CA3AF;
    text-decoration: none;
}

.footer-links a:hover { color: #FFF; }