* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #f2f2f2;

    color: #222;

    min-height: 100dvh;
}


/* CONTENEDOR */

.app {

    width: 100%;

    max-width: 520px;

    min-height: 100dvh;

    margin: auto;

    padding: 15px;
}


/* ENCABEZADO */

.header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 15px;
}

.header h1 {

    margin: 0;

    font-size: 26px;
}

.header p {

    margin: 3px 0 0;

    color: #777;

    font-size: 13px;
}


/* RUTINA */

.routine-card {

    background: white;

    padding: 13px;

    border-radius: 15px;

    margin-bottom: 15px;

    box-shadow:
        0 3px 12px rgba(0,0,0,.08);
}

.routine-card label {

    display: block;

    margin-bottom: 6px;

    font-weight: bold;

    font-size: 13px;

    color: #666;
}

.routine-card select {

    width: 100%;

    height: 48px;

    padding: 0 12px;

    border: 1px solid #ccc;

    border-radius: 10px;

    background: white;

    color: #222;

    font-size: 17px;

    font-weight: bold;
}


/* PROGRESO */

.progress-info {

    display: flex;

    justify-content: space-between;

    margin-bottom: 6px;

    font-size: 13px;

    color: #666;

    font-weight: bold;
}

.progress-bar {

    width: 100%;

    height: 7px;

    background: #ddd;

    border-radius: 10px;

    overflow: hidden;

    margin-bottom: 15px;
}

.progress-fill {

    height: 100%;

    width: 10%;

    background: #222;

    border-radius: 10px;

    transition: width .4s ease;
}


/* EJERCICIO */

.exercise-card {

    background: white;

    border-radius: 17px;

    padding: 20px 12px 15px;

    text-align: center;

    box-shadow:
        0 3px 12px rgba(0,0,0,.08);

    animation: exerciseIn .3s ease;
}

.exercise-name {

    font-size: clamp(28px, 8vw, 38px);

    font-weight: 900;

    line-height: 1.05;

    text-transform: uppercase;
}

.machine {

    margin-top: 8px;

    font-size: 16px;

    color: #555;

    font-weight: bold;
}

.observation {

    min-height: 20px;

    margin-top: 5px;

    font-size: 14px;

    color: #777;
}


/* SERIE */

.series-display {

    text-align: center;

    margin: 14px 0;
}

.series-label {

    font-size: 11px;

    color: #888;

    font-weight: bold;

    letter-spacing: 1px;
}

.current-series {

    margin-top: 4px;

    font-size: 23px;

    font-weight: 900;
}


/* DATOS */

.data-grid {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 7px;

    margin-bottom: 12px;
}

.data-box {

    background: white;

    border-radius: 12px;

    padding: 8px 4px;

    text-align: center;

    box-shadow:
        0 2px 8px rgba(0,0,0,.07);

    border: 1px solid #e5e5e5;
}

.data-box label {

    display: block;

    font-size: 9px;

    font-weight: bold;

    color: #777;

    margin-bottom: 4px;
}

.data-box input {

    width: 100%;

    height: 38px;

    border: 0;

    outline: none;

    background: transparent;

    text-align: center;

    font-size: 17px;

    font-weight: bold;

    color: #222;
}

.data-box input:focus {

    background: #f0f0f0;

    border-radius: 7px;
}


/* MENSAJE */

.finished-message {

    display: none;

    background: #e8f5e9;

    color: #247331;

    border: 1px solid #b7dfbd;

    border-radius: 12px;

    text-align: center;

    padding: 12px;

    margin-bottom: 10px;

    font-size: 18px;

    font-weight: bold;

    animation: pulse .8s infinite alternate;
}

.finished-message small {

    display: block;

    margin-top: 3px;

    font-size: 12px;

    font-weight: normal;
}


/* TEMPORIZADOR */

.timer-card {

    background: #202124;

    color: white;

    border-radius: 16px;

    padding: 13px;

    text-align: center;

    margin-bottom: 10px;

    box-shadow:
        0 4px 14px rgba(0,0,0,.18);
}

.timer-title {

    font-size: 11px;

    color: #aaa;

    font-weight: bold;

    letter-spacing: 2px;
}

.timer {

    font-size: clamp(55px, 17vw, 75px);

    line-height: 1;

    margin-top: 3px;

    font-weight: 900;

    font-variant-numeric:
        tabular-nums;
}

.timer-status {

    margin-top: 4px;

    font-size: 12px;

    color: #bbb;
}


/* BOTÓN TERMINAR */

.finish-button {

    width: 100%;

    min-height: 62px;

    border: none;

    border-radius: 14px;

    background: #222;

    color: white;

    font-size: 18px;

    font-weight: 900;

    cursor: pointer;

    touch-action: manipulation;

    transition:
        transform .1s,
        opacity .2s;
}

.finish-button:active {

    transform: scale(.97);
}

.finish-button:disabled {

    opacity: .4;

    cursor: not-allowed;
}


/* CONTROLES */

.control-buttons {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 8px;

    margin-top: 8px;
}

.control-buttons button {

    min-height: 48px;

    border: 1px solid #ccc;

    border-radius: 11px;

    background: white;

    color: #333;

    font-weight: bold;

    font-size: 13px;

    cursor: pointer;

    touch-action: manipulation;
}

.control-buttons button:active {

    transform: scale(.97);

    background: #eee;
}


/* NAVEGACIÓN */

.navigation {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 8px;

    margin-top: 8px;
}

.navigation button {

    min-height: 48px;

    border: 1px solid #ccc;

    border-radius: 11px;

    background: white;

    color: #333;

    font-weight: bold;

    cursor: pointer;

    touch-action: manipulation;
}

.navigation button:active {

    transform: scale(.97);

    background: #eee;
}


/* ESTADO */

.status {

    text-align: center;

    min-height: 20px;

    margin-top: 8px;

    font-size: 12px;

    color: #777;
}


/* TERMINADA */

.completed-screen {

    display: none;

    text-align: center;

    padding-top: 80px;

    animation: fadeIn .4s ease;
}

.celebration {

    font-size: 70px;

    animation: celebration .8s infinite alternate;
}

.completed-screen h2 {

    font-size: 28px;

    margin: 15px 0 5px;
}

.completed-screen p {

    color: #777;

    margin-bottom: 25px;
}


/* ANIMACIONES */

@keyframes exerciseIn {

    from {

        opacity: 0;

        transform:
            translateY(8px)
            scale(.98);

    }

    to {

        opacity: 1;

        transform:
            translateY(0)
            scale(1);

    }
}

@keyframes pulse {

    from {

        transform: scale(1);

    }

    to {

        transform: scale(1.01);

    }
}

@keyframes fadeIn {

    from {

        opacity: 0;

    }

    to {

        opacity: 1;

    }
}

@keyframes celebration {

    from {

        transform: scale(1);

    }

    to {

        transform: scale(1.12);

    }
}


/* CELULARES PEQUEÑOS */

@media (max-height: 700px) {

    .app {

        padding-top: 8px;
    }

    .header {

        margin-bottom: 8px;
    }

    .routine-card {

        margin-bottom: 8px;
    }

    .exercise-card {

        padding-top: 12px;
    }

    .timer {

        font-size: 52px;
    }

    .finish-button {

        min-height: 56px;
    }

}