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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    text-align: center;
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    max-width: 90%;
    width: 500px;
}

h1 {
    color: #1f2937;
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
}

.game-mode {
    margin-bottom: 2rem;
    margin-top: 2rem;
}

.mode-btn {
    background: #f3f4f6;
    border: none;
    padding: 0.75rem 1.5rem;
    margin: 0 0.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn.active {
    background: #3b82f6;
    color: white;
}

.mode-btn:hover:not(.active) {
    background: #e5e7eb;
}

#board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 2rem auto;
    max-width: 400px;
}

.cell {
    aspect-ratio: 1;
    background: #f3f4f6;
    border: none;
    border-radius: 0.5rem;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell:hover:not(:disabled) {
    background: #e5e7eb;
}

.cell.x {
    color: #3b82f6;
}

.cell.o {
    color: #ef4444;
}

.message {
    font-size: 2rem;
    height: 2rem;
    margin: 1rem 1rem;
    font-weight: 500;
}

.reset-btn {
    background: #1f2937;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-btn:hover {
    background: #374151;
}

@keyframes blueFlash {

    0%,
    100% {
        background: white;
    }

    50% {
        background: rgba(59, 130, 246, 0.1);
    }
}

@keyframes redFlash {

    0%,
    100% {
        background: white;
    }

    50% {
        background: rgba(239, 68, 68, 0.1);
    }
}

.flash-blue {
    animation: blueFlash 1s ease-in-out;
}

.flash-red {
    animation: redFlash 1s ease-in-out;
}

.winner-message {
    font-weight: bold;
}

.winner-message.blue {
    color: #3b82f6;
}

.winner-message.red {
    color: #ef4444;
}