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

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

.hidden-map {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

#camera-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 1000;
    pointer-events: none;
}

#ui-overlay > * {
    pointer-events: auto;
}

.control-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a2e;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.btn:hover {
    transform: scale(1.05);
    background: #fff;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-secondary.active {
    background: rgba(102, 126, 234, 0.8);
}

#info-panel {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 16px 20px;
    z-index: 1000;
    max-height: 40vh;
    overflow-y: auto;
}

#info-panel h2 {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin-bottom: 12px;
}

#sounds-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sound-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

.sound-chip.playing {
    background: rgba(102, 126, 234, 0.6);
    color: white;
}

.sound-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0.5;
}

.sound-chip.playing .sound-indicator {
    opacity: 1;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

#loading-screen {
    position: fixed;
    inset: 0;
    background: #1a1a2e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.5s ease;
}

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

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#loading-status {
    margin-top: 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

#error-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 20px 32px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 3000;
    text-align: center;
    max-width: 400px;
    display: none;
}

#error-message.visible {
    display: block;
}

a-scene {
    position: fixed;
    inset: 0;
}

a-scene.a-loading {
    background: #1a1a2e;
}

a-scene canvas {
    background: transparent !important;
}

.a-enter-vr-button {
    display: none !important;
}
