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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #000000;
    color: #ffffff;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    user-select: none;
    -webkit-user-select: none;
    -webkit-font-smoothing: antialiased;
}

/* Background Fullscreen Video */
#installation-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    pointer-events: none;
    transition: filter 0.4s ease, transform 0.4s ease;
}

body.overlay-open #installation-video {
    filter: blur(16px) brightness(0.75);
    transform: scale(1.03);
}

/* Scroll Hint GIF Overlay */
#scroll-hint {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 1;
    transition: opacity 1s ease;
}

#scroll-hint.scroll-hint-hidden {
    opacity: 0;
}

#scroll-hint-lottie {
    width: 100px;
    height: 150px;
    display: block;
}

/* Clean Thin-Line Overlay (Toggled via 'H' Key) */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 30;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

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

#overlay.overlay-hidden .overlay-panel {
    pointer-events: none;
    transform: translateY(6px);
}

.overlay-panel {
    pointer-events: auto;
    width: 280px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.65);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.3s ease;
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.overlay-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #ffffff;
}

.overlay-key-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    padding: 2px 8px;
    line-height: 1.2;
}

.overlay-divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.overlay-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Thin-Line Checkbox Row */
.checkbox-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
}

.checkbox-row input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-box {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    position: relative;
}

.checkbox-row:hover .checkbox-box {
    border-color: #ffffff;
}

.checkbox-row input[type="checkbox"]:checked + .checkbox-box {
    border-color: #ffffff;
}

.checkbox-row input[type="checkbox"]:checked + .checkbox-box::after {
    content: "";
    width: 8px;
    height: 8px;
    background-color: #ffffff;
}

/* Minimal Telemetry */
.overlay-telemetry {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.telemetry-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.telemetry-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #ffffff;
}

.telemetry-bar-track {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    position: relative;
    overflow: hidden;
}

.telemetry-bar-fill {
    height: 100%;
    width: 0%;
    background: #ffffff;
    border-radius: 999px;
    transition: width 0.08s linear;
}

/* Loading Assets Screen Overlay (Pure Black & White + Pill Aesthetic matching gasta.org) */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    color: #111111;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

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

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 420px;
    padding: 24px;
}

.loading-content h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111111;
}

.loading-content p {
    font-size: 14px;
    font-weight: 500;
    color: #444444;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 2.5px solid rgba(17, 17, 17, 0.14);
    border-top-color: #111111;
    border-radius: 50%;
    animation: spin 0.9s cubic-bezier(0.55, 0.055, 0.675, 0.19) infinite;
}

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

.loading-progress-container {
    width: 240px;
    height: 6px;
    background: rgba(17, 17, 17, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.loading-progress-container div {
    height: 100%;
    background: #111111;
    border-radius: 999px;
    transition: width 0.2s ease;
}

.loading-warning {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    background: #111111;
    line-height: 1.3;
    margin-top: 8px;
    padding: 9px 20px;
    border-radius: 999px;
    white-space: nowrap;
}
