* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: background 0.5s ease;
    padding: 40px 20px;
    box-sizing: border-box;
}

/* Theme: Ocean Breeze */
body.theme-ocean {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7db9e8 100%);
}

/* Theme: Sunset Glow */
body.theme-sunset {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 50%, #ee5a6f 100%);
}

.container {
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 80%;
    max-width: 1200px;
}

h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2.5em;
}

.theme-selector {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.theme-selector label {
    font-size: 1em;
    color: #555;
    font-weight: bold;
}

.theme-selector select {
    padding: 10px 20px;
    font-size: 1em;
    border: 2px solid #667eea;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
    min-width: 180px;
}

.theme-selector select:hover {
    border-color: #764ba2;
}

.theme-selector select:focus {
    border-color: #764ba2;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.player-names {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.player-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-input label {
    font-size: 1em;
    color: #555;
    font-weight: bold;
    min-width: 70px;
}

.player-input input {
    padding: 10px 15px;
    font-size: 1em;
    border: 2px solid #667eea;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
    width: 200px;
}

.player-input input:focus {
    border-color: #764ba2;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

/* Theme-specific colors */
body.theme-ocean .theme-selector select,
body.theme-ocean .player-input input {
    border-color: #2a5298;
}

body.theme-ocean #restartBtn {
    background: #2a5298;
}

body.theme-ocean #restartBtn:hover {
    background: #1e3c72;
}

body.theme-sunset .theme-selector select,
body.theme-sunset .player-input input {
    border-color: #ff6b6b;
}

body.theme-sunset #restartBtn {
    background: #ff6b6b;
}

body.theme-sunset #restartBtn:hover {
    background: #ee5a6f;
}

.game-info {
    margin-bottom: 20px;
}

#status {
    font-size: 1.3em;
    color: #555;
    font-weight: bold;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 110px);
    grid-template-rows: repeat(3, 110px);
    gap: 12px;
    margin: 0 auto 30px;
    width: fit-content;
}

.cell {
    background: #f0f0f0;
    border: 3px solid #333;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cell:hover:not(.taken) {
    background: #e0e0e0;
    transform: scale(1.05);
}

.cell.taken {
    cursor: not-allowed;
}

.cell.x {
    color: #ff0000;
}

.cell.o {
    color: #0000ff;
}

.cell.winning {
    background: #4ade80;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
}

button {
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

#restartBtn {
    background: #667eea;
}

#restartBtn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

#newGameBtn {
    background: #4ade80;
}

#newGameBtn:hover {
    background: #22c55e;
    transform: translateY(-2px);
}

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