:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary: #8b5cf6;
    --secondary: #ec4899;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-hover: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Effects */
.background-globes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.globe {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.globe-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    animation: float 10s infinite alternate;
}

.globe-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    bottom: -50px;
    right: -50px;
    animation: float 12s infinite alternate-reverse;
}

.globe-3 {
    width: 200px;
    height: 200px;
    background: cyan;
    top: 40%;
    left: 40%;
    animation: pulse 8s infinite;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
}

/* Navigation */
.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links li {
    cursor: pointer;
    font-weight: 500;
    transition: color 0.3s;
    opacity: 0.7;
}

.nav-links li:hover,
.nav-links li.active {
    opacity: 1;
    color: var(--secondary);
}

/* Main Content */
.content-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 80vh;
}

section {
    display: none;
    animation: fadeIn 0.5s ease;
}

section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Home Section */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.gradient-text {
    background: linear-gradient(to right, #4f46e5, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.game-cards {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 1rem;
    width: 250px;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
    text-align: center;
}

.card:hover {
    transform: translateY(-5px);
    background: var(--card-hover);
    border-color: var(--secondary);
}

.card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

/* Game Containers */
.game-section {
    text-align: center;
}

.game-section h2 {
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
    color: var(--secondary);
    text-shadow: 0 0 10px rgba(236, 72, 153, 0.5);
}

.game-options {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.game-options label {
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 1rem;
    display: inline-block;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.score-board {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 1px;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 0 1rem;
}

.high-score,
.best-score {
    color: #ffd700;
    margin-bottom: 1rem;
    display: block;
    font-weight: 500;
}

.btn-reset {
    margin-top: 1.5rem;
    padding: 0.8rem 2rem;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    border-radius: 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.2s;
}

.btn-reset:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* Tic Tac Toe */
.ttt-grid {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    gap: 10px;
    margin: 0 auto;
}

.ttt-cell {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: background 0.3s;
}

.ttt-cell:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ttt-cell.x {
    color: var(--secondary);
}

.ttt-cell.o {
    color: cyan;
}

/* Snake */
#snake-canvas {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.5rem;
    border: 1px solid var(--glass-border);
}

/* Memory */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 80px);
    gap: 10px;
    margin: 0 auto;
}

.memory-card {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transform-style: preserve-3d;
    transition: transform 0.5s;
    position: relative;
}

.memory-card.flipped {
    transform: rotateY(180deg);
    background: var(--secondary);
}

.status {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* simple hide for mobile for now, can be improved */
    }

    .glass-nav {
        justify-content: center;
    }

    .card {
        width: 100%;
    }

    .ttt-grid {
        grid-template-columns: repeat(3, 80px);
    }

    .ttt-cell {
        width: 80px;
        height: 80px;
    }

    #snake-canvas {
        width: 300px;
        height: 300px;
    }
}