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

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

.game-container {
    text-align: center;
    padding: 2rem;
}

h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.mode-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.mode-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.mode-btn.active {
    background: white;
    color: #667eea;
    font-weight: bold;
}

.status {
    color: white;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    min-height: 1.5rem;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin: 0 auto 1.5rem;
    width: fit-content;
}

.cell {
    width: 100px;
    height: 100px;
    background: #f0f0f0;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

.cell.x {
    color: #ff6b6b;
    animation: popIn 0.3s ease;
}

.cell.o {
    color: #4ecdc4;
    animation: popIn 0.3s ease;
}

.cell.winner {
    animation: glow 1s ease-in-out infinite;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px currentColor;
        background: #f0f0f0;
    }
    50% {
        box-shadow: 0 0 20px currentColor, 0 0 30px currentColor;
        background: #fff;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.board.draw {
    animation: shake 0.5s ease;
}

.reset-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    background: white;
    color: #764ba2;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.reset-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Responsive design */
@media (max-width: 400px) {
    .cell {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    .mode-selector {
        flex-direction: column;
        gap: 0.5rem;
    }

    .mode-btn {
        width: 100%;
    }
}
