* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden; /* KILL page scroll */
}

:root {
    --primary: #00d4ff;
    --secondary: #1a1a3d;
    --accent: #ff007a;
    --success: #00ff88;
    --warning: #ffaa00;
    --danger: #ff4444;
    --bg: #0a0a0f;
    --surface: #1a1a2e;
    --text: #ffffff;
    --text-dim: #a0a0a0;
    --border: #333;
    --glow: 0 0 20px;
}

/* Persistent Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 72px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    width: 100%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    height: 32px;
    width: auto;
    opacity: 0.6;
    filter: grayscale(100%) brightness(1.2);
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.app-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Persistent Footer */
.app-footer {
    height: 180px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    padding: 1.5rem 0 1rem;
}

.app-footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1rem;
}

.app-footer .footer-section {
    flex: 1;
    min-width: 200px;
}

.app-footer .footer-section h4 {
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 0.5rem;
    color: white;
    font-size: 0.9rem;
}

.app-footer .footer-section p {
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
    opacity: 0.9;
}

.system-info {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-footer .footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.app-footer .footer-links li {
    margin-bottom: 0.5rem;
}

.app-footer .footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

.app-footer .footer-link:hover {
    color: white;
    text-decoration: underline;
}

.app-footer .cta-button {
    display: inline-block;
    background-color: var(--accent);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.app-footer .cta-button:hover {
    background-color: #e6006e;
    transform: translateY(-2px);
}

.app-footer .footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.app-footer .footer-social a {
    color: white;
    margin-left: 1rem;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.app-footer .footer-social a:hover {
    color: var(--accent);
}

.app-footer .newsletter-form .form-group {
    display: flex;
}

.app-footer .newsletter-form input {
    flex-grow: 1;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px 0 0 4px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.app-footer .newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.app-footer .newsletter-button {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.app-footer .newsletter-button:hover {
    background-color: #e6006e;
}

/* View System */
.app-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.app-view.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Landing Section as Full View */
#landing-section {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

/* Main Content View */
.main-content {
    padding: 2rem;
    min-height: 100%;
}

/* Background Animation */
.bg-animation {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 0, 122, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 80%, rgba(0, 255, 136, 0.1) 0%, transparent 50%);
    animation: bgShift 20s ease-in-out infinite;
}

.view-container > * {
    position: relative;
    z-index: 1;
}

@keyframes bgShift {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(2deg); }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .app-footer {
        height: auto;
        min-height: 220px;
    }
    
    .app-footer .footer-content {
        flex-direction: column;
    }
    
    .app-footer .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .app-footer .footer-social {
        margin-top: 1rem;
    }
    
    .app-header {
        padding: 0 1rem;
    }
    
    .app-title {
        font-size: 1.2rem;
    }
    
    .brand-logo {
        height: 30px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .cube { animation: none !important; }
    .bg-animation { animation: none !important; }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.accessibility-controls {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 2000;
}

.accessibility-controls button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    width: 40px;
    height: 40px;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden; /* STOP page scrolling */
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    display: flex;
    flex-direction: column;
    background: #05080d;
}

/* App Shell Layout */
#app-shell {
    flex: 1;
    position: relative;
    overflow: hidden; /* IMPORTANT */
}

/* View System */
.app-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.app-view.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Landing Section as Full View */
#landing-section {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

/* Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card:hover, .card:focus {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--glow) rgba(0, 212, 255, 0.3);
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.card-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.card-desc {
    color: var(--text-dim);
    line-height: 1.6;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin: 2rem 0;
}

.content-text h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.content-text p {
    line-height: 1.8;
    color: var(--text-dim);
}

/* pH Scale */
.ph-scale {
    margin-top: 2rem;
}

.ph-bar {
    background: linear-gradient(90deg, #ff4444 0%, #ffaa00 50%, #00ff88 100%);
    height: 20px;
    border-radius: 10px;
    position: relative;
}

.ph-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Key Concept */
.key-concept {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 10px;
    border-left: 4px solid var(--primary);
}

.key-concept strong {
    color: var(--primary);
}

/* Microbe Legend */
.microbe-legend {
    margin-top: 2rem;
}

.legend-item {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.legend-color.harmful { background: var(--danger); }
.legend-color.biofilm { background: var(--warning); }
.legend-color.clean { background: var(--success); }

/* 3D Cube */
.cube-container {
    perspective: 1000px;
    display: flex;
    justify-content: center;
    z-index: 5;
    position: relative;
}

.scene-3d {
    grid-column: 2;
    width: 100%;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    position: relative;
}

@media (max-width: 767px) {
    .scene-3d {
        grid-column: 1;
        order: -1;
        height: 200px;
    }
}

.cube {
    width: 120px;
    height: 120px;
    position: relative;
    transform-style: preserve-3d;
    animation: cubeRotate 10s linear infinite;
    cursor: grab;
    border-radius: 10px;
}

@media (min-width: 768px) {
    .cube {
        width: 200px;
        height: 200px;
    }
}

.cube:active {
    cursor: grabbing;
}

.cube:focus {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

@keyframes cubeRotate {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

.cube-face {
    position: absolute;
    width: 120px;
    height: 120px;
    background: rgba(0, 212, 255, 0.1);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    border-radius: 10px;
}

.cube-face.front { transform: rotateY(0deg) translateZ(60px); }
.cube-face.back { transform: rotateY(180deg) translateZ(60px); }
.cube-face.right { transform: rotateY(90deg) translateZ(60px); }
.cube-face.left { transform: rotateY(-90deg) translateZ(60px); }
.cube-face.top { transform: rotateX(90deg) translateZ(60px); }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(60px); }

@media (min-width: 768px) {
    .cube-face {
        width: 200px;
        height: 200px;
        font-size: 1.2rem;
    }
    
    .cube-face.front { transform: rotateY(0deg) translateZ(100px); }
    .cube-face.back { transform: rotateY(180deg) translateZ(100px); }
    .cube-face.right { transform: rotateY(90deg) translateZ(100px); }
    .cube-face.left { transform: rotateY(-90deg) translateZ(100px); }
    .cube-face.top { transform: rotateX(90deg) translateZ(100px); }
    .cube-face.bottom { transform: rotateX(-90deg) translateZ(100px); }
}

/* Quiz */
.quiz-container {
    background: rgba(0, 212, 255, 0.05);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid var(--primary);
}

.quiz-question {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.quiz-progress {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
}

.quiz-options {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.quiz-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quiz-option:hover, .quiz-option:focus-within {
    border-color: var(--primary);
    background: rgba(0, 212, 255, 0.1);
}

.quiz-option.selected {
    border-color: var(--primary);
    background: rgba(0, 212, 255, 0.2);
}

.quiz-option.correct {
    border-color: var(--success);
    background: rgba(0, 255, 136, 0.2);
}

.quiz-option.incorrect {
    border-color: var(--danger);
    background: rgba(255, 68, 68, 0.2);
}

.quiz-submit {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-submit:hover:not(:disabled), .quiz-submit:focus:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.quiz-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quiz-explanation {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-style: italic;
}

.quiz-explanation.correct {
    background: rgba(0, 255, 136, 0.1);
    border-left: 4px solid var(--success);
    color: var(--success);
}

.quiz-explanation.incorrect {
    background: rgba(255, 68, 68, 0.1);
    border-left: 4px solid var(--danger);
    color: var(--danger);
}

/* Completion */
.completion-content {
    text-align: center;
}

.trophy-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 2rem;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--surface);
    border: 1px solid var(--primary);
    border-radius: 10px;
    padding: 1rem 2rem;
    z-index: 4000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.notification.success { border-color: var(--success); }
.notification.warning { border-color: var(--warning); }
.notification.error { border-color: var(--danger); }

/* Mobile Responsive */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .progress-container {
        position: relative;
        top: auto;
        right: auto;
        margin: 2rem auto;
        width: 100%;
        max-width: 300px;
    }
    
    .section {
        margin: 0 1rem 2rem;
        padding: 2rem 1rem;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary: #00ffff;
        --accent: #ff00ff;
        --success: #00ff00;
        --warning: #ffff00;
        --danger: #ff0000;
        --bg: #000000;
        --surface: #111111;
        --text: #ffffff;
        --border: #ffffff;
    }
}
/* Level Selection */
.level-select {
    margin: 2rem 0;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.level-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 2rem;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    position: relative;
}

.level-card.active {
    border-color: var(--primary);
    background: rgba(0, 212, 255, 0.1);
}

.level-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #666;
}

.level-card:not(.locked):hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--glow) rgba(0, 212, 255, 0.3);
}

.level-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.level-card.locked .level-icon {
    color: #666;
}

.level-card h3 {
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 1rem;
    color: var(--text);
}

.level-card.locked h3 {
    color: #666;
}

.level-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.level-status.unlocked {
    background: var(--success);
    color: white;
}

.level-status.locked {
    background: #666;
    color: white;
}

.level-status.completed {
    background: var(--primary);
    color: white;
}

/* Concept Cards Container */
.concept-cards-container {
    position: relative;
    height: auto;
    min-height: 80vh;
    overflow: visible;
    margin: 2rem 0;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
}

.concept-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    padding: 3rem 2rem;
    padding-bottom: 80px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s ease;
    z-index: 10;
}

.concept-card.active {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 767px) {
    .concept-card {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.concept-card.active {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 767px) {
    .concept-card {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary);
}

.card-header i {
    font-size: 2rem;
    color: var(--primary);
}

.card-header h4 {
    font-family: 'Orbitron', sans-serif;
    color: var(--text);
    font-size: 1.5rem;
}

.card-content {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 767px) {
    .scene-3d {
        order: -1;
        height: 200px;
    }
}

.card-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    color: var(--text-dim);
}

.card-next-button {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 25px;
    padding: 1rem 2rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: center;
    margin-top: auto;
    margin-bottom: 2rem;
    position: relative;
    bottom: 0;
}

.card-next-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

/* Level Complete Modal */
.level-complete-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.level-complete-content {
    background: var(--surface);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    border: 2px solid var(--primary);
    max-width: 500px;
    width: 90%;
}

.level-complete-content .trophy-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 2rem;
}

.level-complete-content h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    margin-bottom: 1rem;
}

.level-complete-content p {
    color: var(--text-dim);
    margin-bottom: 2rem;
}

.continue-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 25px;
    padding: 1rem 2rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

/* Hidden utility */
.hidden {
    display: none !important;
}
/* Shake Animation */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Hint Box */
.hint-box {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    color: var(--danger);
    font-style: italic;
    animation: slideDown 0.3s ease;
}

/* Mini Confetti */
.confetti-container {
    position: relative;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--success);
    animation: confetti-fall 1s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100px) rotate(360deg);
        opacity: 0;
    }
}

/* Trophy Status */
.level-status.mastery {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #b8860b;
}

.level-status.competent {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #666;
}

.level-status.bronze {
    background: linear-gradient(135deg, #cd7f32, #daa520);
    color: #8b4513;
}
/* Interactive pH Slider */
.ph-interactive-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    margin: 2rem 0;
}

.ph-slider-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ph-slider-container label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    color: var(--primary);
}

.ph-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #ff4444 0%, #ffaa00 50%, #00ff88 100%);
    outline: none;
    cursor: pointer;
}

.ph-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text);
    border: 2px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.ph-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text);
    border: 2px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.ph-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.interactive-ph-cube {
    transition: all 0.3s ease;
}

.interactive-ph-cube.acidic {
    border-color: #ff4444;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
}

.interactive-ph-cube.neutral {
    border-color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.interactive-ph-cube.alkaline {
    border-color: #4ecdc4;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.5);
}

.ph-feedback {
    grid-column: 1 / -1;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid var(--primary);
    margin-top: 1rem;
}

.ph-feedback.success {
    background: rgba(0, 255, 136, 0.1);
    border-left-color: var(--success);
    color: var(--success);
}

.card-next-button.locked {
    background: #666;
    color: #999;
    cursor: not-allowed;
    border-color: #666;
}

@media (max-width: 768px) {
    .ph-interactive-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
/* Remedial Card Styles */
.remedial-card {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(20, 20, 40, 0.95));
    border-left: 4px solid #f7b731;
    border-radius: 12px;
    padding: 2rem;
    margin: 1rem 0;
    animation: slideUpFromBottom 0.5s ease-out;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.remedial-card .card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    color: #f7b731;
}

.remedial-card .card-content {
    text-align: center;
    margin-bottom: 2rem;
}

.remedial-explanation {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #e0e0e0;
    margin-bottom: 1.5rem;
}

.learning-visual {
    margin: 1.5rem 0;
}

.review-retry-btn {
    background: linear-gradient(135deg, #f7b731, #f39c12);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 1.1rem;
}

.review-retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(247, 183, 49, 0.3);
}

@keyframes slideUpFromBottom {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
/* Temperature Toggle Styles */
.temp-control-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 120px;
    height: 40px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    border-radius: 20px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.toggle-switch input:checked + .slider {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
}

.growth-graph {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.temp-feedback {
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(255, 107, 107, 0.1);
    border-left: 4px solid #ff6b6b;
    transition: all 0.3s ease;
}

.temp-feedback.success {
    background: rgba(78, 205, 196, 0.1);
    border-left-color: #4ecdc4;
}

/* Sinner's Circle Styles */
.sinners-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    position: relative;
    margin: 2rem auto;
    overflow: hidden;
    border: 3px solid #333;
}

.circle-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}

.circle-segment.time {
    top: 0;
    left: 0;
    background: #ff6b6b;
    border-radius: 100% 0 0 0;
}

.circle-segment.action {
    top: 0;
    right: 0;
    background: #4ecdc4;
    border-radius: 0 100% 0 0;
}

.circle-segment.chemical {
    bottom: 0;
    right: 0;
    background: #45b7d1;
    border-radius: 0 0 100% 0;
}

.circle-segment.temperature {
    bottom: 0;
    left: 0;
    background: #f7b731;
    border-radius: 0 0 0 100%;
}

.circle-explanation {
    font-size: 0.9rem;
    color: #888;
    text-align: center;
    margin-top: 1rem;
}
/* Data Bank Button Positioning */
.data-bank-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2001 !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.data-bank-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.3);
}

/* Glossary Panel */
.glossary-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 3000;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.glossary-panel.active {
    transform: translateX(0);
}

.glossary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.glossary-header h3 {
    color: #6c5ce7;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.glossary-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.glossary-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.glossary-search {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.glossary-search input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
}

.glossary-search input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Glossary Content */
.glossary-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    max-height: calc(100vh - 200px);
}

.glossary-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.glossary-item:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--primary);
    transform: translateX(5px);
}

.glossary-item h4 {
    color: #4ecdc4;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.copy-icon {
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 0.9rem;
    color: var(--primary);
}

.glossary-item:hover .copy-icon {
    opacity: 1;
}

.glossary-item p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.5;
}

.no-results {
    text-align: center;
    color: var(--text-dim);
    font-style: italic;
    padding: 2rem;
}

/* Mobile Improvements */
@media (max-width: 768px) {
    .glossary-panel {
        width: 100vw;
        right: -100vw;
    }
    
    .card-next-button {
        padding-bottom: calc(0.8rem + env(safe-area-inset-bottom));
        margin-bottom: env(safe-area-inset-bottom);
    }
}


/* Biofilm Animation */
.hook-question {
    font-size: 1.2rem;
    color: #ff6b6b;
    font-weight: 600;
    margin-bottom: 1rem;
}

.mystery-visual {
    text-align: center;
    margin: 2rem 0;
}

.multimedia-container {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.biofilm-animation {
    position: relative;
    width: 300px;
    height: 150px;
    margin: 0 auto;
    border: 2px solid #4ecdc4;
    border-radius: 8px;
    overflow: hidden;
}

.surface-layer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 20px;
    background: #666;
}

.bacteria-layer {
    position: absolute;
    bottom: 20px;
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.bacterium {
    width: 20px;
    height: 20px;
    background: #ff6b6b;
    border-radius: 50%;
    animation: bacteriaGrow 3s ease-in-out infinite;
}

.matrix-layer {
    position: absolute;
    bottom: 20px;
    width: 100%;
    height: 60px;
    background: linear-gradient(to top, rgba(78, 205, 196, 0.3), rgba(78, 205, 196, 0.1));
    animation: matrixForm 4s ease-in-out infinite;
}

.media-caption {
    text-align: center;
    font-style: italic;
    color: #4ecdc4;
    margin-top: 1rem;
}

@keyframes bacteriaGrow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes matrixForm {
    0% { opacity: 0; height: 0; }
    50% { opacity: 0.7; height: 60px; }
    100% { opacity: 0.3; height: 60px; }
}

/* Interactive TACT Circle */
.balance-visual {
    text-align: center;
    margin: 2rem 0;
}

.balance-text {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: #4ecdc4;
}

.interactive-tact-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    position: relative;
    margin: 2rem auto;
    cursor: pointer;
}

.tact-slice {
    position: absolute;
    width: 50%;
    height: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.tact-slice:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.tact-slice.time {
    top: 0;
    left: 0;
    background: #ff6b6b;
    border-radius: 100% 0 0 0;
}

.tact-slice.action {
    top: 0;
    right: 0;
    background: #4ecdc4;
    border-radius: 0 100% 0 0;
}

.tact-slice.chemical {
    bottom: 0;
    right: 0;
    background: #45b7d1;
    border-radius: 0 0 100% 0;
}

.tact-slice.temperature {
    bottom: 0;
    left: 0;
    background: #f7b731;
    border-radius: 0 0 0 100%;
}

.tact-instruction {
    text-align: center;
    color: #888;
    font-style: italic;
    margin-top: 1rem;
}

/* Cross-Reference Styling */
.cross-reference {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.data-link-btn {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.data-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.3);
}
/* Tutorial Modal */
.tutorial-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.5s ease-out;
}

.tutorial-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    border: 2px solid #4ecdc4;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.mission-badge {
    font-size: 4rem;
    color: #f7b731;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.tutorial-content h2 {
    color: #4ecdc4;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.tutorial-content p {
    color: #e0e0e0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.start-mission-btn {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.start-mission-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(78, 205, 196, 0.3);
}

/* Category Filter */
.category-filter {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.category-filter option {
    background: #1a1a2e;
    color: white;
}

/* Category Tags */
.category-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.category-tag.biology {
    background: #ff6b6b;
    color: white;
}

.category-tag.chemistry {
    background: #4ecdc4;
    color: white;
}

.category-tag.physics {
    background: #45b7d1;
    color: white;
}

/* Mobile Thumb Zone */
@media (max-width: 768px) {
    .card-next-button {
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: 20px;
        z-index: 100;
        backdrop-filter: blur(10px);
        background: linear-gradient(135deg, rgba(78, 205, 196, 0.9), rgba(68, 160, 141, 0.9));
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        margin: 0;
        padding: 1rem;
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    .card-next-button:hover {
        transform: translateY(-2px);
    }
    
    .concept-card {
        padding-bottom: 100px; /* Space for fixed button */
    }
    
    .quiz-submit {
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: 20px;
        z-index: 100;
        backdrop-filter: blur(10px);
        background: linear-gradient(135deg, rgba(78, 205, 196, 0.9), rgba(68, 160, 141, 0.9));
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        margin: 0;
        padding: 1rem;
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    .review-retry-btn {
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: 20px;
        z-index: 100;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        margin: 0;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.view-container {
  position: absolute;
  inset: 0;
  overflow-y: auto; /* THE ONLY SCROLLBAR */
  padding: 3rem 2rem;
  opacity: 0;
  pointer-events: none;
  transform: translateX(40px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.view-container.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
/* Navigation Button */
.nav-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid var(--primary);
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    z-index: 1500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    transform: translateY(-2px);
}
/* Mission Report Modal */
.mission-report-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.5s ease-out;
}

.mission-report-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    border: 2px solid var(--success);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.mission-report-content .mission-badge {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.mission-report-content h3 {
    color: var(--success);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.xp-reward {
    color: #f7b731;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.return-base-btn {
    background: linear-gradient(135deg, var(--success), #27ae60);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.return-base-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
}

/* Completion Animations */
.just-completed {
    animation: completedPulse 3s ease-in-out;
    border-color: var(--success) !important;
}

.unlocked-anim {
    animation: unlockScale 2s ease-out;
}

@keyframes completedPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(0, 255, 136, 0.7); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(0, 255, 136, 0.7); }
}

@keyframes unlockScale {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
/* Deep Dive Modal */
.deep-dive-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.deep-dive-content {
    width: 90vw;
    height: 90vh;
    background: var(--surface);
    border-radius: 15px;
    border: 2px solid var(--primary);
    display: flex;
    flex-direction: column;
}

.deep-dive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
}

.deep-dive-header h3 {
    color: var(--primary);
    margin: 0;
}

.deep-dive-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.deep-dive-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

#deep-dive-iframe {
    flex: 1;
    width: 100%;
    border: none;
    border-radius: 0 0 15px 15px;
}

/* Deep Dive Button */
.deep-dive-btn {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.deep-dive-btn:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

/* Button Group */
.button-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin-top: auto;
}

@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .deep-dive-btn {
        width: 100%;
        justify-content: center;
    }
}
/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 212, 255, 0.3);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth Transitions */
.view-container {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.view-container.transitioning {
    opacity: 0;
    transform: translateY(20px);
}

.modal-enter {
    animation: modalEnter 0.3s ease-out;
}

.modal-exit {
    animation: modalExit 0.3s ease-in;
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalExit {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
}

/* Progress Reset Button */
.reset-progress-btn {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    opacity: 0.4;
    transform: scale(0.85);
    background: rgba(255, 68, 68, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    z-index: 1500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.reset-progress-btn:hover {
    opacity: 0.8;
    background: rgba(255, 68, 68, 1);
    transform: scale(0.9);
    box-shadow: 0 5px 15px rgba(255, 68, 68, 0.3);
}

/* Achievement Modal */
.achievement-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    animation: fadeIn 0.5s ease-out;
}

.achievement-content {
    background: linear-gradient(135deg, #f7b731, #f39c12);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    color: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.achievement-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 1s infinite;
}

.achievement-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.achievement-content h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #fff3cd;
}

.achievement-content button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.achievement-content button:hover {
    background: white;
    color: #f7b731;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Performance Optimizations */
.cube, .card, .level-card {
    will-change: transform;
}

.cube {
    transform: translateZ(0); /* Force GPU acceleration */
}
/* Biofilm Button Unlock Effect */
.card-next-button.unlocked-glow {
    animation: unlockGlow 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
}

@keyframes unlockGlow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.8);
        transform: scale(1.02);
    }
}
/* Mission Report Modal */
.mission-report-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.mission-report-modal.hidden {
    display: none;
}

.mission-report-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    border: 2px solid var(--success);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.mission-report-content h2 {
    color: var(--success);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.xp-earned {
    color: #f7b731;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.next-mission {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.return-base-btn {
    background: linear-gradient(135deg, var(--success), #27ae60);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.return-base-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
}

/* Next Mission Pulse Animation */
.next-mission-pulse {
    animation: nextMissionPulse 3s ease-in-out;
}

@keyframes nextMissionPulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 0 rgba(0, 212, 255, 0.7);
    }
    50% { 
        transform: scale(1.1); 
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.7);
    }
}
/* Mobile Next Button Polish */
@media (max-width: 768px) {
    .card-next-button {
        position: fixed !important;
        bottom: 20px !important;
        left: 20px !important;
        right: 20px !important;
        z-index: 1000 !important;
        margin: 0 !important;
        width: auto !important;
    }
    
    .concept-card {
        padding-bottom: 100px; /* Space for fixed button */
    }
    
    .reset-progress-btn {
        bottom: 80px;
    }
}

/* Ensure overlays don't block clicks */
.crt-overlay, 
#particles-js, 
.bg-animation {
    pointer-events: none !important;
    z-index: 0;
}

/* Force buttons to be on top */
.start-btn, 
.data-bank-btn, 
.nav-btn {
    position: relative; 
    z-index: 2001 !important; /* Higher than modal/overlay z-indexes */
    cursor: pointer;
}

/* Ensure Glossary Panel works */
.glossary-panel {
    z-index: 3000; /* Highest priority */
    /* Ensure it has a transform transition for sliding */
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.glossary-panel.active {
    transform: translateX(0);
}
/* Ensure overlays don't block clicks */
.crt-overlay,
#particles-js,
.bg-animation {
    pointer-events: none !important;
    z-index: 0;
}

/* Force buttons to be on top */
.start-btn,
.data-bank-btn,
.nav-btn,
.reset-progress-btn {
    position: relative;
    z-index: 2001 !important;
    cursor: pointer;
}

/* Ensure Glossary Panel works */
.glossary-panel {
    z-index: 3000;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.glossary-panel.active {
    transform: translateX(0);
}
/* Mobile Accessibility Fixes */
@media (max-width: 768px) {
    .quiz-option {
        min-height: 44px; /* WCAG touch target size */
        padding: 1rem;
    }
    
    .card-next-button,
    .quiz-submit {
        min-height: 44px;
        font-size: 1rem;
    }
    
    .cube {
        width: 120px !important;
        height: 120px !important;
    }
    
    .glossary-panel {
        width: 100vw;
        transform: translateX(100%);
    }
    
    .glossary-panel.active {
        transform: translateX(0);
    }
}
/* Micro-animations and UX Polish */
.level-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-option.selected {
    animation: pulse 0.3s ease;
    transform: scale(1.02);
}

.quiz-option:hover {
    transform: translateX(5px);
    background: rgba(0, 212, 255, 0.15);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1.02); }
}

/* Loading Spinner Enhancement */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 212, 255, 0.3);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

.loading-text {
    text-align: center;
    color: var(--primary);
    margin-top: 1rem;
    font-weight: 600;
}

/* Button Micro-interactions */
.card-next-button:hover,
.quiz-submit:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.card-next-button:active,
.quiz-submit:active {
    transform: translateY(0) scale(0.98);
}

/* Enhanced Modal Animations */
.modal-enter {
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-exit {
    animation: modalSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
}

/* Progress Feedback */
.progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Enhanced Notification Styles */
.notification {
    animation: notificationSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@keyframes notificationSlide {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Sound Effect Indicators */
.sound-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: var(--success);
    pointer-events: none;
    animation: soundPop 0.6s ease-out;
    z-index: 3000;
}

@keyframes soundPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}
/* Confirmation Modal */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    animation: fadeIn 0.3s ease;
}

.confirmation-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    border: 2px solid var(--danger);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.warning-icon {
    font-size: 4rem;
    color: var(--danger);
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.confirmation-content h3 {
    color: var(--danger);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.confirmation-content p {
    color: var(--text-dim);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.confirmation-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--border);
    color: var(--text);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.confirm-btn {
    background: linear-gradient(135deg, var(--danger), #c0392b);
    border: none;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 68, 68, 0.3);
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
/* Enhanced Achievement Modal */
.achievement-modal.enhanced {
    backdrop-filter: blur(10px);
}

.achievement-modal.enhanced .achievement-content {
    background: linear-gradient(135deg, #f7b731, #f39c12, #e67e22);
    border: 3px solid #fff;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    animation: achievementBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.achievement-emoji {
    font-size: 5rem;
    display: block;
    margin-bottom: 0.5rem;
    animation: rotate 2s ease-in-out infinite;
}

.achievement-progress {
    margin: 1rem 0;
    text-align: center;
}

.achievement-progress .progress-bar {
    background: rgba(255, 255, 255, 0.3);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.achievement-progress .progress-fill {
    background: linear-gradient(90deg, #fff, #f1c40f);
    height: 100%;
    transition: width 1s ease;
    animation: shimmer 2s infinite;
}

@keyframes achievementBounce {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    50% { transform: scale(1.1) rotate(-10deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes rotate {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}
/* Water Molecule Simulation */
.water-simulation {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 15px;
    border: 2px solid var(--primary);
}

.water-molecule {
    position: relative;
    width: 200px;
    height: 150px;
    margin-bottom: 2rem;
}

.oxygen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: #ff4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    z-index: 2;
}

.hydrogen {
    position: absolute;
    width: 25px;
    height: 25px;
    background: #ffffff;
    border: 2px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: bold;
    z-index: 2;
}

.hydrogen.h1 {
    top: 20%;
    left: 20%;
}

.hydrogen.h2 {
    top: 20%;
    right: 20%;
}

.bond {
    position: absolute;
    width: 3px;
    height: 60px;
    background: var(--primary);
    transform-origin: bottom center;
}

.bond1 {
    bottom: 50%;
    left: 35%;
    transform: rotate(-25deg);
}

.bond2 {
    bottom: 50%;
    right: 35%;
    transform: rotate(25deg);
}

.polarity-indicators {
    display: flex;
    justify-content: space-between;
    width: 200px;
    font-size: 1.5rem;
    font-weight: bold;
}

.delta-negative {
    color: #ff4444;
}

.delta-positive {
    color: var(--primary);
}

.simulation-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    margin-top: 1rem;
}

.simulation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
}

/* Animation states */
.water-molecule.animated .oxygen {
    animation: oxygenPulse 2s ease-in-out infinite;
}

.water-molecule.animated .hydrogen {
    animation: hydrogenPulse 2s ease-in-out infinite;
}

.water-molecule.animated .polarity-indicators {
    animation: polarityShow 1s ease-in-out;
}

@keyframes oxygenPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 0 20px #ff4444; }
}

@keyframes hydrogenPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); box-shadow: 0 0 15px var(--primary); }
}

@keyframes polarityShow {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}
/* Mission Briefing */
.mission-briefing {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--primary);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: left;
}

.mission-briefing p {
    margin: 0.5rem 0;
    color: var(--text-dim);
}

/* Lock Overlay */
.card .lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    font-size: 2rem;
    color: #666;
}

.card.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.card.locked:hover {
    transform: none;
    border-color: #666;
    box-shadow: none;
}

/* Glossary Panel - Left Side */
.glossary-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 400px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 3000;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.glossary-panel.active {
    transform: translateX(0);
}

@media (max-width: 768px) {
    .glossary-panel {
        width: 100vw;
        transform: translateX(-100%);
    }
    
    .glossary-panel.active {
        transform: translateX(0);
    }
}
/* Replay Modal */
.replay-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    animation: fadeIn 0.3s ease;
}

.replay-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    border: 2px solid var(--primary);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.replay-content h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.replay-content p {
    color: var(--text-dim);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.replay-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.replay-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.replay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
}
/* Settings Dropdown */
.settings-dropdown {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

.settings-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.8rem;
    border-radius: 50%;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--primary);
}

.settings-menu {
    position: absolute;
    top: 60px;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    min-width: 200px;
    display: none;
    backdrop-filter: blur(10px);
}

.settings-menu.active {
    display: block;
    animation: slideDown 0.3s ease;
}

.settings-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    color: var(--text);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-option:last-child {
    border-bottom: none;
}

.settings-toggle {
    width: 40px;
    height: 20px;
    background: #666;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}

.settings-toggle.active {
    background: var(--primary);
}

.settings-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.settings-toggle.active::after {
    transform: translateX(20px);
}

/* Tooltips */
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}
/* Library Modal */
.library-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.library-modal.hidden {
    display: none !important;
}

.library-content {
    width: 90%;
    height: 90%;
    position: relative;
    background: white;
}

.library-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
}

#library-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.fixed-ui {
    position: fixed !important;
    z-index: 2001 !important;
}

.data-bank-btn.fixed-ui {
    top: 20px;
    left: 20px;
}

.home-btn.fixed-ui {
    top: 20px;
    left: 380px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.home-btn.fixed-ui:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.library-btn.fixed-ui {
    top: 20px;
    left: 200px;
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.library-btn.fixed-ui:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.3);
}
.hud-controls {
  margin-left: auto;
  display: flex;
  gap: 1rem;
}

.hud-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.hud-btn:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-1px);
}
@media (max-width: 768px) {
    .app-footer {
        position: relative;
        font-size: 0.85rem;
    }

    .footer-content {
        display: none;
    }

    .footer-bottom {
        padding: 0.5rem;
        text-align: center;
    }
}
.back-to-base-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.8rem;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    text-decoration: none;
    color: #eaeaea;
    transition: all 0.25s ease;
}

.back-to-base-btn:hover {
    background: rgba(0, 0, 0, 0.75);
    transform: translateY(-1px);
}

.back-to-base-logo {
    height: 18px;
    opacity: 0.9;
    filter: grayscale(100%) brightness(1.2);
}
/* Mobile Navigation */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 72px;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 0 0 0 10px;
    z-index: 1000;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu button,
.mobile-menu a {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.mobile-menu img {
    height: 16px;
    width: auto;
}

@media (max-width: 768px) {
    .hud-controls {
        display: none;
    }
    
    .hamburger-btn {
        display: block;
    }
    
    .mobile-menu.open {
        display: flex;
    }
}
/* Critical Mobile Navigation Fixes */
.hud-controls {
  display: flex;
}

.hamburger-btn {
  display: none;
}

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

  .hamburger-btn {
    display: block;
  }
}

.mobile-menu {
  position: fixed;
  top: 72px;
  right: 0;
  width: 100%;
  background: rgba(10, 10, 15, 0.96);
  backdrop-filter: blur(12px);
  display: none;
  flex-direction: column;
  padding: 1rem;
  z-index: 999;
}

.mobile-menu.open {
  display: flex;
}
/* Mobile Footer Fix */
@media (max-width: 768px) {
  .app-footer .footer-content {
    display: none;
  }

  .app-footer {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
}
/* Critical Scroll Fix - Eliminate Double Scrolling */
:root {
  --header-height: 72px;
  --footer-height: 180px;
}

html, body {
  height: 100%;
  overflow: hidden;
}

#app-shell {
  height: calc(100vh - var(--header-height) - var(--footer-height));
  overflow-y: auto;
}

@media (max-width: 768px) {
  :root {
    --footer-height: 40px;
  }
}
/* Content Centering Fix */
.view-container {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-container.scrollable {
  align-items: flex-start;
}