/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Play button */
.play-button {
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease,
                filter 0.3s ease;
    max-width: 200px;
    max-height: 200px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
    filter: brightness(1);
}

.play-button:hover {
    transform: scale(1.05);
    opacity: 0.9;
    filter: brightness(1.1);
}

.play-button:active {
    transform: scale(0.98);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: block;
    opacity: 1;
}

.modal-content {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Close button */
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 1001;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.close-btn:active {
    transform: scale(0.95);
}

/* WebXR container */
#webxr-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#webgl-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

#webgl-canvas:active {
    cursor: grabbing;
}

/* Loading */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    z-index: 1002;
    text-align: center;
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* XR buttons */
.xr-buttons {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 1001;
}

.xr-btn {
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 120px;
}

.xr-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
}

.xr-btn:active {
    transform: translateY(-1px);
}

.xr-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Info panels */
.instructions {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 12px;
    max-width: 320px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.4;
}

.instructions h3 {
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.instructions p {
    margin-bottom: 6px;
    opacity: 0.9;
}

.controls-info {
    position: absolute;
    bottom: 100px;
    left: 20px;
    color: white;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.3;
    max-width: 200px;
}

.controls-info strong {
    display: block;
    margin-bottom: 8px;
    color: #fff;
}

/* Responsive design */
@media (max-width: 768px) {
    .play-button {
        max-width: 150px;
        max-height: 150px;
    }
    
    .instructions {
        position: relative;
        top: auto;
        left: auto;
        margin: 15px;
        max-width: none;
        font-size: 13px;
    }
    
    .controls-info {
        position: relative;
        top: auto;
        left: auto;
        margin: 15px;
        max-width: none;
        font-size: 12px;
    }
    
    .xr-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        bottom: 20px;
    }
    
    .xr-btn {
        padding: 12px 24px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .close-btn {
        padding: 10px 14px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .play-button {
        max-width: 120px;
        max-height: 120px;
    }
    
    .instructions {
        margin: 10px;
        padding: 15px;
        font-size: 12px;
    }
    
    .controls-info {
        margin: 10px;
        padding: 12px;
        font-size: 11px;
    }
}

/* High DPI display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
    #webgl-canvas {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .spinner {
        animation: none;
        opacity: 0.5;
    }
}

/* Focus styles for keyboard navigation */
.play-button:focus,
.close-btn:focus,
.xr-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Dark mode support (already dark, but for consistency) */
@media (prefers-color-scheme: dark) {
    body {
        background: #000;
    }
}