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


body {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    min-height: 100vh;
    background-color: #a9cec2;
    font-family: cursive;
    transition: background-color 0.3s ease;
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

h1 {
    color: #324b4c;
    font-size: 3em;
    margin-top: -30px;
    transition: color 0.3s ease;
    animation: slideDown 1s ease-in-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}


.container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
}


.main_box{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    transition: gap 0.3s ease;
    animation: fadeIn 1s ease-in-out 0.5s forwards;
    opacity: 0;
}

@keyframes boxSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-80px);
    }
    33% {
        opacity: 1;
        transform: translateX(0);
    }
    66% {
        opacity: 1;
        transform: translateY(-80px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.box {
    width: 120px;
    height: 120px;
    background-color: #fff;
    border: none;
    text-align: center;
    font-size: 60px;
    font-weight: 700;
    border-radius: 1rem;
    box-shadow: 0 0 1rem rgba(0,0,0,0.1);
    font-family: cursive;
    color: #5f5c6d;
    transition: transform 0.2s, box-shadow 0.2s;
    opacity: 0;
    animation: boxSlideIn 1s ease-in-out forwards;
}

.box:nth-child(1) {
    animation-delay: 0.5s;
}

.box:nth-child(2) {
    animation-delay: 0.6s;
}

.box:nth-child(3) {
    animation-delay: 0.7s;
}

.box:nth-child(4) {
    animation-delay: 0.8s;
}

.box:nth-child(5) {
    animation-delay: 0.9s;
}

.box:nth-child(6) {
    animation-delay: 1s;
}

.box:nth-child(7) {
    animation-delay: 1.1s;
}

.box:nth-child(8) {
    animation-delay: 1.2s;
}

.box:nth-child(9) {
    animation-delay: 1.3s;
}

.box:hover {
    transform: scale(1.05);
    box-shadow: 0 0 1.5rem rgba(0,0,0,0.2);
}

.game {
    background-color: #474554;
    color: #fff;
    padding: 15px;
    padding-inline: 30px;
    font-size: 22px;
    border: 3px solid white;
    border-radius: 10px;
    font-family: cursive;
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.2s;
    opacity: 0;
    animation: fadeIn 1s ease-in-out 1s forwards;
}

.game:hover {
    background-color: #5f5c6d;
    transform: scale(1.05);
}

.winnername {
    font-size: 20px;
    color: #474554;
    font-weight: 600;
    transition: color 0.3s ease;
    opacity: 0;
    animation: fadeIn 1s ease-in-out 1s forwards;
}


@media (max-width: 768px) {
    .box {
        width: 100px;
        height: 100px;
        font-size: 50px;
    }

    .game {
        font-size: 22px;
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.8em;
    }

    .box {
        width: 90px;
        height: 90px;
        font-size: 40px;
    }

    .game {
        font-size: 20px;
        padding: 12px 20px;
    }
}
