/* ========================================
   STYLES.CSS - ESTILOS Y APARIENCIA VISUAL
   ======================================== */

/* ========================================
   IMPORTACIÓN DE FUENTE PIXEL ART
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* ========================================
   ESTILOS BASE DEL BODY
   ======================================== */
body {
    background-color: white;
    color: black;
    font-family: 'Courier New', monospace;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s, font-family 0.3s;
}

/* ========================================
   CONTENEDOR PRINCIPAL DEL JUEGO
   ======================================== */
#game-container {
    background-color: white;
    padding: 30px;
    border: 2px solid black;
    transition: background-color 0.3s, border-color 0.3s;
}

/* ========================================
   TÍTULO DEL JUEGO (H1)
   ======================================== */
h1 {
    text-align: center;
    border-bottom: 2px solid black;
    padding-bottom: 10px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s;
}

h1:hover {
    transform: scale(1.05);
}

h1:active {
    transform: scale(0.98);
}

/* ========================================
   ÁREA DE TEXTO PRINCIPAL
   ======================================== */
#texto {
    margin: 20px 0;
    min-height: 200px;
    white-space: pre-wrap;
}

/* ========================================
   CONTENEDOR DE BOTONES
   ======================================== */
.botones {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* ========================================
   ESTILOS DE BOTONES
   ======================================== */
button {
    background-color: white;
    color: black;
    border: 2px solid black;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    transition: all 0.2s;
}

button:hover {
    background-color: black;
    color: white;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:disabled:hover {
    background-color: white;
    color: black;
}

/* ========================================
   ESTILOS DE INPUTS
   ======================================== */
input {
    padding: 10px;
    font-size: 16px;
    border: 2px solid black;
    font-family: 'Courier New', monospace;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s;
}

.input-grupo {
    margin: 10px 0;
}

/* ========================================
   TEMPORIZADOR (MODO REO)
   ======================================== */
#temporizador {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: rgba(255, 140, 0, 0.9);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 24px;
    font-weight: bold;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    z-index: 1000;
}

/* ========================================
   MODO OSCURO 🌙
   ======================================== */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode #game-container {
    background-color: #2d2d2d;
    border-color: #555;
}

body.dark-mode button {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-mode button:hover {
    background-color: #555;
}

body.dark-mode input {
    background-color: #3d3d3d;
    color: #e0e0e0;
    border-color: #555;
}

/* ========================================
   MODO REO 🟠🔥
   ======================================== */
body.modo-reo {
    background-color: #ff8c00;
    color: white;
}

body.modo-reo #game-container {
    background-color: #ff6600;
    border-color: #ff4500;
}

body.modo-reo button {
    background-color: #ff8c00;
    color: white;
    border-color: white;
}

body.modo-reo button:hover {
    background-color: white;
    color: #ff6600;
}

body.modo-reo input {
    background-color: #ff9933;
    color: white;
    border-color: white;
}

body.modo-reo h1 {
    border-bottom-color: white;
}

/* ========================================
   MODO REO CRÍTICO 🔴💀 (≤5 SEGUNDOS)
   ======================================== */
body.modo-reo-critico {
    background-color: #cc0000 !important;
    color: white !important;
    animation: pulsoRojo 0.5s ease-in-out infinite alternate;
}

body.modo-reo-critico #game-container {
    background-color: #990000 !important;
    border-color: #ff0000 !important;
    border-width: 3px;
}

body.modo-reo-critico button {
    background-color: #cc0000 !important;
    color: white !important;
    border-color: white !important;
    border-width: 2px;
}

body.modo-reo-critico button:hover {
    background-color: white !important;
    color: #cc0000 !important;
}

body.modo-reo-critico input {
    background-color: #dd0000 !important;
    color: white !important;
    border-color: white !important;
}

body.modo-reo-critico h1 {
    border-bottom-color: white !important;
    animation: temblorCritico 0.1s ease-in-out infinite;
}

body.modo-reo-critico #temporizador {
    background-color: rgba(255, 0, 0, 0.95) !important;
    animation: parpadeoTemporizador 0.3s ease-in-out infinite;
    font-size: 28px;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
}

/* Animación de pulso rojo para el fondo */
@keyframes pulsoRojo {
    0% {
        background-color: #cc0000;
    }
    100% {
        background-color: #aa0000;
    }
}

/* Animación de temblor para el título */
@keyframes temblorCritico {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2px);
    }
    75% {
        transform: translateX(2px);
    }
}

/* Animación de parpadeo para el temporizador */
@keyframes parpadeoTemporizador {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* ========================================
   MODO PIXEL ART 🎮✨
   ======================================== */
body.pixel-art-mode h1 {
    font-family: 'Press Start 2P', cursive !important;
    font-size: 20px;
    text-shadow: none; 
    border-bottom-style: dashed;
}

/* ========================================
   RESPONSIVIDAD MÓVIL 📱
   ======================================== */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    #game-container {
        padding: 15px;
    }
    
    button {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    #temporizador {
        top: 10px;
        right: 10px;
        padding: 10px 15px;
        font-size: 18px;
    }
    
    h1 {
        font-size: 1.3em;
    }
    
    body.pixel-art-mode h1 {
        font-size: 14px;
    }
    
    /* Ajuste para temporizador crítico en móvil */
    body.modo-reo-critico #temporizador {
        font-size: 22px;
    }
}