* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

canvas {
    display: block;
}

/* Overlay de menús */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    overflow-y: auto;
    padding: 20px;
}

.menu-overlay.hidden {
    display: none;
}

.menu-container {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid #3a3a3a;
    margin: auto;
}

.menu-container.small {
    max-width: 320px;
}

.menu-container.wide {
    max-width: 650px;
}

/* Layout de configuración */
.config-layout {
    margin-bottom: 20px;
}

.controls-section {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.controls-section .config-section {
    flex: 1;
    margin-bottom: 0;
}

.audio-section {
    margin-bottom: 20px;
}

.game-title {
    text-align: center;
    font-size: clamp(28px, 5vw, 48px);
    color: #f0a030;
    text-shadow: 0 0 20px rgba(240, 160, 48, 0.5), 2px 2px 0 #000;
    margin-bottom: 20px;
    letter-spacing: 4px;
}

h2 {
    text-align: center;
    color: #fff;
    margin-bottom: 20px;
    font-size: clamp(20px, 4vw, 28px);
}

h3 {
    color: #f0a030;
    margin-bottom: 12px;
    font-size: clamp(14px, 2.5vw, 18px);
    border-bottom: 1px solid #3a3a3a;
    padding-bottom: 8px;
}

/* Layout del menú principal */
.main-menu-layout {
    text-align: center;
    margin: auto;
}

.main-menu-content {
    display: flex;
    gap: 40px;
    align-items: stretch;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid #3a3a3a;
}

.map-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.map-section h3 {
    margin: 0;
    border: none;
    padding: 0;
}

.options-section {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 240px;
}

.game-options {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 15px;
}

.game-options h3 {
    margin: 0 0 15px 0;
    border: none;
    padding: 0;
    text-align: center;
}

/* Selector de mapas */
.map-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.map-arrow {
    background: #3a3a3a;
    border: none;
    color: #fff;
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.map-arrow:hover {
    background: #f0a030;
    transform: scale(1.1);
}

.map-preview-container {
    text-align: center;
}

#mapPreview {
    border-radius: 10px;
    border: 3px solid #3a3a3a;
    background: #1a1a1a;
    display: block;
    max-width: 100%;
    height: auto;
}

.map-name {
    display: block;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
}


/* Checkbox de mapa aleatorio */
.checkbox-container {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: #ccc;
    font-size: 14px;
    gap: 10px;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 24px;
    height: 24px;
    background: #3a3a3a;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.checkbox-container input:checked + .checkmark {
    background: #f0a030;
}

.checkmark::after {
    content: '✓';
    color: #fff;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s;
}

.checkbox-container input:checked + .checkmark::after {
    opacity: 1;
}

/* Selector de objetivo de kills */
.kill-goal-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    color: #fff;
    font-size: 16px;
}

.goal-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.goal-btn {
    background: #3a3a3a;
    border: none;
    color: #fff;
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.goal-btn:hover {
    background: #f0a030;
}

.goal-value {
    font-size: 28px;
    font-weight: bold;
    color: #f0a030;
    min-width: 40px;
    text-align: center;
}

/* Botones del menú */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-btn {
    background: linear-gradient(145deg, #4a4a4a, #3a3a3a);
    border: none;
    color: #fff;
    font-size: 18px;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
}

.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.menu-btn.primary.large {
    padding: 20px 40px;
    font-size: 22px;
}

.menu-btn.primary {
    background: linear-gradient(145deg, #f0a030, #d08020);
    color: #000;
}

.menu-btn.primary:hover {
    background: linear-gradient(145deg, #ffb040, #e09030);
}

.menu-btn.danger {
    background: linear-gradient(145deg, #c03030, #a02020);
}

.menu-btn.danger:hover {
    background: linear-gradient(145deg, #d04040, #b03030);
}

/* Secciones de configuración */
.config-section {
    margin-bottom: 25px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
}

.control-row, .audio-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #ccc;
}

.audio-row span:first-child {
    min-width: 130px;
}

.audio-row span:last-child {
    min-width: 45px;
    text-align: right;
}

.key-btn {
    background: #3a3a3a;
    border: 2px solid #4a4a4a;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    min-width: 80px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.key-btn:hover {
    border-color: #f0a030;
}

.key-btn.listening {
    background: #f0a030;
    color: #000;
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

/* Sliders de audio */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 8px;
    background: #3a3a3a;
    border-radius: 4px;
    outline: none;
    margin: 0 10px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #f0a030;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #f0a030;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Pantalla de victoria */
.victory-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px currentColor;
}

.final-score {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    font-size: 48px;
    font-weight: bold;
}

.score {
    min-width: 60px;
    text-align: center;
}

.score.p1 {
    color: #4a8;
}

.score.p2 {
    color: #a48;
}

.score-separator {
    color: #fff;
}

/* Responsive */
@media (max-width: 800px) {
    .main-menu-content {
        flex-direction: column;
        gap: 25px;
    }
    
    .options-section {
        min-width: auto;
    }
    
    .controls-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .menu-container.wide {
        max-width: 95%;
    }
}

@media (max-width: 500px) {
    .menu-overlay {
        padding: 10px;
    }
    
    .menu-container,
    .main-menu-content {
        padding: 20px;
    }
    
    #mapPreview {
        width: 220px;
        height: 138px;
    }
    
    .map-arrow {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .menu-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .menu-btn.primary.large {
        padding: 15px 30px;
        font-size: 18px;
    }
    
    input[type="range"] {
        flex: 1;
        margin: 0 8px;
    }
    
    .audio-row, .control-row {
        font-size: 13px;
    }
    
    .key-btn {
        min-width: 60px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (max-height: 600px) {
    .game-title {
        margin-bottom: 10px;
    }
    
    .main-menu-content {
        padding: 20px;
        gap: 20px;
    }
    
    .map-section {
        gap: 8px;
    }
    
    #mapPreview {
        width: 200px;
        height: 125px;
    }
}
