body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000;
    height: 100vh;
    position: relative;
    background-image: url("sprotomono.png");
    /* Tiled background */
    background-repeat: repeat;
    /* Tile the background */
    background-size: auto;
    /* Keep original size for tiling */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Ensure body takes full height */
    font-family: 'Lora', serif;
    /* Body text font */
}

#introduction {
    position: relative;
    width: 100%;
    height: 100vh;
    perspective: 1000px;
    /* Adds 3D perspective */
}

#Priming {
    display: none;
    /* Hidden by default */
    position: relative;
    width: 100%;
    flex: 1;
    /* Take remaining space */
    color: white;
    text-align: center;
    padding-top: 5vh;
    padding-bottom: 100px;
    /* Add padding to prevent content from being hidden behind the fixed footer */
    overflow-y: auto;
    /* Allow scrolling if content overflows */
}

#Priming .logo {
    display: block;
    margin: 0 auto 20px auto;
    /* Center the logo with margin below */
    width: 22%;
    /* Default for desktop */
    height: auto;
    cursor: pointer;
    /* Indicate it's clickable */
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    #Priming .logo {
        width: 30%;
        /* Increase to 30% on mobile */
    }

    #Priming {
        padding-bottom: 120px;
        /* Slightly more padding on mobile to account for smaller screen */
    }
}

.home-button {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    /* Resized to 50px */
    height: 50px;
    /* Resized to 50px */
    z-index: 30;
}

.info-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    /* Match the image size */
    height: 50px;
    /* Match the image size */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 30;
}

.info-button img {
    width: 50px;
    /* Set image size to 50x50px */
    height: 50px;
    border-radius: 50%;
    /* Ensure the image is circular */
}

.info-text {
    display: none;
    position: fixed;
    top: 70px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 1em;
    z-index: 30;
}

.info-text.visible {
    display: block;
}

.card {
    position: absolute;
    width: 100px;
    height: 166px;
    /* 100 * (133/80) ≈ 166px for 80:133 ratio */
    background-image: url("back-2.jpg");
    /* Updated filename */
    background-size: cover;
    border-radius: 5px;
    /* Border radius as requested */
    transform-style: preserve-3d;
    /* Enables 3D transforms */
    opacity: 0;
    /* Start invisible */
}

.card.enter {
    animation: drop 5s linear 1;
    opacity: 1;
    /* Fade in with animation */
}

.card.exit {
    animation: flyOut 1s linear forwards;
}

@keyframes drop {
    0% {
        transform: translateY(-200px) translateX(var(--start-x)) translateZ(0) rotateX(0deg) rotateY(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) translateX(var(--start-x)) translateZ(var(--z-depth)) rotateX(var(--rotate-x)) rotateY(var(--rotate-y));
        opacity: 0.7;
    }
}

@keyframes flyOut {
    0% {
        transform: translateY(var(--current-y)) translateX(var(--current-x)) translateZ(var(--z-depth)) rotateX(var(--rotate-x)) rotateY(var(--rotate-y));
        opacity: 0.7;
    }

    100% {
        transform: translateY(var(--end-y)) translateX(var(--end-x)) translateZ(var(--z-depth)) rotateX(var(--rotate-x)) rotateY(var(--rotate-y));
        opacity: 0;
    }
}

.overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(13, 0, 76, 0.69);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    color: #FDCA00;
    z-index: 10;
    width: 80%;
    /* Ensure the overlay has a reasonable width for the GIF */
    max-width: 300px;
    /* Optional: cap the width for larger screens */
}

.overlay .image-container {
    display: block;
    text-align: center;
}

.overlay img.trench-gif {
    display: block;
    margin: 0 auto 10px auto;
    /* Center the image with margin below */
    width: 100%;
    /* Expand to the full width of the container */
    height: auto;
    /* Maintain aspect ratio */
}

.overlay p,
h2 {
    margin: 0 0 10px 0;
    /* Margin below the new text */
    font-size: 1em;
}

.overlay button {
    margin: 10px;
    padding: 5px 15px;
    cursor: pointer;
    display: inline-block;
    background: rgba(255, 255, 0, 0.2);
    color: #FDCA00;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1em;
    font-family: 'Cinzel', serif;
    border: none;
    transition: background 0.3s;
}

.overlay button:hover {
    background: rgba(255, 255, 0, 0.4);
}

.hidden {
    display: none;
}

/* Priming Section Styles */
#card-stack {
    position: absolute;
    width: 200px;
    height: 332px;
    /* 200 * (133/80) ≈ 332px for 80:133 ratio */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    border-radius: 10px;
    z-index: 1;
}

.stacked-card {
    position: absolute;
    width: 200px;
    height: 332px;
    /* Match the increased card-stack height */
    background-image: url("back-2.jpg");
    /* Updated filename */
    background-size: cover;
    border-radius: 10px;
    animation: flyIn 2s ease-in-out forwards;
}

@keyframes flyIn {
    0% {
        transform: translate(var(--start-x), var(--start-y)) rotate(var(--rotation));
        opacity: 0;
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }
}

#card-stack:hover::after {
    content: "Draw Cards";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 1em;
}

#tarot-reading {
    display: none;
    margin-top: 20px;
}

.tarot-groups {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 20px auto;
    max-width: 1200px;
}

.tarot-group {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    margin: 10px;
    opacity: 0;
    animation: fadeIn 0.5s ease-in forwards;
    animation-delay: var(--delay);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Add this to center horizontally */
    text-align: center;
    /* Center any text content */
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.tarot-card {
    width: 270px;
    height: 447.66px;
    /* 270 * (829/500) to maintain exact aspect ratio */
    background-image: url("back-2.jpg");
    background-size: 100% 100%;
    border-radius: 5px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.5s ease-in-out;
    margin-bottom: 20px;
}

.tarot-card.flipped {
    transform: rotateY(180deg) scale(1.05);
    /* Slight zoom on reveal */
}

.tarot-card.reversed {
    transform: rotate(180deg);
    /* Rotate the entire card 180 degrees for reversed position */
}

.tarot-card.flipped.reversed {
    transform: rotateY(180deg) rotate(180deg) scale(1.05);
    /* Combine flip and reversed rotation */
}

.tarot-card .front,
.tarot-card .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 5px;
    transition: box-shadow 0.3s;
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

.tarot-card .front {
    background-image: url("back-2.jpg");
}

.tarot-card .back {
    transform: rotateY(180deg);
}

.tarot-card.flipped .back {
    /* Glow removed in previous update */
}

/* Remove hover effect and always show info */
.tarot-info {
    position: static;
    width: 100%;
    background: rgba(13, 0, 76, 0.69);
    color: #FDCA00;
    opacity: 1;
    padding: 16px;
    box-sizing: border-box;
    text-align: center;
    margin-top: 8px;
    border-radius: 10px;
}

/* Add specific border colors for each tarot info section */
.past-info {
    border: 1px solid #F00;
    /* Red border for past */
}

.present-info {
    border: 1px solid #00F;
    /* Blue border for present */
}

.future-info {
    border: 1px solid #FDCA00;
    /* Yellow border for future */
}

.tarot-info .card-name {
    font-weight: bold;
    font-size: 1em;
    margin: 0;
    font-family: 'Cinzel', serif;
    color: #FDCA00;
}

.tarot-info .keywords {
    font-style: italic;
    margin: 0;
    display: block;
}

.tarot-info .meaning {
    margin: 0;
    display: block;
}

/* Tablet and below font size adjustments */
@media (max-width: 768px) {
    .tarot-info .card-name {
        font-size: 1.4em;
        margin-bottom: 8px;
    }

    .tarot-info .keywords {
        font-size: 1.2em;
        margin-bottom: 6px;
    }

    .tarot-info .meaning {
        font-size: 1.1em;
    }
}

/* Remove the separate container for tarot info since it's now an overlay */
.tarot-info-container {
    display: none;
    /* No longer needed */
}

#tarot-meanings {
    position: relative;
    margin: 20px 16px;
    text-align: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background: rgba(13, 0, 76, 0.69);
    border-radius: 10px;
    color: white;
    border: 1px solid #FDCA00;
}

@media (max-width: 768px) {
    #tarot-meanings {
        margin-left: 16px;
        margin-right: 16px;
        flex-direction: column;
        gap: 20px;
    }
}

.reading-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    margin: 0 10px;
}

#tarot-meanings h3 {
    margin-top: 0;
    margin-bottom: 0;
    font-family: 'Cinzel', serif;
    font-size: 1.2em;
    color: #FDCA00;
    display: block;
    width: 100%;
}

#tarot-meanings p {
    background: transparent;
    padding: 10px;
    border-radius: 5px;
    margin: 0;
    font-size: .9em;
    line-height: 1.6;
    max-width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tarot-groups {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

    .tarot-group {
        flex: none;
        width: 100%;
        max-width: 400px;
        margin-top: 24px;
    }

    .tarot-card {
        width: 100%;
        height: calc(100vw * (829/500));
        /* Responsive height maintaining ratio */
        max-height: 700px;
    }

    .tarot-info {
        width: 100%;
        max-width: none;
        margin-top: 20px;
    }
}

/* Smaller Mobile Adjustments */
@media (max-width: 480px) {
    .tarot-group {
        max-width: 320px;
    }

    .tarot-card {
        height: calc(100vw * (829/500));
        max-height: 600px;
    }
}

#buttons {
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    position: relative;
}

@media (max-width: 768px) {
    #buttons {
        flex-direction: column;
        gap: 15px;
    }
}

#buttons button {
    padding: 10px 20px;
    cursor: pointer;
    background: rgba(255, 255, 0, 0.8);
    /* Yellow background for contrast */
    color: black;
    /* Black text for better contrast on yellow */
    border: none;
    border-radius: 5px;
    font-size: 1em;
    transition: background 0.3s;
    font-family: 'Cinzel', serif;
    /* Medieval heading font */
}

#buttons button:hover {
    background: rgba(255, 255, 0, 1);
}

#buttons .getreal-container {
    margin-left: 20px;
    /* Space between "Share to X" button and image */
    position: relative;
    /* For positioning the hover text */
}

#buttons .getreal-container img {
    width: 250px;
    /* Retain the previous size */
    height: auto;
    cursor: pointer;
    animation: shake 0.5s infinite;
    /* Shaking animation */
}

#buttons .getreal-container .hover-text {
    display: none;
    /* Hidden by default */
    position: absolute;
    top: 50%;
    /* Center vertically on the image */
    left: 50%;
    /* Center horizontally on the image */
    transform: translate(-50%, -50%);
    /* Center the text */
    background: rgba(0, 0, 0, 0.8);
    /* Semi-transparent background for readability */
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    font-family: 'Cinzel', serif;
    white-space: nowrap;
    z-index: 10;
    /* Ensure it appears above the image */
    cursor: pointer;
    /* Make it clickable */
}

#buttons .getreal-container:hover .hover-text {
    display: block;
    /* Show on hover */
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

/* Video Modal Styles */
.video-modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    /* Dark semi-transparent background */
    z-index: 100;
    /* Above all other content */
    justify-content: center;
    align-items: center;
}

.video-modal .video-container {
    position: relative;
    background: #000;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.video-modal video {
    max-width: 90vw;
    /* Responsive width */
    max-height: 70vh;
    /* Responsive height */
    border-radius: 5px;
}

.video-modal #skipButton {
    margin-top: 10px;
    padding: 10px 20px;
    background: rgba(255, 255, 0, 0.8);
    /* Yellow background for contrast */
    color: black;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-family: 'Cinzel', serif;
    cursor: pointer;
    transition: background 0.3s;
}

.video-modal #skipButton:hover {
    background: rgba(255, 255, 0, 1);
}



/* Footer Styles */
footer {
    width: 100%;
    background: transparent;
    color: #FDCA00;
    text-align: center;
    padding: 15px 0;
    margin-top: auto;
}

footer p {
    margin: 5px 0;
    font-family: 'Cinzel', serif;
    /* Medieval heading font */
}

footer p:first-child {
    font-size: 1em;
    /* Smaller font size for "HarryPotterObamaSonic10Inu" */
    font-weight: normal;
    /* Remove bold */
}

footer p:nth-child(2) {
    font-size: 1.2em;
    /* From previous update */
    font-weight: bold;
}

footer .social-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

footer .social-buttons a {
    display: inline-block;
    padding: 5px 10px;
    background: rgba(255, 255, 0, 0.2);
    /* Fallback background */
    color: #FDCA00;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1em;
    font-family: 'Cinzel', serif;
    /* Medieval heading font */
}

footer .social-buttons a:hover {
    background: rgba(255, 255, 0, 0.4);
}

/* Mason Drive Animation in Footer */
footer .mason-drive {
    position: absolute;
    width: 100px;
    /* Set size to 50x50px */
    height: 100px;
    bottom: 15px;
    /* Align with the footer padding */
    left: -50px;
    /* Start off-screen left */
    animation: slide 10s linear infinite;
    /* Slide animation, 10s duration, looping */
    z-index: 21;
    /* Ensure it appears above other footer content */
}

@keyframes slide {
    0% {
        left: -50px;
        /* Start off-screen left */
    }

    100% {
        left: 100vw;
        /* Move to off-screen right (viewport width) */
    }
}

/* Floating Image Styles (now floating near yxji.jpg) */
.floating-image {
    position: absolute;
    width: 100px;
    /* Shrunk by 33% from 150px */
    height: 100px;
    /* Shrunk by 33% from 150px */
    background-image: url("mason.png");
    background-size: cover;
    z-index: 5;
    /* Behind the cards but above the background */
    pointer-events: auto;
    /* Allow hover events */
    transition: background-image 0.3s ease;
    /* Smooth transition for image change */
    /* Position it near the info-button (yxji.jpg) */
    top: 20px;
    /* Align with the top of info-button */
    right: 80px;
    /* Position to the left of the info-button (50px button width + 30px offset) */
    animation: float 4s infinite ease-in-out;
    /* Subtle floating near yxji.jpg */
}

.floating-image:hover {
    background-image: url("bite.png");
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(20px, -10px);
        /* Small movement to the right and up */
    }

    50% {
        transform: translate(0, 20px);
        /* Down */
    }

    75% {
        transform: translate(-20px, -10px);
        /* Left and up */
    }

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

/* Update responsive sizes to maintain the same aspect ratio */
@media (max-width: 1200px) {
    .tarot-card {
        width: 252px;
        height: 417.82px;
        /* 252 * (829/500) */
    }

    .tarot-groups {
        gap: 25px;
        padding: 0 20px;
    }

    .tarot-info {
        font-size: 0.95em;
    }
}

@media (max-width: 900px) {
    .tarot-card {
        width: 234px;
        height: 387.97px;
        /* 234 * (829/500) */
    }

    .tarot-groups {
        gap: 20px;
        padding: 0 15px;
    }

    .tarot-info {
        font-size: 0.9em;
    }
}

@media (max-width: 768px) {
    .tarot-card {
        width: 100%;
        height: calc(100vw * (829/500));
        /* Responsive height maintaining ratio */
        max-height: 700px;
    }

    .tarot-groups {
        gap: 15px;
        padding: 0 10px;
    }

    .tarot-info {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .tarot-card {
        height: calc(100vw * (829/500));
        max-height: 600px;
    }

    .tarot-groups {
        gap: 10px;
        padding: 0 5px;
    }

    .tarot-info {
        font-size: 0.8em;
    }

    .tarot-group {
        padding: 10px;
    }
}