body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    transition: background 1s ease;
}

.container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 2.5em;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    text-align: center;
    width: 90%;
    max-width: 600px;
    transition: transform 0.3s ease;
}
.container:hover {
    transform: translateY(-4px);
}

h1, h2 {
    color: #00bcd4;
    text-shadow: 0 0 10px rgba(0, 188, 212, 0.6);
    margin-bottom: 0.5em;
}
h1 {
    font-size: 2.2em;
    letter-spacing: 1px;
}

#setup-screen .form-group {
    margin: 1.2em 0;
}

label {
    display: block;
    margin-bottom: 0.3em;
    font-weight: 500;
    color: #cddcde;
}

input[type="text"], input[type="number"] {
    text-align: center;
    padding: 0.7em;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    width: calc(100% - 1.4em);
    max-width: 300px;
    background-color: rgba(255, 255, 255, 0.08);
    color: #f9f9f9;
    font-size: 1em;
    transition: all 0.3s ease;
}
input:focus {
    outline: none;
    border-color: #00bcd4;
    background-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 10px rgba(0, 188, 212, 0.4);
}

button {
    background: linear-gradient(90deg, #00bcd4, #2196f3);
    color: white;
    border: none;
    padding: 0.8em 1.8em;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
}
button:hover {
    background: linear-gradient(90deg, #26c6da, #42a5f5);
    box-shadow: 0 0 15px rgba(66, 165, 245, 0.6);
}
button:active {
    transform: scale(0.97);
}

#board-container {
    display: grid;
    margin: 2em auto;
    width: fit-content;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 188, 212, 0.3);
}

.cell {
    width: 70px;
    height: 70px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.8em;
    cursor: pointer;
    user-select: none;
    background-color: rgba(255, 255, 255, 0.03);
    transition: all 0.25s ease;
}
.cell:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.cell.X {
    color: #4caf50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.7);
}

.cell.O {
    color: #03a9f4;
    text-shadow: 0 0 10px rgba(3, 169, 244, 0.7);
}

#history-section {
    margin-top: 2.5em;
}
#game-list {
    list-style-type: none;
    padding: 0;
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 1em;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

#game-list li {
    padding: 0.6em 0.8em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s;
}
#game-list li:last-child {
    border-bottom: none;
}
#game-list li:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.replay-btn {
    background: rgba(0, 188, 212, 0.2);
    padding: 0.3em 0.7em;
    font-size: 0.8em;
    border-radius: 5px;
    float: right;
    color: #00bcd4;
    transition: all 0.3s ease;
}
.replay-btn:hover {
    background: rgba(0, 188, 212, 0.4);
}

.hidden {
    display: none;
}

#game-screen, #setup-screen, #history-section {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
