/* ===== CSS Variables & Base ===== */
:root {
    --neon-cyan: #00F0FF;
    --neon-purple: #7B2FFF;
    --neon-pink: #FF2D95;
    --neon-green: #00FF88;
    --dark-900: #0A0A0F;
    --dark-800: #12121A;
    --dark-700: #1A1A2E;
}

/* ===== Tailwind Import ===== */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--dark-900);
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--dark-900);
}
::-webkit-scrollbar-thumb {
    background: var(--dark-700);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--neon-purple);
}

/* ===== Selection Color ===== */
::selection {
    background: rgba(123, 47, 255, 0.3);
    color: #fff;
}

/* ===== Particle Canvas ===== */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

/* ===== Navbar Glass Effect ===== */
#navbar.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ===== Hero Section Animations ===== */
.hero-title {
    animation: titleReveal 1s ease-out forwards;
}

@keyframes titleReveal {
    from { opacity: 0; transform: translateY(40px); filter: blur(10px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.hero-subtitle {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.hero-buttons {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.hero-stats {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ===== Gradient Flow Animation for Title ===== */
@keyframes gradientFlow {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

.animate-gradient-flow {
    background-size: 200% auto;
    animation: gradientFlow 4s ease infinite;
}

/* ===== Pulse Glow for CTA Button ===== */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 240, 255, 0.3), 0 0 60px rgba(123, 47, 255, 0.15); }
    50% { box-shadow: 0 0 30px rgba(0, 240, 255, 0.5), 0 0 80px rgba(123, 47, 255, 0.25); }
}

/* ===== Float Animation ===== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* ===== Game Card Glow Border Effect ===== */
.game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, transparent 40%, rgba(0, 240, 255, 0.1) 50%, transparent 60%);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    transition: all 0.5s ease;
}

.game-card:hover::before {
    background: linear-gradient(135deg, transparent, rgba(0, 240, 255, 0.3), rgba(123, 47, 255, 0.3), transparent);
}

/* ===== Feature Card Hover Glow ===== */
.feature-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ===== Scroll Reveal Animation ===== */
.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Mobile Menu Animation ===== */
#mobile-menu.show {
    display: block;
    animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Mobile Hamburger Toggle ===== */
#mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
    background: var(--neon-cyan) !important;
}

#mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

#mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    background: var(--neon-cyan) !important;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    section[id] {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

/* ===== Utility: Neon Text Glow ===== */
.text-glow-cyan {
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5), 0 0 40px rgba(0, 240, 255, 0.2);
}

.text-glow-purple {
    text-shadow: 0 0 10px rgba(123, 47, 255, 0.5), 0 0 40px rgba(123, 47, 255, 0.2);
}

/* ===== Loading Screen (optional) ===== */
.page-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--dark-900);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.page-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.page-loading .loader {
    width: 48px;
    height: 48px;
    border: 3px solid var(--dark-700);
    border-top-color: var(--neon-cyan);
    border-right-color: var(--neon-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Focus Styles (Accessibility) ===== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
    border-radius: 4px;
}
