/* ──────────────────────────────────────────────
   GARGANTUA - Schwarzschild Black Hole Raytracer
   Full-screen immersive styling
   ────────────────────────────────────────────── */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: 'Courier New', 'Consolas', 'SF Mono', monospace;
    -webkit-font-smoothing: antialiased;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

canvas {
    display: block;
}

/* ─── HUD ─── */
#hud {
    position: fixed;
    top: 24px;
    left: 24px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    line-height: 1.7;
    pointer-events: none;
    z-index: 10;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

#hud .title {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 2px;
    color: rgba(255, 140, 50, 0.95);
    margin-bottom: 4px;
}

#hud .fps {
    color: rgba(150, 255, 150, 0.8);
}

#hud .warning {
    color: rgba(255, 200, 100, 0.9);
    font-size: 11px;
}

/* ─── Controls Panel ─── */
#controls-panel {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ctrl-btn {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.ctrl-btn.active {
    background: rgba(255, 140, 50, 0.2);
    border-color: rgba(255, 140, 50, 0.5);
    color: rgba(255, 140, 50, 1);
}

/* ─── Parameter Panel (collapsed by default) ─── */
#params-panel {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 16px;
    display: none;
    flex-wrap: wrap;
    gap: 10px 20px;
    max-width: 95vw;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

#params-panel.visible {
    display: flex;
}

.param-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.param-group label {
    color: rgba(255, 200, 150, 0.9);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.param-group input[type="range"] {
    width: 100px;
    accent-color: #ff8c32;
}

.param-group .value {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

/* ─── Quality Badge ─── */
#quality-badge {
    position: fixed;
    top: 24px;
    right: 80px;
    z-index: 10;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: bold;
    color: #fff;
    pointer-events: none;
}

#quality-badge.cinematic {
    background: rgba(180, 50, 50, 0.6);
}

#quality-badge.high {
    background: rgba(50, 120, 180, 0.6);
}

#quality-badge.standard {
    background: rgba(80, 80, 80, 0.6);
}

/* ─── Toast ─── */
#toast {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

#toast.show {
    opacity: 1;
}

/* ─── Shortcut reference ─── */
#shortcuts {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 10;
    color: rgba(255, 255, 255, 0.25);
    font-size: 9px;
    line-height: 1.5;
    pointer-events: none;
    text-align: right;
}

/* ─── Loading ─── */
#loading {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    transition: opacity 0.6s;
}

#loading.hidden {
    opacity: 0;
    pointer-events: none;
}

#loading .spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 140, 50, 0.3);
    border-top-color: rgba(255, 140, 50, 0.9);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

#loading .text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    letter-spacing: 2px;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    #hud {
        top: 12px;
        left: 12px;
        font-size: 11px;
    }
    #hud .title {
        font-size: 14px;
    }
    #controls-panel {
        right: 8px;
        gap: 2px;
    }
    .ctrl-btn {
        width: 36px;
        height: 36px;
        border-radius: 6px;
        font-size: 14px;
    }
    #params-panel {
        bottom: 8px;
        padding: 8px 12px;
        gap: 6px 12px;
    }
    .param-group input[type="range"] {
        width: 70px;
    }
    #shortcuts {
        display: none;
    }
}
