/* --- Estilos Generales y Fuentes --- */
:root {
    --main-bg: #1e88e5;
    --secondary-bg: #42a5f5;
    --red-panel: #e53935;
    --order-panel: #fffde7;
    --text-dark: #3e2723;
    --font-main: 'Fredoka One', cursive;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(180deg, var(--main-bg) 50%, var(--secondary-bg) 50%);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* --- Contenedor Principal (MÓVIL PRIMERO) --- */
#game-wrapper {
    width: 100%;
    height: 100%;
    max-width: 1400px;
    max-height: 900px;
    background-color: var(--secondary-bg);
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* --- Encabezado Responsivo --- */
header h1 {
    font-size: clamp(1rem, 4vw, 1.8rem);
    color: white;
    background-color: var(--red-panel);
    padding: 0.5rem 1rem;
    border-radius: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
#timer {
    font-size: clamp(1.2rem, 5vw, 2rem);
    font-weight: bold;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.2rem 0.8rem;
    border-radius: 10px;
    border: 2px solid white;
    white-space: nowrap;
}

/* --- Contenedor Principal del Juego (MÓVIL PRIMERO) --- */
#main-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 0.8rem;
    margin: 0.8rem 0;
    overflow-y: auto;
    padding: 0 0.2rem;
}

#left-panel, #center-panel, #right-panel {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* Paneles Específicos */
#status-display, #order-display {
    background-color: var(--order-panel);
    border-radius: 15px;
    padding: 0.8rem;
    text-align: center;
}
#status-display p { font-size: clamp(1rem, 4vw, 1.4rem); }
#order-display h2 { font-size: clamp(1.1rem, 4.5vw, 1.6rem); }
#order-list { list-style: none; padding-left: 0; font-size: clamp(1rem, 4vw, 1.4rem); }
.current-volovan { font-weight: bold; color: #d84315; }

#center-panel {
    min-height: 220px;
    position: relative;
}
#volovan-station img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(100px, 30vw, 180px);
}

#ingredient-selector {
    background-color: var(--red-panel);
    border-radius: 15px;
    padding: 0.8rem;
}
#ingredient-selector h2 {
    color: white;
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: clamp(1.1rem, 4.5vw, 1.6rem);
}
#ingredient-icons {
    display: flex;
    justify-content: space-around;
    align-items: center;
}
#ingredient-icons img {
    width: clamp(55px, 18vw, 85px); /* <-- INGREDIENTES MÁS GRANDES */
    cursor: pointer;
    transition: transform 0.2s;
}
#ingredient-icons img:hover { transform: scale(1.1); }

#right-panel { min-height: 180px; }
#oven {
    background: url(imagenes/oven.png) no-repeat center center;
    background-size: contain;
    width: 100%;
    height: 100%;
    position: relative;
}
#oven-window-top {
    width: 100%; left: 25%; top: 35%; height: 80%;
    overflow: hidden; display: flex;
    justify-content: center; align-items: center;
}
#oven-flames { width: 80%; height: 80%; object-fit: contain; }
#oven-window-bottom {
    position: absolute;
    width: 60%; left: 40%; top: 50%; height: 45%;
}
#oven-window-bottom img { width: 100%; height: 100%; object-fit: contain; }

/* Controles y Mensajes */
#game-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 0.5rem;
}
#start-game-btn, #restart-btn {
    font-size: clamp(1.2rem, 5vw, 1.8rem); /* <-- BOTÓN MÁS GRANDE */
    padding: 1rem 2rem;
    border-radius: 25px;
    border: 3px solid #388e3c;
    cursor: pointer;
    background-color: #4caf50;
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); /* <-- SOMBRA PARA VISIBILIDAD */
    transition: transform 0.1s ease-in-out;
}
#start-game-btn:active, #restart-btn:active { transform: scale(0.95); }

#message-overlay {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    color: white; font-size: clamp(1.5rem, 8vw, 3rem);
    text-align: center; padding: 1rem;
}
.hidden { display: none !important; }

/* ======================================================= */
/* --- MEDIA QUERIES PARA PANTALLAS GRANDES (TABLET/PC) --- */
/* ======================================================= */

@media (min-width: 768px) and (min-height: 550px) {
    #game-wrapper {
        border-radius: 25px;
        border: 8px solid #1565c0;
        padding: 1.5rem;
    }
    
    #main-container {
        flex-direction: row;
        overflow-y: hidden;
    }

    #left-panel { flex: 2; }
    #center-panel { flex: 5; }
    #right-panel { flex: 2; }

    #volovan-station img {
        top: 80%;
        width: clamp(150px, 30vmin, 250px);
    }
    
    #oven { background-size: cover; }
    #oven-window-bottom { width: 80%; left: 10%; top: 45%; height: 50%; }

    #start-game-btn, #restart-btn {
        font-size: 1.8rem;
        padding: 1.2rem 2.5rem;
    }
}