/* ==========================================================================
   Hour Power: Rate Explorer — Main Stylesheet
   Design Aesthetic: Modern Dark Theme with Glassmorphic Elements, Neon Accents,
   and Responsive Micro-Animations designed for Kids & Parents.
   ========================================================================== */

:root {
    --bg-dark: #0b0f17;
    --bg-gradient: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0f172a 60%, #090d16 100%);
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.12);
    --card-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);

    --primary-cyan: #38bdf8;
    --primary-purple: #a855f7;
    --accent-amber: #fbbf24;
    --accent-emerald: #34d399;
    --accent-rose: #fb7185;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

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

body {
    font-family: var(--font-heading);
    background: var(--bg-dark);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ── Typography & Links ─────────────────────────────────────────────────── */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

a {
    color: var(--primary-cyan);
    text-decoration: none;
    transition: all 0.2s ease;
}

/* ── Glassmorphism Utility ──────────────────────────────────────────────── */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 24px;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 15, 23, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 24px;
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.back-home-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.back-home-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.logo-title {
    display: flex;
    flex-direction: column;
}

.logo-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-cyan);
}

.logo-title h1 {
    font-size: 1.5rem;
    line-height: 1.1;
    background: linear-gradient(135deg, #38bdf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 14px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
}

.star-icon { color: var(--accent-amber); }
.streak-icon { color: #f97316; }

.icon-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: transform 0.2s ease, background 0.2s ease;
}
.icon-btn:hover {
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.15);
}

/* ── Main Layout ────────────────────────────────────────────────────────── */
.main-container {
    max-width: 1000px;
    margin: 24px auto 60px;
    padding: 0 20px;
}

/* ── Tab Navigation ─────────────────────────────────────────────────────── */
.nav-tabs {
    display: flex;
    gap: 8px;
    background: rgba(15, 23, 42, 0.6);
    padding: 6px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(168, 85, 247, 0.2));
    color: #ffffff;
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}

/* ── Views Switcher ─────────────────────────────────────────────────────── */
.app-view {
    display: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.app-view.active-view {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ── Mode Selection Dashboard (Level Selector) ──────────────────────────── */
.hero-banner {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-img {
    width: 220px;
    height: 124px;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-text h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.level-card {
    position: relative;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.level-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-cyan);
    box-shadow: 0 12px 28px rgba(56, 189, 248, 0.2);
    background: rgba(30, 41, 59, 0.8);
}

.level-recommended {
    border-color: var(--primary-purple);
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.12) 0%, rgba(30, 41, 59, 0.6) 100%);
}

.recom-tag {
    position: absolute;
    top: -12px;
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-cyan));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.level-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}
.level-1-badge { background: rgba(52, 211, 153, 0.2); color: var(--accent-emerald); }
.level-2-badge { background: rgba(58, 189, 248, 0.2); color: var(--primary-cyan); }
.level-3-badge { background: rgba(251, 113, 133, 0.2); color: var(--accent-rose); }

.level-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.level-card h3 {
    font-size: 1.35rem;
    margin-bottom: 8px;
}

.level-desc {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 16px;
    flex-grow: 1;
}

.level-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-amber);
    background: rgba(251, 191, 36, 0.1);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

/* ── Shift Gameplay View ────────────────────────────────────────────────── */
.gameplay-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.shift-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.shift-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.level-title-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
}

.progress-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    width: 220px;
}

.progress-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.progress-bar-track {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-purple));
    border-radius: 999px;
    transition: width 0.4s ease;
}

/* Problem Card */
.problem-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 28px;
}

.scenario-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.scenario-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
}

.category-pill {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--primary-cyan);
    letter-spacing: 0.05em;
}

.problem-text-box {
    background: rgba(15, 23, 42, 0.5);
    border-left: 4px solid var(--primary-cyan);
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
    line-height: 1.6;
}

/* Visual Rate Timeline Bar */
.visual-rate-container {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.visual-rate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-cyan);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
}

.visual-blocks-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 4px 12px;
}

.hour-block {
    flex: 1;
    min-width: 110px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.hour-block-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-amber);
    background: rgba(251, 191, 36, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.hour-block-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    min-height: 48px;
    align-items: center;
}

.item-icon {
    font-size: 1.3rem;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.visual-summary-bar {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-cyan);
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.visual-summary-bar.answered {
    color: var(--accent-emerald);
    background: rgba(52, 211, 153, 0.15);
    border-color: rgba(52, 211, 153, 0.3);
}

/* Answers Options Grid */
.answer-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.answer-prompt {
    font-weight: 600;
    color: var(--text-secondary);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.option-btn {
    background: rgba(30, 41, 59, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    padding: 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.option-btn:hover {
    border-color: var(--primary-cyan);
    background: rgba(56, 189, 248, 0.15);
    transform: translateY(-2px);
}

.option-btn.correct-choice {
    background: rgba(52, 211, 153, 0.25) !important;
    border-color: var(--accent-emerald) !important;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.4);
}

.option-btn.wrong-choice {
    background: rgba(251, 113, 133, 0.2) !important;
    border-color: var(--accent-rose) !important;
    opacity: 0.6;
}

/* Helper Buttons */
.helper-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn {
    font-family: var(--font-heading);
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-purple));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-hint {
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--accent-amber);
}
.btn-hint:hover {
    background: rgba(251, 191, 36, 0.25);
}

.btn-explain {
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: var(--primary-purple);
}
.btn-explain:hover {
    background: rgba(168, 85, 247, 0.25);
}

.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.1rem; }

.hint-card {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-top: 8px;
    font-size: 0.95rem;
    color: #fef08a;
    animation: fadeIn 0.3s ease;
}

/* ── Rate Lab Sandbox ───────────────────────────────────────────────────── */
.sandbox-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sandbox-header h2 {
    font-size: 1.8rem;
    margin-bottom: 6px;
}
.sandbox-header p {
    color: var(--text-secondary);
}

.sandbox-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    background: rgba(15, 23, 42, 0.5);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.highlight-val {
    color: var(--primary-cyan);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
}

.form-select, .form-slider {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 1rem;
    outline: none;
}

.sandbox-action {
    display: flex;
    justify-content: center;
}

.sim-clock-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.clock-icon-lg { font-size: 2rem; }

.sandbox-equation-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.eq-part {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.eq-num {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-cyan);
}

.eq-part-total .eq-num {
    color: var(--accent-emerald);
    font-size: 2.4rem;
}

.eq-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.eq-op {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    color: var(--primary-purple);
}

/* ── Badges Grid ────────────────────────────────────────────────────────── */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.badge-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.badge-card.unlocked {
    border-color: var(--accent-amber);
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.1) 0%, rgba(30, 41, 59, 0.6) 100%);
}

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

.badge-icon {
    font-size: 2.5rem;
}

.badge-title {
    font-size: 1.1rem;
    font-weight: 700;
}

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

/* ── Guide View ─────────────────────────────────────────────────────────── */
.guide-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 20px;
}

.guide-section h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--primary-cyan);
}

.guide-illustration {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: var(--font-mono);
}

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

.g-hour { color: var(--accent-amber); width: 80px; font-weight: 700; }
.g-items { color: var(--text-primary); }

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

.trick-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trick-card h4 { color: var(--accent-emerald); font-size: 1.05rem; }

.code-box {
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    color: var(--primary-cyan);
    font-size: 0.9rem;
    text-align: center;
}

.example-box {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ── Modals & Dialogs ───────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11, 15, 23, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}

.modal-card {
    max-width: 540px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;

    /* Prevent text cutoff */
    word-break: break-word;
    overflow-wrap: break-word;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}
.close-btn:hover { color: var(--text-primary); }

.solution-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.step-card {
    background: rgba(15, 23, 42, 0.5);
    border-left: 3px solid var(--primary-purple);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    line-height: 1.5;
}

.celebration-card {
    text-align: center;
    align-items: center;
}

.celebration-badge {
    font-family: var(--font-mono);
    color: var(--accent-amber);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

.stars-earned-row {
    display: flex;
    gap: 12px;
    font-size: 3rem;
    margin: 10px 0;
}

.star-pop {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.badge-unlocked-text {
    color: var(--accent-amber);
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 8px;
}

.celebration-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
}

/* ── Confetti Canvas ────────────────────────────────────────────────────── */
#confettiCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1001;
}

/* ── Utility Classes ────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Animations ─────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.animate-spin-slow {
    animation: spin 12s linear infinite;
}

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

/* ── Responsive Mobile Rules ────────────────────────────────────────────── */
@media (max-width: 640px) {
    .header-container { flex-direction: column; gap: 12px; }
    .hero-banner { flex-direction: column; text-align: center; }
    .hero-img { width: 100%; height: auto; }
    .nav-tabs { flex-wrap: wrap; }
    .tab-btn { min-width: 45%; }
    .shift-header { flex-direction: column; gap: 12px; align-items: stretch; }
    .progress-section { width: 100%; align-items: stretch; }
    .options-grid { grid-template-columns: 1fr; }
    .helper-actions { flex-direction: column; }
    .sandbox-controls { grid-template-columns: 1fr; }
    .sandbox-equation-card { flex-direction: column; gap: 8px; }
}
