:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --secondary-gradient: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --cell-size: 100px;
    --gap: 15px;
    --x-color: #f43f5e;
    --o-color: #3b82f6;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background Animations */
.background-blobs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #6366f1;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #a855f7;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: #2dd4bf;
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Main Container */
.container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 450px;
    width: 90%;
}

header h1 {
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.status {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #94a3b8;
    font-weight: 500;
}

.player-x { color: var(--x-color); font-weight: 700; }
.player-o { color: var(--o-color); font-weight: 700; }

/* Game Board */
.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
    margin-bottom: 2rem;
}

.cell {
    width: var(--cell-size);
    height: var(--cell-size);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.cell:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.cell.x {
    color: var(--x-color);
    text-shadow: 0 0 20px rgba(244, 63, 94, 0.3);
}

.cell.o {
    color: var(--o-color);
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.cell.winning {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Restart Button */
.restart-btn {
    background: var(--primary-gradient);
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
    font-family: 'Outfit', sans-serif;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

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

/* Responsive */
@media (max-width: 480px) {
    :root {
        --cell-size: 80px;
        --gap: 10px;
    }
    
    .container {
        padding: 1.5rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
}
