* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #070d25;
    --secondary-color: #2e114b;
    --bg-color: #f0f2f5;
    --text-color: #333;
    --cell-bg: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #8a2be2;
    --secondary-color: #da70d6;
    --bg-color: #1a1a2e;
    --text-color: #f0f0f0;
    --cell-bg: #16213e;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    min-height: 100vh;
    color: var(--text-color);
    transition: var(--transition);
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 0.8s ease;
}

.game-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #cec0c0, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.score-board {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.score-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.player-icon {
    font-size: 2rem;
    animation: bounce 2s infinite;
}

.score-label {
    font-size: 0.9rem;
    opacity: 0.8;
    color:#f0f0f0;
    font-weight: bold;
}

.score-value {
    font-size: 2rem;
    font-weight: 700;
    color: rgb(179, 0, 0);
}

.score-divider {
    font-weight: 700;
    color: var(--secondary-color);
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease;
}

.current-player {
    font-size: 1.2rem;
    font-weight: 600;
    color:#aa8dc6
}

.player-x { color: #ff6b6b; }
.player-o { color: #4ecdc4; }

.game-status {
    font-size: 1.1rem;
    font-weight: 600;
    color: wheat;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 30px;
    animation: zoomIn 0.8s ease;
}

.cell {
    aspect-ratio: 1;
    background: var(--cell-bg);
    border: none;
    border-radius: 15px;
    font-size: 3rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.cell:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.cell.x {
    color: #ff6b6b;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
}

.cell.o {
    color: #4ecdc4;
    text-shadow: 0 0 20px rgba(78, 205, 196, 0.5);
}

.cell.win {
    animation: pulse 1s infinite;
    background: linear-gradient(45deg, #ffd93d, #ff6b6b);
}

.game-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    animation: fadeInUp 0.8s ease;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.btn-reset {
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    color: white;
}

.btn-theme {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-sound {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.winning-line {
    position: absolute;
    background: linear-gradient(45deg, #ffd93d, #ff6b6b);
    height: 8px;
    border-radius: 4px;
    opacity: 0;
    transition: var(--transition);
    z-index: 10;
}

.game-footer {
    text-align: center;
    margin-top: 30px;
    opacity: 0.7;
    font-size: 0.9rem;
}

#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .cell {
        font-size: 2.5rem;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
}