@import url('https://fonts.googleapis.com/css2?family=Balsamiq+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap');

html{
    width: 100%;
    height: 100%;
    background: linear-gradient(325deg, rgb(255, 255, 134) 0%, rgb(180, 231, 132) 30%, rgb(24, 113, 148) 70%, rgb(22, 4, 63) 100%);
    font-family: 'Balsamiq Sans';
    overflow: hidden;
}

.game{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.controls{
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.start{
    background: rgb(9, 145, 138);
    color: rgb(224, 231, 238);
    border-radius: 5px;
    padding: 10px 20px;
    border: 2px solid white;
    cursor: pointer;
    font-size: 20px;
    letter-spacing: 0.02em;
    font-weight: bold;

}

.start:active{
    color: rgb(147, 192, 190);
}


.best{
    position: absolute;
    right: 0;
    background: rgb(41, 13, 141);
    padding: 11px;
}
.disabled{
    color: rgb(106, 107, 107);
}

.stats{
    color: rgb(44, 41, 41);
    font-size: 14pt;
    font-weight: bold;
}

.board-container{
    position: relative;
}

.board, .win{
    border-radius: 5px;
    box-shadow: 0 25px 50px rgb(33 33 33 / 25%);
    background: linear-gradient(135deg, rgb(255, 255, 134) 0%, rgb(180, 231, 132) 30%, rgb(24, 113, 148) 70%, rgb(22, 4, 63) 100%);
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    backface-visibility: hidden;
}

.board {
    display: grid;
    grid-template-columns: repeat(4, auto);
    grid-gap: 20px;
    padding: 20px;
}
.board-container.flippedd .board{
    transform: rotateY(180deg) rotateZ(50deg);
}

.board-container.board-container.flippedd .win{
    transform: rotateY(0) rotateZ(0);
}

.card {
    position: relative;
    width: 100px;
    height: 100px;
    perspective: 1000px;
    margin: 10px;
    
}
  
.card img {
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* Скрываем обратную сторону */
    position: absolute;
    top: 0;
    left: 0;
    transform: rotateY(180deg); /* Скрываем картинку */
    transition: transform 0.6s;
    filter: drop-shadow(5px 9px 15px rgba(19, 4, 102, 0.3));
}

.win{
    
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    background: rgb(210, 230, 125);
    box-shadow: 0px 0px 40px 22px rgba(1, 97, 65, 0.2) inset;
    transition: all 1s ease-in;
    /* transform: rotateY(180deg) rotateZ(50deg); */
}

.won{
    font-size: 50px;
    line-height: 0px;
    color: #044722;
}

.win-img {
    width: 50%;
    border-radius: 10px;
    box-shadow: 0px 5px 35px 2px rgba(255, 255, 255, 0.8);
}

.win .timer{
    margin-top: -8px;
    border: 2px solid white;
    border-radius: 5px;
    padding: 10px 20px;
    color: #322a2a;
    background: aliceblue;
}

p{
    font-family: 'Balsamiq Sans';
    font-size: 18px;
    letter-spacing: 0.01em;
    padding: 0 25px;
}

.again{
    border: 2px solid white;
    border-radius: 10px;
    background: #E3F39F;
    cursor: pointer;
}

.gh-logo{
    width: 70px;
}

.logo-rs{
    width: 50px;
    border-radius: 5px;
}

footer{
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    min-height: 100px;
    background: rgb(224, 226, 228, 0.4);
    border-top: 5px solid rgba(255, 255, 255, 0.7);
}

.footer-flex{
    margin-top: 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    align-content: center;
    
}

.git-link{
    display: flex;
    align-items: center;
}

a{
    text-decoration: none;
    font-size: 22px;
    color: rgb(38, 39, 39);
}


.front {
    background-color: #ffffff;
    color: rgb(235, 146, 243);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 700;
    backface-visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.6s;
    border-radius: 10px;
    box-shadow: 11px 9px 27px -4px rgba(2, 22, 37, 0.5);
    cursor: pointer;
}

.card.flipped .front {
    transform: rotateY(180deg); /* Анимация для поворота верхней части */
  }
  
.card.flipped img {
    transform: rotateY(0deg); /* Показать картинку */
}

.score{
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 189px;
    left: 0;
    width: 100%;
    height: 76%;
    text-align: center;
    background: rgb(210, 230, 125);
    box-shadow: 0px 0px 40px 22px rgba(1, 97, 65, 0.2) inset;
    transition: all 1s ease-in;
    z-index: 1;
    border-radius: 10px;
}

.flex-score{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.results{
    font-size: 40px;
    color: #E3F39F;
    border: 2px solid white;
    border-radius: 10px;
    padding: 10px 30px;
    background: #1ba85b;
    box-shadow: 0px 0px 20px 0px rgba(255, 255, 255, 0.6) inset;
}

th{
    font-size: 25px;
    padding: 10px 20px;
}

td{
    padding: 2px 0;
}

.hidden {
    display: none;
}

.close {
    font-size: 30px;
    position: absolute;
    bottom: 0;
    cursor: pointer;
    background: #68c994;
    color: #151150;
}

.discription{
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 0;
    border-radius: 10px;
    background: rgb(220, 225, 228, 0.3);
    box-shadow: 0px 0px 29px 1px rgba(255, 255, 255, 0.4) inset;
    padding: 15px 0px;
    width: 400px;
    margin: 20px auto;
    margin-top: -60px;
}

.rules{
    text-align: center;
    color: rgb(28, 30, 31);
    font-weight: 200;
}

.name{
    font-size: 50px;
    color: #e9f0cb;
    font-weight: 100;
    margin: 0;
}