/* ===== GOOGLE FONTS ===== */
/* ===== DESIGN TOKENS ===== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #eef2ff;
    --primary-glow: rgba(99, 102, 241, 0.18);
    --accent: #a855f7;
    --accent-light: #faf5ff;
    --cyan: #06b6d4;
    --bg: #f8faff;
    --bg-card: #ffffff;
    --bg-input: #f9fafb;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-focus: #6366f1;
    --success: #10b981;
    --success-light: #d1fae5;
    --error: #ef4444;
    --error-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, .07), 0 2px 4px -1px rgba(0, 0, 0, .05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, .08), 0 4px 6px -2px rgba(0, 0, 0, .04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04);
    --glow: 0 0 0 3px rgba(99, 102, 241, .2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --transition: all 0.22s cubic-bezier(.4, 0, .2, 1);
}

/* ===== RESET ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== NAVBAR ===== */
.navbar {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6366f1 100%);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(79, 70, 229, .35);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    padding: 0 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-decoration: none;
    color: white;
}

.logo-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .3));
}

/* XP chip in nav */
.nav-xp-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: var(--radius-full);
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 700;
    color: white;
    backdrop-filter: blur(8px);
}

.nav-xp-chip .xp-icon {
    font-size: 16px;
}

.nav-links {
    display: flex;
    gap: 4px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: rgba(255, 255, 255, .88);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    padding: 7px 14px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
}

.nav-links a:hover {
    color: white;
    background: rgba(255, 255, 255, .15);
}

.nav-links a.active {
    color: white;
    background: rgba(255, 255, 255, .22);
}

.nav-links a svg {
    width: 16px;
    height: 16px;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 9px;
    background: rgba(255, 255, 255, .15);
    border-radius: var(--radius-sm);
    border: none;
}

.hamburger span {
    width: 22px;
    height: 2.5px;
    background: white;
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #4338ca 0%, #7c3aed 100%);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    gap: 8px;
    z-index: 999;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    color: white;
    text-decoration: none;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    transition: var(--transition);
    font-size: 15px;
}

.mobile-menu a:hover,
.mobile-menu a.active {
    background: rgba(255, 255, 255, .18);
}

.mobile-menu svg {
    width: 20px;
    height: 20px;
}

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 20px;
}

/* ===== PAGE HEADER ===== */
.page-header {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 28px 32px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--cyan));
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-title svg {
    width: 36px;
    height: 36px;
    color: var(--primary);
}

.module-switcher {
    display: flex;
    gap: 8px;
    background: var(--primary-light);
    padding: 5px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(99, 102, 241, .2);
}

.module-btn {
    padding: 10px 24px;
    border: none;
    background: transparent;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-family: inherit;
}

.module-btn svg {
    width: 18px;
    height: 18px;
}

.module-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .4);
}

.module-btn:hover:not(.active) {
    background: rgba(99, 102, 241, .1);
}

/* ===== CONTENT GRID ===== */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
    align-items: start;
}

/* ===== CANVAS PANEL ===== */
.canvas-panel {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.canvas-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--primary-light);
}

.canvas-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.canvas-title svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.view-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--primary-light);
    padding: 7px 14px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(99, 102, 241, .18);
}

input[type="range"] {
    width: 90px;
    max-width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
}

#crystalCanvas,
#practiceCanvas {
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #f8faff 0%, #eef2ff 100%);
    cursor: crosshair;
    box-shadow: inset 0 2px 12px rgba(99, 102, 241, .06);
    max-width: 100%;
    display: block;
}

.axis-legend {
    margin-top: 20px;
    display: flex;
    gap: 32px;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--primary-light);
    padding: 14px 28px;
    border-radius: var(--radius-full);
    flex-wrap: wrap;
    justify-content: center;
    border: 1px solid rgba(99, 102, 241, .15);
}

.axis-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.axis-color {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

.axis-x {
    background: #4f46e5;
}

.axis-y {
    background: #10b981;
}

.axis-z {
    background: #ef4444;
}

.info-overlay {
    position: absolute;
    top: 80px;
    right: 24px;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    padding: 18px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(99, 102, 241, .2);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 14px;
    min-width: 170px;
}

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

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
    font-weight: 700;
}

.info-value {
    font-weight: 800;
    color: var(--primary);
    font-size: 15px;
}

/* ===== CONTROLS PANEL ===== */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
}

.control-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, .3);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-light) 0%, #faf5ff 100%);
    padding: 22px 24px;
    border-bottom: 1px solid rgba(99, 102, 241, .12);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header svg {
    width: 26px;
    height: 26px;
    color: var(--primary);
}

.card-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-dark);
}

.card-body {
    padding: 24px;
}

/* ===== PILL TABS ===== */
.tabs-container {
    display: flex;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    padding: 4px;
    gap: 4px;
    margin-bottom: 22px;
    border: 1px solid rgba(99, 102, 241, .2);
}

.tab {
    flex: 1;
    padding: 10px 12px;
    text-align: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    color: var(--primary);
    border-radius: var(--radius-full);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    background: transparent;
    font-family: inherit;
}

.tab svg {
    width: 14px;
    height: 14px;
}

.tab:hover:not(.active) {
    background: rgba(99, 102, 241, .1);
}

.tab.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(99, 102, 241, .35);
}

.tab-content {
    display: none;
    animation: fadeUp 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

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

/* ===== FORM ELEMENTS ===== */
.form-section {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group label {
    font-weight: 800;
    color: var(--primary);
    min-width: 20px;
    font-size: 15px;
}

input[type="number"],
input[type="text"] {
    width: 76px;
    padding: 11px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    transition: var(--transition);
    color: var(--text);
    background: var(--bg-input);
    font-family: inherit;
}

input[type="number"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--glow);
    background: white;
    transform: translateY(-1px);
}

/* ===== BUTTONS ===== */
.btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: none;
    padding: 13px 26px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, .15) 0%, transparent 60%);
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, .45);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--primary);
    border: 2px solid rgba(99, 102, 241, .3);
    box-shadow: none;
}

.btn-secondary::after {
    display: none;
}

.btn-secondary:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    box-shadow: var(--glow);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 14px rgba(16, 185, 129, .3);
}

.btn-success:hover {
    box-shadow: 0 8px 20px rgba(16, 185, 129, .45);
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

/* ===== GAME-STYLE EXPLANATION BOX ===== */
.explanation-box {
    background: linear-gradient(135deg, var(--primary-light) 0%, #faf5ff 100%);
    border: 1px solid rgba(99, 102, 241, .2);
    border-left: 4px solid var(--primary);
    padding: 20px;
    border-radius: var(--radius-lg);
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.8;
    display: none;
}

.explanation-box.visible {
    display: block;
    animation: slideIn 0.35s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }

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

.step {
    margin-bottom: 12px;
    padding: 10px 14px 10px 48px;
    position: relative;
    background: rgba(255, 255, 255, .7);
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, .1);
    backdrop-filter: blur(4px);
}

.step:last-child {
    margin-bottom: 0;
}

.step::before {
    content: attr(data-step);
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, .3);
}

.math {
    font-family: 'Courier New', monospace;
    font-style: italic;
    background: rgba(99, 102, 241, .1);
    color: var(--primary-dark);
    padding: 2px 7px;
    border-radius: 5px;
    font-weight: 700;
}

.overline {
    text-decoration: overline;
}

/* ===== INTERACTIVE STATUS ===== */
.interactive-status {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
    border: 1px solid rgba(99, 102, 241, .2);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
}

.status-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--border);
    transition: var(--transition);
}

.status-dot.active {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .2);
}

.status-dot.pending {
    background: var(--warning);
    animation: blink 1.4s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* ===== PRACTICE ARENA ===== */
.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--primary-light);
    flex-wrap: wrap;
    gap: 12px;
}

.progress-badge {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 7px 18px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .3);
}

.question-type {
    padding: 6px 14px;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, .2);
}

.question-text {
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 18px;
    color: var(--text);
    line-height: 1.5;
}

.hint-text {
    font-size: 14px;
    color: #92400e;
    font-style: italic;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: #fffbeb;
    border-left: 4px solid var(--warning);
    border-radius: var(--radius-md);
    display: none;
    align-items: center;
    gap: 10px;
}

.hint-text.shown {
    display: flex;
}

.hint-text svg {
    width: 18px;
    height: 18px;
    color: var(--warning);
    flex-shrink: 0;
}

.feedback {
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin-top: 18px;
    font-weight: 700;
    display: none;
    align-items: center;
    gap: 12px;
    font-size: 15px;
}

.feedback.visible {
    display: flex;
    animation: pop 0.4s ease;
}

@keyframes pop {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }
}

.feedback svg {
    width: 22px;
    height: 22px;
}

.feedback.correct {
    background: var(--success-light);
    color: #065f46;
    border: 2px solid #a7f3d0;
}

.feedback.incorrect {
    background: var(--error-light);
    color: #991b1b;
    border: 2px solid #fca5a5;
}

.navigation-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--primary-light);
}

/* ===== PROGRESS PAGE ===== */
.progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, .3);
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-light), #faf5ff);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, .2);
}

.stat-icon svg {
    width: 26px;
    height: 26px;
}

.stat-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

.stat-value {
    font-size: 40px;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 8px;
}

.stat-desc {
    color: var(--text-muted);
    font-size: 14px;
}

.progress-bar-container {
    margin-top: 18px;
}

.progress-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
}

.progress-bar {
    height: 10px;
    background: var(--primary-light);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 10px;
    transition: width 1s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .4) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

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

.weakness-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.weakness-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--primary-light);
}

.weakness-header svg {
    width: 28px;
    height: 28px;
    color: var(--warning);
}

.weakness-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.weakness-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.weakness-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
    border: 2px solid #fcd34d;
    border-radius: var(--radius-lg);
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.weakness-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--warning);
}

.weakness-topic {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.weakness-score {
    font-size: 13px;
    color: var(--error);
    font-weight: 700;
    margin-bottom: 12px;
}

.weakness-tip {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
    background: rgba(245, 158, 11, .08);
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
}

.btn-practice-weakness {
    width: 100%;
    justify-content: center;
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, .3);
}

.btn-practice-weakness:hover {
    box-shadow: 0 8px 20px rgba(245, 158, 11, .4);
}

.strength-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.strength-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.strength-header svg {
    width: 28px;
    height: 28px;
    color: var(--success);
}

.strength-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.strength-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.strength-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
    border: 2px solid #6ee7b7;
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.strength-card svg {
    width: 36px;
    height: 36px;
    color: var(--success);
    flex-shrink: 0;
}

.strength-info h4 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.strength-info p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== PRACTICE ARENA PAGE ===== */
.arena-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6366f1 100%);
    color: white;
    padding: 48px 40px;
    border-radius: var(--radius-xl);
    margin-bottom: 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(99, 102, 241, .4);
}

.arena-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 50%, rgba(168, 85, 247, .3) 0%, transparent 60%);
}

.arena-title {
    font-size: 34px;
    font-weight: 900;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    position: relative;
}

.arena-title svg {
    width: 38px;
    height: 38px;
}

.arena-subtitle {
    font-size: 17px;
    opacity: 0.88;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.practice-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* ===== PREMIUM PRACTICE CARDS ===== */
.practice-mode-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
    position: relative;
}

.practice-mode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px rgba(99, 102, 241, .15);
    border-color: rgba(99, 102, 241, .3);
}

.practice-card-header {
    padding: 22px 22px 18px;
    position: relative;
    overflow: hidden;
}

.practice-card-header::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    opacity: 0.1;
}

.practice-card-body {
    padding: 0 22px 22px;
}

.practice-card-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 22px;
}

.practice-card-title {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 5px;
}

.practice-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 14px;
}

.practice-card-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.practice-card-pill {
    background: var(--primary-light);
    border-radius: var(--radius-full);
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

.recommended-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    letter-spacing: .5px;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-card);
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 24px 0;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo-text {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-tagline {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.footer-credits {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.footer-credits a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
}

.footer-credits a:hover {
    color: var(--primary-glow);
    text-decoration: underline;
}

/* ===== SESSION STATS BAR ===== */
.session-stats-bar {
    background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
    border: 1px solid rgba(99, 102, 241, .2);
    border-radius: var(--radius-xl);
    padding: 16px 24px;
    display: flex;
    gap: 28px;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.session-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.session-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.session-stat-icon svg {
    width: 16px;
    height: 16px;
}

.session-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.session-stat-value {
    font-size: 20px;
    font-weight: 900;
    color: var(--text);
    line-height: 1;
}

.session-progress-bar {
    flex: 1;
    min-width: 120px;
}

.session-progress-track {
    height: 6px;
    background: rgba(99, 102, 241, .15);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}

.session-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width .5s ease;
}

/* ===== GAMIFICATION ===== */
.gamification-section {
    margin-top: 36px;
}

.section-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.level-badge {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-radius: 50%;
    width: 96px;
    height: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(99, 102, 241, .4);
    margin-bottom: 14px;
}

.level-badge-number {
    font-size: 30px;
}

.level-badge-text {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.level-progress {
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    padding: 14px;
    margin-bottom: 18px;
    border: 1px solid rgba(99, 102, 241, .15);
}

.level-progress-bar {
    background: var(--border);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.level-progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    height: 100%;
    transition: width .5s ease;
}

.points-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.badge {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.badge:hover {
    transform: translateY(-3px) scale(1.03);
    border-color: rgba(99, 102, 241, .4);
    box-shadow: var(--shadow-md);
}

.badge.earned {
    border-color: var(--primary);
    background: var(--primary-light);
}

.badge.earned::after {
    content: "✓";
    position: absolute;
    top: 6px;
    right: 8px;
    color: var(--primary);
    font-weight: 900;
    font-size: 12px;
}

.badge-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.badge-name {
    font-size: 11px;
    font-weight: 800;
    color: var(--text);
}

.badge-desc {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ===== UTILITY ===== */
.hidden {
    display: none !important;
}

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

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.gap-2 {
    gap: 8px;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: linear-gradient(135deg, var(--primary-dark), var(--accent));
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(99, 102, 241, .4);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 2000;
    animation: toastIn 0.4s ease;
    font-weight: 600;
}

.toast.visible {
    display: flex;
}

.toast svg {
    width: 22px;
    height: 22px;
    color: #a7f3d0;
}

@keyframes toastIn {
    from {
        transform: translateY(80px);
        opacity: 0;
    }

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

/* ===== LOADING ===== */
.loading {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

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

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }

    .controls-panel {
        order: -1;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .nav-xp-chip {
        display: none;
    }

    .main-wrapper {
        padding: 14px 12px;
    }

    .page-header {
        flex-direction: column;
        text-align: center;
        padding: 18px;
    }

    .page-title {
        font-size: 22px;
        justify-content: center;
        margin-bottom: 12px;
    }

    .module-switcher {
        width: 100%;
        justify-content: center;
    }

    .module-btn {
        flex: 1;
        justify-content: center;
    }

    .canvas-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .canvas-title {
        justify-content: center;
        font-size: 15px;
    }

    .view-controls {
        justify-content: center;
        width: 100%;
    }

    .canvas-panel {
        padding: 12px;
    }

    #crystalCanvas,
    #practiceCanvas {
        width: 100% !important;
        height: auto !important;
    }

    .info-overlay {
        position: relative;
        top: auto;
        right: auto;
        margin-top: 14px;
        width: 100%;
        min-width: unset;
    }

    .axis-legend {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 12px;
    }

    .card-header {
        padding: 14px 18px;
    }

    .card-body {
        padding: 14px 18px;
    }

    .card-title {
        font-size: 16px;
    }

    .practice-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .navigation-controls {
        flex-direction: column;
    }

    .navigation-controls .btn,
    .btn-group .btn {
        width: 100%;
        justify-content: center;
    }

    .btn-group {
        flex-direction: column;
    }

    .progress-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 32px;
    }

    .arena-header {
        padding: 28px 18px;
    }

    .arena-title {
        font-size: 24px;
        flex-wrap: wrap;
    }

    .arena-subtitle {
        font-size: 14px;
    }

    .practice-modes {
        grid-template-columns: 1fr;
    }

    .input-row {
        justify-content: center;
        flex-wrap: wrap;
    }

    input[type="number"],
    input[type="text"] {
        width: 68px;
        padding: 9px 6px;
        font-size: 15px;
    }

    .tabs-container {
        flex-wrap: wrap;
    }

    .tab {
        flex: 1 1 40%;
        font-size: 12px;
        padding: 9px 8px;
    }

    .interactive-status {
        flex-direction: column;
        gap: 10px;
    }

    .weakness-grid,
    .strength-grid {
        grid-template-columns: 1fr;
    }

    .toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
        justify-content: center;
    }

    input[type="range"] {
        width: 75px;
    }

    .footer-inner {
        padding: 18px 16px;
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .session-stats-bar {
        gap: 14px;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .module-btn {
        padding: 9px 14px;
        font-size: 13px;
    }

    .btn {
        padding: 11px 18px;
        font-size: 13px;
    }

    .card-body {
        padding: 12px 14px;
    }

    .question-text {
        font-size: 16px;
    }

    .page-title {
        font-size: 19px;
    }

    .stat-card {
        padding: 18px;
    }
}

/* ===== GAME-IFIED PRACTICE ARENA & PROGRESS ===== */

/* --- Game Mode Selection Cards --- */
.game-lobby {
    max-width: 1200px;
    margin: 0 auto;
}

.lobby-hero {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #6366f1 100%);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(99, 102, 241, .35);
    margin-bottom: 32px;
}

.lobby-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(168, 85, 247, .4) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(6, 182, 212, .25) 0%, transparent 50%);
}

.lobby-hero-content {
    position: relative;
    z-index: 1;
}

.lobby-title {
    font-size: 38px;
    font-weight: 900;
    color: white;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.lobby-title-icon {
    font-size: 42px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

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

    50% {
        transform: translateY(-8px);
    }
}

.lobby-subtitle {
    color: rgba(255, 255, 255, .85);
    font-size: 17px;
    max-width: 560px;
    margin: 0 auto 28px;
}

/* XP + Level bar in lobby */
.lobby-xp-bar {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: var(--radius-full);
    padding: 10px 24px;
    backdrop-filter: blur(8px);
    flex-wrap: wrap;
    justify-content: center;
}

.lobby-level-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
    font-weight: 900;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 8px rgba(251, 191, 36, .4);
}

.lobby-xp-track {
    width: 140px;
    height: 8px;
    background: rgba(255, 255, 255, .2);
    border-radius: 4px;
    overflow: hidden;
}

.lobby-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #34d399);
    border-radius: 4px;
    transition: width .8s ease;
}

.lobby-xp-text {
    color: white;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.lobby-streak {
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-weight: 800;
    font-size: 14px;
}

/* Game Mode Cards Grid */
.game-modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.game-mode-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 2px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.game-mode-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, .15);
}

.game-mode-card.locked {
    opacity: .6;
    cursor: not-allowed;
}

.game-mode-card-banner {
    height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.game-mode-card-banner.green {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.game-mode-card-banner.orange {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.game-mode-card-banner.red {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.game-mode-card-banner.cyan {
    background: linear-gradient(90deg, #06b6d4, #67e8f9);
}

.game-mode-card-inner {
    padding: 22px;
}

.game-mode-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.game-mode-name {
    font-size: 19px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}

.game-mode-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.game-mode-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.game-mode-pill {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(99, 102, 241, .18);
}

.game-mode-pill.hard {
    background: #fee2e2;
    color: #dc2626;
}

.game-mode-pill.medium {
    background: #fef3c7;
    color: #d97706;
}

.game-mode-pill.easy {
    background: #d1fae5;
    color: #059669;
}

.game-mode-locked-icon {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 18px;
    opacity: .5;
}

.game-mode-best {
    position: absolute;
    top: 14px;
    right: 14px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
    font-size: 10px;
    font-weight: 900;
    padding: 3px 9px;
    border-radius: var(--radius-full);
}

/* ===== ACTIVE GAME SESSION ===== */
.game-session {
    max-width: 1200px;
    margin: 0 auto;
}

/* Game HUD (top bar) */
.game-hud {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-badge {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.hud-badge.primary {
    background: var(--primary-light);
    color: var(--primary);
}

.hud-badge.xp {
    background: #fef3c7;
    color: #d97706;
}

.hud-badge.streak {
    background: #fee2e2;
    color: #dc2626;
}

.hud-badge.combo {
    background: #faf5ff;
    color: var(--accent);
}

.hud-badge.timer {
    background: #f0fdf4;
    color: #059669;
}

.hud-badge.timer.urgent {
    background: #fee2e2;
    color: #dc2626;
    animation: pulse-red 1s infinite;
}

@keyframes pulse-red {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .6;
    }
}

.hud-sep {
    width: 1px;
    height: 28px;
    background: var(--border);
    flex-shrink: 0;
}

.hud-progress-wrap {
    flex: 1;
    min-width: 120px;
}

.hud-progress-track {
    height: 8px;
    background: var(--primary-light);
    border-radius: 4px;
    overflow: hidden;
}

.hud-progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width .4s ease;
}

.hud-exit {
    margin-left: auto;
}

/* Main game layout */
.game-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    align-items: start;
}

/* Question Card */
.question-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.question-card-header {
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-light), #faf5ff);
    border-bottom: 1px solid rgba(99, 102, 241, .12);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.question-type-badge {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.question-num {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 700;
    margin-left: auto;
}

.question-card-canvas {
    padding: 20px;
    display: flex;
    justify-content: center;
}

.question-card-canvas canvas {
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    max-width: 100%;
}

/* Answer Panel */
.answer-panel {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.answer-panel-header {
    background: linear-gradient(135deg, var(--primary-light), #faf5ff);
    padding: 16px 22px;
    border-bottom: 1px solid rgba(99, 102, 241, .12);
}

.answer-panel-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary-dark);
}

.answer-panel-body {
    padding: 22px;
}

/* Multiple choice options */
.mc-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.mc-option {
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    color: var(--text);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.mc-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateX(4px);
}

.mc-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.mc-option.correct {
    border-color: var(--success);
    background: var(--success-light);
    color: #065f46;
}

.mc-option.wrong {
    border-color: var(--error);
    background: var(--error-light);
    color: #991b1b;
}

.mc-option-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    transition: var(--transition);
}

.mc-option.selected .mc-option-letter {
    background: var(--primary);
    color: white;
}

.mc-option.correct .mc-option-letter {
    background: var(--success);
    color: white;
}

.mc-option.wrong .mc-option-letter {
    background: var(--error);
    color: white;
}

/* Type-in answer input */
.answer-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.answer-index-input {
    flex: 1;
    min-width: 60px;
    padding: 14px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
    background: var(--bg-input);
    transition: var(--transition);
}

.answer-index-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--glow);
    background: white;
}

.answer-index-input.correct {
    border-color: var(--success);
    background: var(--success-light);
    color: #065f46;
}

.answer-index-input.wrong {
    border-color: var(--error);
    background: var(--error-light);
    color: #991b1b;
}

.answer-index-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* Action row */
.game-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.game-actions .btn {
    flex: 1;
    justify-content: center;
    min-width: 90px;
}

/* Feedback popup */
.game-feedback {
    margin-top: 16px;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    display: none;
    align-items: flex-start;
    gap: 14px;
    font-weight: 600;
    font-size: 14px;
}

.game-feedback.visible {
    display: flex;
    animation: pop .35s ease;
}

.game-feedback.correct {
    background: var(--success-light);
    border: 2px solid #6ee7b7;
    color: #065f46;
}

.game-feedback.wrong {
    background: var(--error-light);
    border: 2px solid #fca5a5;
    color: #991b1b;
}

.game-feedback-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.game-feedback-text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.xp-gain {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef3c7;
    color: #d97706;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 13px;
    margin-top: 6px;
}

/* ===== SCORE SCREEN (end of session) ===== */
.score-screen {
    text-align: center;
    padding: 40px 24px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: none;
    animation: fadeUp .5s ease;
}

.score-screen.visible {
    display: block;
}

.score-emoji {
    font-size: 72px;
    margin-bottom: 16px;
    animation: pop .6s ease;
}

.score-title {
    font-size: 32px;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 8px;
}

.score-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.score-stats-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.score-stat-box {
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    padding: 18px 24px;
    min-width: 110px;
    border: 1px solid rgba(99, 102, 241, .2);
}

.score-stat-val {
    font-size: 34px;
    font-weight: 900;
    color: var(--primary);
}

.score-stat-lbl {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-top: 4px;
}

.score-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== ACHIEVEMENT POPUP ===== */
.achievement-popup {
    position: fixed;
    top: 80px;
    right: 24px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
    padding: 16px 22px;
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 32px rgba(251, 191, 36, .5);
    display: none;
    align-items: center;
    gap: 14px;
    z-index: 3000;
    max-width: 320px;
    animation: achieveIn .5s cubic-bezier(.34, 1.56, .64, 1);
}

.achievement-popup.visible {
    display: flex;
}

@keyframes achieveIn {
    from {
        transform: translateX(120%) scale(.8);
        opacity: 0;
    }

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

.achievement-popup-icon {
    font-size: 36px;
}

.achievement-popup-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    opacity: .8;
}

.achievement-popup-name {
    font-size: 16px;
    font-weight: 900;
}

.achievement-popup-desc {
    font-size: 12px;
    opacity: .8;
}

/* Combo burst */
.combo-burst {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 56px;
    font-weight: 900;
    color: var(--accent);
    pointer-events: none;
    z-index: 4000;
    opacity: 0;
    text-shadow: 0 4px 20px rgba(168, 85, 247, .5);
}

.combo-burst.show {
    animation: comboPop .8s cubic-bezier(.34, 1.56, .64, 1) forwards;
}

@keyframes comboPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.5);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -60%) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -80%) scale(1);
    }
}

/* ===== PROGRESS PAGE GAME REDESIGN ===== */
.progress-game-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #6366f1 100%);
    border-radius: var(--radius-xl);
    padding: 36px 40px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(99, 102, 241, .3);
}

.progress-game-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 50%, rgba(168, 85, 247, .3) 0%, transparent 60%);
}

.progress-hero-row {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    position: relative;
}

.player-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    box-shadow: 0 6px 24px rgba(251, 191, 36, .4);
    flex-shrink: 0;
}

.player-info {
    flex: 1;
    min-width: 200px;
}

.player-name {
    font-size: 26px;
    font-weight: 900;
    color: white;
    margin-bottom: 4px;
}

.player-rank {
    font-size: 14px;
    color: rgba(255, 255, 255, .75);
    font-weight: 600;
    margin-bottom: 12px;
}

.player-xp-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-xp-track {
    flex: 1;
    max-width: 260px;
    height: 10px;
    background: rgba(255, 255, 255, .2);
    border-radius: 5px;
    overflow: hidden;
}

.player-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #34d399);
    border-radius: 5px;
    transition: width 1.2s ease;
}

.player-xp-label {
    color: rgba(255, 255, 255, .85);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.player-stats-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.player-chip {
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: var(--radius-full);
    padding: 6px 16px;
    color: white;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Mastery Rings */
.mastery-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.mastery-rings {
    display: flex;
    gap: 28px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 16px 0;
}

.mastery-ring-wrap {
    text-align: center;
}

.mastery-ring-svg {
    width: 100px;
    height: 100px;
    transform: rotate(-90deg);
}

.mastery-ring-track {
    fill: none;
    stroke: var(--primary-light);
    stroke-width: 8;
}

.mastery-ring-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s ease;
}

.mastery-ring-fill.planes {
    stroke: url(#ringGradPlanes);
}

.mastery-ring-fill.directions {
    stroke: url(#ringGradDirs);
}

.mastery-ring-fill.overall {
    stroke: url(#ringGradOverall);
}

.mastery-ring-label {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
}

.mastery-ring-pct {
    font-size: 22px;
    font-weight: 900;
    color: var(--primary);
    margin-top: 2px;
}

/* Achievement Grid */
.achievements-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.achievement-tile {
    border-radius: var(--radius-lg);
    padding: 18px 12px;
    text-align: center;
    border: 2px solid var(--border);
    transition: var(--transition);
    cursor: default;
    background: var(--bg-card);
    position: relative;
    overflow: hidden;
}

.achievement-tile.earned {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fffbeb, #fff);
}

.achievement-tile.earned::before {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 8px;
    color: #d97706;
    font-weight: 900;
    font-size: 12px;
}

.achievement-tile.locked {
    opacity: .45;
    filter: grayscale(.7);
}

.achievement-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.achievement-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.achievement-name {
    font-size: 12px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 3px;
}

.achievement-req {
    font-size: 11px;
    color: var(--text-muted);
}

/* Daily streak calendar */
.streak-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.streak-calendar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.streak-day {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.streak-day.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

.streak-day.inactive {
    background: var(--primary-light);
    color: var(--text-muted);
}

.streak-day.today {
    box-shadow: 0 0 0 2px var(--primary);
}

/* Topic mastery cards */
.topic-mastery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.topic-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 18px;
    transition: var(--transition);
}

.topic-card:hover {
    border-color: rgba(99, 102, 241, .3);
    box-shadow: var(--shadow-sm);
}

.topic-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.topic-card-icon {
    font-size: 22px;
}

.topic-card-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
}

.topic-card-pct {
    font-size: 13px;
    font-weight: 700;
    margin-left: auto;
}

.topic-card-pct.high {
    color: var(--success);
}

.topic-card-pct.mid {
    color: var(--warning);
}

.topic-card-pct.low {
    color: var(--error);
}

.topic-bar {
    height: 6px;
    background: var(--primary-light);
    border-radius: 3px;
    overflow: hidden;
}

.topic-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

.topic-bar-fill.high {
    background: linear-gradient(90deg, var(--success), #34d399);
}

.topic-bar-fill.mid {
    background: linear-gradient(90deg, var(--warning), #fbbf24);
}

.topic-bar-fill.low {
    background: linear-gradient(90deg, var(--error), #f87171);
}

/* ===== RESPONSIVE GAME LAYOUT ===== */
@media (max-width: 900px) {
    .game-layout {
        grid-template-columns: 1fr;
    }

    .answer-panel {
        order: -1;
    }
}

@media (max-width: 768px) {
    .lobby-title {
        font-size: 26px;
    }

    .lobby-hero {
        padding: 28px 18px;
    }

    .game-modes-grid {
        grid-template-columns: 1fr;
    }

    .game-hud {
        gap: 10px;
        padding: 10px 14px;
    }

    .score-stats-row {
        gap: 12px;
    }

    .score-stat-box {
        min-width: 85px;
        padding: 14px;
    }

    .score-stat-val {
        font-size: 26px;
    }

    .progress-hero-row {
        flex-direction: column;
        text-align: center;
    }

    .player-xp-bar-wrap {
        justify-content: center;
    }

    .mastery-rings {
        gap: 16px;
    }

    .achievement-popup {
        top: auto;
        bottom: 24px;
        right: 12px;
        left: 12px;
    }

    .achievement-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .game-actions .btn {
        font-size: 13px;
        padding: 10px 14px;
    }
}

/* =====================================================
   LEARNING HUB
   ===================================================== */

/* ---- Hub page wrapper ---- */
.hub-page {
    animation: fadeUp .35s ease;
}

.hub-sandbox {
    animation: fadeUp .35s ease;
}

/* ---- Hero ---- */
.hub-hero {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #6366f1 100%);
    border-radius: var(--radius-xl);
    padding: 52px 40px 44px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    color: white;
    box-shadow: 0 12px 40px rgba(99, 102, 241, .35);
}

.hub-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hub-hero-content {
    position: relative;
    z-index: 1;
    max-width: 680px;
}

.hub-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .18);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: var(--radius-full);
    padding: 5px 16px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 18px;
}

.hub-hero-title {
    font-size: 38px;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 14px;
}

.hub-hero-sub {
    font-size: 16px;
    opacity: .88;
    line-height: 1.65;
    margin-bottom: 24px;
}

.hub-progress-strip {
    height: 8px;
    background: rgba(255, 255, 255, .22);
    border-radius: var(--radius-full);
    overflow: hidden;
    max-width: 420px;
}

.hub-progress-fill {
    height: 100%;
    background: #10b981;
    border-radius: var(--radius-full);
    transition: width .6s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 0 12px rgba(16, 185, 129, .7);
}

.hub-progress-label {
    font-size: 13px;
    margin-top: 8px;
    opacity: .8;
}

/* ---- Track columns ---- */
.hub-tracks-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

@media (max-width: 760px) {
    .hub-tracks-wrap {
        grid-template-columns: 1fr;
    }
}

.hub-track {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.hub-track-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    font-weight: 800;
    font-size: 16px;
    color: white;
}

.hub-track-header.dir-track {
    background: linear-gradient(90deg, #4f46e5, #6366f1);
}

.hub-track-header.plane-track {
    background: linear-gradient(90deg, #059669, #10b981);
}

.hub-lessons-col {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---- Lesson Cards ---- */
.hub-lesson-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.hub-lesson-card:hover:not(.locked) {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.hub-lesson-card.locked {
    opacity: .55;
    cursor: not-allowed;
}

.hub-lesson-card.completed {
    background: #d1fae5;
    border-color: #10b981;
}

.hlc-level {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 800;
    font-size: 15px;
    flex-shrink: 0;
}

.hub-lesson-card.completed .hlc-level {
    background: #10b981;
}

.hub-lesson-card.locked .hlc-level {
    background: #94a3b8;
}

.hlc-body {
    flex: 1;
    min-width: 0;
}

.hlc-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--primary);
    margin-bottom: 2px;
}

.hub-lesson-card.completed .hlc-tag {
    color: #059669;
}

.hlc-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.hlc-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hlc-check {
    color: #10b981;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
}

.hlc-arrow {
    color: var(--primary);
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
    transition: var(--transition);
}

.hub-lesson-card:hover .hlc-arrow {
    transform: translateX(4px);
}

/* ---- Back button (shared) ---- */
.hub-back-btn,
.hub-lesson-topbar .hub-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.hub-back-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* ---- Lesson View ---- */
.hub-lesson-view {
    animation: fadeUp .35s ease;
}

.hub-lesson-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.hub-breadcrumb {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.lesson-xp-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border-radius: var(--radius-full);
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 800;
}

/* ---- Stepper ---- */
.lesson-stepper-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 18px 24px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.lesson-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    min-width: fit-content;
    margin: 0 auto;
    justify-content: center;
}

.ls-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    border: 2px solid transparent;
}

.ls-dot.ls-idle {
    background: var(--bg-input);
    border-color: var(--border);
    color: var(--text-muted);
}

.ls-dot.ls-active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .4);
    transform: scale(1.1);
}

.ls-dot.ls-done {
    background: #10b981;
    color: white;
}

.ls-dot:hover {
    transform: scale(1.15);
}

.ls-line {
    flex: 1;
    height: 3px;
    background: var(--border);
    min-width: 20px;
    max-width: 60px;
}

/* ---- Lesson layout ---- */
.lesson-layout {
    display: grid;
    grid-template-columns: 520px 1fr;
    gap: 28px;
    align-items: start;
}

@media (max-width: 1050px) {
    .lesson-layout {
        grid-template-columns: 1fr;
    }
}

/* ---- Lesson canvas ---- */
.lesson-canvas-wrap {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#lessonCanvas {
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #f8faff 0%, #eef2ff 100%);
    box-shadow: inset 0 2px 12px rgba(99, 102, 241, .06);
    max-width: 100%;
    display: block;
}

.lesson-axis-legend {
    display: flex;
    gap: 18px;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.lal-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.lesson-canvas-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    pointer-events: none;
}

/* ---- Lesson panel ---- */
.lesson-panel {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 420px;
}

.lesson-tag {
    display: inline-flex;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-full);
    padding: 3px 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
    width: fit-content;
}

.lesson-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3;
}

.lesson-explanation {
    font-size: 15px;
    line-height: 1.75;
    color: var(--text);
    flex: 1;
}

.lesson-explanation h3 {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--primary-dark);
}

.lesson-explanation p {
    margin-bottom: 10px;
}

.lesson-explanation ul,
.lesson-explanation ol {
    padding-left: 20px;
    margin-bottom: 10px;
}

.lesson-explanation li {
    margin-bottom: 6px;
}

.lesson-explanation code {
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 5px;
    padding: 1px 7px;
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

.lesson-explanation strong {
    color: var(--primary-dark);
}

/* Rule callout */
.lex-rule {
    background: linear-gradient(135deg, #eef2ff, #faf5ff);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 12px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    margin-top: 10px;
}

/* Lesson table */
.lex-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
}

.lex-table th,
.lex-table td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}

.lex-table th {
    background: var(--primary-light);
    font-weight: 800;
    color: var(--primary-dark);
}

.lex-table tr:nth-child(even) td {
    background: #f9fafb;
}

/* ---- Nav buttons ---- */
.lesson-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: auto;
}

.lesson-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: var(--transition);
}

.lesson-nav-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}

.lesson-nav-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, .45);
}

.lesson-nav-btn.secondary {
    background: var(--bg-card);
    color: var(--primary);
    border: 2px solid rgba(99, 102, 241, .3);
}

.lesson-nav-btn.secondary:hover {
    background: var(--primary-light);
}

.lesson-nav-btn.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, .35);
}

.lesson-nav-btn.success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, .45);
}

.lesson-nav-btn.hidden {
    display: none;
}

/* ---- Sandbox topbar ---- */
.sandbox-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 0;
}

/* ---- Shared utilities ---- */
.hidden {
    display: none !important;
}

/* =====================================================
   CRYSTALLOGRAPHIC CALCULATOR
   ===================================================== */

.hub-calc-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 36px 40px;
    margin-top: 32px;
    position: relative;
    overflow: hidden;
}

.hub-calc-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #a855f7, #10b981, #06b6d4);
}

.hub-calc-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

.hub-calc-icon {
    font-size: 42px;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, .3));
}

.hub-calc-title {
    font-size: 24px;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 4px;
    letter-spacing: -.5px;
}

.hub-calc-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ---- Tab bar ---- */
.hub-calc-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    background: var(--primary-light);
    padding: 6px;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(99, 102, 241, .15);
}

.hct-tab {
    flex: 1;
    min-width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    color: var(--text-muted);
}

.hct-tab span {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

.hct-tab small {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
}

.hct-tab:hover:not(.active) {
    background: rgba(99, 102, 241, .1);
    color: var(--primary);
}

.hct-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, .4);
}

.hct-tab.active span,
.hct-tab.active small {
    color: white;
}

/* ---- Tab content panes ---- */
.hct-content {
    display: none;
    animation: fadeUp .3s ease;
}

.hct-content.active {
    display: block;
}

/* ---- Formula box ---- */
.calc-formula-box {
    background: linear-gradient(135deg, #0f172a, #1e1b4b);
    border-radius: var(--radius-lg);
    padding: 20px 28px;
    margin-bottom: 24px;
    border: 1px solid rgba(99, 102, 241, .3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.cfb-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, .45);
    margin-bottom: 8px;
}

.cfb-math {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
    color: #a5b4fc;
    line-height: 1.6;
}

/* ---- Input section ---- */
.calc-inputs {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.calc-input-group {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    flex: 1;
    min-width: 240px;
}

.cig-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.cig-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cig-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cig-field label {
    font-size: 11px;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
}

.cig-field input {
    width: 72px;
    padding: 10px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    background: white;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    transition: var(--transition);
}

.cig-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--glow);
    transform: translateY(-1px);
}

/* ---- Calculate button ---- */
.calc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(99, 102, 241, .4);
    margin-bottom: 24px;
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, .5);
}

.calc-btn:active {
    transform: translateY(0);
}

/* ---- Result display ---- */
.calc-result {
    display: none;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, .2);
    animation: fadeUp .35s ease;
}

.calc-result.visible {
    display: block;
}

.calc-steps {
    background: #f8faff;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calc-step {
    font-size: 13px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    color: var(--text);
    padding: 8px 14px;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    line-height: 1.5;
}

.calc-answer {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    padding: 18px 28px;
    font-size: 22px;
    font-weight: 900;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -.5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15);
}

.calc-unit {
    font-size: 14px;
    font-weight: 600;
    opacity: .8;
    background: rgba(255, 255, 255, .18);
    border-radius: var(--radius-full);
    padding: 2px 10px;
}

.calc-error {
    background: var(--error-light);
    color: var(--error);
    border: 1px solid var(--error);
    border-radius: var(--radius-lg);
    padding: 12px 18px;
    font-weight: 700;
    font-size: 14px;
}

/* ---- Hub hero enhancements ---- */
.hub-hero {
    background: linear-gradient(135deg, #3730a3 0%, #6d28d9 45%, #4f46e5 75%, #0891b2 100%);
}

.hub-hero-badge {
    background: rgba(255, 255, 255, .2);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, .3);
    font-size: 13px;
    letter-spacing: .3px;
}

.hub-hero-title {
    font-size: 42px;
    line-height: 1.1;
}

/* ---- Lesson card hover glow ---- */
.hub-lesson-card:not(.locked):hover {
    box-shadow: 0 4px 20px rgba(99, 102, 241, .2);
}

.hub-lesson-card.completed:hover {
    box-shadow: 0 4px 20px rgba(16, 185, 129, .25);
}

/* ---- Stepper dots glow ---- */
.ls-dot.ls-active {
    box-shadow: 0 0 0 6px rgba(99, 102, 241, .18), 0 4px 12px rgba(99, 102, 241, .4);
}

.ls-dot.ls-done {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .15);
}

/* ---- Responsive calculator ---- */
@media (max-width: 680px) {
    .hub-calc-section {
        padding: 24px 20px;
    }

    .hub-calc-title {
        font-size: 20px;
    }

    .hub-calc-tabs {
        gap: 4px;
    }

    .hct-tab {
        min-width: 80px;
        padding: 8px 10px;
    }

    .hct-tab span {
        font-size: 13px;
    }

    .calc-inputs {
        flex-direction: column;
    }

    .calc-answer {
        font-size: 17px;
    }

    .cfb-math {
        font-size: 13px;
    }
}

@media (max-width: 680px) {
    .hub-calc-section {
        padding: 24px 20px;
        margin-top: 20px;
    }

    .hub-calc-title {
        font-size: 20px;
    }

    .hub-calc-tabs {
        gap: 4px;
    }

    .hct-tab {
        min-width: 80px;
        padding: 8px 10px;
    }

    .hct-tab span {
        font-size: 13px;
    }

    .calc-inputs {
        flex-direction: column;
    }

    .calc-answer {
        font-size: 17px;
        padding: 14px 20px;
    }

    .cfb-math {
        font-size: 13px;
    }

    .cig-row {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        justify-content: space-between;
    }

    .cig-field input {
        width: 100%;
        min-width: 0;
    }
}

/* =====================================================
   GLOBAL MOBILE RESPONSIVENESS OVERRIDES
   ===================================================== */
@media (max-width: 768px) {

    /* Main Layout */
    .main-wrapper {
        padding: 16px 12px 80px 12px;
    }

    /* Footer */
    .footer-inner {
        flex-direction: column;
        text-align: center;
        justify-content: center;
        gap: 8px;
        padding: 16px 12px;
    }

    .footer-brand {
        flex-direction: column;
        gap: 4px;
    }

    .footer-separator {
        display: none;
    }

    /* Learning Hub Hero */
    .hub-hero {
        padding: 32px 20px;
        border-radius: var(--radius-xl);
        margin-bottom: 24px;
    }

    .hub-hero-title {
        font-size: 28px;
        line-height: 1.2;
    }

    .hub-hero-sub {
        font-size: 14px;
        margin-bottom: 20px;
    }

    /* Tracks Wrapper */
    .hub-tracks-wrap {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .hub-track-header {
        padding: 14px 18px;
        font-size: 15px;
    }

    .hub-lessons-col {
        padding: 12px;
    }

    .hub-lesson-card {
        padding: 12px 14px;
        gap: 10px;
    }

    .hlc-title {
        font-size: 14px;
    }

    .hlc-desc {
        font-size: 12px;
    }

    /* Lesson View */
    .hub-lesson-view {
        padding: 16px;
        border-radius: var(--radius-xl);
        margin-top: 10px;
    }

    .hub-lesson-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .hlv-canvas-area {
        min-height: 280px;
        padding: 10px;
    }

    #lessonCanvas {
        max-width: 100%;
        height: auto;
    }

    .hlv-panel {
        padding: 0;
        border: none;
    }

    /* Stepper */
    .lesson-stepper {
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 20px;
    }

    .ls-line {
        display: none;
        /* hide lines on mobile for wrapping */
    }

    .ls-dot {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    /* Typography inside lessons */
    .lex-content h3 {
        font-size: 18px;
    }

    .lex-content p {
        font-size: 14px;
    }

    /* Buttons */
    .hlv-nav-btns {
        flex-direction: column;
        gap: 10px;
        margin-top: 24px;
    }

    .hlv-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {

    /* Extreme small devices */
    .hub-hero-title {
        font-size: 24px;
    }

    .calc-btn {
        width: 100%;
        justify-content: center;
    }

    .hct-tab {
        min-width: 45%;
    }
}

/* ==================== ABOUT PAGE & GLOBAL FOOTER ==================== */
#page-about {
    padding-top: 50px;
    /* Accounts for navbar */
}

/* About Hero Section */
.about-hero {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px 60px;
    position: relative;
    overflow: hidden;
}

.about-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 100%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.about-hero-content {
    max-width: 800px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.about-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(168, 85, 247, 0.1) 100%);
    color: var(--primary-dark);
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 24px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.about-badge-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.about-hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    color: var(--text);
}

.about-gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
    font-weight: 400;
}

.about-hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 48px;
    padding-top: 48px;
    border-top: 1px solid var(--border);
}

.about-stat {
    text-align: center;
}

.about-stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 8px;
}

.about-stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* About Main Content */
.about-main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 120px;
}

/* Features Grid */
.about-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
    margin-bottom: 80px;
}

.about-feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.about-feature-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.about-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    border-color: rgba(99, 102, 241, 0.3);
}

.about-feature-card:hover::before {
    transform: scaleX(1);
}

.about-feature-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(168, 85, 247, 0.1) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--primary);
    transition: var(--transition);
}

.about-feature-card:hover .about-feature-icon {
    transform: scale(1.1) rotate(5deg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.about-feature-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 2;
}

.about-feature-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text);
    letter-spacing: -0.02em;
}

.about-feature-description {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
}

.about-feature-list {
    list-style: none;
    margin-top: 24px;
    padding: 0;
}

.about-feature-list li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.about-feature-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--success-light);
}

/* Philosophy Section */
.about-philosophy-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: var(--radius-xl);
    padding: 80px 60px;
    margin-bottom: 80px;
    position: relative;
    overflow: hidden;
    color: white;
    text-align: center;
}

.about-philosophy-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg fill=\"none\" fill-rule=\"evenodd\"%3E%3Cg fill=\"%23ffffff\" fill-opacity=\"0.05\"%3E%3Cpath d=\"M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z\"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.about-philosophy-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.about-philosophy-label {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.9;
    margin-bottom: 16px;
}

.about-philosophy-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 24px;
    line-height: 1.2;
}

.about-philosophy-text {
    font-size: 1.125rem;
    line-height: 1.8;
    opacity: 0.95;
    font-weight: 400;
}

/* Team Section */
.about-team-section {
    text-align: center;
    margin-bottom: 80px;
}

.about-section-header {
    margin-bottom: 48px;
}

.about-section-label {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.about-section-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.about-team-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.about-team-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
}

.about-team-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: white;
    font-weight: 900;
    font-size: 1.5rem;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.about-team-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}

.about-team-role {
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 16px;
}

.about-team-bio {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

.about-team-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-light);
    color: var(--primary-dark);
    text-decoration: none;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
}

.about-team-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* CTA Section */
.about-cta-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 60px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.about-cta-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
}

.about-cta-text {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: 32px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.about-cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}


/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .about-hero {
        min-height: auto;
        padding: 40px 24px 60px;
    }

    .about-hero-stats {
        flex-direction: column;
        gap: 24px;
    }

    .about-features-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .about-feature-card {
        padding: 32px;
    }

    .about-philosophy-section {
        padding: 48px 32px;
    }

    .about-philosophy-title {
        font-size: 1.75rem;
    }

    .about-team-card {
        padding: 32px;
    }

    .about-cta-section {
        padding: 40px 24px;
    }

    .about-cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .about-cta-buttons .btn {
        width: 100%;
        justify-content: center;
    }


}

/* Animations for About Page */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.animate-in {
    animation: fadeInUp 0.8s ease-out forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}
/* ===== PREMIUM GLOBAL FOOTER ===== */
.premium-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    margin-top: 80px;
    padding-top: 60px;
    font-family: inherit;
}

.footer-top {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px 60px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 48px;
}

.footer-brand-section {
    max-width: 340px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 20px;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.footer-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.footer-logo-icon svg {
    width: 20px;
    height: 20px;
}

.footer-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 24px;
}

.footer-socials {
    display: flex;
    gap: 16px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.social-link svg {
    width: 18px;
    height: 18px;
}

.footer-links-group {
    display: flex;
    gap: 64px;
    flex-wrap: wrap;
}

.footer-col {
    min-width: 120px;
}

.footer-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-block;
}

.footer-links a:hover {
    color: var(--primary);
    transform: translateX(3px);
}

.footer-bottom {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 24px 0;
}

.footer-bottom-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
    font-weight: 500;
}

.footer-legal {
    display: flex;
    gap: 24px;
}

.footer-legal a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
    font-weight: 500;
}

.footer-legal a:hover {
    color: var(--text);
}

@media (max-width: 768px) {
    .footer-top {
        flex-direction: column;
        gap: 40px;
        padding-bottom: 40px;
    }
    
    .footer-links-group {
        width: 100%;
        justify-content: flex-start;
        gap: 48px;
    }
    
    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
}

