        /* Override site styles for game integration */
        .page-shell {
            background: black;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            padding-top: 0 !important;
        }

        #game-main {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #000205;
            padding: 40px 0;
            overflow: hidden;
            position: relative;
            z-index: 1;
        }

        .site-header {
            z-index: 2000 !important;
            position: relative;
        }

        /* Core UI Enhancement */
        :root {
            --teal: #00f2ff;
            --orange: #ff9d00;
            --bg-dark: #000205;
            --panel-bg: rgba(0, 15, 20, 0.7);
            --glass-border: rgba(0, 242, 255, 0.3);
            --glow: 0 0 15px rgba(0, 242, 255, 0.4);
        }

        /* Mission logic handled via HUD layer */
        .mission-item {
            font-size: 0.65rem;
            margin-bottom: 5px;
            display: flex;
            align-items: center;
            gap: 5px;
            color: #fff;
        }

        .mission-done {
            text-decoration: line-through;
            opacity: 0.5;
            color: var(--teal);
        }

        /* Combat Visuals */
        .combat-target {
            position: absolute;
            width: 40px;
            height: 40px;
            border: 2px solid #ff3300;
            border-radius: 50%;
            background: rgba(255, 51, 0, 0.2);
            box-shadow: 0 0 15px #ff3300;
            cursor: crosshair;
            z-index: 500;
            display: flex;
            align-items: center;
            justify-content: center;
            animation: target-pulse 1s infinite;
            pointer-events: auto;
        }

        .combat-target::after {
            content: '✖';
            color: #ff3300;
            font-size: 20px;
        }

        @keyframes target-pulse {
            0% {
                transform: scale(1);
                opacity: 0.8;
            }

            50% {
                transform: scale(1.2);
                opacity: 1;
            }

            100% {
                transform: scale(1);
                opacity: 0.8;
            }
        }

        #ground-control {
            position: absolute;
            bottom: 30px;
            left: 20px;
            width: 320px;
            background: rgba(0, 10, 20, 0.9);
            border-left: 3px solid var(--teal);
            padding: 12px;
            display: flex;
            gap: 12px;
            align-items: center;
            z-index: 1000;
            transform: translateX(-120%);
            transition: transform 0.4s ease-out;
            pointer-events: none;
        }

        #ground-control.visible {
            transform: translateX(0);
        }

        .assistant-portrait {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            background: #001a1d;
            border: 1px solid var(--teal);
            overflow: hidden;
            flex-shrink: 0;
        }

        .assistant-text {
            font-size: 0.7rem;
            color: #fff;
            line-height: 1.3;
            font-family: monospace;
        }

        #game-wrapper {
            position: relative;
            width: 100%;
            max-width: 1600px;
            aspect-ratio: 16 / 9;
            margin: 0 auto;
            background: var(--bg-dark);
            box-shadow: 0 0 100px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 242, 255, 0.1);
            display: flex;
            flex-direction: column;
            border-radius: 4px;
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.05);
            z-index: 10;
        }

        #game-wrapper:fullscreen,
        #game-wrapper:-webkit-full-screen,
        #game-wrapper:-ms-fullscreen {
            max-width: none !important;
            width: 100vw !important;
            height: 100vh !important;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none !important;
            border-radius: 0 !important;
        }

        /* Mode Fenêtré */
        body.windowed-mode {
            padding: 40px;
            background: linear-gradient(135deg, #050505 0%, #1a1a1a 100%);
        }

        #game-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
        }

        /* --- HUD Elements --- */
        #hud {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 10;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: 20px;
            opacity: 0;
            transition: opacity 1s ease;
        }

        .hud-visible {
            opacity: 1 !important;
        }

        .overlay {
            background: radial-gradient(circle at center, rgba(0, 5, 10, 0.4) 0%, rgba(0, 2, 5, 0.95) 100%);
            backdrop-filter: blur(10px);
            transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .preflight-menu,
        .market-menu {
            background: var(--panel-bg);
            backdrop-filter: blur(15px);
            border: 1px solid var(--glass-border);
            border-radius: 12px;
            padding: 30px;
            box-shadow: var(--glow), inset 0 0 20px rgba(0, 242, 255, 0.05);
            animation: panelAppear 0.5s ease-out;
        }

        @keyframes panelAppear {
            from {
                opacity: 0;
                transform: translateY(20px) scale(0.95);
            }

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

        .btn {
            background: transparent;
            border: 1px solid var(--teal);
            color: var(--teal);
            padding: 10px 25px;
            text-transform: uppercase;
            letter-spacing: 2px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            position: relative;
            overflow: hidden;
        }

        #permanent-fullscreen-btn {
            position: absolute;
            top: 20px;
            right: 15px;
            width: 40px;
            height: 40px;
            background: rgba(0, 0, 0, 0.5);
            border: 1px solid var(--glass-border);
            color: var(--teal);
            z-index: 3000;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            backdrop-filter: blur(5px);
            transition: all 0.3s;
        }

        #permanent-fullscreen-btn:hover {
            background: var(--teal);
            color: #000;
            box-shadow: 0 0 15px var(--teal);
        }

        #permanent-fullscreen-btn svg {
            width: 20px;
            height: 20px;
            fill: currentColor;
        }

        .btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(0, 242, 255, 0.2), transparent);
            transition: 0.5s;
        }

        .btn:hover::before {
            left: 100%;
        }

        .btn:hover {
            background: var(--teal);
            color: #000;
            box-shadow: 0 0 20px var(--teal);
            transform: translateY(-2px);
        }

        .btn-primary {
            background: var(--teal);
            color: #000;
            border: none;
        }

        .btn-primary:hover {
            background: #fff;
            box-shadow: 0 0 30px #fff;
        }

        .btn-primary:disabled {
            background: #333 !important;
            color: #666 !important;
            cursor: not-allowed;
            box-shadow: none !important;
        }

        .nav-btn {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: #fff;
            padding: 8px 15px;
            border-radius: 4px;
            cursor: pointer;
            transition: 0.3s;
        }

        .nav-btn:hover {
            background: rgba(255, 255, 255, 0.15);
            border-color: var(--teal);
            color: var(--teal);
            box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
        }

        /* HUD Improvements */
        .hud-bar-container {
            width: 220px;
            height: 12px;
            background: rgba(0, 40, 50, 0.4);
            border-radius: 4px;
            overflow: hidden;
            border: 1px solid rgba(0, 242, 255, 0.2);
            box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
            position: relative;
        }

        .hud-bar {
            height: 100%;
            width: 100%;
            transition: transform 0.4s cubic-bezier(0.1, 0.7, 0.3, 1);
            box-shadow: 0 0 15px currentColor;
            position: relative;
            transform-origin: left;
        }

        .hud-bar::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.2) 100%);
        }

        #energy-bar {
            background: linear-gradient(90deg, #0088ff, #00f2ff);
            color: #00f2ff;
        }

        #hp-bar {
            background: linear-gradient(90deg, #aa0000, #ff3c00);
            color: #ff3c00;
        }

        #oxy-bar {
            background: linear-gradient(90deg, #00aa66, #00ff88);
            color: #00ff88;
        }

        #fuel-bar {
            background: linear-gradient(90deg, #cc7700, #ff9d00);
            color: #ff9d00;
        }

        #heat-bar {
            background: linear-gradient(90deg, #cc7700, #ff9d00);
            color: #ff9d00;
        }

        .telemetry-val {
            font-family: 'JetBrains Mono', 'Courier New', monospace;
            color: var(--orange);
            font-weight: bold;
            font-size: 1.1rem;
            text-shadow: 0 0 5px var(--orange);
        }

        #crosshair {
            border: 1px solid rgba(0, 242, 255, 0.5);
            box-shadow: 0 0 10px rgba(0, 242, 255, 0.3);
        }

        #game-wrapper::after {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
            background-size: 100% 3px, 3px 100%;
            pointer-events: none;
            z-index: 1000;
            opacity: 0.3;
        }

        .scanner-info {
            background: var(--glass);
            border-bottom: 3px solid var(--orange);
            padding: 12px 25px;
            text-align: center;
            max-width: 600px;
            backdrop-filter: blur(5px);
        }

        #telemetry {
            position: absolute;
            bottom: 40px;
            left: 50%;
            transform: translateX(-50%);
            display: none;
            flex-direction: column;
            gap: 5px;
            align-items: center;
            background: rgba(0, 20, 30, 0.85);
            border: 2px solid var(--teal);
            border-top: 4px solid var(--teal);
            padding: 12px 25px;
            font-family: 'JetBrains Mono', monospace;
            text-align: center;
            pointer-events: none;
            z-index: 2000;
            backdrop-filter: blur(8px);
            box-shadow: 0 0 30px rgba(0, 242, 255, 0.2);
            border-radius: 8px;
        }


        #skip-cinematic-btn {
            position: absolute;
            top: 18px;
            right: 68px;
            width: 38px;
            height: 38px;
            z-index: 220;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, 0.45);
            border: 1px solid rgba(255, 255, 255, 0.25);
            color: #fff;
            border-radius: 4px;
            cursor: pointer;
            backdrop-filter: blur(8px);
            transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
        }

        #skip-cinematic-btn:hover {
            background: rgba(0, 242, 255, 0.12);
            border-color: var(--teal);
            color: var(--teal);
        }

        #skip-cinematic-btn[hidden] {
            display: none;
        }

        #skip-cinematic-btn svg {
            width: 19px;
            height: 19px;
            fill: currentColor;
        }

        /* --- Mining Grid Styles --- */
        #mining-overlay {
            position: absolute;
            inset: 0;
            background: rgba(0, 5, 10, 0.95);
            z-index: 5000;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 20px;
            backdrop-filter: blur(15px);
            font-family: 'Space Grotesk', sans-serif;
        }

        .mining-grid-header {
            color: var(--teal);
            margin-bottom: 20px;
            text-align: center;
        }

        .mining-grid-container {
            display: grid;
            grid-template-columns: repeat(15, 35px);
            gap: 3px;
            background: rgba(0, 242, 255, 0.05);
            padding: 8px;
            border: 1px solid var(--glass-border);
            border-radius: 8px;
            box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
        }

        .mining-block {
            width: 35px;
            height: 35px;
            background: #2a2a2a;
            border-radius: 3px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.6rem;
            font-weight: 700;
            transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.05);
            user-select: none;
        }

        .mining-block:hover {
            filter: brightness(1.3);
            transform: scale(1.05);
            z-index: 10;
        }

        .mining-block.block-rock { background: #444; color: #888; }
        .mining-block.block-hard { background: #222; color: #555; border-color: #000; }
        .mining-block.block-mineral { background: #1a3a3d; color: var(--teal); border-color: var(--teal); box-shadow: inset 0 0 10px var(--teal); }
        .mining-block.block-empty { background: rgba(0, 0, 0, 0.4); cursor: default; border: none; opacity: 0.3; }

        .mining-block.rover-active {
            border: 2px solid var(--orange);
            box-shadow: 0 0 15px var(--orange);
            z-index: 100;
        }

        .rover-cursor {
            position: absolute;
            width: 24px;
            height: 24px;
            pointer-events: none;
            transition: all 0.1s ease;
            filter: drop-shadow(0 0 5px var(--orange));
        }

        .mining-block-hp {
            position: absolute;
            bottom: 0;
            left: 0;
            height: 3px;
            background: var(--teal);
            transition: width 0.2s;
        }

        .mining-stats {
            display: flex;
            gap: 30px;
            margin-top: 20px;
            color: #fff;
            font-size: 0.8rem;
            letter-spacing: 1px;
        }

        .mining-depth { color: var(--orange); font-weight: 700; }

        /* --- Cinematic Overlay --- */
        #cinematic-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #000;
            z-index: 200;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 40px;
            text-align: center;
            overflow: hidden;
        }

        #earth-apocalypse-bg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            opacity: 0.6;
            filter: grayscale(0.4) contrast(1.2) brightness(0.8);
            z-index: 1;
        }

        #pre-start-screen {
            position: relative;
            z-index: 100;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .cinematic-text {
            font-size: 1.8rem;
            font-weight: 300;
            max-width: 800px;
            color: #fff;
            text-shadow: 0 0 20px var(--teal);
            opacity: 0;
            transition: opacity 1.5s ease;
            position: absolute;
            line-height: 1.6;
            font-style: italic;
            pointer-events: none;
        }

        /* --- Overlays --- */
        .overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.95);
            z-index: 100;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            padding: 20px;
            transition: opacity 0.8s ease;
        }

        h1 {
            font-size: 3rem;
            color: var(--teal);
            margin-bottom: 15px;
            text-transform: uppercase;
            letter-spacing: 4px;
        }

        .preflight-menu {
            background: var(--glass);
            border: 1px solid var(--teal);
            padding: 20px;
            margin-top: 20px;
            display: none;
            width: 100%;
            max-width: 600px;
        }

        .story-text {
            max-width: 600px;
            font-size: 1rem;
            line-height: 1.5;
            margin-bottom: 30px;
            color: #ccc;
        }

        /* --- Menus (Market & Upgrades) --- */
        .game-menu {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 95%;
            max-width: 900px;
            max-height: 85vh;
            background: rgba(0, 10, 15, 0.98);
            border: 1px solid var(--teal);
            padding: 30px;
            z-index: 50;
            display: none;
            pointer-events: auto;
            overflow-y: auto;
            box-shadow: 0 0 100px rgba(0, 0, 0, 1);
        }

        .menu-title {
            color: var(--teal);
            border-bottom: 2px solid var(--teal);
            margin-bottom: 20px;
            padding-bottom: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

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

        .market-item {
            background: rgba(15, 137, 148, 0.05);
            border: 1px solid rgba(15, 137, 148, 0.2);
            padding: 15px;
            border-radius: 4px;
            transition: border-color 0.3s;
        }

        .market-item:hover {
            border-color: var(--teal);
        }

        .market-item h4 {
            color: var(--teal);
            margin-bottom: 5px;
        }

        .market-item p {
            font-size: 0.8rem;
            color: #888;
            margin-bottom: 10px;
        }

        .price-tag {
            color: var(--orange);
            font-weight: 700;
            font-size: 0.9rem;
        }

        /* --- 2D Mode Overlay --- */
        #canvas-2d {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 5;
            display: none;
            background: rgba(0, 0, 0, 0.4);
        }

        .phase-indicator {
            position: absolute;
            top: 100px;
            left: 50%;
            transform: translateX(-50%);
            color: var(--orange);
            font-weight: 700;
            letter-spacing: 5px;
            font-size: 1.5rem;
            text-shadow: 0 0 10px var(--orange);
            display: none;
        }

        /* --- Warp Effect --- */
        #warp-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 2;
            background: radial-gradient(circle, transparent 20%, rgba(15, 137, 148, 0.2) 100%);
            opacity: 0;
            transition: opacity 0.5s;
        }

        .houston-avatar {
            width: 40px;
            height: 40px;
            background: #000;
            border: 1px solid var(--teal);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            flex-shrink: 0;
            box-shadow: 0 0 10px rgba(0, 242, 255, 0.3);
        }

        .houston-eye {
            width: 15px;
            height: 2px;
            background: var(--teal);
            box-shadow: 0 0 8px var(--teal);
            animation: houston-blink 4s infinite;
        }

        @keyframes houston-blink {

            0%,
            90%,
            100% {
                height: 2px;
            }

            95% {
                height: 10px;
                border-radius: 50%;
            }
        }

        .houston-bubble {
            background: rgba(0, 0, 0, 0.7);
            border: 1px solid rgba(0, 242, 255, 0.2);
            border-radius: 4px 12px 12px 12px;
            padding: 10px 15px;
            backdrop-filter: blur(5px);
            flex-grow: 1;
        }

        .hidden {
            display: none !important;
        }

        #crosshair {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 24px;
            height: 24px;
            border: 1px solid var(--teal);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            pointer-events: none;
            z-index: 5;
            opacity: 0.5;
        }

        /* --- Scan Result Modal --- */
        #scan-modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 90%;
            max-width: 500px;
            background: rgba(0, 0, 0, 0.9);
            border: 2px solid var(--teal);
            box-shadow: 0 0 20px rgba(15, 137, 148, 0.5);
            padding: 30px;
            z-index: 500;
            backdrop-filter: blur(10px);
            display: none;
            flex-direction: column;
            gap: 15px;
            text-align: center;
        }

        #scan-modal.visible {
            display: flex;
        }

        .chem-tag {
            background: rgba(15, 137, 148, 0.2);
            border: 1px solid var(--teal);
            color: var(--teal);
            padding: 2px 8px;
            font-size: 0.7rem;
            border-radius: 4px;
            margin: 0 4px;
        }

        .anecdote {
            font-size: 1.1rem;
            color: #fff;
            font-style: italic;
            margin: 15px 0;
            line-height: 1.4;
        }

        .wiki-link {
            color: var(--orange);
            text-decoration: none;
            font-size: 0.8rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            border-bottom: 1px dashed var(--orange);
            align-self: center;
        }

        .wiki-link:hover {
            color: white;
            border-bottom-color: white;
        }

        body.high-contrast .hp-bar-container {
            border-color: #fff !important;
        }

        body.high-contrast .telemetry-val {
            color: #fff !important;
            font-weight: bold;
        }

        /* Mobile Controls */
        #mobile-controls {
            display: none;
            position: fixed;
            bottom: 30px;
            left: 0;
            width: 100%;
            height: 200px;
            z-index: 1000;
            pointer-events: none;
        }

        .joystick-zone {
            position: absolute;
            bottom: 20px;
            left: 20px;
            width: 150px;
            height: 150px;
            background: rgba(255, 255, 255, 0.05);
            border: 2px solid rgba(0, 242, 255, 0.2);
            border-radius: 50%;
            pointer-events: auto;
            touch-action: none;
        }

        .joystick-stick {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 60px;
            height: 60px;
            background: radial-gradient(circle, var(--teal), #000);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            box-shadow: 0 0 20px var(--teal);
        }

        .fire-btn-mobile {
            position: absolute;
            bottom: 20px;
            right: 20px;
            width: 80px;
            height: 80px;
            background: rgba(255, 105, 20, 0.3);
            border: 3px solid var(--orange);
            border-radius: 50%;
            pointer-events: auto;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-weight: bold;
            box-shadow: 0 0 15px var(--orange);
            touch-action: none;
            font-size: 1.2rem;
            text-shadow: 0 0 5px #000;
        }

        @media (max-width: 768px) {
            #mobile-controls {
                display: block !important;
            }

            .preflight-menu {
                transform: scale(0.85);
                width: 95vw !important;
                max-height: 90vh;
                overflow-y: auto;
                left: 2.5vw !important;
                top: 5vh !important;
                margin: 0 !important;
            }

            .hud-container {
                font-size: 0.6rem;
            }

            .btn {
                padding: 15px !important;
                font-size: 1.1rem !important;
            }

            .nav-btn {
                padding: 12px !important;
                min-height: 44px;
            }

            #pre-start-screen {
                width: 90vw !important;
                padding: 20px !important;
            }

            .menu-title h2 {
                font-size: 1.2rem;
            }

            #cockpit-overlay {
                position: fixed;
                top: 0;
                left: 0;
                width: 100vw;
                height: 100vh;
                pointer-events: none;
                background: radial-gradient(circle, transparent 60%, rgba(0, 15, 25, 0.4) 100%);
                box-shadow: inset 0 0 150px rgba(0, 242, 255, 0.15);
                z-index: 1001;
                display: none;
            }

            #controls-tutorial {
                transition: opacity 1s, transform 1s;
                cursor: pointer;
            }

            #controls-tutorial.hidden {
                opacity: 0;
                transform: translateY(20px);
                pointer-events: none;
            }
        }
