/* Estilos generales */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
    --primary-color: #00ad8f;
    --primary-light: #33bea4;
    --primary-dark: #008c72;
    --accent-color: #ffca29;
    --accent-light: #ffda5e;
    --accent-dark: #e6b520;
    --text-color: #000000;
    --bg-color: #ffffff;
}

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

body {
    font-family: 'Press Start 2P', cursive;
    background-color: var(--primary-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 20px;
    position: relative;
}

/* Ladrillos decorativos retro */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 18px, #19d3b3 18px, #19d3b3 20px),
        repeating-linear-gradient(90deg, transparent, transparent 18px, #19d3b3 18px, #19d3b3 20px);
    background-size: 40px 40px;
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
    image-rendering: pixelated;
}

.screen {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    transition: all 0.3s ease;
    background-color: var(--bg-color);
    aspect-ratio: 9/16;
    position: relative;
    overflow: hidden;
    /* Efecto de pantalla retropixel */
    border: 12px solid #333;
    border-radius: 20px;
    box-shadow: 
        0 0 10px rgba(0, 0, 0, 0.3),
        inset 0 0 15px rgba(0, 0, 0, 0.5);
    margin-block-start: -130px;
}

/* Botones físicos del teléfono retro */
.screen::after {
    content: '';
    position: absolute;
    right: -15px;
    top: 50px;
    width: 5px;
    height: 30px;
    background-color: #222;
    border-radius: 0 3px 3px 0;
    box-shadow: 0 2px 2px rgba(0,0,0,0.2);
    z-index: 20;
}

/* Segundo botón físico */
.screen::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 80px;
    width: 5px;
    height: 40px;
    background-color: #222;
    border-radius: 3px 0 0 3px;
    box-shadow: 0 2px 2px rgba(0,0,0,0.2);
    z-index: 20;
}

/* Antena retráctil */
body::after {
    content: '';
    position: fixed;
    top: calc(50% - 200px);
    right: calc(50% - 190px);
    width: 4px;
    height: 60px;
    background-color: #222;
    border-radius: 2px;
    z-index: 30;
    transform: rotate(-15deg);
    transform-origin: bottom center;
}

body::before {
    content: '';
    position: fixed;
    top: calc(50% - 200px);
    right: calc(50% - 190px);
    width: 8px;
    height: 8px;
    background-color: #444;
    border-radius: 50%;
    z-index: 31;
}

.hidden {
    display: none;
}

/* Efecto de líneas de escaneo retro */
.screen .scanlines {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.05) 50%,
        transparent 100%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
    opacity: 0.4;
}

/* Efecto de curvatura CRT */
.screen .crt-effect {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at center,
        transparent 60%,
        rgba(0, 0, 0, 0.2) 100%
    );
    pointer-events: none;
    z-index: 11;
}

/* Efecto de brillo en los bordes */
.screen {
    position: relative;
}

.screen .edge-glow {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(to bottom, rgba(255,255,255,0.15) 0%, transparent 1px) 0 0 / 100% 4px,
        linear-gradient(to right, rgba(255,255,255,0.15) 0%, transparent 1px) 0 0 / 4px 100%;
    pointer-events: none;
    z-index: 12;
    opacity: 0.7;
}

/* Pantalla de inicio */
.logo-container {
    margin-bottom: 30px;
    width: 64%;
    max-width: 240px;
    z-index: 5;
}

/* Olla y cucharón */
.pot-container {
    position: relative;
    width: 100px;
    height: 80px;
    margin-top: 20px;
    z-index: 5;
}

.pot {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 15px;
    background-color: #e0e0e0;
    border-radius: 45px;
    border: 3px solid #999;
    overflow: visible;
    image-rendering: pixelated;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Comida en el plato */
.pot::after {
    content: '';
    position: absolute;
    top: -25px;
    left: 15px;
    width: 55px;
    height: 35px;
    background-color: #ff9800;
    border-radius: 30px 30px 10px 10px;
    box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.2);
}

.ladle {
    position: absolute;
    top: -15px;
    right: 15px;
    width: 6px;
    height: 45px;
    background-color: #a0a0a0;
    border-radius: 3px;
    transform-origin: bottom center;
    transform: rotate(-15deg);
    animation: stir 2s infinite ease-in-out;
    image-rendering: pixelated;
}

.ladle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 22px;
    height: 22px;
    background-color: #a0a0a0;
    border-radius: 50%;
    border: 2px solid #808080;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes stir {
    0% { transform: rotate(-15deg); }
    25% { transform: rotate(5deg); }
    50% { transform: rotate(-5deg); }
    75% { transform: rotate(15deg); }
    100% { transform: rotate(-15deg); }
}

.logo {
    width: 100%;
    height: auto;
    image-rendering: pixelated;
}

.message-container {
    margin-bottom: 30px;
    z-index: 5;
}

.message-container h1 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    text-shadow: 2px 2px 0px var(--accent-color);
    letter-spacing: -0.5px;
}

.message-container p {
    font-size: 0.8rem;
    line-height: 1.5;
    padding: 0 10px;
}

/* Botones estilo retro */
.retro-button {
    background-color: var(--primary-color);
    color: var(--bg-color);
    border: none;
    padding: 12px 25px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--primary-dark);
    position: relative;
    text-decoration: none;
    display: inline-block;
    margin: 10px;
    text-transform: uppercase;
    transition: all 0.1s ease;
    image-rendering: pixelated;
    border-radius: 4px;
    z-index: 5;
    /* Efecto de botón pixelado */
    border: 2px solid transparent;
    border-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="6" height="6"><path d="M0 0h2v2H0zm2 2h2v2H2zm2-2h2v2H4z" fill="%23008c72" /></svg>') 2 stretch;
}

.retro-button:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--primary-dark);
}

.retro-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--primary-dark);
}

.retro-button.secondary {
    background-color: var(--accent-color);
    box-shadow: 0 4px 0 var(--accent-dark);
}

.retro-button.secondary:hover {
    background-color: var(--accent-light);
    box-shadow: 0 6px 0 var(--accent-dark);
}

.retro-button.secondary:active {
    box-shadow: 0 2px 0 var(--accent-dark);
}

/* Pantalla de juego */
#game-canvas {
    border: 4px solid #19d3b3;
    background-color: var(--bg-color);
    image-rendering: pixelated;
    max-width: 100%;
    z-index: 5;
    /* Efecto de pantalla retro */
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.game-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
    font-size: 1rem;
    gap: 8px;
}

.game-logo {
    display: flex;
    justify-content: center;
}

.game-logo-img {
    height: 67px;
    width: auto;
    image-rendering: pixelated;
}

.score {
    padding: 5px 10px;
    background-color: var(--primary-color);
    color: var(--bg-color);
    border-radius: 4px;
}

/* Controles móviles */
.game-controls {
    margin-top: 15px;
    display: none; /* Se mostrará en dispositivos móviles */
    z-index: 5;
    width: 100%;
}

.mobile-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.horizontal-controls {
    display: flex;
    justify-content: center;
    gap: 22px;
    width: 100%;
}

.control-button {
    width: 50px;
    height: 50px;
    background-color: var(--accent-color);
    border: 2px solid var(--accent-dark);
    border-radius: 8px; /* Más cuadrado para estilo retropixel */
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--accent-dark);
    user-select: none;
    image-rendering: pixelated;
    /* Efecto de botón pixelado */
    position: relative;
    overflow: hidden;
}

.control-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--accent-dark);
}

/* Pantalla final */
#end-screen {
    padding: 30px 25px;
}

.end-logo-container {
    margin-bottom: 20px;
    z-index: 5;
}

.end-logo {
    height: 67px;
    width: auto;
    image-rendering: pixelated;
}

#end-screen h1 {
    font-size: 1rem;
    margin: 0 15px;
    margin-bottom: 10px;
}

#end-screen p {
    margin: 0 15px;
    margin-bottom: 10px;
}

.coupon-container {
    margin: 20px 15px;
}

.coupon {
    background-color: var(--accent-color);
    padding: 15px 30px;
    font-size: 1.2rem;
    margin-top: 10px;
    border: 2px dashed var(--primary-color);
    letter-spacing: 2px;
}

/* Efectos visuales */
.fireworks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* Responsive */
@media (max-width: 768px) {
    .message-container h1 {
        font-size: 1.2rem;
    }
    
    .message-container p {
        font-size: 0.8rem;
    }
    
    .retro-button {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
    .game-controls {
        display: block;
    }
}

@media (max-width: 480px) {
    .message-container h1 {
        font-size: 1rem;
    }
    
    .coupon {
        font-size: 1rem;
        padding: 10px 20px;
    }
}

.small-text {
    font-size: 0.4rem; /* La mitad de 0.8rem */
}


