body {
    font-family: 'Arial', sans-serif;
    /* background: linear-gradient(to top, #1b5e20, #2e7d32, #388e3c, #4caf50, #e8f5e8); */
    background-position: center;
    background-repeat: no-repeat;
    /* background-size: 400% 400%; */
    animation: gradientBG 15s ease infinite;
    color: white;
    text-align: center;
    margin: 0;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
}


h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.game-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: rgba(135, 28, 28, 0.1);
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}
.score-board {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 10px;
}

.score-item {
    font-size: 1.1rem;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.card {
    aspect-ratio: 1/1;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card-front {
    background-color: #4caf50;
    transform: rotateY(180deg);
}

.card-back {
    background-color: #81c784;
    font-size: 2rem;
}

.card-back img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.card.matched {
    cursor: default;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.btn {
    padding: 10px 20px;
    font-size: 1rem;
    background-color: #1b5e20;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2e7d32;
}

.win-message {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.win-message h2 {
    color: #ffeb3b;
    margin-top: 0;
}

.hidden {
    display: none;
}

@media (max-width: 600px) {
    .game-grid {
        gap: 10px;
    }
    
    .score-board {
        flex-direction: column;
        gap: 5px;
    }
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.game-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.score-board {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 10px;
}

.score-item {
    font-size: 1.1rem;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.card {
    aspect-ratio: 1/1;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card-front {
    background-color: #4caf50;
    transform: rotateY(180deg);
}

.card-back {
    background-color: #81c784;
    font-size: 2rem;
}

.card-back img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.card.matched {
    cursor: default;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.btn {
    padding: 10px 20px;
    font-size: 1rem;
    background-color: #1b5e20;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2e7d32;
}

.win-message {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.win-message h2 {
    color: #ffeb3b;
    margin-top: 0;
}

.hidden {
    display: none;
}

@media (max-width: 600px) {
    .game-grid {
        gap: 10px;
    }
    
    .score-board {
        flex-direction: column;
        gap: 5px;
    }
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#background-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -1;
}
