* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: rgb(195, 236, 250);
    color: gray;
}

h1 {
    color: darkblue;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    text-align: center;
}

.game-mode {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

.game-mode button {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    background-color: rgb(0, 0, 139);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
}

.game-mode button:hover {
    background-color: rgb(80, 82, 199);
    transform: translateY(-2px);
}

.game-mode button.active {
    background-color: rgb(0, 0, 139);
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 80px);
    grid-template-rows: repeat(3, 80px);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background-color: white;
    padding: 1rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f6fa;
    border: none;
    border-radius: 10px;
    font-size: 2.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cell:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: white;
}

.cell.x {
    color: blueviolet;
}

.cell.o {
    color: rgb(247, 160, 175);
}

.status {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    font-weight: 600;
    color: rgb(87, 87, 87);
    padding: 0.6rem 1.2rem;
    background-color: white;
    border-radius: 50px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-align: center;
    max-width: 90%;
}

#reset {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    background-color: rgb(78, 77, 77);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#reset:hover {
    transform: translateY(-2px);
    background-color: #636e72;
}

.winning-cell {
    animation: winningAnimation 1s ease-in-out infinite alternate;
    background: linear-gradient(135deg, var(--warning) 0%, #ffeaa7 100%);
    box-shadow: 0 0 10px var(--warning);
}

@keyframes winningAnimation {
    0% {
        transform: scale(1);
        box-shadow: 0 0 8px var(--warning);
    }

    100% {
        transform: scale(1.03);
        box-shadow: 0 0 15px var(--warning);
    }
}

.cell-pop {
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    80% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile-specific styles */
@media (max-width: 480px) {
    body {
        padding: 15px;
        justify-content: flex-start;
        padding-top: 30px;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.8rem;
    }

    .game-mode {
        margin-bottom: 1rem;
    }

    .game-mode button {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .board {
        grid-template-columns: repeat(3, 70px);
        grid-template-rows: repeat(3, 70px);
        padding: 0.8rem;
        gap: 0.4rem;
    }

    .cell {
        font-size: 2rem;
        border-radius: 8px;
    }

    .status {
        font-size: 1rem;
        padding: 0.5rem 1rem;
        margin-bottom: 1rem;
    }

    #reset {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}