/* ===================================
   ESTILOS GENERALES Y MENÚ PRINCIPAL
   =================================== */

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

body {
    font-family: 'Comic Sans MS', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #81C784 0%, #4CAF50 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.pantalla {
    display: none;
    width: 100%;
    max-width: 800px;
    animation: fadeIn 0.3s ease-in;
}

.pantalla.activa {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* MENÚ PRINCIPAL - ESTILO CAPITULIN */
#menu-principal {
    background: white;
    border-radius: 30px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    padding: 40px 30px;
    text-align: center;
}

.header-capitulin {
    margin-bottom: 40px;
}

.logo-circulo {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #66BB6A, #43A047);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4); }
    50% { box-shadow: 0 8px 30px rgba(76, 175, 80, 0.7); }
}

.header-capitulin h1 {
    color: #2E7D32;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitulo {
    color: #558B2F;
    font-size: 1.2em;
    font-weight: normal;
}

/* BOTONES DE OPCIONES */
.menu-opciones {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.boton-opcion {
    background: white;
    border: 4px solid #4CAF50;
    border-radius: 20px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.boton-opcion:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.boton-opcion:active {
    transform: translateY(-2px);
}

.boton-opcion.suma {
    border-color: #4CAF50;
}

.boton-opcion.suma:hover {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
}

.boton-opcion.resta {
    border-color: #FF6B6B;
}

.boton-opcion.resta:hover {
    background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
}

.boton-opcion .icono {
    font-size: 3em;
}

.boton-opcion .texto {
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
}

.boton-opcion .descripcion {
    font-size: 1em;
    color: #666;
}

/* FOOTER */
.footer-capitulin {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #E0E0E0;
}

.footer-capitulin p {
    color: #558B2F;
    font-size: 1em;
    font-weight: bold;
}

/* ===================================
   ESTILOS DE LAS PANTALLAS DE JUEGO
   =================================== */

#pantalla-suma, #pantalla-resta {
    background: white;
    border-radius: 30px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    padding: 20px;
}

.boton-volver {
    background: #757575;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.boton-volver:hover {
    background: #616161;
    transform: translateY(-2px);
}

.boton-volver:active {
    transform: translateY(0);
}

.titulo-modo {
    text-align: center;
    color: #2E7D32;
    margin-bottom: 20px;
    font-size: 2em;
}

#app-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

/* OPERACIONES Y RESULTADOS */
.sumandos, .resultado, .operacion {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 10px;
    gap: 10px;
}

.columna {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 5px;
}

.signo {
    font-size: 2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

/* CÍRCULOS DE LLEVADA/PRÉSTAMO */
.llevada-circulo, .prestamo-circulo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #00C853;
    background-color: #CCFF90;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    min-height: 40px;
}

.prestamo-circulo {
    border-color: #F44336;
    background-color: #FFCDD2;
    color: #C62828;
}

#suma-llevada-arriba, #resta-prestamo-arriba {
    margin-bottom: 5px;
}

/* ANIMACIONES */
.parpadeo-llevada, .parpadeo-prestamo {
    animation: parpadeo 0.6s ease-in-out 3;
}

@keyframes parpadeo {
    0%, 100% { 
        transform: scale(1);
    }
    50% { 
        background-color: #FFD600;
        transform: scale(1.2);
        box-shadow: 0 0 20px #FFD600;
    }
}

.parpadeo-prestamo {
    animation: parpadeo-resta 0.6s ease-in-out 3;
}

@keyframes parpadeo-resta {
    0%, 100% { 
        transform: scale(1);
    }
    50% { 
        background-color: #FF5722;
        transform: scale(1.2);
        box-shadow: 0 0 20px #FF5722;
    }
}

/* CAJAS DE NÚMEROS */
.numero-box, .resultado-box {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    margin: 5px 0;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 4px #00000030;
}

.numero-box.azul { background-color: #448AFF; color: white; }
.numero-box.amarillo { background-color: #FFEA00; color: #333; }
.resultado-box.rosa { background-color: #FF4081; color: white; }

.resultado-box {
    padding: 0;
    text-align: center;
    border: 3px solid #333;
    transition: all 0.2s;
}

.resultado-box.correcto { 
    border-color: #00E676; 
    background-color: #B9F6CA; 
}

.resultado-box.error { 
    border-color: #FF1744; 
    background-color: #FF8A80; 
}

/* RANA */
.rana-interactiva {
    font-size: 2em;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
    margin: 5px 0;
}

.rana-interactiva.activo {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

#suma-camino-rana, #resta-camino-rana {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* TECLADO */
#suma-teclado-numerico, #resta-teclado-numerico {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
    padding: 10px;
    background-color: #F5F5F5;
    border-radius: 10px;
}

.teclado-boton {
    padding: 15px;
    font-size: 1.5em;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 3px #388E3C;
    transition: all 0.1s;
}

#resta-teclado-numerico .teclado-boton {
    background-color: #FF6B6B;
    box-shadow: 0 3px #E53935;
}

.teclado-boton:active {
    transform: translateY(2px);
    box-shadow: 0 1px #388E3C;
}

#resta-teclado-numerico .teclado-boton:active {
    box-shadow: 0 1px #E53935;
}

/* MENSAJES Y BOTONES */
#suma-mensaje-feedback, #resta-mensaje-feedback {
    margin-top: 20px;
    font-size: 1.2em;
    font-weight: bold;
    min-height: 30px;
    color: #1B5E20;
}

#resta-mensaje-feedback {
    color: #B71C1C;
}

.boton-accion {
    margin-top: 20px;
    padding: 15px 30px;
    font-size: 1.3em;
    font-weight: bold;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px #388E3C;
    transition: all 0.2s;
}

#resta-boton-nueva {
    background-color: #FF6B6B;
    box-shadow: 0 4px #E53935;
}

.boton-accion:hover {
    transform: translateY(-2px);
}

.boton-accion:active {
    transform: translateY(2px);
}

.boton-accion.oculto {
    display: none;
}

hr {
    border: none;
    border-top: 3px solid #333;
    margin: 15px 0;
}

/* RESPONSIVE */
@media (max-width: 600px) {
    .header-capitulin h1 {
        font-size: 2em;
    }
    
    .logo-circulo {
        width: 90px;
        height: 90px;
        font-size: 3em;
    }
    
    .boton-opcion .texto {
        font-size: 1.5em;
    }
}
