/* --- CONFIGURACIÓN DE FONDO --- */
:root {
    --bg-image: url('/img/back.png'); 
}

body, html {
    margin: 0; padding: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
    touch-action: none;
}

#game-container {
    width: 100vw; height: 100vh;
    background: var(--bg-image) no-repeat center center/cover;
    background-color: #1a1a1a;
    position: relative;
}

.top-gradient {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 25vh;
    background: linear-gradient(to bottom, rgba(40, 55, 125, 1) 0%, rgba(40, 55, 125, 0.8) 50%, rgba(40, 55, 125, 0) 100%);
    z-index: 8;
    pointer-events: none;
}

.header {
    position: absolute; top: 0; width: 100%;
    display: flex; flex-direction: column; align-items: center;
    padding-top: 10px; z-index: 10;
}

.brand-logo img { height: 10vh; max-height: 120px; margin-bottom: 15px; margin-top: 20px; }

#hud {
    display: flex; gap: 15px;
    background: white;
    padding: 10px 20px; border-radius: 30px;
    color: rgb(40, 55, 125); font-weight: bold; font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.transition-fade { animation: fadeIn 0.8s ease-in-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@keyframes ballFade { from { opacity: 0; } to { opacity: 1; } }
.ball-spawn { animation: ballFade 0.5s ease-in forwards; }

.overlay {
    position: absolute; inset: 0;
    background: rgba(40, 55, 125, 0.95);
    background-image: url('/img/back.png');
    background-size: cover;
    background-position: center;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    z-index: 100; color: white; text-align: center;
}

#countdown-overlay {
    position: absolute; inset: 0;
    display: flex; justify-content: center; align-items: center;
    z-index: 50; pointer-events: none;
    background: rgba(40, 55, 125, 0.3);
}

#countdown-text { font-size: 4rem; color: white; font-weight: 700; text-transform: uppercase; text-shadow: 0 5px 15px rgba(0,0,0,0.5); opacity: 0; }
.zoom-fade-anim { animation: zoomFade 2s ease-in-out forwards; }
@keyframes zoomFade { 0% { opacity: 0; transform: scale(0.5); } 30% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1.5); } }

.hidden { display: none !important; }

#categories-container {
    position: absolute; bottom: 5vh; width: 100%;
    display: flex; justify-content: center; gap: 5vw; z-index: 20;
}

.category-btn {
    width: 25vw; height: 25vw; max-width: 110px; max-height: 110px;
    background: white; border: 4px solid #fff; border-radius: 20px;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}

.ball { position: absolute; width: 20vw; height: 20vw; max-width: 90px; max-height: 90px; z-index: 5; cursor: grab; }
.ball img { width: 100%; height: 100%; pointer-events: none; object-fit: contain; }

#screen-flash { position: fixed; inset: 0; pointer-events: none; z-index: 200; opacity: 0; background: red; }
.flash-active { animation: flashAnim 0.4s; }
@keyframes flashAnim { 0% { opacity: 0.6; } 100% { opacity: 0; } }

.correct { background-color: #4CAF50 !important; }
.wrong { background-color: #F44336 !important; }

#play-btn, #restart-btn { background: transparent !important; border: none !important; padding: 0 !important; cursor: pointer; outline: none !important; }
#play-btn img { width: 120px; }
#restart-btn img { width: 180px; }

@media (max-width: 400px) { #hud { font-size: 0.75rem; gap: 8px; } }