:root {
    --font-family: 'Fredoka One', sans-serif;
    --heading-font: 'Fredoka One', cursive, sans-serif;
}

h1 {
    font-family: var(--heading-font);
    font-weight: 400;
    font-size: 3rem;
}

.game-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.grid-container {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    background-color: rgba(255, 255, 255, 0.5);
    padding: 10px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.tic-box {
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.tic-box:hover {
    background-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.tic-box:active {
    transform: scale(0.95);
}

.icons,
.scores {
    display: flex;
    justify-content: space-evenly;
    margin-top: 1rem;
    align-items: center;
}

.scores>h1 {
    margin: 0;
    font-size: 4rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    font-family: 'Fredoka One', cursive, sans-serif;
    /* Fallback to sans-serif */
}

.scoreboard {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px 10px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.reset-div {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.reset-btn {
    font-family: var(--font-family);
    font-size: 1.2rem;
    border-radius: 5px;
    transition: all 0.2s;
    background-color: #ff6b6b;
    color: white;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 0 #d35454;
    transform: translateY(0);
}

.reset-btn:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #d35454;
}

.reset-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #d35454;
}

.win-tile {
    background-color: #75f379 !important;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Animation for placing a mark */
.pop-in img {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 370px) {
    .tic-box {
        width: 4rem;
        height: 4rem;
    }

    img {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 600px) and (min-width: 371px) {
    .tic-box {
        width: 5.5rem;
        height: 5.5rem;
    }

    img {
        width: 70px;
        height: 70px;
    }
}

@media (min-width: 601px) {
    .tic-box {
        width: 8rem;
        height: 8rem;
    }

    h1 {
        font-size: 3rem;
    }

    img {
        width: 100px;
        height: 100px;
    }

    .icons>img {
        width: 70px;
        height: 70px;
    }
}

/* Responsive Layout for Large Screens */
@media (min-width: 1000px) {
    .game-content {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: start;
        gap: 20px;
        margin-top: 2rem;
        max-width: 1200px;
        /* Ensure enough width for the layout */
    }

    .grid-container {
        grid-column: 2;
        margin: 0;
        /* Remove auto margin as grid handles centering */
    }

    .scoreboard {
        grid-column: 3;
        justify-self: end;
        /* Align to the far right */
        margin-top: 0;
        width: 300px;
        height: auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    text-decoration: none;
    color: white;
    font-family: var(--font-family);
    font-size: 1.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s;
    backdrop-filter: none;
}

.back-btn:hover {
    background-color: rgba(0, 0, 0, 0.4);
    transform: none;
}