* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: #0f1015;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: monospace;
    overflow: hidden;
    color: #ffffff;
    padding: 10px;
    background-size: cover;
    background-position: center;
    transition: background-image 0.3s ease-in-out;
}

@media (max-width: 600px) {
    body { background-image: url('assets/cel.png'); }
}

@media (min-width: 601px) {
    body { background-image: url('assets/bk.png'); }
}

#contenedor-juego {
    position: relative;
    width: 100%;
    max-width: 410px; 
    background-color: #1a1c23;
    border: 4px solid #34495e;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#contenedor-juego::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/meson.png');
    background-size: 100% auto;
    background-repeat: no-repeat;
    background-position: center bottom 120px;
    z-index: -1;
}

/* HUD con sección izquierda para el logo */
#hud {
    background-color: #0c0d10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 3px solid #2c3e50;
    z-index: 2;
}

#seccion-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

#logo-restaurante {
    height: 40px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
}

#datos-hud {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 13px;
    font-weight: bold;
    gap: 2px;
}

#puntos-txt { color: #2ecc71; }
#tiempo-txt { color: #e74c3c; }
#combo-txt { color: #9b59b6; }

canvas {
    width: 100%;
    display: block;
    background-color: #20222c;
    z-index: 1;
}

#botonera {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    background-color: #0c0d10;
    padding: 10px;
    gap: 6px;
    border-top: 3px solid #2c3e50;
    z-index: 2;
}

.btn-ingrediente {
    background-color: #2c3e50;
    border: 2px solid #34495e;
    color: white;
    border-radius: 6px;
    padding: 10px 0;
    font-size: 10px;
    font-family: monospace;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-ingrediente:active {
    background-color: #1a252f;
    transform: scale(0.95);
}

.btn-entregar {
    grid-column: span 4;
    background-color: #2ecc71;
    border: 2px solid #27ae60;
    color: white;
    font-family: monospace;
    font-size: 15px;
    font-weight: bold;
    padding: 12px 0;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    margin-top: 2px;
}

.btn-entregar:active {
    background-color: #27ae60;
    transform: scale(0.98);
}

.icono-ingrediente {
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.c-carne { background-image: url('assets/ingredientes/carne.png'); }
.c-pescado { background-image: url('assets/ingredientes/pescado.png'); }
.c-patatas { background-image: url('assets/ingredientes/patatas.png'); }
.c-ensalada { background-image: url('assets/ingredientes/ensalada.png'); }
.c-mariscos { background-image: url('assets/ingredientes/mariscos.png'); }
.c-pimientos { background-image: url('assets/ingredientes/pimientos.png'); }
.c-pan { background-image: url('assets/ingredientes/pan.png'); }
.c-verdura { background-image: url('assets/ingredientes/verdura.png'); }

/* --- SISTEMA DE POPUPS --- */
.popup-pantalla {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    padding: 15px;
}

.popup-contenido {
    width: 100%;
    height: 100%;
    max-height: 480px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 40px;
    position: relative;
}

/* Pantalla Win adaptada para contener el formulario abajo */
.popup-contenido-win {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center top;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 20px;
}

.btn-popup-accion {
    background-color: #e74c3c;
    color: white;
    font-family: monospace;
    font-size: 18px;
    font-weight: bold;
    padding: 12px 35px;
    border: 3px solid #ffffff;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: transform 0.1s;
}
.btn-popup-accion:active {
    transform: scale(0.95);
}

.puntuacion-final-msg {
    color: #f1c40f;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px #000;
}

/* --- ESTILOS DEL FORMULARIO DE SORTEO --- */
.contenedor-formulario {
    background-color: rgba(20, 22, 30, 0.95);
    border: 2px solid #f1c40f;
    border-radius: 10px;
    padding: 15px;
    width: 90%;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.3);
}

.contenedor-formulario h3 {
    font-size: 13px;
    color: #f1c40f;
    text-align: center;
    margin-bottom: 10px;
}

.grupo-campo {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.grupo-campo label {
    font-size: 11px;
    margin-bottom: 3px;
    color: #bdc3c7;
}

.grupo-campo input {
    background-color: #2c3e50;
    border: 1px solid #34495e;
    color: white;
    padding: 6px 8px;
    font-family: monospace;
    font-size: 12px;
    border-radius: 4px;
    outline: none;
}

.grupo-campo input:focus {
    border-color: #f1c40f;
}

.btn-enviar-datos {
    background-color: #2ecc71;
    color: white;
    border: none;
    width: 100%;
    padding: 10px 0;
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 5px;
}
.btn-enviar-datos:active {
    background-color: #27ae60;
}

.oculto { display: none !important; }