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

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

/* Container */
.container {
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
}

/* Header */
header h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5em;
    font-weight: bold;
}

.subtitle {
    color: #666;
    font-size: 1em;
    margin-bottom: 20px;
}

/* Game Info */
.game-info {
    margin-bottom: 20px;
    font-size: 1.2em;
    color: #555;
    min-height: 30px;
    font-weight: 600;
}

.current-player {
    color: #667eea;
}

/* Game Board */
.board {
    display: grid;
    grid-template-columns: repeat(3, 120px);
    grid-template-rows: repeat(3, 120px);
    gap: 10px;
    margin: 0 auto 30px;
    background: #eee;
    padding: 10px;
    border-radius: 10px;
    justify-content: center;
}

/* Cell Styles */
.cell {
    background: white;
    border: none;
    font-size: 3em;
    font-weight: bold;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell:hover:not(.taken) {
    background: #f0f0f0;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.cell:active:not(.taken) {
    transform: scale(0.98);
}

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

/* Player Colors */
.cell.x {
    color: #667eea;
}

.cell.o {
    color: #f093fb;
}

/* Winner Animation */
.cell.winner {
    background: #ffd700;
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.1); 
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    }
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

button {
    padding: 12px 30px;
    font-size: 1em;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.reset-btn {
    background: #667eea;
    color: white;
}

.reset-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

/* Score Board */
.score-board {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    flex-wrap: wrap;
}

.score {
    text-align: center;
    min-width: 80px;
}

.score-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

.score-value {
    font-size: 2em;
    font-weight: bold;
}

.score.x .score-value {
    color: #667eea;
}

.score.o .score-value {
    color: #f093fb;
}

.score.draw .score-value {
    color: #95a5a6;
}

/* Footer */
footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 0.9em;
}

footer a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #5568d3;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 2em;
    }

    .board {
        grid-template-columns: repeat(3, 90px);
        grid-template-rows: repeat(3, 90px);
        gap: 8px;
    }

    .cell {
        font-size: 2.5em;
    }

    .score-board {
        gap: 15px;
    }
}

@media (max-width: 400px) {
    .board {
        grid-template-columns: repeat(3, 80px);
        grid-template-rows: repeat(3, 80px);
        gap: 6px;
    }

    .cell {
        font-size: 2em;
    }
}

/* Accessibility */
.cell:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
