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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* background-color: #9370DB; */
    /* background: linear-gradient(135deg, #0037fe, #060303, #6600ff); */
    /* background: linear-gradient(-45deg, #9370DB, #8A2BE2, #E6E6FA, white); */
    background-clip: url("https://www.shutterstock.com/shutterstock/videos/3657478763/preview/stock-footage-flow-of-flat-crystals-on-black.webm");
    background-size: 400% 400%;
    animation: gradient 5s ease infinite;
    height: 100vh;
    color: white;
    overflow: hidden;
}
#video-background {
            opacity: calc(20px);
            position: fixed;
            right: 0;
            bottom: 0;
            min-width: 100%;
            min-height: 100%;
            width: auto;
            height: auto;
            z-index: -1;
        }

        .video-background {
        position: fixed;
        right: 0;
        bottom: 0;
        min-width: 100%;
        min-height: 100%;
        width: auto;
        height: auto;
        z-index: -1;
    }
    
    .video-foreground {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
    }
    
    .content {
        position: relative;
        z-index: 1;
        color: white;
    }

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

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

    100% {
        background-position: 0% 50%;
    }
}

.screen {
    width: 100%;
    height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* Home Screen */
.container {
     backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(px); /* For Safari */
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
}

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

.settings {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    margin-bottom: 30px;
}

.setting-group {
    /* background-color: rgba(255, 255, 255, 0.1); */
    border-radius: 15px;
    padding: 20px;
    min-width: 250px;
}

.setting-group h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.card-types {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.card-option {
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.card-option:hover {
    transform: translateY(-5px);
}

.card-option.selected {
    transform: scale(1.05);
    position: relative;
}

.card-option.selected::after {
    content: '✓';
    position: absolute;
    top: -10px;
    right: -10px;
    /* background-color: #4CAF50; */
    background-color: #9370DB;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.card-preview {
    background-size: cover;
    width: 100px;
    height: 140px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    margin-bottom: 8px;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.card-option.selected .card-preview {
    /* border-color: #4CAF50; */
    border-color: #9370DB;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.difficulty-levels {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.level-btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.level-btn:hover {
    /* background-color: rgba(255, 255, 255, 0.2); */
    background-color:purple
}

.level-btn.selected {
    /* background-color: #4CAF50; */
    background-color: #9370DB;
    font-weight: bold;
}

.start-btn {
    /* background-color: #4CAF50; */
    background-color: #9370DB;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    margin-top: 20px;
}

.start-btn:hover {
    /* background-color: #45a049; */
    background-color: #9370DB;
    transform: scale(1.05);
}


.game-header {
    position: absolute;
    top: 20px;
    width: 70%;
    max-width: 800px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 15px 20px;
    border-radius: 10px;
}

.stats {
    display: flex;
    gap: 20px;
}

.stat-box {
    background-color: purple;
    padding: 8px 15px;
    border-radius: 8px;
    display: flex;
    gap: 5px;
}

.back-btn {
    background-color: purple;
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.game-board {
    display: grid;
    gap: 15px;
     backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(px); /* For Safari */
    width: 100%;
    width: 580px;
    height: 500px;
    margin-top: 130px;
    perspective: 990px;
    /* background: linear-gradient(65deg, #1a2a6c, #b21f1f, #fdbb2d);
    animation: gradient 15s ease infinite;  */
    /* background-color: #9470db22; */
    background: linear-gradient(-45deg, #9370DB, #892be285, #e6e6fa00, white);
    background-size: 400% 400%;
    animation: gradient 5s ease infinite;
    padding: 30px;
    background-size: 400% 400%;
    border-radius: 20px;
    backdrop-filter: blur;
}
@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}


.card {
    aspect-ratio: 3/4;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    height: 100px;
    width: 75px;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-size: cover;
    background-position: center;
}

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

.card-back {
    
     background-image:url(https://i.pinimg.com/originals/94/66/26/946626fc5448a4651dbae29951180d46.jpg); 
    background-position: center;
     background-size: cover;
}

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

.card.matched {
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.5s, opacity 0.5s linear;
}

/* Win Screen */
.win-container {
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.win-container h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    /* color: #4CAF50; */
    color: #9370DB;
}

.win-container p {
    font-size: 1.5rem;
    margin: 15px 0;
}

.win-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.win-btn {
    /* background-color: #4CAF50; */
    background-color: #9370DB;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.win-btn:hover {
    /* background-color: #45a049; */
    background-color: #9370DB;
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .settings {
        flex-direction: column;
        align-items: center;
    }

    .card-types {
        flex-wrap: wrap;
    }

    .game-board {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .game-board {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats {
        flex-direction: column;
        gap: 10px;
    }
}

