/* Configurações gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    overflow: hidden;
    background: #050505;
    color: #ffffff;
    font-family: Georgia, "Times New Roman", serif;
}

/* Tela completa */
.tela-inicial {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    background: #050505;
}

.titulo-principal {
    position: absolute;
    top: clamp(28px, 7vh, 80px);
    left: 50%;
    z-index: 20;
    width: 100%;
    padding: 0 24px;
    transform: translateX(-50%);

    color: #ffffff;
    font-size: clamp(2rem, 4.4vw, 5rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
    text-shadow:
        0 0 8px rgba(255, 255, 255, 0.8),
        0 0 24px rgba(255, 255, 255, 0.35),
        2px 3px 5px rgba(0, 0, 0, 0.95);

    pointer-events: none;
}

/* Área que contém os dois universos */
.seletor-aventuras {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    background: #050505;
}

.lado-aventura {
    position: relative;
    /* Base zero permite que o flex-grow realmente redistribua a tela. */
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    overflow: hidden;

    transition:
        flex-grow 800ms cubic-bezier(0.22, 1, 0.36, 1),
        filter 800ms ease;
}

/* Imagem completa de cada lado */
.imagem-aventura {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;

    filter: grayscale(100%) contrast(1.08) brightness(0.72);
    transition:
        filter 800ms ease,
        transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

/*
   O mosaico da Marvel é quadrado. Ele acompanha a largura do painel para
   expandir horizontalmente, em vez de aumentar como se estivesse dando zoom.
*/
.lado-marvel .imagem-aventura {
    object-fit: fill;
}

/* Camada escura para destacar os botões e o título */
.lado-aventura::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 34%),
        radial-gradient(circle at center, transparent 0 18%, rgba(0, 0, 0, 0.22) 70%);
    pointer-events: none;
    transition: background 800ms ease;
}

/* Camada independente: os botões não acompanham o movimento dos painéis. */
.botoes-aventura {
    position: absolute;
    inset: 0;
    z-index: 15;
    pointer-events: none;
}

/* Botões das aventuras */
.botao-aventura {
    position: absolute;
    top: 54%;
    z-index: 5;

    display: flex;
    width: clamp(180px, 18vw, 340px);
    aspect-ratio: 1 / 1;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);

    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.76);
    box-shadow:
        0 0 14px rgba(255, 255, 255, 0.45),
        inset 0 0 22px rgba(255, 255, 255, 0.08);

    transition:
        transform 350ms ease,
        background 350ms ease,
        box-shadow 350ms ease;

    pointer-events: auto;
}

.botao-rpg {
    left: 25%;
}

.botao-marvel {
    left: 75%;
}

.botao-aventura:hover,
.botao-aventura:focus-visible {
    transform: translate(-50%, -50%) scale(1.07);
    background: rgba(0, 0, 0, 0.9);
    box-shadow:
        0 0 18px rgba(255, 255, 255, 0.85),
        0 0 48px rgba(255, 255, 255, 0.28),
        inset 0 0 26px rgba(255, 255, 255, 0.14);
    outline: none;
}

.logo-aventura {
    display: block;
    width: 82%;
    height: 82%;
    object-fit: contain;
    filter: grayscale(100%);
    transition: transform 350ms ease;
}

.botao-aventura:hover .logo-aventura,
.botao-aventura:focus-visible .logo-aventura {
    transform: scale(1.04);
}

/* Rachadura que se move junto com a divisão */
.rachadura {
    position: relative;
    z-index: 10;
    flex: 0 0 clamp(26px, 3vw, 58px);
    height: 100%;
    margin: 0 clamp(-29px, -1.5vw, -13px);
    pointer-events: none;
}

.rachadura svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.rachadura path {
    fill: none;
    stroke: #ffffff;
    stroke-width: 7;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    filter:
        drop-shadow(0 0 5px rgba(255, 255, 255, 0.9))
        drop-shadow(0 0 14px rgba(255, 255, 255, 0.45));
}

/* As classes são adicionadas apenas quando o mouse entra no botão. */
.seletor-aventuras.rpg-ativo .lado-rpg {
    flex-grow: 1.85;
}

.seletor-aventuras.rpg-ativo .lado-marvel {
    flex-grow: 1;
    filter: brightness(0.5);
}

.seletor-aventuras.marvel-ativo .lado-marvel {
    flex-grow: 1.85;
}

.seletor-aventuras.marvel-ativo .lado-rpg {
    flex-grow: 1;
    filter: brightness(0.5);
}

.seletor-aventuras.rpg-ativo .lado-rpg .imagem-aventura,
.seletor-aventuras.marvel-ativo .lado-marvel .imagem-aventura {
    filter: grayscale(100%) contrast(1.12) brightness(0.92);
}

/* Um zoom muito leve permanece apenas no cenário widescreen de Abismo. */
.seletor-aventuras.rpg-ativo .lado-rpg .imagem-aventura {
    transform: scale(1.025);
}

/* Ajustes para telas menores */
@media (max-width: 760px) {
    body {
        overflow-y: auto;
    }

    .tela-inicial {
        min-height: 100svh;
    }

    .titulo-principal {
        top: 22px;
        font-size: clamp(1.65rem, 7vw, 2.6rem);
    }

    .botao-aventura {
        width: clamp(130px, 34vw, 210px);
    }

    .rachadura {
        flex-basis: 24px;
        margin: 0 -12px;
    }

    .seletor-aventuras.rpg-ativo .lado-rpg,
    .seletor-aventuras.marvel-ativo .lado-marvel {
        flex-grow: 1.45;
    }
}

/* Respeita usuários que preferem menos movimento */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
