/* =========================
   RESET
========================= */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

/* trava a rolagem da página quando um modal está aberto,
   evitando que conteúdos longos (ex: Rede de Proteção)
   "vazem" para a página por trás no celular */

body.modal-aberto{
    overflow:hidden;
    height:100dvh;
}

body{
    font-family:'Baloo 2', cursive;
    background:linear-gradient(180deg,#a8edf0,#e8ffff);
    overflow-x:hidden;
}

/* =========================
   HEADER
========================= */

.topo{
    width:100%;
    padding:20px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    background:#ffffff;
    box-shadow:0 2px 10px rgba(0,0,0,0.1);
}

.logo{
    font-size:40px;
    color:#ff4d6d;
    font-weight:700;
}

.menu{
    display:flex;
    gap:15px;
}

.menu button{
    border:none;
    background:#42a5b3;
    color:#fff;
    padding:12px 22px;
    border-radius:15px;
    font-size:18px;
    cursor:pointer;
    transition:0.3s;
    font-family:'Baloo 2', cursive;
}

.menu button:hover{
    transform:translateY(-3px);
    background:#2d8d99;
}
/* =========================
   CONTAINER
========================= */

.container{
    width:100%;
    min-height:100vh;
    padding:30px;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:20px;
}

/* =========================
   TABULEIRO RESPONSIVO
========================= */

.area-tabuleiro{

    position:relative;

    width:100%;

    max-width:1000px;

    aspect-ratio:1/1;

    margin:auto;

}

.tabuleiro{

    width:100%;

    height:100%;

    object-fit:contain;

    display:block;

    border-radius:30px;

    box-shadow:0 10px 30px rgba(0,0,0,0.2);

}

/* =========================
   PERSONAGEM
========================= */

.personagem{
	opacity:0;
	pointer-events:none;
    position:absolute;
    width:7vw;
    height:7vw;

    max-width:70px;
    max-height:70px;

    min-width:40px;
    min-height:40px;
    border-radius:50%;
    overflow:visible;
    z-index:1000;
    transition:
    left 0.25s linear,
    top 0.25s linear;
    pointer-events:none;
    border:4px solid #fff;
    box-shadow:0 4px 10px rgba(0,0,0,0.25);
    background:#fff;

}

/* imagem */

.personagem img{
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius:50%;
}

.personagem:active{
    cursor:grabbing;
}
/* =========================
   PAINEL
========================= */

.painel{
    width:100%;
    max-width:1000px;
    background:#fff;
    border-radius:24px;
    padding:15px 25px;
    box-shadow:0 10px 25px rgba(0,0,0,0.15);

    display:flex;
    flex-direction:row;
    flex-wrap:wrap;
    align-items:center;
    justify-content:space-between;
    gap:15px;

    /* gruda no topo ao rolar a página, sempre visível */
    position:sticky;
    top:15px;
    z-index:100;
}

.titulo-painel{
    font-size:22px;
    color:#ff4d6d;
    margin:0;
    white-space:nowrap;
}

/* =========================
   CARDS
========================= */

.card{
    background:#f4fbfc;
    border-radius:16px;
    padding:8px 16px;
    margin:0;
}

.card h3{
    color:#42a5b3;
    margin-bottom:2px;
    font-size:15px;
}

.card p{
    font-size:14px;
}

/* =========================
   DADO
========================= */

.area-dado{
    display:flex;
    flex-direction:row;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
    background:transparent;
    padding:0;
}

.dado{
	position:relative;
    width:70px;
    height:70px;
    background:#fff;
    border-radius:18px;
    border:4px solid #42a5b3;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:34px;
    color:#42a5b3;
    box-shadow:0 5px 15px rgba(0,0,0,0.15);
    flex-shrink:0;
}

.btn-jogar{
    width:auto;
    border:none;
    background:#ff4d6d;
    color:#fff;
    padding:12px 22px;
    border-radius:16px;
    font-size:18px;
    cursor:pointer;
    transition:0.3s;
    font-family:'Baloo 2', cursive;
    font-weight:700;
    white-space:nowrap;
}

.btn-jogar:hover{
    transform:scale(1.03);
    background:#e63d5e;
}

/* botão secundário — mover automaticamente (alternativa ao arrastar) */

.btn-mover-auto{
    background:#42a5b3;
    font-size:15px;
    margin-top:0;
}

.btn-mover-auto:hover:not(:disabled){
    transform:scale(1.03);
    background:#2d8d99;
}

/* número */

.numero-dado{

    position:absolute;

    bottom:8px;
    right:10px;

    background:#ff4d6d;

    color:#fff;

    width:35px;
    height:35px;

    border-radius:50%;

    display:flex;
    justify-content:center;
    align-items:center;

    font-size:20px;
    font-weight:bold;
}

/* animação */

.girando{
    animation:girar 0.5s linear infinite;
}

@keyframes girar{

    from{
        transform:rotate(0deg);
    }

    to{
        transform:rotate(360deg);
    }

}
/* =========================
   STATUS
========================= */

.status{
    display:flex;
    flex-direction:row;
    gap:10px;
    flex-wrap:wrap;
}

.info{
    background:#42a5b3;
    color:#fff;
    padding:8px 14px;
    border-radius:14px;
    text-align:center;
    min-width:85px;
    font-size:13px;
}

.info span{
    font-size:20px;
    font-weight:bold;
}

/* =========================
   MODAL
========================= */

.modal{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100vh;
    height:100dvh;
    background:rgba(0,0,0,0.5);

    display:none;

    justify-content:center;
    align-items:center;

    padding:20px;
    box-sizing:border-box;

    z-index:999;
}

.modal-box{
    width:500px;
    max-width:90%;
    max-height:80vh;
    max-height:80dvh;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
    background:#fff;
    border-radius:30px;
    padding:35px 30px 30px 30px;
    text-align:center;
    animation:aparecer 0.4s ease;
}

.modal-box h2{
    color:#c9184a;
    margin-bottom:15px;
    font-size:35px;
}

.modal-box p{
    font-size:22px;
    line-height:1.6;
    color:#222;
    margin-bottom:25px;
}

.modal-box button{
    border:none;
    background:#2d8d99;
    color:#fff;
    padding:14px 30px;
    border-radius:18px;
    font-size:20px;
    cursor:pointer;
    font-family:'Baloo 2', cursive;
}

.modal{
    z-index: 9999;
}

.btn-jogar:disabled{
    opacity:0.7;
    cursor:not-allowed;
}

/* =========================
   ANIMAÇÃO
========================= */

@keyframes aparecer{

    from{
        opacity:0;
        transform:translateY(50px);
    }

    to{
        opacity:1;
        transform:translateY(0);
    }

}

/* =========================
   CASAS
========================= */
.casa{

    position:absolute;

    width:7vw;
    height:7vw;

    max-width:70px;
    max-height:70px;

    min-width:40px;
    min-height:40px;

    border-radius:50%;

    z-index:20;

}

/* =========================
   RESPONSIVO
========================= */

@media(max-width:1200px){

    .painel{
        max-width:700px;
    }

}

@media(max-width:768px){

    .topo{
        flex-direction:column;
        gap:15px;
    }

    .logo{
        font-size:30px;
        text-align:center;
    }

    .menu{
        flex-wrap:wrap;
        justify-content:center;
    }

    .personagem{
        width:45px;
        height:45px;
        font-size:24px;
    }

    .dado{
        width:90px;
        height:90px;
        font-size:45px;
    }

    .btn-jogar{
        font-size:20px;
    }

    .titulo-painel{
        font-size:28px;
    }

}

/* telas muito pequenas (celulares compactos) */

@media(max-width:420px){

    .logo{
        font-size:22px;
    }

    .menu button{
        padding:9px 14px;
        font-size:14px;
    }

    .dado{
        width:75px;
        height:75px;
        font-size:34px;
    }

    .numero-dado{
        width:26px;
        height:26px;
        font-size:14px;
    }

    .btn-jogar{
        font-size:16px;
        padding:12px;
    }

    .btn-mover-auto{
        font-size:14px;
    }

    .painel{
        padding:15px;
    }

    .modal-box{
        padding:20px;
    }

    .modal-box h2{
        font-size:26px;
    }

    .modal-box p{
        font-size:17px;
    }

    .casa{
        min-width:32px;
        min-height:32px;
    }

    .personagem{
        min-width:32px;
        min-height:32px;
    }

}

/* celular deitado (landscape) com pouca altura de tela */

@media(max-height:480px) and (orientation:landscape){

    .tela-abertura{
        padding:10px;
    }

    .logo-abertura{
        width:60px;
        margin-bottom:0;
    }

    .personagem-abertura img{
        width:100px;
    }

    .titulo-abertura h1{
        font-size:26px;
    }

    .titulo-abertura p{
        font-size:14px;
    }

    .topo{
        flex-direction:row;
        padding:10px 20px;
    }

    .logo{
        font-size:20px;
    }

    .container{
        padding:10px;
        gap:10px;
    }

    .painel{
        max-width:260px;
        padding:15px;
    }

    .modal-box,
    .modal-regras{
        max-height:85vh;
        overflow-y:auto;
    }

}

/* =========================
   MODAL INICIAL
========================= */

.modal-inicial{

    position:fixed;

    inset:0;

    background:rgba(0,0,0,0.7);

    display:flex;

    justify-content:center;

    align-items:center;

    padding:15px;

    z-index:5000;

}

.box-inicial{

    width:min(460px, 92vw);

    background:#fff;

    border-radius:28px;

    padding:28px;

    text-align:center;

    animation:aparecer 0.4s ease;

    box-shadow:0 10px 40px rgba(0,0,0,0.25);

}

.box-inicial h2{

    font-size:32px;

    margin-bottom:10px;

}

.box-inicial p{

    font-size:20px;

    margin-bottom:15px;

}

.box-inicial input{

    width:100%;

    padding:14px;

    border-radius:18px;

    border:2px solid #42a5b3;

    font-size:18px;

    outline:none;

    margin-bottom:18px;

    font-family:'Baloo 2', cursive;

}

.box-inicial button{

    width:100%;

    border:none;

    background:#ff4d6d;

    color:#fff;

    padding:14px;

    border-radius:20px;

    font-size:20px;

    cursor:pointer;

    font-family:'Baloo 2', cursive;

    font-weight:bold;

    transition:0.3s;

}

.box-inicial button:hover{

    transform:scale(1.03);

}

/* =========================
   PERSONAGENS
========================= */

.lista-personagens{

    display:grid;

    grid-template-columns:repeat(2,1fr);

    gap:12px;

    margin-bottom:20px;

}

.avatar{

    border:4px solid transparent;

    border-radius:20px;

    padding:10px;

    cursor:pointer;

    transition:0.3s;

    background:#f5f5f5;

    display:flex;
    flex-direction:column;
    align-items:center;
    gap:10px;

}

.avatar span{

    font-size:22px;

    font-weight:bold;

    color:#42a5b3;

}

.avatar:hover{

    transform:scale(1.05);

}

.avatar.ativo{

    border-color:#ff4d6d;

    background:#ffe7ec;

}

.avatar img{

    width:100%;

    height:85px;

    object-fit:contain;

}

.personagem{

    animation:flutuar 2s ease-in-out infinite;

}

@keyframes flutuar{

    0%{
        transform:translateY(0px);
    }

    50%{
        transform:translateY(-4px);
    }

    100%{
        transform:translateY(0px);
    }

}

/* =========================
   MODAL REGRAS
========================= */

.modal-regras{

    width:90%;
    max-width:750px;

    max-height:85vh;

    overflow-y:auto;

    background:#fff;

    border-radius:30px;

    padding:35px;

    text-align:left;

    box-shadow:0 10px 40px rgba(0,0,0,0.25);

}

/* SCROLL BONITO */

.modal-regras::-webkit-scrollbar{

    width:10px;

}

.modal-regras::-webkit-scrollbar-thumb{

    background:#42a5b3;
    border-radius:20px;

}

/* TITULO */

.modal-regras h2{

    text-align:center;

    color:#c9184a;

    font-size:40px;

    margin-bottom:25px;

}

/* CONTEÚDO */

.conteudo-regras{

    display:flex;
    flex-direction:column;
    gap:20px;

}

/* SUBTÍTULOS */

.conteudo-regras h3{

    color:#c9184a;

    font-size:28px;

    margin-bottom:10px;

}

/* TEXTOS */

.conteudo-regras p,
.conteudo-regras li{

    font-size:22px;

    line-height:1.8;

    color:#444;

}

/* LISTA */

.conteudo-regras ul{

    padding-left:30px;

    display:flex;
    flex-direction:column;
    gap:15px;

}

/* BOTÃO */

.btn-fechar-regras{

    width:100%;

    margin-top:35px;

    border:none;

    background:#42a5b3;

    color:#fff;

    padding:18px;

    border-radius:20px;

    font-size:24px;

    cursor:pointer;

    font-family:'Baloo 2', cursive;

    font-weight:700;

    transition:0.3s;

}

.btn-fechar-regras:hover{

    background:#2d8d99;

    transform:scale(1.02);

}

/* =========================
   RESPONSIVO
========================= */

@media(max-width:768px){

    .modal-regras{

        width:95%;

        padding:25px;

        max-height:90vh;

    }

    .modal-regras h2{

        font-size:32px;

    }

    .conteudo-regras h3{

        font-size:24px;

    }

    .conteudo-regras p,
    .conteudo-regras li{

        font-size:18px;

    }

    .btn-fechar-regras{

        font-size:20px;

    }

}

/* =========================
   PERGUNTAS
========================= */

.area-respostas{

    display:flex;

    gap:20px;

    justify-content:center;

    margin-top:25px;

}

.area-respostas button{

    border:none;

    background:#2d8d99;

    color:#fff;

    padding:14px 30px;

    border-radius:18px;

    font-size:22px;

    cursor:pointer;

    font-family:'Baloo 2', cursive;

    font-weight:700;

    transition:0.3s;

}

.area-respostas button:hover{

    transform:scale(1.05);

    background:#2d8d99;

}

#textoModal{
    margin-bottom:20px;
}

#btnContinuar{
    margin-top:15px;
    position:relative;
    z-index:9999;
}

.botoes-pergunta{
    display:flex;
    justify-content:center;
    gap:15px;
    margin-top:20px;
}

.botoes-pergunta button{
    border:none;
    background:#2d8d99;
    color:#fff;
    padding:12px 25px;
    border-radius:15px;
    font-size:20px;
    cursor:pointer;
    font-family:'Baloo 2', cursive;
}

.modal-box{
    position:relative;
}

.fechar-modal{
    display:none;
    position:absolute;
    top:15px;
    right:15px;
    width:40px;
    height:40px;
    border:none;
    background:transparent;
    color:#2d8d99;
    font-size:34px;
    font-weight:bold;
    cursor:pointer;
    display:flex;
    justify-content:center;
    align-items:center;
    transition:0.3s;
    z-index:50;
    line-height:1;
}

.fechar-modal:hover{
    transform:scale(1.15);
    color:#2d8d99;

}

/* =========================
   BALÃO PERSONAGEM
========================= */

.fala-personagem{

    position: absolute;

    bottom: 120%;

    left: 50%;

    transform: translateX(-50%);

    background: #fff;

    color: #333;

    padding: 12px 16px;

    border-radius: 15px;

    min-width: 180px;

    max-width: 250px;

    font-size: 15px;

    font-weight: 700;

    text-align: center;

    box-shadow: 0 4px 15px rgba(0,0,0,0.2);

    opacity: 0;

    visibility: hidden;

    transition: 0.3s;

    z-index: 9999;

}

/* seta do balão */

.fala-personagem::after{

    content: "";

    position: absolute;

    bottom: -10px;

    left: 50%;

    transform: translateX(-50%);

    border-width: 10px 10px 0 10px;

    border-style: solid;

    border-color: #fff transparent transparent transparent;

}

/* mostrar */

.fala-personagem.ativo{

    opacity: 1;

    visibility: visible;

}

/* =========================
   TELA DE ABERTURA
========================= */

.tela-abertura{

    position:fixed;

    inset:0;

    width:100%;
    height:100vh;

    background:
    linear-gradient(
        180deg,
        #8ee3ff 0%,
        #dff8ff 100%
    );

    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;

    overflow:hidden;

    z-index:99999;
}

/* LOGO */

.logo-abertura{

    width:120px;

    margin-bottom:10px;

    animation:flutuar 3s infinite ease-in-out;
}

/* CONTEÚDO */

.conteudo-abertura{

    width:100%;
    max-width:1000px;

    display:flex;
    align-items:center;
    justify-content:center;

    gap:20px;

    padding:20px;
}

/* PERSONAGENS */

.personagem-abertura{

    display:flex;
    align-items:flex-end;
    justify-content:center;
}

.personagem-abertura img{

    width:220px;
    max-width:100%;

    animation:flutuar 3s infinite ease-in-out;
}

/* TÍTULO */

.titulo-abertura{

    text-align:center;

    max-width:400px;
}

.titulo-abertura h1{

    font-size:58px;

    line-height:1;

    color:#ff4d6d;

    margin-bottom:15px;

    font-family:'Baloo 2', cursive;
}

.titulo-abertura p{

    font-size:22px;

    color:#444;

    line-height:1.4;
}

/* ANIMAÇÃO */

@keyframes flutuar{

    0%{
        transform:translateY(0px);
    }

    50%{
        transform:translateY(-10px);
    }

    100%{
        transform:translateY(0px);
    }

}

/* RESPONSIVO */

@media(max-width:900px){

    .conteudo-abertura{

        flex-direction:column;

        gap:10px;
    }

    .personagem-abertura img{

        width:170px;
    }

    .titulo-abertura h1{

        font-size:42px;
    }

    .titulo-abertura p{

        font-size:18px;
    }

}

@media(max-width:500px){

    .logo-abertura{

        width:90px;
    }

    .personagem-abertura img{

        width:130px;
    }

    .titulo-abertura h1{

        font-size:32px;
    }

    .titulo-abertura p{

        font-size:16px;
    }

}

