* {
    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;
    padding: 20px;
}

.container {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 30px;
    max-width: 500px;
    width: 100%;
    text-align: center;
}

header h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5em;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

main {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(45deg, #f093fb, #f5576c);
    padding: 15px 20px;
    border-radius: 15px;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.current-player {
    font-size: 1.2em;
    font-weight: bold;
}

#current-player {
    font-size: 1.5em;
    margin-left: 10px;
}

.player-x {
    color: #3498db;
}

.player-o {
    color: #e74c3c;
}

.reset-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.game-board {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.row {
    display: flex;
    gap: 10px;
}

.cell {
    width: 100%;
    aspect-ratio: 1;
    background-color: #f8f9fa;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
}

.cell:hover {
    background-color: #e9ecef;
    transform: translateY(-3px);
}

.cell.x {
    color: #3498db;
}

.cell.o {
    color: #e74c3c;
}

.status-message {
    font-size: 1.3em;
    font-weight: bold;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    padding: 10px;
    border-radius: 10px;
}

.status-message.win {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.tie {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.game-stats {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    padding: 20px;
    border-radius: 15px;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
}

footer {
    margin-top: 30px;
    color: #666;
    font-size: 0.9em;
}

/* Animation for winning cells */
.winning-cell {
    animation: pulse 1s infinite;
}

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

/* Responsive design */
@media (max-width: 600px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .game-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .row {
        gap: 5px;
    }
    
    .cell {
        font-size: 2.5em;
    }
}
