/* Global Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #2d3748;
    --secondary-color: #4a5568;
    --background-color: #f7fafc;
    --accent-color: #3182ce;
    --border-color: #e2e8f0;
    --button-bg: #4a5568;
    --button-hover: #2d3748;
}

body {
    background-color: #e2e8f0;
    min-height: 100vh;
    padding: 20px;
    color: var(--primary-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    line-height: 1.5;
}

/* Container */
.container {
    background-color: #ffffff;
    padding: 30px;
    text-align: center;
    max-width: 800px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* Heading */
h1 {
    color: var(--primary-color);
    font-size: 2.2rem;
    font-weight: bold;
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 15px;
}

/* Status Box */
.status {
    font-size: 1.1rem;
    margin: 15px 0;
    padding: 12px;
    background-color: var(--background-color);
    font-weight: 500;
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* Game Board */
.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
}

.cell {
    background-color: #fff;
    border: 2px solid var(--border-color);
    height: 100px;
    font-size: 2.8rem;
    font-weight: 600;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.cell:hover {
    background-color: #edf2f7;
    transform: scale(1.05);
}

/* Scoreboard */
.score-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f8fafc;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-top: 20px;
}

.score-title {
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 15px;
    font-weight: 600;
}

.scores {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 7px;
}

.score {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #ffffff;
    text-align: center;
    padding: 0 15px;
}

.score:hover {
    background: #edf2f7;
    transform: scale(1.05);
}

.score-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
}

.score-label {
    font-size: 0.95rem;
    color: var(--secondary-color);
    margin-top: 5px;
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    margin: 20px 0;
    gap: 12px;
}

button {
    background-color: var(--button-bg);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

/* Responsive Design */

/* For tablets and medium screens */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .cell {
        height: 80px;
        font-size: 2.2rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .scores {
        gap: 10px;
    }

    button {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}

/* For small screens (mobile) */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        gap: 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .status {
        font-size: 1rem;
        padding: 10px;
    }

    .board {
        gap: 8px;
    }

    .cell {
        height: 70px;
        font-size: 2rem;
    }

    .score-board {
        padding: 15px;
    }

    .score-value {
        font-size: 1.5rem;
    }

    button {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}