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

body {
    overflow: hidden;
    background: #000;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #e0e0e0;
    user-select: none;
}

canvas { display: block; }

/* Loading Screen */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a1628 0%, #1a2a4a 40%, #0d2137 100%);
    transition: opacity 1.5s ease-out;
}
#loading-screen.fade-out { opacity: 0; pointer-events: none; }

.loading-mandala {
    width: 120px; height: 120px;
    border: 3px solid rgba(120, 200, 255, 0.15);
    border-top-color: rgba(120, 200, 255, 0.8);
    border-radius: 50%;
    animation: spin 2s linear infinite;
    position: relative;
}
.loading-mandala::before {
    content: '';
    position: absolute;
    inset: 12px;
    border: 2px solid rgba(180, 220, 255, 0.1);
    border-bottom-color: rgba(180, 220, 255, 0.6);
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}
.loading-mandala::after {
    content: '🌿';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-glow { 0%, 100% { opacity: 0.6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.1); } }

.loading-text {
    margin-top: 30px;
    font-size: 18px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(180, 220, 255, 0.7);
    animation: fade-pulse 2s ease-in-out infinite;
}
.loading-sub {
    margin-top: 12px;
    font-size: 13px;
    color: rgba(150, 190, 230, 0.4);
    letter-spacing: 2px;
}
@keyframes fade-pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

#loading-progress {
    margin-top: 30px;
    width: 200px; height: 2px;
    background: rgba(120, 200, 255, 0.1);
    border-radius: 1px;
    overflow: hidden;
}
#loading-progress .bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(120, 200, 255, 0.3), rgba(120, 200, 255, 0.8));
    transition: width 0.3s ease;
}

/* Start Prompt */
#start-prompt {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(10, 22, 40, 0.85), rgba(5, 10, 20, 0.95));
    backdrop-filter: blur(8px);
    cursor: pointer;
}
#start-prompt.visible { display: flex; }

.start-title {
    font-size: 42px;
    font-weight: 200;
    letter-spacing: 8px;
    color: rgba(200, 230, 255, 0.9);
    margin-bottom: 8px;
}
.start-subtitle {
    font-size: 16px;
    letter-spacing: 6px;
    color: rgba(150, 200, 240, 0.5);
    margin-bottom: 50px;
}
.start-button {
    width: 100px; height: 100px;
    border: 2px solid rgba(120, 200, 255, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    letter-spacing: 3px;
    color: rgba(180, 220, 255, 0.8);
    animation: breathe 4s ease-in-out infinite;
    transition: all 0.3s ease;
}
.start-button:hover {
    border-color: rgba(120, 200, 255, 0.8);
    background: rgba(120, 200, 255, 0.1);
    transform: scale(1.05);
}
@keyframes breathe { 0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(120, 200, 255, 0.1); } 50% { transform: scale(1.08); box-shadow: 0 0 40px rgba(120, 200, 255, 0.2); } }

.start-hint {
    margin-top: 40px;
    font-size: 12px;
    color: rgba(150, 190, 230, 0.3);
    letter-spacing: 2px;
}

/* HUD */
#hud {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}
#hud.visible { opacity: 1; }
#hud > * { pointer-events: auto; }

/* Crosshair */
.crosshair {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 20px; height: 20px;
    pointer-events: none;
    opacity: 0.3;
}
.crosshair::before, .crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
}
.crosshair::before { width: 12px; height: 1px; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.crosshair::after { width: 1px; height: 12px; top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* Controls Panel */
.controls-panel {
    position: absolute;
    left: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 18px;
    min-width: 200px;
}
.control-group-title {
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(180, 220, 255, 0.4);
    margin-bottom: 10px;
}

.env-buttons, .weather-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.env-btn, .weather-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: rgba(220, 230, 240, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.env-btn:hover, .weather-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}
.env-btn.active, .weather-btn.active {
    background: rgba(120, 200, 255, 0.15);
    border-color: rgba(120, 200, 255, 0.4);
    color: rgba(200, 235, 255, 1);
    box-shadow: 0 0 12px rgba(120, 200, 255, 0.1);
}
.btn-icon { font-size: 16px; }

/* Time Slider */
.time-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}
.time-label {
    font-size: 11px;
    color: rgba(180, 220, 255, 0.5);
    min-width: 40px;
}
.time-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}
.time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px;
    background: rgba(200, 230, 255, 0.8);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(120, 200, 255, 0.3);
}
.time-value {
    font-size: 12px;
    color: rgba(180, 220, 255, 0.6);
    min-width: 44px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}
.volume-icon {
    font-size: 16px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.volume-icon:hover { opacity: 1; }
.volume-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    background: rgba(200, 230, 255, 0.7);
    border-radius: 50%;
    cursor: pointer;
}

/* Info Panel */
.info-panel {
    position: absolute;
    right: 24px;
    bottom: 24px;
    text-align: right;
}
.info-fps {
    font-size: 11px;
    color: rgba(180, 220, 255, 0.3);
    font-variant-numeric: tabular-nums;
}
.info-hint {
    font-size: 11px;
    color: rgba(180, 220, 255, 0.25);
    margin-top: 4px;
}

/* Breathing Guide */
#breathing-guide {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}
#breathing-guide.active { display: flex; }

.breath-circle {
    width: 120px; height: 120px;
    border: 2px solid rgba(120, 200, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s linear;
}
.breath-text {
    font-size: 14px;
    letter-spacing: 3px;
    color: rgba(200, 230, 255, 0.8);
}
.breath-timer {
    margin-top: 16px;
    font-size: 12px;
    color: rgba(180, 220, 255, 0.4);
    font-variant-numeric: tabular-nums;
}

/* Breathing Button */
.breath-toggle {
    position: absolute;
    right: 24px;
    top: 24px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 12px;
    color: rgba(180, 220, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.breath-toggle:hover {
    background: rgba(120, 200, 255, 0.1);
    border-color: rgba(120, 200, 255, 0.3);
}
.breath-toggle.active {
    background: rgba(120, 200, 255, 0.15);
    border-color: rgba(120, 200, 255, 0.4);
    color: rgba(200, 235, 255, 1);
}

/* VR Button Override */
.vr-button {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
}

/* Notification */
.notification {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 13px;
    color: rgba(200, 230, 255, 0.8);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.notification.show { opacity: 1; }

/* Pointer Lock Instructions */
.lock-hint {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.lock-hint.visible { opacity: 1; pointer-events: auto; cursor: pointer; }
.lock-hint p {
    font-size: 14px;
    color: rgba(200, 230, 255, 0.6);
    margin-bottom: 8px;
}
.lock-hint .key {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    margin: 0 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .controls-panel { left: 12px; bottom: 12px; }
    .control-group { min-width: 160px; padding: 10px 14px; }
    .env-btn, .weather-btn { padding: 6px 10px; font-size: 11px; }
    .start-title { font-size: 28px; letter-spacing: 4px; }
}
