:root {
    --bg-dark: #050505;
    --text-light: #ffffff;
    --text-muted: #aaaaaa;
    --accent: #00ffff;
    /* Cyan glow */
    --accent-glow: rgba(0, 255, 255, 0.5);

    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    /* Improve font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Base Layers */
.layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass through layers unless specified on children */
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.glass-btn {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-transform: uppercase;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-2px);
}

/* Interactive Cursor / Crosshair */
.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease, background 0.2s ease;
    mix-blend-mode: difference;
}

.crosshair.interactive {
    transform: translate(-50%, -50%) scale(2.5);
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

/* Loader Screen */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    z-index: 100;
    pointer-events: auto;
    transition: opacity 1s ease;
}

.loader-content {
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.glow-text {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 4px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #fff, var(--text-muted));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 20px 0;
    overflow: hidden;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background: var(--text-light);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transition: width 0.1s linear;
}

#enter-btn {
    margin-top: 20px;
    opacity: 0;
    transform: translateY(20px);
}

/* UI Overlay */
.ui-overlay {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.controls-hint {
    position: absolute;
    bottom: 30px;
    left: 30px;
    padding: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.controls-hint p {
    margin: 5px 0;
}

.controls-hint strong {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 5px;
}

.floating-top {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
}

/* 3D World Tracking Labels */
.labels-layer {
    pointer-events: none;
    /* Crucial: clicks must pass through to 3D canvas */
}

.world-label {
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--accent);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-family: monospace;
    font-size: 16px;
    /* Translate -50% centers the dot exactly on the projected coordinate */
    transform-origin: center;
    box-shadow: 0 0 10px var(--accent-glow);
    animation: pulse-label 2s infinite ease-in-out;
    opacity: 0.8;
    transition: opacity 0.3s;
}

@keyframes pulse-label {
    0% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 5px var(--accent-glow);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 15px var(--accent);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 5px var(--accent-glow);
    }
}

/* Popups */
.popup-layer {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 50;
    pointer-events: auto;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.main-popup {
    position: relative;
    width: 90%;
    max-width: 800px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(1);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.popup-layer.hidden .main-popup {
    transform: scale(0.9);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.popup-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#video-player {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background: #000;
}

#info-title {
    font-size: 2rem;
    margin-bottom: 10px;
}

#info-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.glow-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.glow-link:hover {
    border-color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

/* Utils */
.hidden {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}