@font-face {
    font-family: "HelloPumpkin";
    src: url("../fonts/hello-pumpkin.otf") format("opentype");
}

@font-face {
    font-family: "Fredoka";
    src: url("../fonts/Fredoka-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
}

body {
    margin: 0;
    padding: 0;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(15, 15, 15, 0.7)), url("../images/wood-background.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    height: 100vh;
    width: 100vw;
    font-family: "HelloPumpkin", sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

header {
    width: 100%;
    background-color: rgb(24, 22, 22);
    height: 150px;
    box-shadow: thistle 0px 2px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

img#logo {
    width: 250px;
    height: auto;
}

.map-container {
    position: relative;
    /* min() garante que o mapa encolhe por altura em telas portrait, mantendo o aspect ratio */
    width: min(90vw, calc(90vh * 16 / 9));
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    /* border: 3px solid #261c21; */
    /* box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5); */
    background-size: cover;
    background-repeat: no-repeat;
}

.map-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: fill;
}

.map-hotspots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}


.map-hotspot-button {
    position: absolute;
    cursor: pointer;
    opacity: 0;
    border: none;
    transition: opacity 0.2s ease;
}

/* Descomente para visualizar as áreas clicáveis durante o desenvolvimento */
/* .map-hotspot-button {
    opacity: 0.3 !important;
    background: red !important;
} */

#cuia-button {
    top: 61%;
    left: 53%;
    width: 10%;
    height: 15%;
}

#papafigo-button {
    top: 34%;
    left: 29%;
    width: 8%;
    height: 10%;
}

#gloria-button {
    top: 27%;
    left: 67%;
    width: 10%;
    height: 25%;
}

/* Histórias não disponíveis nesta versão */
#forest-button,
#cave-button {
    cursor: not-allowed;
}

#forest-button {
    top: 45%;
    left: 76%;
    width: 12%;
    height: 15%;
}

#cave-button {
    top: 25%;
    left: 50%;
    width: 12%;
    height: 15%;
}

/* ──────────────────────────────────────────────────────────────────────────
   Botão e Modal de Informações
   ────────────────────────────────────────────────────────────────────────── */

body.modal-open {
    overflow: hidden !important;
}

/* Botão de Informações "?" */
.info-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #ffb651;
    border: 3px solid #5a189a;
    border-radius: 50%;
    color: #5a189a;
    font-family: "Fredoka-Bold", sans-serif;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.info-btn:hover {
    background-color: #ffb703;
    border-color: #7b2cbf;
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
}

.info-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Modal Overlay (Fundo Escurecido) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Container */
.modal-container {
    background: rgba(29, 17, 36, 0.98);
    background-size: cover;
    border: 5px solid #5a189a;
    border-radius: 16px;
    width: 90%;
    max-width: 550px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(90, 24, 154, 0.3);
    transform: scale(0.85);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
    opacity: 1;
}

/* Botão Fechar */
.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 15px;
    background: transparent;
    border: none;
    color: #ff9f1c;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
    transition: color 0.2s ease, transform 0.2s ease;
}

.modal-close-btn:hover {
    color: #ffb703;
    transform: scale(1.1);
}

.modal-close-btn:active {
    transform: scale(0.9);
}

.modal-content {
    padding: 30px 24px 20px 24px;
    overflow-y: auto;
    flex-grow: 1;
    scrollbar-width: thin;
    scrollbar-color: #ff9f1c transparent;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
    background-color: #ff9f1c;
    border-radius: 3px;
}

/* Título e Cabeçalhos */
.modal-title {
    font-family: "HelloPumpkin", sans-serif;
    font-size: 38px;
    color: #ff9f1c;
    text-align: center;
    margin-top: 0;
    margin-bottom: 25px;
    text-shadow: 2px 2px 0px #5a189a;
    letter-spacing: 1px;
}

.modal-content h3 {
    font-family: "HelloPumpkin", sans-serif;
    font-size: 24px;
    letter-spacing: 2px;
    color: #ffb703;
    margin-top: 25px;
    margin-bottom: 12px;
    border-bottom: 2px solid #5a189a;
    padding-bottom: 5px;
    text-shadow: 1px 1px 0px #2d1d16;
}

.modal-content p,
.modal-content li {
    font-family: Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #f4f1de;
}

.modal-content ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.modal-content li {
    margin-bottom: 8px;
}

.image-placeholder-1-1 {
    width: 200px;
    height: 200px;
    margin: 15px auto;
    border: 2px dashed #ff9f1c;
    border-radius: 12px;
    background-color: rgba(255, 159, 28, 0.05);
    position: relative;
    box-sizing: border-box;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.image-placeholder-1-1 img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: calc(100% - 24px);
    max-height: calc(100% - 24px);
    object-fit: contain;
}

.modal-footer {
    padding: 15px 24px 20px 24px;
    display: flex;
    justify-content: center;
    border-top: 1px solid rgba(255, 159, 28, 0.15);
    background-color: rgba(0, 0, 0, 0.25);
    border-radius: 0 0 12px 12px;
}

.modal-back-btn {
    background-color: #ff9f1c;
    color: #2d1d16;
    border: 2px solid #5a189a;
    border-radius: 8px;
    padding: 8px 30px;
    font-family: "HelloPumpkin", sans-serif;
    font-size: 20px;
    letter-spacing: 2px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.modal-back-btn:hover {
    background-color: #ffb703;
    transform: scale(1.05);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.4);
}

.modal-back-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-content a {
    color: #fff;
    text-decoration: underline;
}

.modal-content a:hover {
    color: #fff;
    text-decoration: underline;
}

.modal-content a:visited {
    color: #fff;
}

.modal-content a:active {
    color: #fff;
}

@media (max-width: 600px) {
    .info-btn {
        bottom: 15px;
        right: 15px;
        width: 44px;
        height: 44px;
        font-size: 24px;
    }

    .modal-container {
        width: 92%;
        max-height: 82vh;
        border-width: 4px;
    }

    .modal-content {
        padding: 20px 16px;
    }

    .modal-title {
        font-size: 30px;
        margin-bottom: 15px;
    }

    .modal-content h3 {
        font-size: 20px;
        margin-top: 20px;
    }

    .modal-content p,
    .modal-content li {
        font-size: 14px;
    }

    .image-placeholder-1-1 {
        width: 160px;
        height: 160px;
    }
}