/* ==================================================
   RESET
   ================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    background: #000;
    color: #fff;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    overflow-x: hidden;
}



/* ==================================================
   COSMOS BACKGROUND
   ================================================== */

.cosmos-background {
    position: fixed;
    inset: 0;

    z-index: -10;

    background: #000;

    overflow: hidden;
}


.stars {
    position: absolute;
    inset: 0;

    background-image:
        radial-gradient(
            1px 1px at 10% 20%,
            rgba(255,255,255,.7),
            transparent
        ),
        radial-gradient(
            1px 1px at 25% 70%,
            rgba(255,255,255,.5),
            transparent
        ),
        radial-gradient(
            1px 1px at 40% 30%,
            rgba(255,255,255,.6),
            transparent
        ),
        radial-gradient(
            1px 1px at 55% 80%,
            rgba(255,255,255,.5),
            transparent
        ),
        radial-gradient(
            1px 1px at 70% 15%,
            rgba(255,255,255,.7),
            transparent
        ),
        radial-gradient(
            1px 1px at 85% 55%,
            rgba(255,255,255,.5),
            transparent
        ),
        radial-gradient(
            1px 1px at 90% 90%,
            rgba(255,255,255,.7),
            transparent
        );

    opacity: .7;
}



/* ==================================================
   HOURGLASS
   ================================================== */

.hourglass {
    position: absolute;

    top: 50%;
    left: 50%;

    width: 150px;
    height: 220px;

    transform:
        translate(-50%, -50%);

    opacity: .13;

    animation:
        hourglassFloat 6s
        ease-in-out infinite;
}


@keyframes hourglassFloat {

    0%,
    100% {
        transform:
            translate(-50%, -50%);
    }

    50% {
        transform:
            translate(
                -50%,
                calc(-50% - 8px)
            );
    }

}


.glass-top,
.glass-bottom {

    position: absolute;

    left: 10px;

    width: 130px;
    height: 85px;

    border:
        1px solid
        rgba(255,255,255,.7);

}


.glass-top {
    top: 10px;

    clip-path:
        polygon(
            0 0,
            100% 0,
            62% 100%,
            38% 100%
        );
}


.glass-bottom {
    bottom: 10px;

    clip-path:
        polygon(
            38% 0,
            62% 0,
            100% 100%,
            0 100%
        );
}


.glass-neck {

    position: absolute;

    left: 69px;
    top: 92px;

    width: 12px;
    height: 36px;

    border-left:
        1px solid
        rgba(255,255,255,.7);

    border-right:
        1px solid
        rgba(255,255,255,.7);
}


.sand-top {

    position: absolute;

    top: 20px;
    left: 28px;

    width: 94px;
    height: 60px;

    background:
        rgba(255,255,255,.45);

    clip-path:
        polygon(
            0 0,
            100% 0,
            60% 100%,
            40% 100%
        );
}


.sand-bottom {

    position: absolute;

    bottom: 20px;
    left: 28px;

    width: 94px;
    height: 60px;

    background:
        rgba(255,255,255,.3);

    clip-path:
        polygon(
            40% 0,
            60% 0,
            100% 100%,
            0 100%
        );
}



/* ==================================================
   HOME
   ================================================== */

#home {

    min-height: 100vh;

    display: flex;
    flex-direction: column;

    align-items: center;

    padding:
        70px 30px;
}


.cosmos-title {

    text-align: center;

    margin-bottom: 60px;
}


.title-symbol {

    font-size: 28px;

    opacity: .65;

    margin-bottom: 10px;
}


.cosmos-title h1 {
    font-size: clamp(22px, 3vw, 42px);
    font-weight: 300;
    letter-spacing: 8px;
    margin-left: 8px;
    line-height: 1.5;
}



/* ==================================================
   WORLDS
   ================================================== */

/* IMPORTANT:
   HEAVEN / EARTH / HELL
   ARE VERTICALLY STACKED.
*/

.worlds {

    width:
        min(1600px, 100%);

    display: flex;

    flex-direction: column;

    gap: 28px;
}



/* ==================================================
   WORLD BUTTONS
   ================================================== */

.world {

    position: relative;

    width: 100%;

    height: auto;

    aspect-ratio: 16 / 9;

    display: block;

    appearance: none;
    -webkit-appearance: none;

    padding: 0;

    border: none;

    overflow: hidden;

    cursor: pointer;

    background: #050505;

    color: white;

    border-radius: 4px;

    transition:
        transform .45s ease,
        box-shadow .45s ease;
}


.world img {

    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;

    transition:
        transform .8s ease;
}


.world-overlay {

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            to top,
            rgba(0,0,0,.9),
            rgba(0,0,0,.05) 70%
        );
}


.world-label {

    position: absolute;

    left: 0;
    right: 0;
    bottom: 30px;

    z-index: 2;

    text-align: center;

    font-size: 22px;

    letter-spacing: 9px;
}


.world:hover {

    transform:
        translateY(-7px);

    box-shadow:
        0 20px 50px
        rgba(255,255,255,.08);
}


.world:hover img {

    transform:
        scale(1.04);
}



/* ==================================================
   BIOME SCREEN
   ================================================== */

.screen {

    position: fixed;

    inset: 0;

    z-index: 20;

    background:
        radial-gradient(
            circle at center,
            #111 0%,
            #030303 70%,
            #000 100%
        );

    overflow-y: auto;

    opacity: 0;

    visibility: hidden;

    transform:
        scale(.72);

    transition:
        opacity .6s ease,
        transform .7s ease,
        visibility .6s;
}


.screen.active {

    opacity: 1;

    visibility: visible;

    transform:
        scale(1);
}


.back-button {

    position: fixed;

    top: 25px;
    left: 25px;

    z-index: 30;

    padding:
        12px 18px;

    color: white;

    background:
        rgba(0,0,0,.6);

    border:
        1px solid
        rgba(255,255,255,.25);

    cursor: pointer;

    letter-spacing: 2px;
}


.back-button:hover {

    background:
        rgba(255,255,255,.1);
}


.biome-page {

    max-width: 1300px;

    margin: 0 auto;

    padding:
        100px 40px;
}


.biome-heading {

    display: flex;

    justify-content: center;
    align-items: center;

    gap: 25px;

    margin-bottom: 15px;
}


.biome-heading h1 {

    font-size:
        clamp(35px, 6vw, 70px);

    font-weight: 300;

    letter-spacing: 12px;
}


.biome-heading span {

    opacity: .5;
}


.biome-description {

    text-align: center;

    max-width: 600px;

    margin:
        0 auto 60px;

    opacity: .55;

    letter-spacing: 2px;
}



/* ==================================================
   CHARACTERS
   ================================================== */

.characters {

    display: flex;

    flex-wrap: wrap;

    justify-content: center;

    align-items: flex-start;

    gap: 30px;
}


.character {

    width: 280px;
    height: 400px;

    position: relative;

    overflow: hidden;

    background: #080808;

    border:
        1px solid
        rgba(255,255,255,.15);

    cursor: pointer;

    transition:
        transform .4s ease,
        border-color .4s ease;
}


.character:hover {

    transform:
        translateY(-10px);

    border-color:
        rgba(255,255,255,.55);
}


.character img {

    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}


.character::after {

    content: "";

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            to top,
            rgba(0,0,0,.95),
            transparent 60%
        );

    pointer-events: none;
}


.character-name {

    position: absolute;

    z-index: 2;

    bottom: 55px;

    left: 20px;
    right: 20px;

    font-size: 18px;

    letter-spacing: 3px;
}


.character-role {

    position: absolute;

    z-index: 2;

    bottom: 25px;

    left: 20px;

    opacity: .55;

    font-size: 11px;

    letter-spacing: 3px;
}



/* ==================================================
   BOSS
   ================================================== */

.character.boss {

    width: 360px;
    height: 500px;

    flex-basis: 100%;

    order: -1;
}



/* ==================================================
   CHARACTER MODAL
   ================================================== */

#character-modal {

    position: fixed;

    inset: 0;

    z-index: 100;

    display: flex;

    justify-content: center;
    align-items: center;

    padding: 30px;

    background:
        rgba(0,0,0,.9);

    backdrop-filter:
        blur(10px);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transition:
        opacity .4s ease,
        visibility .4s ease;
}


#character-modal.active {

    opacity: 1;

    visibility: visible;

    pointer-events: auto;
}



/* ==================================================
   CHARACTER MODAL INNER
   ================================================== */

.character-modal-inner {

    width:
        min(1250px, 100%);

    max-height: 90vh;

    overflow-y: auto;

    position: relative;

    display: grid;

    /*
       CHARACTER IMAGE
       INFORMATION
       TAROT
    */

    grid-template-columns:
        240px
        1fr
        220px;

    gap: 40px;

    align-items: center;

    padding: 55px;

    background:
        linear-gradient(
            135deg,
            #111,
            #050505
        );

    border:
        1px solid
        rgba(255,255,255,.2);
}



/* ==================================================
   CHARACTER IMAGE
   ================================================== */

.character-portrait {

    width: 240px;

    height: 360px;

    overflow: hidden;

    background: #000;

    border:
        1px solid
        rgba(255,255,255,.25);
}


.character-portrait img {

    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}



/* ==================================================
   CLOSE BUTTON
   ================================================== */

.close-character {

    position: absolute;

    top: 15px;
    right: 20px;

    width: 40px;
    height: 40px;

    border: none;

    background: transparent;

    color: white;

    font-size: 30px;

    cursor: pointer;

    opacity: .6;

    z-index: 20;
}


.close-character:hover {

    opacity: 1;
}



/* ==================================================
   CHARACTER INFO
   ================================================== */

.character-info h2 {

    font-size:
        clamp(28px, 4vw, 50px);

    font-weight: 300;

    letter-spacing: 5px;

    margin-bottom: 20px;
}


.character-description {

    line-height: 1.7;

    opacity: .7;

    margin-bottom: 30px;
}


.character-stats {

    display: flex;

    flex-wrap: wrap;

    gap: 30px;

    margin-bottom: 35px;
}


.character-stats div {

    min-width: 80px;

    font-size: 13px;

    letter-spacing: 1px;
}


.character-stats span {

    display: block;

    font-size: 9px;

    letter-spacing: 3px;

    opacity: .4;

    margin-bottom: 7px;
}


.character-lore h3 {

    font-size: 11px;

    letter-spacing: 4px;

    font-weight: 400;

    opacity: .5;

    margin-bottom: 10px;
}


.character-lore p {

    line-height: 1.8;

    opacity: .7;
}


.character-quote {

    margin-top: 30px;

    padding-left: 20px;

    border-left:
        1px solid
        rgba(255,255,255,.4);

    font-style: italic;

    opacity: .65;
}



/* ==================================================
   TAROT — STEAM / WARFRAME STYLE 3D CARD
   ================================================== */

.tarot-section {
    display: flex;
    justify-content: center;
    align-items: center;

    perspective: 1200px;
}


/* ==================================================
   OUTER CARD
   ================================================== */

.tarot-card {

    width: 200px;
    height: 330px;

    position: relative;

    cursor: pointer;

    outline: none;

    /*
       These variables are controlled by JavaScript.
    */

    --rotate-x: 0deg;
    --rotate-y: 0deg;

    transform-style: preserve-3d;

    transform:
        perspective(1000px)
        translateY(var(--lift, 0px))
        rotateX(var(--rotate-x))
        rotateY(var(--rotate-y))
        scale(var(--scale, 1));

    transition:
        transform .12s ease-out,
        filter .2s ease;
}


/* ==================================================
   WHEN MOUSE LEAVES
   ================================================== */

.tarot-card.resetting {

    transition:
        transform .6s
        cubic-bezier(.2,.8,.2,1),
        filter .4s ease;

    --rotate-x: 0deg;
    --rotate-y: 0deg;

    --lift: 0px;
    --scale: 1;

    filter:
        drop-shadow(
            0 5px 10px
            rgba(0,0,0,.3)
        );
}


/* ==================================================
   HOVER STATE
   ================================================== */

.tarot-card:hover {

    --lift: -8px;
    --scale: 1.035;

    filter:
        drop-shadow(
            0 20px 35px
            rgba(0,0,0,.7)
        );
}


/* ==================================================
   3D INNER
   ================================================== */

.tarot-card-inner {

    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    transform-style: preserve-3d;

    -webkit-transform-style: preserve-3d;

    transition:
        transform .8s
        cubic-bezier(.2,.8,.2,1);

}


/* ==================================================
   CLICK FLIP
   ================================================== */

.tarot-card.flipped .tarot-card-inner {

    transform:
        rotateY(180deg);

}


/* ==================================================
   CARD SIDES
   ================================================== */

.tarot-front,
.tarot-back {

    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    overflow: hidden;

    border-radius: 6px;

    background: #050505;

    border:
        1px solid
        rgba(255,255,255,.35);

    backface-visibility:
        hidden;

    -webkit-backface-visibility:
        hidden;

}


/* ==================================================
   FRONT
   ================================================== */

.tarot-front {

    transform:
        rotateY(0deg);

}


/* ==================================================
   BACK
   ================================================== */

.tarot-back {

    transform:
        rotateY(180deg);

}


/* ==================================================
   IMAGES
   ================================================== */

.tarot-front img,
.tarot-back img {

    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    pointer-events: none;

}


/* ==================================================
   LIGHT / SHINE EFFECT
   ================================================== */

.tarot-card::after {

    content: "";

    position: absolute;

    inset: 0;

    z-index: 10;

    border-radius: 6px;

    pointer-events: none;

    opacity: 0;

    background:
        radial-gradient(
            circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(255,255,255,.22),
            rgba(255,255,255,.07) 20%,
            transparent 55%
        );

    transition:
        opacity .25s ease;

    mix-blend-mode:
        screen;
}


.tarot-card:hover::after {

    opacity: 1;

}


/* ==================================================
   FOCUS
   ================================================== */

.tarot-card:focus-visible {

    outline:
        1px solid
        rgba(255,255,255,.8);

    outline-offset: 5px;

}



/* ==================================================
   MOBILE
   ================================================== */

@media (max-width: 900px) {

    .character-modal-inner {

        grid-template-columns:
            200px
            1fr
            190px;

        gap: 25px;

        padding: 45px 30px;
    }


    .character-portrait {

        width: 200px;
        height: 310px;
    }


    .tarot-card {

        width: 170px;
        height: 280px;
    }

}


@media (max-width: 700px) {

    .character-modal-inner {

        grid-template-columns: 1fr;

        gap: 30px;

        padding: 50px 25px 30px;

        text-align: center;
    }


    .character-portrait {

        width: 220px;
        height: 300px;

        margin: 0 auto;
    }


    .character-stats {

        justify-content: center;
    }


    .character-quote {

        text-align: left;
    }


    .tarot-card {

        width: 190px;
        height: 310px;
    }

}


@media (max-width: 500px) {

    .cosmos-title h1 {

        letter-spacing: 7px;
    }


    .biome-page {

        padding:
            90px 20px;
    }


    .world {

        height: auto;
        aspect-ratio: 16 / 9;
    }


    .character.boss {

        width: 280px;
        height: 400px;
    }

}