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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    background: #000;
}

#webgl {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#css3d-root {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

#css3d-renderer {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

/* URL overlay - keep focusable even when hidden */
#url-overlay {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 16px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    transition: opacity .12s;
    margin: 0 auto;
    max-width: 400px;
}

#url-overlay.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

#url-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#url-input:focus {
    border-color: #4CAF50;
}

#hint {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    z-index: 100;
    pointer-events: none;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 20px;
    background: rgba(255, 59, 48, 0.95);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 300px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 600px) {
    #url-overlay {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
        margin: 0;
    }
    
    #url-input {
        width: 100%;
    }
}