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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    width: 90%;
    backdrop-filter: blur(10px);
}

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

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    flex-wrap: wrap;
    gap: 1rem;
}

.current-player {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4a5568;
}

#player-display {
    color: #667eea;
    font-size: 1.5rem;
}

.score {
    display: flex;
    gap: 1rem;
    font-weight: bold;
    color: #4a5568;
}

.score span {
    background: rgba(102, 126, 234, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 300px;
    margin: 0 auto 2rem;
    background: #4a5568;
    padding: 10px;
    border-radius: 15px;
}

.cell {
    background: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 3rem;
    font-weight: bold;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1;
    min-height: 80px;
}

.cell:hover {
    background: #f7fafc;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.cell.x {
    color: #e53e3e;
    background: #fed7d7;
}

.cell.o {
    color: #3182ce;
    background: #bee3f8;
}

.cell.winning {
    background: #48bb78 !important;
    color: white;
    animation: pulse 0.6s ease-in-out;
}

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

.game-status {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 2rem;
    min-height: 2rem;
    color: #4a5568;
}

.game-status.winner {
    color: #48bb78;
    animation: bounce 0.8s ease-in-out;
}

.game-status.tie {
    color: #ed8936;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn.secondary {
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
    color: #4a5568;
    box-shadow: 0 4px 15px rgba(160, 174, 192, 0.3);
}

.btn.secondary:hover {
    box-shadow: 0 6px 20px rgba(160, 174, 192, 0.4);
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .cell {
        font-size: 2.5rem;
        min-height: 70px;
    }
    
    .score {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .controls {
        flex-direction: column;
    }
}
