/* MAPA */

#tela-mapa {
    width: min(1100px, 96vw);
    min-height: auto;
    z-index: 2;
    text-align: center;
    padding-top: 0;
    padding-bottom: 35px;
}

.titulo-mapa {
    color: white;
    font-size: 2.2rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

/* BANNER DO MÓDULO */

.banner-modulo {
    display: block;
    width: min(520px, 90vw);
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.18));
}

/* SELEÇÃO DE MÓDULOS */

#container-modulos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px 14px;
    flex-wrap: wrap;
    max-width: 560px;
    margin: 18px auto 26px;
}

.btn-modulo {
    width: 162px;
    min-height: 62px;

    background: rgba(255, 255, 255, 0.88);
    color: var(--ocean-dark);
    border: 3px solid rgba(230, 126, 34, 0.55);
    box-shadow: 0 5px 0 rgba(184, 107, 47, 0.45);
    padding: 7px 12px;
    font-size: 0.82rem;
    border-radius: 999px;

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

    cursor: pointer;
    transition:
        transform 0.25s ease,
        filter 0.25s ease,
        opacity 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease,
        background 0.25s ease;
}

.btn-modulo:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.03);
}

.btn-modulo.ativo {
    background: #fff7df;
    border-color: var(--orange);
    box-shadow: 0 5px 0 #b9550e;
    transform: translateY(-2px);
}

.btn-modulo-imagem {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.18));
}

.btn-modulo.ativo .btn-modulo-imagem {
    filter:
        drop-shadow(0 4px 6px rgba(0, 0, 0, 0.20)) drop-shadow(0 0 7px rgba(255, 204, 77, 0.55));
}

.btn-modulo-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.btn-modulo-texto {
    display: block;
    width: 92px;
    max-width: 92px;

    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;

    text-align: center;
    line-height: 1.05;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--ocean-dark);
}

/* ILHAS / CENÁRIOS CLICÁVEIS */

#container-cards {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 34px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.ilha-mapa {
    width: 230px;
    min-height: 230px;
    background: transparent;
    border: none;
    box-shadow: none;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.25s ease, filter 0.25s ease, opacity 0.25s ease;
}

.ilha-mapa:hover:not(.bloqueada) {
    transform: translateY(-8px) scale(1.04);
}

.ilha-mapa-visual {
    position: relative;
    min-height: 160px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.ilha-mapa-imagem {
    width: 220px;
    height: 160px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.22));
    transition: transform 0.25s ease, filter 0.25s ease;
}

.ilha-mapa:hover:not(.bloqueada) .ilha-mapa-imagem {
    filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.26));
}

.ilha-mapa-info {
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 16px;
    background: rgba(255, 250, 240, 0.76);
    box-shadow: 0 5px 12px rgba(20, 60, 100, 0.10);
}

.ilha-mapa-info h3 {
    margin: 0 0 6px;
    color: var(--ocean-dark);
    font-size: 1rem;
    line-height: 1.2;
}

.ilha-mapa .estrelas-card {
    font-size: 1.15rem;
    margin: 0;
    letter-spacing: 1px;
}

.ilha-mapa.bloqueada {
    cursor: not-allowed;
    opacity: 0.68;
    filter: grayscale(1);
}

.ilha-mapa.bloqueada .ilha-mapa-imagem {
    opacity: 0.6;
}

.ilha-cadeado {
    position: absolute;
    top: 16px;
    right: 22px;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    font-size: 1.65rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.ilha-mapa-icon {
    font-size: 4rem;
}

.ilha-mapa.botao-ilha-visual {
    background: transparent;
    border: none;
    box-shadow: none;
}

.ilha-mapa.botao-ilha-visual .ilha-mapa-visual {
    min-height: 180px;
}

.ilha-mapa-imagem.botao-ilha-visual-img {
    width: 240px;
    height: 180px;
    object-fit: contain;
    filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.18));
}

.ilha-mapa.botao-ilha-visual.bloqueada .ilha-mapa-imagem.botao-ilha-visual-img {
    opacity: 1;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.16));
}

/* AÇÕES DO MAPA: BAÚ + CABINE */

.area-acoes-mapa {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 44px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.btn-cenario-conquista {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.btn-cenario-conquista:hover {
    transform: translateY(-6px) scale(1.03);
    background: transparent;
    box-shadow: none;
}

.btn-cenario-conquista:active {
    transform: translateY(-2px) scale(0.98);
    box-shadow: none;
}

.btn-cenario-conquista img {
    width: 140px;
    height: 120px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.22));
    transition: transform 0.25s ease, filter 0.25s ease;
}

.btn-cenario-conquista {
    min-width: 180px;
}

.btn-cenario-conquista:hover img {
    transform: scale(1.05);
    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.28));
}

.btn-cenario-conquista span {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 3px solid var(--orange);
    color: var(--ocean-dark);
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

/* MODAL: CABINE DO CAPITÃO */

.modal-cabine {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.modal-cabine-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 30, 40, 0.45);
    backdrop-filter: blur(2px);
}

.modal-cabine-box {
    position: relative;
    z-index: 1001;
    width: min(560px, 92vw);
    max-height: 88vh;
    overflow-y: auto;
    margin: 5vh auto 0;
    background: #fffaf1;
    border: 4px solid #d8902f;
    border-radius: 28px;
    padding: 26px 22px 24px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.modal-cabine-box h3 {
    margin: 0 0 20px;
    text-align: center;
    color: var(--ocean-dark);
    font-size: 1.7rem;
    letter-spacing: 0.3px;
}

.btn-fechar-cabine {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 4px 0 #b9550e;
    font-size: 1rem;
}

.cabine-bloco {
    background: rgba(255, 255, 255, 0.75);
    border: 2px solid rgba(74, 144, 226, 0.22);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 16px;
}

.cabine-bloco label,
.cabine-subtitulo {
    display: block;
    margin: 0 0 12px;
    font-weight: 700;
    color: var(--ocean-dark);
    text-align: center;
}

#input-cabine-nome {
    width: 100%;
    max-width: 100%;
    margin-bottom: 12px;
}

.cabine-personagens {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.cabine-personagem-option {
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid #d9e6f2;
    border-radius: 18px;
    padding: 8px;
    box-shadow: none;
}

.cabine-personagem-option:hover {
    transform: translateY(-3px);
}

.cabine-personagem-option.selected {
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.15);
}

.cabine-personagem-option img {
    width: 100%;
    max-width: 70px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.cabine-bloco-danger {
    border-color: rgba(192, 57, 43, 0.25);
}

.btn-resetar-cabine {
    background: var(--danger);
    box-shadow: 0 6px 0 #81261d;
}

#input-cabine-nome {
    text-align: center;
    display: block;
    margin: 0 auto 14px;
}

.cabine-personagens {
    justify-items: center;
}

.cabine-personagem-option {
    width: 86px;
    height: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cabine-personagem-option img {
    max-height: 92px;
    object-fit: contain;
}

.btn-resetar-cabine {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* AÇÕES PRINCIPAIS DA CABINE */

.cabine-acoes-principais {
    display: flex;
    justify-content: center;
    margin: 4px 0 16px;
}

.btn-salvar-cabine {
    background: var(--green);
    box-shadow: 0 6px 0 var(--green-dark);
    padding: 14px 34px;
    font-size: 1.05rem;
}

/* BOTÃO ANTIGO DE JOGAR — MANTIDO POR SEGURANÇA */

.btn-jogar {
    background: var(--orange);
    box-shadow: 0 6px 0 #b9550e;
    font-size: 1rem;
    padding: 10px 22px;
    margin-top: 10px;
}

/* ===============================
   CABINE DO CAPITÃO — AJUSTE MOBILE
   Evita personagem saindo do modal
================================ */

@media (max-width: 520px) {
    .modal-cabine-box {
        width: min(94vw, 380px);
        padding: 24px 14px 22px;
        overflow-x: hidden;
    }

    .cabine-bloco {
        padding: 14px 10px;
        overflow: hidden;
    }

    .cabine-personagens {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;

        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;

        justify-items: center;
    }

    .cabine-personagem-option {
        width: clamp(62px, 18vw, 76px);
        height: clamp(92px, 26vw, 106px);
        padding: 5px;
        border-radius: 14px;
        box-sizing: border-box;
    }

    .cabine-personagem-option img {
        max-width: 100%;
        max-height: 84px;
        object-fit: contain;
    }
}
