/* =========================================================
   GLUB — TELA DE TREINO
   ========================================================= */

#treino-tela {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: none;
    z-index: 100;
    background: #e5edf6;
}

.treino-fundo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    z-index: 0;
}

/* Placa menor, no canto superior esquerdo. */
.treino-placa {
    position: absolute;
    left: 1.2%;
    top: 1.5%;
    width: 132px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 3px solid #713a16;
    border-radius: 10px;
    background: linear-gradient(#b96a2e, #8b421b);
    color: #fff;
    font: 900 23px/1 Arial, sans-serif;
    letter-spacing: 1px;
    text-shadow: 1px 2px 1px rgba(0,0,0,.35);
    transform: rotate(-4deg);
    box-shadow: 0 4px 7px rgba(0,0,0,.28);
    z-index: 10;
    pointer-events: none;
}

.treino-pisu {
    position: absolute;
    height: auto;
    transform: translate(-50%, -50%);
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    z-index: 1;
}

/*
   Bocas:
   - I, E, E: à esquerda dos respectivos pisos;
   - A: abaixo do piso;
   - O, O, U: à direita dos respectivos pisos.
   As imagens são exatamente as referências da Capa.
*/
.treino-boca-plataforma {
    position: absolute;
    height: auto;
    transform: translate(-50%, -50%) scaleY(.72);
    transform-origin: center center;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    z-index: 6;
    filter: drop-shadow(0 3px 2px rgba(0,0,0,.18));
    opacity: 0;
}

/* A boca só existe visualmente durante a pronúncia, como na Capa. */
.treino-boca-abrindo {
    animation: treinoBocaAbrir 120ms ease-out forwards;
}

.treino-boca-aberta {
    opacity: 1;
    transform: translate(-50%, -50%) scaleY(1);
}

.treino-boca-fechando {
    animation: treinoBocaFechar 180ms ease-in forwards;
}

@keyframes treinoBocaAbrir {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scaleY(.72);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scaleY(1);
    }
}

@keyframes treinoBocaFechar {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scaleY(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scaleY(.72);
    }
}

.treino-vogais {
    position: absolute;
    inset: 0;
    z-index: 4;
}

.treino-vogal {
    position: absolute;
    width: 10%;
    height: auto;
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
    z-index: 4;
}

.treino-vogal-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;

    /* Vogais suspensas: movimento suave e contínuo desde a abertura do Treino.
       A animação fica na imagem para não alterar a posição/click do botão. */
    animation: treinoVogalSuspensa 2.6s ease-in-out infinite;
    will-change: transform;
}

/* Cada vogal começa em um ponto diferente do ciclo, evitando movimento sincronizado. */
.treino-vogal:nth-child(1) .treino-vogal-img { animation-delay: -0.15s; animation-duration: 2.55s; }
.treino-vogal:nth-child(2) .treino-vogal-img { animation-delay: -1.10s; animation-duration: 2.85s; }
.treino-vogal:nth-child(3) .treino-vogal-img { animation-delay: -0.55s; animation-duration: 2.70s; }
.treino-vogal:nth-child(4) .treino-vogal-img { animation-delay: -1.65s; animation-duration: 3.00s; }
.treino-vogal:nth-child(5) .treino-vogal-img { animation-delay: -0.85s; animation-duration: 2.75s; }
.treino-vogal:nth-child(6) .treino-vogal-img { animation-delay: -1.35s; animation-duration: 2.90s; }
.treino-vogal:nth-child(7) .treino-vogal-img { animation-delay: -0.35s; animation-duration: 2.60s; }

@keyframes treinoVogalSuspensa {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

.treino-vogal:hover { filter: brightness(1.05); }
.treino-vogal:active { transform: translate(-50%, -50%) scale(.96); }
.treino-vogal:focus { outline: none; }
.treino-vogal:focus-visible {
    outline: 3px solid rgba(255,255,255,.9);
    outline-offset: 4px;
}

/* =========================================================
   AVENTUREIRO ESCOLHIDO — FLUTUANDO NO CENTRO
   ========================================================= */
.treino-avatar {
    position: absolute;
    left: 50%;
    top: 16%;
    width: var(--glub-avatar-largura,12.8125%);
    height: var(--glub-avatar-altura,22.7777778%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
    filter: drop-shadow(0 5px 4px rgba(0,0,0,.25));
    animation: treinoAvatarFlutuar 2.8s ease-in-out infinite;
}

.treino-avatar img {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

@keyframes treinoAvatarFlutuar {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -12px); }
}

/* =========================================================
   BOTÃO JOGAR
   ========================================================= */
#treino-jogar {
    position: absolute;
    right: 3%;
    bottom: 5%;
    width: 92px;
    height: 92px;
    border: 4px solid rgba(20, 45, 110, .85);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #6c35ff, #4014d9 70%);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 4px 10px rgba(0,0,0,.28);
    transition: transform 160ms ease, filter 160ms ease;
}

#treino-jogar:hover { transform: scale(1.06); filter: brightness(1.08); }
#treino-jogar:active { transform: scale(.95); }
#treino-jogar:focus { outline: none; }
#treino-jogar:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* =========================================================
   VOLTAR
   ========================================================= */
#treino-voltar {
    position: absolute;
    left: 1.5%;
    bottom: 3%;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.82);
    color: #174d7a;
    box-shadow: 0 2px 7px rgba(0,0,0,.25);
    font-family: Arial, sans-serif;
    font-size: 30px;
    font-weight: bold;
    line-height: 48px;
    text-align: center;
    cursor: pointer;
    z-index: 20;
    transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
    touch-action: manipulation;
}

#treino-voltar:hover {
    transform: scale(1.08);
    filter: brightness(1.06);
    box-shadow: 0 5px 12px rgba(0,0,0,.30);
}
#treino-voltar:active { transform: scale(.94); }
#treino-voltar:focus { outline: none; }
#treino-voltar:focus-visible { outline: 3px solid rgba(23,77,122,.75); outline-offset: 3px; }
