
*{
    box-sizing: border-box;

  -webkit-tap-highlight-color:transparent;
  outline:none;
}
*:focus{
    outline:none;
}

html{
    min-height: 100vh;
}
body{
    margin: 0;
    background:url("requirements/background.png") no-repeat center center;
    align-items: center;
    display: flex;
    flex-direction: column;
    background-size: cover;
    font-family: 'Times New Roman', Times, serif;
}

/********************* start ********************/
.overlay-text{
    display: none;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    display: flex;
    transition:transform 0.6s;
}

.start-container{
    height:377px;
    width: 639px;
    background-color:#a0b765af;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 36px;
    border: 5px solid #324e4d;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);

}


.start-desc{
    height: 219.8px;
    width: 565.6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color:#e0b78c ;
    border: 3px solid black;
    padding: 10px;
    padding-inline: 20px;
    font-size: 18px;
    border-radius: 18px;
    color: black;
}
.start-desc p{
    margin: 3px;
    width: 100%;
    text-align: center;
}
.start-initial{
    cursor: pointer;
    margin-top: 23px;
    padding-top: 8px;
    font-size: 25px;
    color: white;
    font-weight: 700;
    height: 50px;
    width:220.4px;
    text-align: center;
    margin-inline: auto;
    background-color: #324e4d;
    border:3px solid #a0b765;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.start-initial:hover{
    transform: scale(1.1);
}

.overlay-text.visible{
    display: flex;
    flex-direction: column;
    animation: overlay-grow 500ms forwards;
}
@keyframes overlay-grow{
    from{
        background-color:rgba(0,0,0,0);
        font-size:0;
    }
    to{
        background-color:rgba(0,0,0,.8);
        font-size: 6em;
    }
}

/********************** Game Over **********************/
#game-over{
    visibility: hidden;
}

.game-over-container{
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
    font-family: sans-serif;
    height: 277px;
    width: 522px;
    background-color:#e75555b4 ;
    border:6px solid #704f4f;
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}
.game-over-desc{
    font-size: 27px;
    font-weight: 700;
    color: white;
}
.Restart{
    font-size: 22px;
    padding: 8px;
    padding-inline: 25px;
    border-radius: 10px;
    margin-top: 10px;
    background:white;
    color: red;
    font-weight: 600;
    border:3px solid #704f4f;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.Restart:hover{
    transform: scale(1.2);
}

/******************* Victory **********************/
.victory-container{
    height: 277px;
    width: 522px;
    background-color:#324e4dd7 ;
    border-radius: 36px;
    border:4px solid #a0b765 ;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    align-items: center;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}
.victory-desc{
    font-size: 30px;
    font-weight: 700;
    color: white;
}
.Restart2{
    font-size: 22px;
    padding: 8px;
    border-radius: 10px;
    margin-top: 10px;
    background:white;
    color: #324e4d;
    font-weight: 600;
    border:4px solid #a0b765;
    transition: transform 0.3s ease;
    cursor: pointer;
}
.Restart2:hover{
    transform: scale(1.2);
}

.container{
    margin-bottom: 20px;
    box-sizing: border-box;
    justify-content: center;
    display: grid;
    padding-top: 35px;
    padding-bottom: 30px;
    grid-template-columns: repeat(4,auto);
    gap: 13px;
    width: 481.6px;
    height:590px;
    background: url("requirements/image.jpg") no-repeat center center;
    background-size: cover;
    border-radius: 10px;
    border: 3px solid #324e4d;
    box-shadow: 0 9px 16px rgba(0, 0, 0, 0.3);
}

.info{
    color: rgb(0, 0, 0);
    font-weight: 800;
    padding-bottom: 5px;
    padding-inline: 10px;
    font-size: 1.3rem;
    grid-column: 1/-1;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    border-bottom: 3px solid #3c3d39;
    box-shadow: 0px 3px 0px rgb(204, 192, 192); /* X Y blur color */
}

.info1{
    display: flex;
    gap: 4px;
}
#time-rem,#flips-count{
    text-align: center;
    background-color: rgb(235, 233, 233);
    width: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-inline: 4px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid #324e4d;
    color: black;
}
.title{
    margin-top: 40px;
    color: rgb(0, 0, 0);
    text-shadow:2px 2px 5px rgba(255, 255, 255, 0.7);
    text-align: center;
    font-size: 2.8rem;
    font-family:Georgia, 'Times New Roman', Times, serif;
    font-weight: 700;
}

.card{
    overflow: hidden;
    position: relative;
    height: 101.4px;
    width: 79.8px;
    transform-style:preserve-3d;
    transition:transform 0.6s;
    cursor: pointer;
    overflow: hidden;
}


.backside, .frontside{
    position: absolute;
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    backface-visibility: hidden;
    border-radius: 10px;
}
.frontside{
    transition: background-color 0.3s ease;
}
.card:hover .frontside{
  background-color: #b2ca77;
}


#victory{
    visibility: hidden;
    
}


.card.flipped{
    transform:rotateY(180deg);
}



.image{
    height: 100%;
    width: 100%;
    object-fit: cover;
    overflow: hidden;
}

.frontside{
    border: 2px solid #324e4d;
    background-color: #a0b765;
}


.backside{
    background-color: rgb(69, 220, 102);
    border:2px solid black;
    transform: rotateY(180deg);
    overflow: hidden;

}
.matched {
  position: relative;
  border-radius: inherit;
}

.matched::after {
  content: "";
  position: absolute;
  
  width: 100%; 
  height:100%;

  background: radial-gradient(circle,rgba(226, 244, 226, 0)  45%, rgba(40, 243, 36, 0.747) 90%);
  
   /* card ka shape maintain karega */
  pointer-events: none; /* click block na ho */
}


.flipped{
    transform: rotateY(180deg);
}
.card.flipped .frontside{
    backface-visibility: hidden;
}
.card.flipped .backside{
    backface-visibility: visible;
}


@media (max-width:650px){
    .txt{
        font-size: 60px;
    }
    .title{
        font-size: 40px;
    }
    .start-container{
        width: 80%;
        height: 400px;
    }
    .start-desc{
        width: 85%;
        font-size: 16px;
    }
    .start-initial{
        font-size:20px ;
        padding-top: 11px;
    }
    .game-over-container{
        width: 80%;
        height: 200px;
    }

    .victory-container{
        width: 80%;
        height: 200px;
    }
    .Restart2 , .Restart{
        font-size:20px ;
    }

    .container{
        width: 70%;
        height: 500px;
    }
    .card{
        width: 60px;
        height: 80px;
    }
    @keyframes overlay-grow{
        from{
            background-color:rgba(0,0,0,0);
            font-size:0;
        }
        to{
            background-color:rgba(0,0,0,.8);
            font-size: 50px;
        }
    }
   
}

@media (max-width:500px){
    .txt{
        font-size: 50px;
        background-color: rgba(41, 140, 232, 0.544);
        padding: 8px;
        border-radius: 10px;

    }
    
    .title{
        font-size: 40px;
        margin-top: 70px;

    }
    .container{
        width: 85%;
        height: 500px;
    }
    .card{
        width: 65px;
        height: 80px;
    }
   
   
}

@media (max-width:430px){
    .title{
        font-size: 35px;
    }
    .info1{
        font-size: 18px;
    }
    .start-desc{
        height: 70%;
    }
    .Restart2 , .Restart{
        font-size: 18px;
    }
    #flips-count,#time-rem{
        height:30px;
    }
    .container{
        height:450px;
    }
    .card{
        height:70px;
        width: 55px;
    }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-3px); }
}

.timer-warning {
  animation: shake 0.5s ease-in-out;
}