/* ================================
     🏰 LANDING PAGE
================================ */
body {
    background-image: url('../img/index.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000;
    font-family: "UnifrakturCook", cursive !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    cursor: url('../img/cursor.cur'), auto;
    position: relative;
    z-index: -102;
}

body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle,
            transparent 0%,
            rgba(0, 0, 0, 0.3) 50%,
            rgba(0, 0, 0, 1) 90%,
            rgba(0, 0, 0, 1) 100%);
    z-index: 1;
    animation: flickerGradient 5s infinite;
    pointer-events: none;
    z-index: -101;
}

@keyframes flickerGradient {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }

    75% {
        opacity: 0.6;
    }
}

/* ================================
     🎴 CARD SELECTOR PAGE
================================ */

/* Title Animation */
.card-title-animated {
    font-size: 2.8rem;
    text-align: center;
    background: linear-gradient(10deg,
            #ff3c00,
            #FDCF58,
            #ff3c00,
            #FDCF58,
            #ff3c00);
    background-size: 300% auto;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: shimmerFlow 10s linear infinite;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 1));
    margin-bottom: 2rem;
}

@keyframes shimmerFlow {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 100% center;
    }
}

/* Card Container */
.cards {
    display: flex;
    gap: 2rem;
    perspective: 1200px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center; /* Ensures cards are vertically centered */
}

/* Individual Card */
.realm-card {
    position: relative;
    width: 250px;
    height: 350px;
    border-radius: 15px;
    overflow: hidden;
    transform-style: preserve-3d;
    /* Enables 3D space for child elements */
    transition:
        rotatey 0.8s ease,
        box-shadow 0.4s ease,
        scale 0.4s ease;
    /* Smooth flipping and shadow animation */
    box-shadow: 0 30px 80px rgba(0, 0, 0, 1);
    background-color: #000;
    cursor: pointer;
}

/* Flipped State */
.realm-card.flipped {
    transform: rotateY(180deg) scale(1.5) !important;
        margin: auto; /* Centers the card horizontally and vertically */
        box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8); /* Highlighted shadow when flipped */
        transition: transform 0.8s ease, box-shadow 0.4s ease;
    z-index: 999;
}

/* Disabled state */
.realm-card.disabled {
    pointer-events: none; /* Prevent interactions */
    opacity: 0.7; /* Dim the card to show it's disabled */
}

/* Front and Back Faces */
.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    transform-style: preserve-3d;
    box-sizing: border-box;
    border: 10px solid #0e0e0e;
    transition: opacity 0.4s ease;
    /* Smooth fade-in/out for safety */
}

/* Front Face */
.card-front {
    transform: rotateY(0deg);
    z-index: 1;
}

/* Back Face */
.card-back {
    transform: rotateY(180deg);
    background: black;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    padding: 1rem;
}

.card-back h1 {
    text-align: center;
    color: #7c3023;
    text-shadow: 1px 0 #b44532, 0 1px #b44532
}

.card-back input[type="password"] {
    width: 75%;
    padding: 10px;
    border: 1px solid #524e46;
    /* Lighter border */
    border-radius: 5px;
    background-color: #20201daa;
    /* Semi-transparent black */
    color: #fff;
    /* Dark taupe */
    text-align: center;
    font-size: 1rem;
}

.card-back input[type="password"]::placeholder {
    color: rgb(255, 255, 255, .3);
    /* Dark taupe placeholder */
}

.loading-bar {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    opacity: 0.2;
    pointer-events: none;
    mix-blend-mode: difference;
}

/* When Flipped */
.realm-card.flipped .card-back {
    z-index: 2;
}

/* Backdrop */
#card-backdrop {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 0;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#card-backdrop.active {
    z-index: -10;
    opacity: 1;
    filter: blur(20px);
    display: block;
}

/* Shine and Holo Effects */
.shine,
.holo-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    z-index: 9999;
    transition: all 0.2s ease;
}

.shine {
    mix-blend-mode: soft-light;
}

.holo-layer {
    mix-blend-mode: overlay;
    mask-image: url(../img/pattern-hex.png);
    mask-size: 100%;
    z-index: 5;
}

.user-message {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #7c3023;
    text-shadow: 1px 0 #b44532, 0 1px #b44532;
    /* Light gray for readability */
    font-size: 2rem;
}

/* ================================
     📱 MOBILE RESPONSIVENESS
================================ */

@media screen and (max-width: 768px) {

    /* General Body Adjustments */
    body {
        height: auto;
        /* Allow the page to scroll naturally */
        padding: 1rem;
        overflow: scroll;
    }

    /* Stack Cards Vertically */
    .cards {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        overflow: auto;
    }

    /* Adjust Card Sizes */
    .server-card {
        margin-bottom: 1rem;
    }

    /* Adjust Title for Smaller Screens */
    .card-title-animated {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    /* Modal (Server Panel) Layout */
    #server-panel {
        width: 300px;
        height: 450px;
        transform: translate(-50%, -50%);
    }

    /* Always Show Holo Effect on Mobile */
    .server-holo-bg {
        mask-image: url(../img/pattern-hex.png) !important;
        mask-size: 70% !important;
        opacity: 1 !important;
    }

    #home-panel {
        padding: 0;
        margin-bottom: 5rem;
    }

    /* Server Content Adjustments */
    #server-content {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        display: flex;
        padding: 10px;
        box-sizing: border-box;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-around;
    }
}
