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

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

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

#map {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 1.0;
    filter: brightness(1.0);
}

#canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

#ui-overlay {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    align-items: center;
    z-index: 1000;
    pointer-events: none;
}

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

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

.btn {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a2e;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

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

.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.12);
    color: white;
    backdrop-filter: blur(8px);
}

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

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

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

#info-panel h2 {
    font-size: 16px;
    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.08);
    border-radius: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
}

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

.sound-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0.5;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.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.4); opacity: 0.6; }
}

#loading-screen {
    position: fixed;
    inset: 0;
    background: #0a0a12;
    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.15);
    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.6);
}

#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;
}

@media (min-width: 600px) {
    #info-panel {
        left: auto;
        right: 16px;
        bottom: 16px;
        width: 320px;
    }
}
