* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    font-family: Arial, sans-serif;
}

body {
    background: #f3f5f7;
}

button,
input {
    font-family: inherit;
}

.pantalla {
    min-height: 100vh;
    padding: 30px;
}

.oculta {
    display: none;
}

/* BIENVENIDA */

#pantalla-bienvenida {
    display: flex;
    align-items: center;
    justify-content: center;
}

#pantalla-bienvenida.oculta {
    display: none;
}

.tarjeta {
    background: white;
    border-radius: 24px;
    padding: 50px;
    width: 500px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
}

.bienvenida h1 {
    font-size: 52px;
    margin: 0 0 30px;
}

.pregunta {
    font-size: 28px;
    font-weight: bold;
}

#nombre {
    width: 100%;
    height: 70px;
    font-size: 30px;
    text-align: center;
    border: 3px solid #bbb;
    border-radius: 14px;
    outline: none;
}

#nombre:focus {
    border-color: #555;
}

#btn-empezar {
    margin-top: 30px;
    width: 240px;
    height: 70px;
    font-size: 24px;
    font-weight: bold;
    border: 0;
    border-radius: 15px;
    cursor: pointer;
}

#aviso-nombre {
    min-height: 25px;
    font-weight: bold;
}

/* CABECERA */

.cabecera {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.datos-jugador {
    font-size: 20px;
    font-weight: bold;
    display: flex;
    gap: 30px;
}

/* MENÚ */

.menu-principal {
    max-width: 900px;
    margin: 60px auto;
    text-align: center;
}

.menu-principal h1 {
    font-size: 40px;
    margin-bottom: 60px;
}

.botones-menu {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
}

.boton-grande {
    width: 280px;
    height: 180px;
    border: 0;
    border-radius: 25px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0, 0, 0, .15);
}

.boton-grande:hover {
    transform: translateY(-3px);
}

.boton-grande:active {
    transform: translateY(1px);
}

.icono {
    display: block;
    font-size: 60px;
    margin-bottom: 15px;
}

.boton-volver {
    height: 50px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

/* TABLET / PANTALLAS PEQUEÑAS */

@media (max-width: 700px) {

    .pantalla {
        padding: 15px;
    }

    .tarjeta {
        width: 95%;
        padding: 30px;
    }

    .botones-menu {
        gap: 25px;
    }

    .boton-grande {
        width: 90%;
        max-width: 320px;
        height: 140px;
    }
}

.sumas-layout {
    max-width: 950px;
    margin: 20px auto;
    display: flex;
    gap: 35px;
}

.zona-suma,
.panel-pasos {
    background: white;
    border-radius: 22px;
    padding: 30px;
    box-shadow: 0 5px 18px rgba(0,0,0,.12);
}

.zona-suma {
    width: 48%;
    text-align: center;
}

.panel-pasos {
    width: 52%;
}

.zona-suma h1 {
    margin-top: 0;
    font-size: 32px;
}

.operacion {
    position: relative;
    width: 250px;
    margin: 30px auto;
    font-size: 58px;
    font-weight: bold;
}

.fila {
    display: grid;
    grid-template-columns: 70px 70px;
    justify-content: center;
    min-height: 72px;
}

.fila span {
    display: flex;
    align-items: center;
    justify-content: center;
}

.suma-fila {
    position: relative;
}

.signo {
    position: absolute;
    left: 15px;
}

.linea {
    width: 160px;
    height: 5px;
    background: #222;
    margin: 0 auto 10px;
}

.llevada {
    min-height: 45px;
    font-size: 34px;
    color: red;
}

.casilla-suma {
    position: absolute;
    width: 64px;
    height: 64px;
    font-size: 42px;
    font-weight: bold;
    text-align: center;
    border: 4px solid #333;
    border-radius: 12px;
    outline: none;
    background: #fffbea;
}

.casilla-suma:focus {
    border-color: #4c7edc;
}

.destacado {
    background: #dceeff;
    border-radius: 12px;
}

.paso-hecho {
    font-size: 19px;
    font-weight: bold;
    color: #27863c;
    margin-bottom: 14px;
}

.paso-actual {
    font-size: 24px;
    font-weight: bold;
    line-height: 1.4;
    margin: 25px 0;
}

.btn-ayuda {
    border: 0;
    border-radius: 14px;
    padding: 15px 22px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

.texto-ayuda {
    min-height: 70px;
    margin-top: 20px;
    font-size: 20px;
    font-weight: bold;
}

.enter-ayuda {
    margin-top: 25px;
    font-size: 16px;
    opacity: .75;
}

.flecha {
    position: absolute;
    font-size: 44px;
    font-weight: bold;
    color: #e24949;
    animation: parpadeo .7s infinite alternate;
}

@keyframes parpadeo {
    from {
        opacity: .25;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(5px);
    }
}

@media (max-width: 700px) {
    .sumas-layout {
        flex-direction: column;
    }

    .zona-suma,
    .panel-pasos {
        width: 100%;
    }
}

.operacion-dinamica {
    --tamano-celda: 72px;

    position: relative;
    display: inline-grid;
    gap: 4px;
    margin: 35px auto 20px;
    padding: 25px;
    font-size: 52px;
    font-weight: bold;
}

.fila-operacion {
    display: grid;
    grid-template-columns:
        50px
        repeat(var(--columnas), var(--tamano-celda));
    align-items: center;
    min-height: 72px;
}

.signo-operacion {
    display: flex;
    justify-content: center;
    align-items: center;
}

.celda-operacion {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--tamano-celda);
    height: 68px;
    border-radius: 12px;
}

.celda-vacia {
    color: transparent;
}

.fila-llevadas {
    min-height: 58px;
    font-size: 32px;
    color: #d82727;
}

.linea-operacion {
    height: 5px;
    margin-left: 50px;
    background: #222;
    border-radius: 4px;
}

.entrada-operacion {
    width: 60px;
    height: 60px;
    padding: 0;
    border: 4px solid #3970c9;
    border-radius: 12px;
    background: #fffbea;

    font-size: 38px;
    font-weight: bold;
    text-align: center;
    line-height: 60px;
    outline: none;
}

.entrada-operacion:focus {
    box-shadow:
        0 0 0 5px rgba(57, 112, 201, .18);
}

.celda-llevada {
    color: #d82727;
    font-size: 32px;
}

.celda-resultado {
    min-height: 68px;
}

.flecha-celda {
    position: absolute;
    right: calc(100% + 4px);
    top: 50%;
    transform: translateY(-50%);

    color: #e24949;
    font-size: 40px;
    animation: flecha-lateral .65s infinite alternate;
}

@keyframes flecha-lateral {
    from {
        opacity: .3;
        margin-right: 8px;
    }

    to {
        opacity: 1;
        margin-right: 0;
    }
}

.indicacion-enter {
    min-height: 28px;
    font-size: 17px;
    opacity: .75;
}

@media (max-width: 700px) {
    .operacion-dinamica {
        --tamano-celda: 58px;

        padding: 12px;
        font-size: 42px;
    }

    .fila-operacion {
        grid-template-columns:
            42px
            repeat(var(--columnas), var(--tamano-celda));
    }

    .linea-operacion {
        margin-left: 42px;
    }

    .celda-operacion {
        width: var(--tamano-celda);
    }
}

/* ==================================================
   CONFIGURACIÓN DE SUMAS
================================================== */

.configuracion-sumas {
    max-width: 950px;
    margin: 25px auto;
    text-align: center;
}

.configuracion-sumas > h1 {
    margin: 10px 0 35px;
    font-size: 38px;
}


.bloque-configuracion {
    margin-bottom: 28px;
    padding: 25px;

    background: white;

    border-radius: 22px;

    box-shadow:
        0 5px 18px
        rgba(0, 0, 0, .10);
}


.bloque-configuracion h2 {
    margin: 0 0 22px;

    font-size: 24px;
}


.opciones-configuracion {
    display: flex;

    justify-content: center;

    gap: 18px;

    flex-wrap: wrap;
}


.boton-opcion {
    width: 220px;

    min-height: 105px;

    padding: 15px;

    border:
        4px solid transparent;

    border-radius: 18px;

    background: #edf1f5;

    font-size: 23px;

    font-weight: bold;

    cursor: pointer;
}


.boton-opcion:hover {
    transform:
        translateY(-2px);
}


.boton-opcion small {
    display: block;

    margin-top: 10px;

    font-size: 15px;

    font-weight: normal;
}


.boton-opcion.seleccionado {
    border-color: #3970c9;

    background: #dceaff;
}


.boton-empezar-ejercicio {
    width: 260px;

    height: 68px;

    border: 0;

    border-radius: 18px;

    background: #3970c9;

    color: white;

    font-size: 24px;

    font-weight: bold;

    cursor: pointer;
}


.boton-empezar-ejercicio:hover {
    transform:
        translateY(-2px);
}


/* ==================================================
   COLUMNA ACTUAL DE LA SUMA
================================================== */

.celda-destacada {
    background: #ffe0e0;

    color: #bd2020;

    border:
        3px solid #e34a4a;
}


/* ==================================================
   MÓVIL / TABLET
================================================== */

@media (max-width: 700px) {

    .configuracion-sumas > h1 {
        font-size: 30px;
    }


    .boton-opcion {
        width: 100%;
    }
}

.btn-otra-suma {
    width: 220px;
    min-height: 60px;
    margin-top: 20px;

    border: 0;
    border-radius: 14px;

    background: #3970c9;
    color: white;

    font-size: 20px;
    font-weight: bold;

    cursor: pointer;
}

.btn-otra-suma:hover {
    transform: translateY(-2px);
}

/* ==================================================
   NIVELES DE SUMAS
================================================== */

.elige-nivel {
    margin-bottom: 30px;
    font-size: 22px;
    font-weight: bold;
}

.niveles-sumas {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.tarjeta-nivel {
    width: 260px;
    min-height: 190px;
    padding: 25px;

    border: 4px solid transparent;
    border-radius: 24px;

    background: white;

    box-shadow:
        0 6px 18px
        rgba(0, 0, 0, .12);

    cursor: pointer;
}

.tarjeta-nivel:hover {
    transform: translateY(-4px);
    border-color: #3970c9;
}

.numero-nivel {
    display: block;

    margin-bottom: 20px;

    font-size: 18px;
    font-weight: bold;

    color: #3970c9;
}

.tarjeta-nivel strong {
    display: block;

    font-size: 25px;
}

.ejemplo-nivel {
    display: block;

    margin-top: 20px;

    font-size: 22px;
}


/* ==================================================
   SUMA SIMPLE
================================================== */

.zona-suma-simple {
    max-width: 700px;

    margin: 50px auto;

    padding: 45px;

    background: white;

    border-radius: 25px;

    text-align: center;

    box-shadow:
        0 6px 20px
        rgba(0, 0, 0, .12);
}

.titulo-nivel-simple {
    font-size: 18px;
    font-weight: bold;

    color: #3970c9;
}

.zona-suma-simple h1 {
    margin-bottom: 50px;

    font-size: 36px;
}

.operacion-simple {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 20px;

    font-size: 64px;
    font-weight: bold;
}

#respuesta-simple {
    width: 90px;
    height: 90px;

    border: 5px solid #3970c9;
    border-radius: 16px;

    background: #fffbea;

    font-size: 58px;
    font-weight: bold;

    text-align: center;

    outline: none;
}

#respuesta-simple:focus {
    box-shadow:
        0 0 0 6px
        rgba(57, 112, 201, .18);
}

#mensaje-simple {
    min-height: 45px;

    margin-top: 30px;

    font-size: 25px;
    font-weight: bold;
}

@media (max-width: 700px) {

    .operacion-simple {
        gap: 10px;

        font-size: 45px;
    }

    #respuesta-simple {
        width: 70px;
        height: 70px;

        font-size: 45px;
    }

    .tarjeta-nivel {
        width: 100%;
    }
}

#mensaje-resta {
    min-height: 45px;
    margin-top: 30px;

    font-size: 25px;
    font-weight: bold;
}

#respuesta-resta {
    width: 90px;
    height: 90px;

    border: 5px solid #3970c9;
    border-radius: 16px;

    background: #fffbea;

    font-size: 58px;
    font-weight: bold;

    text-align: center;

    outline: none;
}

#respuesta-resta:focus {
    box-shadow:
        0 0 0 6px
        rgba(57, 112, 201, .18);
}

@media (max-width: 700px) {

    #respuesta-resta {
        width: 70px;
        height: 70px;

        font-size: 45px;
    }
}

/* ==================================================
   LENGUA
================================================== */

.zona-lengua {
    max-width: 750px;
    margin: 50px auto;
    padding: 45px;

    background: white;

    border-radius: 25px;

    text-align: center;

    box-shadow:
        0 6px 20px
        rgba(0, 0, 0, .12);
}


.zona-lengua h1 {
    margin: 10px 0 20px;

    font-size: 38px;
}


.instruccion-lengua {
    margin-bottom: 40px;

    font-size: 22px;
    font-weight: bold;
}


.palabra-grande {
    min-height: 110px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 30px 0 45px;

    padding: 20px;

    font-size: 64px;
    font-weight: bold;

    letter-spacing: 10px;
}


.boton-lengua {
    min-width: 240px;
    min-height: 65px;

    padding: 10px 25px;

    border: 0;
    border-radius: 16px;

    background: #3970c9;
    color: white;

    font-size: 20px;
    font-weight: bold;

    cursor: pointer;
}


.boton-lengua:hover {
    transform: translateY(-2px);
}


.opciones-letras {
    display: flex;

    justify-content: center;

    gap: 20px;

    flex-wrap: wrap;

    margin-bottom: 25px;
}


.boton-letra {
    width: 90px;
    height: 90px;

    border: 4px solid #3970c9;
    border-radius: 18px;

    background: #edf4ff;

    font-size: 45px;
    font-weight: bold;

    cursor: pointer;
}


.boton-letra:hover {
    background: #dceaff;

    transform: translateY(-2px);
}


.mensaje-lengua {
    min-height: 45px;

    font-size: 25px;
    font-weight: bold;
}


@media (max-width: 700px) {

    .zona-lengua {
        padding: 25px 15px;
    }

    .palabra-grande {
        font-size: 45px;

        letter-spacing: 6px;
    }

    .boton-letra {
        width: 75px;
        height: 75px;

        font-size: 38px;
    }
}

.botones-lectura {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 25px 0;
}

.boton-secundario {
    background: white;
    color: #3970c9;
    border: 3px solid #3970c9;
}

#estado-microfono {
    min-height: 55px;
    margin: 20px 0;
}

@media (max-width: 700px) {

    .botones-lectura {
        flex-direction: column;
        align-items: center;
    }

    .botones-lectura .boton-lengua {
        width: 100%;
        max-width: 300px;
    }
}