/* ==========================================================================
   css/identificacao.css
   Tela única de identificação — nome + personagem
   O Caminho das Virtudes
   ========================================================================== */

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

html,
body {
    width: 100%;
    min-height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    overflow-x: hidden;
    background-color: #a8c47f;
}

#app {
    width: 100%;
    min-height: 100dvh;
}

/* ============================================================
   TELA
   ============================================================ */

.tela-identificacao {
    width: 100%;
    min-height: 100dvh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px 12px;

    background-image:
        linear-gradient(rgba(255, 246, 222, 0.18),
            rgba(245, 218, 166, 0.22)),
        url("../assets/fundos/fundo-inicio.webp");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    overflow-x: hidden;
}

/* ============================================================
   CARD CENTRAL
   ============================================================ */

.card-identificacao {
    width: min(94vw, 430px);
    margin-inline: auto;
    padding: 22px 18px 16px;

    border-radius: 24px;
    background: rgba(255, 249, 237, 0.96);
    border: 2px solid #e8cc8a;

    box-shadow: 0 20px 40px rgba(35, 22, 8, 0.28);
}

/* ============================================================
   TÍTULO E SUBTÍTULO
   ============================================================ */

.ident-titulo {
    color: #4d341c;

    font-size: clamp(1.05rem, 5vw, 1.28rem);
    font-weight: 900;
    line-height: 1.18;
    text-align: center;

    margin-bottom: 8px;
}

.ident-subtitulo {
    max-width: 330px;
    margin: 0 auto 16px;

    color: #7a6040;

    font-size: 0.84rem;
    line-height: 1.38;
    text-align: center;
}

/* ============================================================
   CAMPO DE NOME
   ============================================================ */

.ident-campo {
    width: 100%;
    position: relative;

    margin-bottom: 6px;
}

.ident-input {
    width: 100%;
    min-height: 50px;

    padding: 13px 48px 13px 14px;

    border: 2px solid rgba(180, 140, 80, 0.3);
    border-radius: 15px;

    background: rgba(255, 255, 255, 0.96);
    color: #3d2409;

    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;

    outline: none;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.ident-input::placeholder {
    color: rgba(120, 90, 50, 0.42);
    font-weight: 500;
}

.ident-input:focus {
    border-color: #d4a017;
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.18);
}

.ident-contador {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);

    color: rgba(120, 90, 50, 0.42);

    font-size: 0.7rem;
    font-weight: 700;

    pointer-events: none;
}

.ident-erro {
    margin: 6px 0 10px;

    color: #b04020;

    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
}

/* ============================================================
   SEÇÃO DE PERSONAGENS
   ============================================================ */

.ident-secao {
    margin: 14px 0 10px;

    color: #6a5434;

    font-size: 0.82rem;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ============================================================
   GRADE DE AVATARES
   ============================================================ */

.avatar-grid {
    width: 100%;

    display: grid;
    grid-template-columns: repeat(3, 76px);
    justify-content: center;
    gap: 10px;

    margin-bottom: 12px;
}

.avatar-opcao {
    width: 76px;
    height: 76px;

    position: relative;

    border: 2px solid rgba(180, 140, 80, 0.2);
    border-radius: 15px;

    background: rgba(255, 255, 255, 0.96);

    padding: 4px;

    cursor: pointer;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.avatar-opcao:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(80, 55, 20, 0.1);
}

.avatar-opcao:focus-visible {
    outline: 3px solid #6ab7ff;
    outline-offset: 3px;
}

.avatar-opcao.oculto {
    display: none;
}

.avatar-opcao.selecionado {
    border-color: #d4a017;

    box-shadow:
        0 0 0 3px rgba(212, 160, 23, 0.22),
        0 5px 14px rgba(80, 55, 20, 0.14);
}

.avatar-foto {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
    border-radius: 12px;
}

/* Selo ✓ */

.avatar-selo {
    position: absolute;
    right: 4px;
    bottom: 4px;

    width: 19px;
    height: 19px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.85);

    background: linear-gradient(180deg, #ffd46a 0%, #f0a01e 100%);
    color: #3d2409;

    font-size: 0.58rem;
    font-weight: 900;

    opacity: 0;
    transform: scale(0.72);

    transition:
        opacity 0.18s ease,
        transform 0.18s ease;

    pointer-events: none;
}

.avatar-opcao.selecionado .avatar-selo {
    opacity: 1;
    transform: scale(1);
}

/* ============================================================
   INPUT FILE OCULTO
   ============================================================ */

input[type="file"] {
    display: none;
}

/* ============================================================
   BOTÃO VER MAIS
   ============================================================ */

.btn-ver-mais {
    width: 100%;
    min-height: 36px;

    padding: 8px 14px;
    margin-bottom: 10px;

    border: 1px solid rgba(180, 140, 80, 0.24);
    border-radius: 999px;

    background: rgba(255, 250, 235, 0.58);
    color: #7a6040;

    font-size: 0.8rem;
    font-weight: 800;
    font-family: inherit;

    cursor: pointer;

    transition: filter 0.12s ease;
}

.btn-ver-mais:hover {
    filter: brightness(0.97);
}

.btn-ver-mais:focus-visible {
    outline: 3px solid #6ab7ff;
    outline-offset: 3px;
}

/* ============================================================
   BOTÃO USAR MINHA IMAGEM
   ============================================================ */

.btn-usar-imagem {
    width: 100%;
    min-height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    margin-bottom: 10px;

    border: 1.5px dashed rgba(180, 140, 80, 0.42);
    border-radius: 14px;

    background: rgba(255, 250, 235, 0.72);
    color: #7a6040;

    font-size: 0.86rem;
    font-weight: 800;
    font-family: inherit;

    cursor: pointer;

    transition:
        filter 0.12s ease,
        border-color 0.12s ease,
        background 0.12s ease;
}

.btn-usar-imagem:hover {
    filter: brightness(0.98);
    border-color: rgba(180, 140, 80, 0.65);
}

.btn-usar-imagem.selecionado {
    border-style: solid;
    border-color: #d4a017;

    background: rgba(255, 238, 185, 0.72);
    color: #4d341c;
}

.btn-usar-imagem:focus-visible {
    outline: 3px solid #6ab7ff;
    outline-offset: 3px;
}

.upload-icone {
    font-size: 1rem;
    line-height: 1;
}

/* ============================================================
   STATUS
   ============================================================ */

.ident-status {
    width: 100%;
    min-height: 1.1em;

    margin-bottom: 12px;

    color: #7a6040;

    font-size: 0.78rem;
    line-height: 1.25;
    text-align: center;
}

.ident-status.erro {
    color: #b04020;
    font-weight: 700;
}

/* ============================================================
   TELAS MUITO PEQUENAS
   ============================================================ */

@media (max-width: 360px) {
    .tela-identificacao {
        padding: 16px 10px;
    }

    .card-identificacao {
        width: min(95vw, 400px);
        padding: 18px 14px 14px;
        border-radius: 22px;
    }

    .ident-titulo {
        font-size: 1rem;
    }

    .ident-subtitulo {
        font-size: 0.78rem;
        margin-bottom: 12px;
    }

    .ident-input {
        min-height: 46px;
        font-size: 0.94rem;
    }

    .avatar-grid {
        grid-template-columns: repeat(3, 68px);
        gap: 8px;
    }

    .avatar-opcao {
        width: 68px;
        height: 68px;
    }

}

/* ============================================================
   MOBILE LANDSCAPE — tela baixa
   ============================================================ */

@media (orientation: landscape) and (max-height: 520px) {
    .tela-identificacao {
        align-items: flex-start;
        justify-content: center;

        min-height: 100dvh;
        padding: 12px 14px 20px;

        overflow-y: auto;
    }

    .card-identificacao {
        width: min(92vw, 560px);
        padding: 14px 16px 16px;
    }

    .ident-titulo {
        font-size: 0.98rem;
        margin-bottom: 4px;
    }

    .ident-subtitulo {
        font-size: 0.76rem;
        margin-bottom: 10px;
    }

    .ident-input {
        min-height: 44px;
        font-size: 0.92rem;
    }

    .ident-secao {
        margin: 10px 0 6px;
    }

    .avatar-grid {
        grid-template-columns: repeat(5, 62px);
        gap: 7px;
        margin-bottom: 8px;
    }

    .avatar-opcao {
        width: 62px;
        height: 62px;
    }

    .btn-ver-mais {
        min-height: 32px;
        margin-bottom: 7px;
        padding: 6px 12px;
    }

    .btn-usar-imagem {
        min-height: 36px;
        margin-bottom: 8px;
        font-size: 0.8rem;
    }

}

/* ============================================================
   TABLET E DESKTOP
   ============================================================ */

@media (min-width: 600px) {
    .card-identificacao {
        width: min(92vw, 560px);
        padding: 26px 26px 22px;
    }

    .ident-titulo {
        font-size: 1.35rem;
    }

    .ident-subtitulo {
        font-size: 0.9rem;
    }

    .avatar-grid {
        grid-template-columns: repeat(5, 82px);
        gap: 10px;
    }

    .avatar-opcao {
        width: 82px;
        height: 82px;
    }
}