@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;800&display=swap');

:root {
    --primary: #000000;
    --primary-glow: rgba(0, 0, 0, 0.05);
    --accent: #000000;
    --background: #ffffff;
    --surface: #ffffff;
    --surface-hover: #f9f9f9;
    --text: #000000;
    --text-muted: #888888;
    --border: #eeeeee;
    --glass: rgba(255, 255, 255, 0.9);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("https://grainy-gradients.vercel.app/noise.svg");
    opacity: 0.05;
    pointer-events: none;
    z-index: 9999;
}

h1,
h2,
h3,
.brand {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 var(--primary-glow);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Base Components */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.glass {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
}

/* Header & Nav */
header {
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

/* Hero Section */
.hero {
    padding: 8rem 0 4rem;
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    z-index: -1;
    filter: blur(80px);
}

.hero h1 {
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: 300;
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    animation: fadeIn 0.8s ease-out;
    line-height: 1.1;
}

.hero p {
    font-size: clamp(1rem, 4vw, 1.25rem);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    animation: fadeIn 0.8s ease-out 0.2s backwards;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

.game-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.8s ease-out 0.4s backwards;
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    background: var(--surface-hover);
}

.game-icon {
    width: 4rem;
    height: 4rem;
    background: var(--surface);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: var(--primary);
    border: 1px solid var(--border);
}

.game-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.game-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 1rem;
    text-transform: uppercase;
}

/* Footer */
footer {
    padding: 4rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Utility */
.btn {
    padding: 0.75rem 2rem;
    border-radius: 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--background);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.8rem;
    padding: 1.25rem 3rem;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.calc-btn {
    padding: 1rem;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    transition: background 0.1s;
    user-select: none;
    -webkit-user-select: none;
    font-family: monospace;
}

.calc-btn:hover {
    background: #f4f4f4;
}

.calc-btn:active {
    background: #eee;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 3rem;
    }

    @media (orientation: landscape) {
        .hero {
            padding: 4rem 0 2rem;
        }

        #game-container {
            height: 80vh;
        }
    }
}