:root {
    --bg-color: #f0f2f5;
    --primary-color: #ffffff;
    --accent-color: #6a1b9a;
    --gradient-1: #9b51e0;
    --gradient-2: #4a2c7a;
    --text-color: #1c1f30;
    --cell-bg: #e2e4e8;
    --cell-x: #e85d04;
    --cell-o: #2a9d8f;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    flex-direction: column;
    color: var(--text-color);
    overflow: hidden;
}

.container {
    background-color: var(--primary-color);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 90%;
    max-width: 400px;
    margin: 50px auto 80px;
}

h1 {
    font-size: 2em;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--accent-color);
}

.status {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 20px;
    min-height: 25px;
    color: var(--text-color);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 15px;
    width: 100%;
}

.cell {
    width: 100%;
    height: 100px;
    background-color: var(--cell-bg);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5em;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.cell:hover {
    transform: scale(1.05);
}

.cell.x {
    color: var(--cell-x);
}

.cell.o {
    color: var(--cell-o);
}

.button-container {
    margin-top: 25px;
}

.button {
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
    background-image: linear-gradient(45deg, var(--gradient-1), var(--gradient-2));
    margin: 5px;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background-color: var(--primary-color);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 350px;
}

.modal-content h2 {
    margin: 0;
    color: var(--accent-color);
    font-size: 1.8em;
}

footer {
    background-color: var(--bg-color);
    text-align: center;
    margin-top: auto;
    width: 100%;
    box-sizing: border-box;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
}

.footer-links {
    color: #555;
    font-size: 0.8em;
    margin-bottom: 10px;
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: #555;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-copyright {
    color: #777;
    font-size: 0.7em;
}

@media (max-width: 480px) {
    .container {
        padding: 20px;
    }
    .cell {
        height: 80px;
        font-size: 3em;
    }
    h1 {
        font-size: 1.8em;
    }
}
