@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@300;400;500;600&family=Luckiest+Guy&display=swap');

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

:root {
    --win-bg: #85FFBD;
    --win-bg-linear: linear-gradient(45deg, #85FFBD 0%, #FFFB7D 100%);
    --bg: #FF9A8B;
    --bg-linear: linear-gradient(90deg, #FF9A8B 0%, #FF6A88 55%, #FF99AC 100%);

    --header-font: 'Hind Siliguri', sans-serif;
    --score-font: 'Luckiest Guy', cursive;
}

body {

    background: var(--bg-linear);
}

main {

    position: relative;
}

.overlay {
    height: 100%;
    width: 100%;
    background: linear-gradient(rgba(0, 0, 0, .6), rgba(0, 0, 0, .6));
    position: absolute;
    top: 0;
    overflow: auto;
    padding: 10px;

}

.modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg);
    padding: 20px;
    border-radius: 10px;
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    overflow: auto;
    animation: modal .5s ease;
    padding: 10px;
    font-family: var(--header-font);
    z-index: 100;

}

@keyframes modal {
    0% {
        transform: translate(-50%, -100%);
    }

    100% {
        transform: translate(-50%, -50%);
    }
}

.modal .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal .content p {
    font-size: 1.1rem;
    overflow: auto;
}

@media screen and (max-width: 768px) {
    .modal .header h1 {
        font-size: 1.5rem;
    }

    .modal .content p {
        font-size: .85rem;
    }
}

.modal .header .close_modal {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all .5s ease;
}

.modal .header .close_modal:hover {
    transform: rotate(360deg);
}


@media screen and (max-width: 768px) {
    .modal {
        width: 90%;
    }

    .modal .header .close_modal {
        font-size: 1.2rem;
    }

    .modal p {
        font-size: .9rem;
    }
}

.playing_card {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    padding: 10px;
}

.player_0,
.player_1 {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    width: 600px;
    height: 600px;
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;

    background: linear-gradient(rgba(255, 255, 255, .3), rgba(255, 255, 255, .3));
    transition: all .5s ease;

}

.active {
    background: linear-gradient(rgba(255, 255, 255, .6), rgba(255, 255, 255, .6));
    transition: all .5s ease;
}

.winner {
    background: var(--win-bg-linear);
}


.hidden {
    display: none;
}


.roll_animation_close {
    animation: roll_animation_close 1s ease-in-out;
    transition: all 1s ease-in-out;
}

.roll_animation_open {
    animation: roll_animation_open 1s ease-in-out;
    transition: all 1s ease-in-out;
}

@keyframes roll_animation_close {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes roll_animation_open {
    0% {
        transform: rotate(360deg);
    }

    100% {
        transform: rotate(0deg);
    }
}



.player_0 {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.player_1 {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.player_0 .header h1,
.player_1 .header h1 {
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    font-family: var(--header-font);

}

.player_0 .header .total_score_1,
.player_1 .header .total_score_2 {
    font-size: 5rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
    margin-top: .7rem;
    font-family: var(--score-font);
}


.player_0 .footer,
.player_1 .footer {
    background-color: #FF99AC;
    padding: 10px;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
}

.player_0 .footer p,
.player_1 .footer p {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    font-family: var(--header-font);

}

#current_score_0,
#current_score_1 {
    font-family: var(--score-font);
    font-size: 2rem;
    letter-spacing: 3px;
}

.dice_image {
    width: 100px;
    height: auto;
    object-fit: cover;
    animation: roll .7s ease-in-out;
    transition: all .5s ease;
}

.dice_image:hover {
    transform: rotate(360deg);
}

@keyframes roll {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.controls {
    position: absolute;
    display: flex;
    justify-content: space-around;
    flex-direction: column;
    gap: 1rem;

}

.controls .header {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: space-around;
    align-items: center;
}

.controls .footer {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.controls button {
    padding: 5px 10px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-family: var(--header-font);
    font-weight: bold;
    cursor: pointer;
    transition: all .3s ease;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
}

.controls button:hover {
    background-color: #e0e0e0;
}

.controls button:active {
    transform: translateY(4px);
}

footer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

footer p {
    font-size: 1rem;
    font-family: var(--score-font);
    text-align: center;
}

footer p a {
    color: black;
}

footer p a:hover {
    transform: rotate3d(1, 1, 1, 360deg);

}

@media screen and (max-width: 768px) {

    .player_0 .header h1,
    .player_1 .header h1 {
        font-size: 1.5rem;
    }

    .player_0 .header .total_score_1,
    .player_1 .header .total_score_2 {
        font-size: 3rem;
    }

    .player_0 .footer p,
    .player_1 .footer p {
        font-size: 1rem;
    }

    .dice_image {
        width: 70px;
    }

    .controls button {
        padding: 5px;
        font-size: .8rem;
    }

    footer p {
        font-size: .7rem;
    }
}