* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --circle-color: #ff6b6b;
    --cross-color: #4ecdc4;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --board-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    --border-radius: 20px;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    background: var(--bg-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 600px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-title {
    text-align: center;
    color: white;
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 700;
    letter-spacing: 2px;
}

.game-title i {
    margin: 0 10px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.status-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.turn-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f7f7f7;
    padding: 10px 15px;
    border-radius: 30px;
}

.turn-text {
    font-weight: 500;
    color: #555;
}

.turn-icon {
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.turn-icon.circle-turn {
    color: var(--circle-color);
}

.turn-icon.cross-turn {
    color: var(--cross-color);
}

.turn-name {
    font-weight: 600;
    color: #333;
}

.score-board {
    display: flex;
    gap: 20px;
}

.score-item {
    text-align: center;
    padding: 5px 15px;
    border-radius: 30px;
    background: #f7f7f7;
}

.score-icon {
    font-size: 1.2rem;
    margin-right: 5px;
}

.score-icon.circle {
    color: var(--circle-color);
}

.score-icon.cross {
    color: var(--cross-color);
}

.score-icon.draw {
    color: #f6c23e;
}

.score-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: #333;
}

.game-board {
    aspect-ratio: 1;
    margin-bottom: 30px;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 15px;
}

.cell {
    background: white;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cell:hover:not(.disabled) {
    transform: scale(1.05);
    background: #f0f0f0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.cell.circle {
    color: var(--circle-color);
}

.cell.cross {
    color: var(--cross-color);
}

.cell.win {
    animation: winPulse 1s infinite;
}

@keyframes winPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.cell.disabled {
    cursor: not-allowed;
    opacity: 0.9;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.control-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.control-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.control-btn.restart:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.control-btn.reset:hover {
    background: #ff6b6b;
    color: white;
}

.game-message {
    text-align: center;
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    min-height: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-icon {
    font-size: 5rem;
    color: #ffd700;
    margin-bottom: 20px;
    animation: trophyShake 0.5s ease;
}

@keyframes trophyShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.modal-content h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2rem;
}

.modal-content p {
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.modal-btn {
    padding: 12px 40px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.modal-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
}

@media (max-width: 500px) {
    .container {
        padding: 15px;
    }
    
    .game-title {
        font-size: 1.8rem;
    }
    
    .status-panel {
        flex-direction: column;
        text-align: center;
    }
    
    .score-board {
        justify-content: center;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cell {
        font-size: 2.5rem;
    }
}
