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

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

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    max-width: 500px;
    width: 100%;
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.score-board {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    padding: 15px;
    color: white;
}

.score-item {
    text-align: center;
}

.player-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 400;
    margin-bottom: 5px;
}

.score {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
}

.game-status {
    text-align: center;
    margin-bottom: 25px;
}

.status-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #4a5568;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 25px;
    display: inline-block;
    animation: pulse 2s infinite;
}

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

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 15px;
}

.cell {
    aspect-ratio: 1;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.cell.x {
    color: #e53e3e;
    animation: popIn 0.3s ease-out;
}

.cell.o {
    color: #3182ce;
    animation: popIn 0.3s ease-out;
}

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

.cell.winning {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    animation: winningCell 0.6s ease-in-out;
}

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

.game-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-reset {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: white;
}

.btn-new {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #4a5568;
}

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

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

.winner-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.winner-modal.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.winner-animation {
    position: relative;
    margin-bottom: 20px;
}

.trophy {
    font-size: 4rem;
    animation: bounce 1s infinite;
}

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

.confetti {
    position: absolute;
    top: 0;
    left: 50%;
    width: 10px;
    height: 10px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #f9ca24);
    animation: confettiFall 2s infinite;
}

@keyframes confettiFall {
    0% {
        transform: translateX(-50%) translateY(-20px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(200px) rotate(360deg);
        opacity: 0;
    }
}

.winner-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 20px;
}

.btn-play-again {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 20px;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .cell {
        font-size: 2rem;
    }
    
    .score-board {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 320px) {
    .game-title {
        font-size: 1.5rem;
    }
    
    .cell {
        font-size: 1.5rem;
    }
}