* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #000;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    position: fixed;
    touch-action: none;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

#loading-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.loading-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* Error Screen */
.error-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.error-content {
    text-align: center;
    color: white;
    padding: 20px;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

#error-message {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    line-height: 1.5;
}

.retry-button {
    background: white;
    color: #f5576c;
    border: none;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 24px;
    cursor: pointer;
    transition: transform 0.2s;
}

.retry-button:active {
    transform: scale(0.95);
}

/* Main App Container */
#app-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Video Feed */
#video-feed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

/* Wireframe Canvas */
#wireframe-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* FPS Counter */
.fps-counter {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
    backdrop-filter: blur(4px);
}

/* Controls Panel */
.controls-panel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.control-button {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.control-button:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.9);
}

.control-button.active {
    background: rgba(100, 200, 255, 0.8);
}

.control-button .icon {
    width: 28px;
    height: 28px;
    color: #000;
}

/* Footer */
.footer {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    z-index: 5;
    backdrop-filter: blur(4px);
}

.footer a {
    color: #64c8ff;
    text-decoration: none;
    font-weight: 600;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .control-button {
        width: 54px;
        height: 54px;
    }
    
    .control-button .icon {
        width: 24px;
        height: 24px;
    }
    
    .fps-counter {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Orientation Lock Warning (optional) */
@media (orientation: landscape) and (max-height: 500px) {
    .controls-panel {
        bottom: 10px;
        right: 10px;
    }
}