/* General body styling */
body {
    font-family: 'Inter', sans-serif;
}


/* --- NEW INTERFACE STYLES (for index.html) --- */

/* Styles for the background GIF */
#bg-gif {
    position: fixed; /* Use fixed to stay in place on scroll */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -1;
    object-fit: cover; /* Ensures the GIF covers the screen without stretching */
    filter: brightness(0.4); /* Darken the GIF to make text readable */
}

/* Hover effect for the main content box */
.interface-box {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}
.interface-box:hover {
    transform: scale(1.02) translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Keyframe animations for content fade-in */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Applying animations to elements */
.title-animation {
    animation: fadeInDown 0.8s ease-out both;
}
.subtitle-animation {
    animation: fadeInDown 0.8s ease-out 0.2s both; /* 0.2s delay */
}
.button-animation {
    animation: fadeInUp 0.8s ease-out 0.4s both; /* 0.4s delay */
}


/* --- GAME STYLES (for game.html) --- */

/* Container for the 3D card effect */
.card-container {
    perspective: 1000px;
}

/* The card itself, handles the 3D transform */
.card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s, opacity 0.5s; /* Added opacity transition */
    cursor: pointer;
}

/* The state when the card is flipped */
.card.flipped {
    transform: rotateY(180deg);
}

/* Common styles for both front and back faces of the card */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* Hides the back of the element when it's facing away */
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0.5rem;
}

/* Styling for the front of the card (the default view) */
.card-front {
    background-color: #4a5568;
}

/* Styling for the back of the card (the emoji view) */
.card-back {
    background-color: #2d3748;
    color: white;
    transform: rotateY(180deg); /* Rotated to be hidden initially */
    font-size: 2.5rem;
}

/* Animation for when a pair is matched */
.matched-animation {
    animation: matchWobble 0.8s ease-in-out;
}

/* The keyframes that define the wobble animation */
@keyframes matchWobble {
    0% { transform: rotateY(180deg) scale(1); }
    15% { transform: rotateY(180deg) scale(1.1) rotateZ(5deg); }
    30% { transform: rotateY(180deg) scale(1.1) rotateZ(-5deg); }
    45% { transform: rotateY(180deg) scale(1.1) rotateZ(5deg); }
    60% { transform: rotateY(180deg) scale(1.1) rotateZ(-5deg); }
    75% { transform: rotateY(180deg) scale(1.1); }
    100% { transform: rotateY(180deg) scale(1); }
}

/* Style for permanently matched cards */
.card.matched {
    opacity: 0.5;
    cursor: default;
}