/*! © 2026 LogosVox. All rights reserved. Copying, modifying or redistributing this code is not permitted. https://games.logosvox.com/terms */

        /* The shared top bar (lv-shell) floats over the canvas: what sat at the top moves below it. */
        #ui-container { top: calc(var(--lv-shell-h, 0px) + 12px) !important; }
    

        :root {
            --glass-bg: rgba(30, 30, 35, 0.65);
            --glass-border: rgba(255, 255, 255, 0.12);
            --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
            --text-color: #f5f5f7;
            --text-secondary: rgba(235, 235, 245, 0.6);
            --accent-color: #0A84FF;
            --active-green: #30D158;
            --active-red: #FF453A;
        }

        body {
            margin: 0;
            overflow: hidden;
            font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            background-color: #000;
            user-select: none;
            -webkit-font-smoothing: antialiased;
        }

        #canvas-container {
            width: 100vw;
            height: 100vh;
            position: absolute;
            top: 0;
            left: 0;
            z-index: 0;
            cursor: grab;
        }
        
        #canvas-container:active {
            cursor: grabbing;
        }

        /* Start Overlay */
        #start-overlay {
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.6);
            backdrop-filter: blur(25px);
            -webkit-backdrop-filter: blur(25px);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 100;
            transition: opacity 0.6s ease;
        }
        
        #start-btn {
            padding: 16px 48px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: white;
            font-size: 17px;
            font-weight: 500;
            letter-spacing: 0.5px;
            border-radius: 100px;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
        }
        
        #start-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: scale(1.02);
        }

        #instructions {
            margin-top: 24px;
            color: var(--text-secondary);
            font-size: 13px;
            letter-spacing: 0.2px;
            font-weight: 400;
        }

        /* Engine Controls HUD */
        #engine-hud {
            position: absolute;
            bottom: 40px;
            right: 40px;
            z-index: 20;
        }

        #engine-btn {
            width: 72px;
            height: 72px;
            border-radius: 50%;
            border: 1px solid rgba(255,255,255,0.15);
            background: rgba(20, 20, 20, 0.5);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            color: white;
            font-weight: 600;
            font-size: 11px;
            letter-spacing: 0.5px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            box-shadow: 0 8px 24px rgba(0,0,0,0.2);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        #engine-btn:hover {
            transform: scale(1.05);
            background: rgba(40, 40, 40, 0.6);
        }

        #engine-btn:active {
            transform: scale(0.95);
        }

        #engine-btn.running {
            background: rgba(48, 209, 88, 0.15);
            border-color: var(--active-green);
            color: var(--active-green);
            box-shadow: 0 0 20px rgba(48, 209, 88, 0.2);
        }

        #engine-btn span {
            font-size: 20px;
            margin-bottom: 4px;
            display: block;
        }

        /* Top Menu - Modern Glass */
        #ui-container {
            position: absolute;
            top: 24px;
            left: 50%;
            transform: translateX(-50%);
            width: 320px;
            background: var(--glass-bg);
            backdrop-filter: blur(40px);
            -webkit-backdrop-filter: blur(40px);
            border: 1px solid var(--glass-border);
            border-radius: 24px;
            box-shadow: var(--glass-shadow);
            z-index: 10;
            color: var(--text-color);
            transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
            overflow: hidden;
        }

        #ui-container.minimized {
            height: 52px; /* Just header */
            width: 220px;
            background: rgba(30, 30, 35, 0.4);
        }

        .ui-header {
            padding: 16px 20px;
            display: flex;
            justify-content: center;
            align-items: center;
            position: relative;
            cursor: pointer;
            border-bottom: 1px solid rgba(255,255,255,0.05);
        }
        
        #ui-container.minimized .ui-header {
            border-bottom: none;
        }

        .header-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            transition: transform 0.2s;
        }
        
        .header-content:active {
            transform: scale(0.98);
        }

        h1 {
            font-size: 13px;
            font-weight: 600;
            letter-spacing: 0.5px;
            margin: 0;
            color: var(--text-color);
            text-transform: uppercase;
        }

        .subtitle {
            font-size: 10px;
            color: var(--text-secondary);
            margin-top: 2px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .subtitle span {
            background: rgba(255,255,255,0.2);
            width: 4px; height: 4px; border-radius: 50%;
        }
        
        .subtitle span.active {
            background: var(--accent-color);
            transform: scale(1.2);
        }

        #minimize-btn {
            position: absolute;
            right: 16px;
            background: transparent;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 4px;
            transition: transform 0.3s;
            opacity: 0.7;
        }
        
        #minimize-btn:hover { opacity: 1; }

        #ui-container.minimized #minimize-btn {
            transform: rotate(180deg);
        }

        .ui-content-wrapper {
            position: relative;
            width: 100%;
            overflow: hidden;
        }

        .ui-page {
            padding: 20px 24px 24px 24px;
            transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.0, 0.0, 1.0);
            display: none; /* Hidden by default logic */
            width: 100%;
            box-sizing: border-box;
        }
        
        .ui-page.active {
            display: block;
            animation: fadeIn 0.4s;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .control-group {
            margin-bottom: 20px;
        }

        .control-label {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            margin-bottom: 10px;
            font-weight: 500;
            color: var(--text-secondary);
        }
        
        .value-display {
            color: var(--text-color);
            font-variant-numeric: tabular-nums;
        }

        /* iOS Style Slider */
        input[type=range] {
            -webkit-appearance: none;
            width: 100%;
            background: transparent;
            margin: 0;
        }
        input[type=range]:focus { outline: none; }
        
        input[type=range]::-webkit-slider-runnable-track {
            width: 100%;
            height: 4px;
            cursor: pointer;
            background: rgba(255, 255, 255, 0.15);
            border-radius: 2px;
            transition: background 0.2s;
        }
        
        input[type=range]:hover::-webkit-slider-runnable-track {
            background: rgba(255, 255, 255, 0.25);
        }

        input[type=range]::-webkit-slider-thumb {
            height: 20px;
            width: 20px;
            border-radius: 50%;
            background: #ffffff;
            cursor: pointer;
            -webkit-appearance: none;
            margin-top: -8px; /* Center on track */
            box-shadow: 0 2px 8px rgba(0,0,0,0.3);
            border: 0.5px solid rgba(0,0,0,0.04);
            transition: transform 0.1s;
        }
        
        input[type=range]::-webkit-slider-thumb:active {
            transform: scale(0.95);
        }

        /* Segmented Control for Weather */
        .weather-buttons {
            display: flex;
            background: rgba(0, 0, 0, 0.2);
            padding: 3px;
            border-radius: 9px;
            margin-top: 8px;
        }

        .weather-btn {
            background: transparent;
            border: none;
            color: var(--text-secondary);
            padding: 6px 0;
            border-radius: 7px;
            font-size: 11px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            flex: 1;
            text-align: center;
        }

        .weather-btn:hover {
            color: var(--text-color);
        }

        .weather-btn.active {
            background: rgba(255, 255, 255, 0.15);
            color: white;
            box-shadow: 0 1px 4px rgba(0,0,0,0.1);
            font-weight: 600;
        }
    