/* ------------------ Fonts & Base ------------------ */
@import url('https://fonts.googleapis.com/css2?family=Lexend&family=Montserrat:wght@400;700&display=swap');

@font-face {
    font-family: 'Big Apple';
    src: url('./Big Apple 3PM.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Lexend', 'Montserrat', sans-serif;
    color: #fff;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    background-color: #1d1d2d;
}

/*  ----------------- Trailer ------------------- */

.trailer iframe {
    width: 100%;
    height: 400px;
    border: none;
    border-radius: 12px;
}

/* ------------------ Parallax ------------------ */
.parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%;
    background: url('img/bg.png') center top no-repeat;
    background-size: cover;
    z-index: -1;
    pointer-events: none;
    transition: transform 0.05s ease-out;
}

/* ------------------ Header ------------------ */
header {
    position: relative;
    padding: 100px 20px 120px;
    text-align: center;
    margin-bottom: 40px;
    overflow: hidden;
}

.blur-layer {
    position: absolute;
    inset: 0;
    background: rgba(29, 29, 45, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    mask-image: linear-gradient(to bottom, black 30%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 30%, transparent 100%);
    z-index: 0;
}

header>*:not(.blur-layer) {
    position: relative;
    z-index: 1;
}

.logo {
    display: block;
    margin: 0 auto;
    width: 500px;
    max-width: 90%;
    height: auto;
    padding: 2em 0;
}

header h1 {
    font-family: 'Big Apple', sans-serif;
    font-size: 3em;
    margin: 0;
}

header p {
    font-size: 1.2em;
    color: #ccc;
}

/* ------------------ Navegação (Desktop) ------------------ */
nav {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: center;
    z-index: 10;
    padding: 15px 0;
    background: transparent;
    transition: background 0.3s ease;
}

.nav-blur-layer {
    position: absolute;
    inset: 0;
    background: rgba(29, 29, 45, 0.5);
    backdrop-filter: blur(10px);
    opacity: 0;
    -webkit-backdrop-filter: blur(10px);
    mask-image: linear-gradient(to bottom, black 20%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 20%, transparent 100%);
    z-index: 0;
    transition: all 0.2s ease;
}

/* Efeito quando fixado */
.nav-blur-layer.fixed-nav {
    opacity: 1;
}

/* Links continuam iguais */
nav a {
    margin: 0 5px;
    /* color: rgb(255, 255, 255); */
    /* background: rgba(29, 29, 45, 0.55); */
    text-decoration: none;
    /* font-weight: 600; */
    font-size: 1.1em;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.3s, color 0.3s;
    z-index: 2;
}

nav a:hover,
nav a:focus {
    /* background-color: #6df; */
    /* color: #000; */
    outline: none;
}


/* ------------------ Botão e Menu Mobile ------------------ */
#nav-bur-mobile,
.menu-button,
.side-nav,
#overlay {
    display: none;
}

@media (max-width: 550px) {
    .character-card {
        width: 300px !important;
    }
}

@media (max-width: 768px) {
    /* ------------------ Sobre ------------------ */

    .modal-nav {
        top: 75% !important;
        transform: translateY(-75%) !important;
    }

    p {
        font-size: 1.2em;
    }

    #sobre {
        margin-inline: 20px;
    }

    #nav-bur-mobile {
        display: block;
        position: fixed;
        top: 0;
        opacity: 1 !important;
        left: 0;
        width: 100%;
        height: 15%;
        background: rgba(29, 29, 45, 0.5);
        backdrop-filter: blur(10px);
        z-index: 100;
    }

    .menu-button {
        display: block;
        position: fixed;
        top: 20px;
        left: 20px;
        src: url("img/hud/btn_menu.png");
        z-index: 100;
        background-color: transparent;
        border: none;
        user-select: none;
        border-radius: 6px;
        cursor: pointer;
    }

    #menu-toggle-img {
        transition: transform 0.2s ease, opacity 0.2s ease;
        transform: scale(1);
        opacity: 1;
        transform-origin: center;
    }

    .shrinking {
        transform: scale(0) !important;
        opacity: 0 !important;
    }

    .growing {
        transform: scale(1) !important;
        opacity: 1 !important;
    }

    .side-nav {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        height: 100%;
        background: linear-gradient(135deg, rgba(131, 131, 131, 0.642) 00%, transparent 90%);
        backdrop-filter: blur(10px);
        padding-left: 20px;
        gap: 15px;
        z-index: 90;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0);
        transform: translateX(-100%);
        opacity: 0;
        transition: transform 0.4s cubic-bezier(0.32, 1, 0.36, 1.2), opacity 0.3s ease, box-shadow 0.4s ease;

    }

    .side-nav.open {
        transform: translateX(-7%);
        opacity: 1;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
    }


    .side-nav a {
        margin-left: 20px;
        background-color: rgba(131, 131, 131, 0.23);
        padding: 10px 15px;
        margin-right: 20px;
        text-align: center;
        width: 70%;
        color: rgb(255, 255, 255);
        font-family: 'Big Apple', sans-serif !important;
        letter-spacing: 2px;
        font-weight: normal !important;
        text-decoration: none;
        transform: scale(1);
        font-size: 1.3em;
        transition: all 0.2s;
    }

    .side-nav a:hover {
        outline: none;
        background-color: rgba(131, 131, 131, 0.63);
        transform: scale(1.05);
    }

    .side-nav a:hover {
        color: #fff;
    }

    #overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 80;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

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

    nav {
        display: none;
    }
}

/* ------------------ Conteúdo Principal ------------------ */
.content {
    position: relative;
    z-index: 1;
    background-color: rgba(30, 30, 47, 0.5);
}

.section {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 20px;
}

.button {
    display: inline-block;
    background: #6df;
    color: #000;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
}

/* ------------------ Galeria ------------------ */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.gallery img {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(109, 223, 255, 0.5);
}

/* ------------------ Personagens ------------------ */
.characters {
    display: flex;
    max-height: 450px;
    overflow-y: scroll;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.character-card {
    border-radius: 12px;
    padding: 15px;
    width: 200px;
    text-align: center;
}

.character-card img {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    /* para alguns navegadores */
    width: 192px;
    /* 48px * 4x aumento, por exemplo */
    height: auto;
    /* mantém proporção */
}

.character-card,
.devlog-entry {
    background-color: rgb(173 173 173 / 50%);
    position: relative;
    z-index: 1;
}

.character-card h3 {
    font-family: 'Big Apple', sans-serif;
    font-size: 1.5em;
    margin: 10px 0;
    font-weight: 500;
    letter-spacing: 2px;
    color: #fff;
}

.character-card h3,
.devlog-entry h3 {
    background-color: rgb(173 173 173 / 50%);
    padding: 10px;
    border-radius: 8px;
}

.devlog-entry h3 {
    width: fit-content !important;
}


/* ------------------ Devlog com Scroll ------------------ */
#devlog-container {
    max-height: 350px;
    overflow-y: auto;
    padding-right: 8px;
    scroll-behavior: smooth;
}

.devlog-tag {
    display: inline-block;
    background-color: #aaa;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 14px;
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    font-family: 'Big Apple', monospace;
}

.tag-mundo {
    background-color: #f2c7c7 !important;
    /* rosa pastel claro */
    color: #9e4a4a !important;
}

.tag-combate {
    background-color: #c7f2c7 !important;
    /* verde pastel claro */
    color: #4a9e4a !important;
}

.tag-missão {
    background-color: #dcefc7 !important;
    /* verde pastel claro */
    color: #4a6f35 !important;
}

.tag-história {
    background-color: #c7d7f2 !important;
    /* azul pastel claro */
    color: #315a9e !important;
}

.tag-personagem {
    background-color: #f2c7f2 !important;
    /* rosa pastel claro */
    color: #9e4a9e !important;
}

.tag-sistema {
    background-color: #c7d7ef !important;
    /* azul pastel claro */
    color: #315a9e !important;
}

.tag-bug {
    background-color: #f2d6d6 !important;
    /* vermelho pastel claro */
    color: #9e4a4a !important;
}

.tag-atualizacao {
    background-color: #f9ebc7 !important;
    /* amarelo pastel claro */
    color: #9e8a31 !important;
}

.tag-dungeon {
    background-color: #d6c7f2 !important;
    /* roxo pastel claro */
    color: #6f4a9e !important;
}


#devlog,
#personagens,
#sobre,
#galeria,
.devlog-entry {
    background-color: rgba(145, 145, 145, 0.5);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    padding: 20px;
    margin-bottom: 15px;
}

/* ------------------ Image Modal -------------*/
/* Modal - fundo escuro e centralização */
.image-modal {
    display: none;
    visibility: hidden;
    pointer-events: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.4s ease;
    will-change: opacity;
}

/* Mostrar com fade */
.image-modal.show {
    display: flex;
    /* ou block */
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
}

/* Conteúdo da imagem com animação zoom */
.image-modal .modal-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(109, 223, 255, 0.9);
    cursor: zoom-in;
    transition: transform 0.4s ease;
    will-change: transform;
    user-select: none;
}

/* Quando zoom ativado */
.image-modal .modal-content.zoomed {
    cursor: zoom-out;
    transform: scale(2);
}

/* Botão fechar */
.modal-close {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 10000;
    outline: none;
    width: 48px;
    height: 48px;
    position: fixed;
    top: 20px;
    right: 30px;
    background-color: transparent;
    user-select: none;
    transition: color 0.3s ease;
}


/* Botões de navegação */
.modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 10000;
    outline: none;
    width: 64px;
    /* ou o tamanho da imagem */
    height: 64px;
}

.arrow-icon {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    object-fit: contain;
    transition: filter 0.3s ease;
}

.arrow-icon:hover {
    filter: brightness(.65);
    transition: filter 0.3s ease;
}

.modal-nav.disabled .arrow-icon {
    opacity: 0.5;
    pointer-events: none;
}


#modal-prev {
    left: 20px;
}

#modal-next {
    right: 20px;
}

/* Esconder botão quando não tiver próxima/imagem */
.modal-nav.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ------------------ Mácaras ------------------ */

/* Máscara quando estiver rolando e não estiver no topo */
.mask-top {
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 5%, black 100%);
    mask-image: linear-gradient(to bottom, transparent, black 5%, black 100%);
}

/* Máscara quando estiver rolando e não estiver no fim */
.mask-bottom {
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 95%, transparent);
    mask-image: linear-gradient(to bottom, black 0%, black 95%, transparent);
}

/* Quando as duas máscaras estiverem aplicadas, terá fade nas duas bordas */
.mask-top.mask-bottom {
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
}

/* Sem máscara (scroll no topo e no fim) */
.no-mask {
    -webkit-mask-image: none;
    mask-image: none;
}

.metric span {
    font-size: 1.5em;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    color: #fff;
}


/* ------------------ Tipografia ------------------ */
.devlog-entry h3,
section h2 {
    letter-spacing: 2px;
    font-weight: 500;
    font-family: 'Big Apple', sans-serif;
}

.bigApple {
    font-family: 'Big Apple', sans-serif !important;
    letter-spacing: 2px;
    font-weight: normal !important;
}

nav a,
header p,
section p,
footer {
    font-family: 'Lexend', 'Montserrat', sans-serif;
}

/* ------------------ Rodapé ------------------ */
footer {
    text-align: center;
    padding: 20px;
    color: #ffffff;
    inset: 0;
    background: rgba(29, 29, 45, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    mask-image: linear-gradient(to top, black 20%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 20%, transparent 100%);
    z-index: 0;
}

/* ---------------- Pixel art Buttons */

.hud-button,
.menu-button img {
    image-rendering: pixelated;
    background-size: 150% 150% !important;
    cursor: pointer;
    width: 60px;
    border: none;
    background: none;
    padding: 0;
}

.hud-icon-button {
    background: none;
    border: none;
    padding: 0;
}

.hud-button-stretch {
    display: inline-block;
    padding: 12px 24px;
    font-family: 'Big Apple', sans-serif;
    font-size: 1.2em;
    color: #7f708a;
    background-image: url("img/hud/btn_play.png");
    background-repeat: repeat-x;
    background-size: 100% 100%;
    border: none;
    text-decoration: none;
    image-rendering: pixelated;
    text-align: center;
    white-space: nowrap;
    width: auto;
    /* min-width: 150px; */
}

.centered-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.collum {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.hud-button-small,
.hud-button-mid,
.hud-button-big,
.hud-button {
    display: inline-block;
    padding: 12px 24px;
    font-family: 'Big Apple', sans-serif;
    font-size: 1.2em;
    color: #7f708a;
    background-repeat: repeat-x;
    background-size: 100% 100% !important;
    border: none;
    text-decoration: none;
    image-rendering: pixelated;
    font-weight: normal !important;
    text-align: center;
    white-space: nowrap;
    width: auto;
    text-shadow: none !important;
    /* min-width: 150px; */
}

.hud-button-small {
    background-image: url("img/hud/btn_play_small.png");
}

.hud-button-mid {
    background-image: url("img/hud/btn_play.png");
}

.hud-button-big {
    background-image: url("img/hud/btn_play_big.png");
}

/* ---------------- scrollbar ------------------ */
/* Scroll personalizado para desktop */
@media (min-width: 1285p) {

    .parallax-bg {
        background-position: center -600px;
    }
}

@media (min-width: 768px) {


    header {
        padding: 50px 20px 0;
        margin-bottom: 40px;
    }

    .parallax-bg {
        background-position: center -400px;
    }

    ::-webkit-scrollbar {
        width: 12px;
    }

    ::-webkit-scrollbar-track {
        background: rgba(22, 22, 37, 0.5);
        border-radius: 10px;
    }

    ::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, #6df, #38a5ff);
        border-radius: 10px;
        border: 2px solid rgba(22, 22, 37, 0.7);
        transition: background 0.3s ease;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, #89e0ff, #00cfff);
    }

}