:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --accent-color: #fd79a8;
    --dark-color: #2d3436;
    --light-color: #f5f6fa;
    --success-color: #00b894;
    --warning-color: #fdcb6e;
    --danger-color: #d63031;
}

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

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

.container {
    width: 100%;
    max-width: 500px;
}

.game-card {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.game-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--dark-color);
    font-weight: 600;
    font-size: 2.2rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.difficulty-selector {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.difficulty-selector label {
    margin-bottom: 8px;
    color: var(--dark-color);
    font-weight: 600;
}

select {
    padding: 12px 15px;
    font-size: 16px;
    border-radius: 10px;
    border: 2px solid var(--secondary-color);
    background-color: white;
    color: var(--dark-color);
    outline: none;
    transition: all 0.3s;
}

select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.status {
    font-size: 1.3rem;
    margin: 20px 0;
    height: 30px;
    color: var(--dark-color);
    text-align: center;
    font-weight: 600;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    margin: 25px 0;
    aspect-ratio: 1/1;
}

.cell {
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 15px;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    aspect-ratio: 1/1;
}

.cell:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background-color: var(--light-color);
}

.cell:active {
    transform: translateY(1px);
}

.controls {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

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

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

.reset-btn {
    background-color: var(--success-color);
}

.switch-btn {
    background-color: var(--warning-color);
}

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

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

.winning-cell {
    animation: pulse 1.5s infinite;
    background-color: rgba(100, 255, 100, 0.2);
}

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

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--accent-color);
    opacity: 0;
}

@media (max-width: 500px) {
    .game-card {
        padding: 20px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .cell {
        font-size: 2.5rem;
    }

    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}