:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --x-color: #e84393;
    --o-color: #0984e3;
    --win-color: #00b894;
    --dark-color: #2d3436;
    --light-color: #f5f6fa;
    --shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--dark-color);
    padding: 20px;
}

.container {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 350px;
    text-align: center;
}

.title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-info {
    margin-bottom: 25px;
}

.player-turn {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding: 10px;
    background-color: var(--light-color);
    border-radius: 10px;
    font-weight: 600;
}

.player-turn span {
    color: var(--primary-color);
    font-weight: 700;
}

.scoreboard {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
}

.score {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    width: 45%;
}

.x-score {
    background-color: rgba(232, 67, 147, 0.2);
    color: var(--x-color);
}

.o-score {
    background-color: rgba(9, 132, 227, 0.2);
    color: var(--o-color);
}

.score span:last-child {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 5px;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.cell {
    aspect-ratio: 1/1;
    background-color: var(--light-color);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.cell:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1);
}

.cell.x {
    color: var(--x-color);
}

.cell.o {
    color: var(--o-color);
}

.cell.win {
    background-color: var(--win-color);
    color: white;
    animation: pulse 1s infinite;
}

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

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    font-family: 'Poppins', sans-serif;
}

.btn:hover {
    background-color: #5649c5;
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.15);
}

.winning-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.winning-modal.show {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--win-color);
}

.hidden {
    display: none;
}

@media (max-width: 500px) {
    .container {
        padding: 20px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .cell {
        font-size: 2.5rem;
    }
}