:root {
    --board-size: 15; 
    --cell-size: 35px; 
    --primary-color: #3f51b5; 
    --secondary-color: #c0392b; 
    --bg-color: #2c3e50; 
    --font-color: #ecf0f1;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--bg-color);
    color: var(--font-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.container {
    text-align: center;
    background-color: #34495e;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    position: relative; 
}

h1 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 2.5em;
}

#status {
    font-size: 1.2em;
    margin: 15px 0;
    font-weight: bold;
    color: #4CAF50; 
}

#game-board {
    display: grid;
    grid-template-columns: repeat(var(--board-size), var(--cell-size));
    grid-template-rows: repeat(var(--board-size), var(--cell-size));
    
    border: 5px solid #7f8c8d;
    background-color: #bdc3c7; 
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.cell {
    width: var(--cell-size);
    height: var(--cell-size);
    border: 1px solid #7f8c8d; 
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
    font-size: 1.5em; 
    font-weight: bold;
}

.cell:hover {
    background-color: rgba(255, 255, 255, 0.3); 
}

.cell.x {
    color: var(--primary-color);
    text-shadow: 0 0 5px rgba(0, 0, 255, 0.8);
    animation: place-piece 0.3s ease-out;
}

.cell.o {
    color: var(--secondary-color);
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.8);
    animation: place-piece 0.3s ease-out;
}

@keyframes place-piece {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal {
    display: none; 
    position: fixed;
    z-index: 1; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8); 
}

.modal-content {
    background-color: #34495e;
    margin: 15% auto; 
    padding: 30px;
    border: 1px solid #888;
    width: 80%; 
    max-width: 400px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    animation: fadeIn 0.5s;
}

#result-text {
    font-size: 2.5em;
    margin-bottom: 20px;
}

#modal-reset-btn {
    padding: 10px 20px;
    font-size: 1.2em;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

#modal-reset-btn:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

@keyframes fadeIn {
    from {opacity: 0;} 
    to {opacity: 1;}
}
#reset-btn { display: none; }