/* ============================================
   MILA GAMES — Design System & Styles
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Colors */
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);

    --text-primary: #f0f0ff;
    --text-secondary: #9090b0;
    --text-muted: #606080;

    --accent-1: #7c3aed;  /* violet */
    --accent-2: #06b6d4;  /* cyan */
    --accent-3: #f43f5e;  /* rose */
    --accent-4: #f59e0b;  /* amber */
    --accent-5: #10b981;  /* emerald */

    --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #06b6d4 50%, #f43f5e 100%);
    --gradient-hero: linear-gradient(160deg, #0a0a1a 0%, #1a103a 40%, #0a1a2a 100%);
    --gradient-card: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(6, 182, 212, 0.05));
    --gradient-glow: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(124, 58, 237, 0.12), transparent 40%);

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(124, 58, 237, 0.3);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.3);

    /* Typography */
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;

    /* Spacing */
    --section-padding: 100px 0;
    --container-width: 1200px;
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --border-radius-lg: 24px;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

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

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 0;
    transition: var(--transition-smooth);
}

.navbar.scrolled {
    padding: 12px 0;
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    transition: var(--transition-fast);
}

.nav-logo:hover {
    transform: scale(1.02);
}

.logo-icon {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 8px rgba(124, 58, 237, 0.5));
}

.logo-text {
    color: var(--text-primary);
}

.logo-accent {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 36px;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 1px;
    transition: var(--transition-smooth);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link:hover::after {
    width: 100%;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 40px 60px;
    background: var(--gradient-hero);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
    animation: pulse-glow 8s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
    animation: pulse-glow 10s ease-in-out infinite reverse;
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
}

.hero-content {
    max-width: 650px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #c4b5fd;
    margin-bottom: 32px;
    animation: fade-in-up 0.8s ease-out;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 24px;
}

.title-line {
    display: block;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--text-secondary);
    animation: fade-in-up 0.8s ease-out 0.15s both;
}

.title-gradient {
    font-size: clamp(3.5rem, 8vw, 5.5rem);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fade-in-up 0.8s ease-out 0.3s both;
    filter: drop-shadow(0 0 30px rgba(124, 58, 237, 0.3));
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 40px;
    line-height: 1.7;
    animation: fade-in-up 0.8s ease-out 0.45s both;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px;
    background: var(--gradient-primary);
    color: white;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    border-radius: 50px;
    transition: var(--transition-spring);
    animation: fade-in-up 0.8s ease-out 0.6s both;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.hero-cta:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 35px rgba(124, 58, 237, 0.5);
}

.hero-cta:active {
    transform: translateY(-1px) scale(0.99);
}

.cta-arrow {
    transition: var(--transition-fast);
}

.hero-cta:hover .cta-arrow {
    transform: translateX(4px);
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Floating Cards --- */
.hero-visual {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.floating-cards {
    position: relative;
    width: 100%;
    height: 100%;
}

.float-card {
    position: absolute;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    animation: float 6s ease-in-out infinite;
}

.card-1 { top: 15%; left: 8%; animation-delay: 0s; animation-duration: 7s; }
.card-2 { top: 25%; right: 10%; animation-delay: 1s; animation-duration: 8s; }
.card-3 { bottom: 30%; left: 5%; animation-delay: 2s; animation-duration: 6s; }
.card-4 { top: 10%; right: 25%; animation-delay: 0.5s; animation-duration: 9s; }
.card-5 { bottom: 20%; right: 8%; animation-delay: 1.5s; animation-duration: 7.5s; }
.card-6 { bottom: 40%; left: 20%; animation-delay: 3s; animation-duration: 8.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(3deg); }
    50% { transform: translateY(-25px) rotate(-2deg); }
    75% { transform: translateY(-10px) rotate(1deg); }
}

/* --- Stats Bar --- */
.stats-bar {
    position: relative;
    z-index: 2;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.stats-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 36px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 50px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-subtle);
}

/* --- Section Common --- */
.section-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 40px;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-tag {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #c4b5fd;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* --- Games Section --- */
.games-section {
    position: relative;
    z-index: 2;
    padding: var(--section-padding);
    background: var(--bg-primary);
}

.games-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-glow);
    pointer-events: none;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* --- Game Card --- */
.game-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition-smooth);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-card);
    opacity: 0;
    transition: var(--transition-smooth);
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
}

.game-card:hover::before {
    opacity: 1;
}

.game-card-thumb {
    position: relative;
    height: 200px;
    background: var(--gradient-card);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.game-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-card-emoji {
    font-size: 4rem;
    z-index: 1;
}

.game-card-thumb::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, var(--bg-card));
}

.game-card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.game-card-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-2);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.game-card-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.game-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.game-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.game-card-tags {
    display: flex;
    gap: 6px;
}

.game-card-tag {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.game-card-play {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: var(--accent-1);
    color: white;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 50px;
    transition: var(--transition-spring);
    border: none;
    cursor: pointer;
}

.game-card-play:hover {
    background: #6d28d9;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    animation: fade-in-up 0.8s ease-out;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: float 4s ease-in-out infinite;
}

.empty-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.empty-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto 32px;
}

.empty-loader {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.loader-dot {
    width: 10px;
    height: 10px;
    background: var(--accent-1);
    border-radius: 50%;
    animation: loader-bounce 1.4s ease-in-out infinite;
}

.loader-dot:nth-child(2) { animation-delay: 0.16s; }
.loader-dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes loader-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* --- About Section --- */
.about-section {
    position: relative;
    z-index: 2;
    padding: var(--section-padding);
    background: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.about-card {
    padding: 40px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius-lg);
    text-align: center;
    transition: var(--transition-smooth);
}

.about-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
    background: var(--bg-card-hover);
}

.about-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.about-card h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.about-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* --- Footer --- */
.footer {
    position: relative;
    z-index: 2;
    padding: 50px 0 30px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.footer-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 40px;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.footer-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

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

/* --- Scroll Reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero {
        padding: 100px 24px 60px;
    }

    .float-card {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }

    .stats-container {
        flex-wrap: wrap;
        gap: 24px;
        padding: 28px 24px;
    }

    .stat-divider {
        display: none;
    }

    .stat-item {
        flex: 1;
        min-width: 80px;
    }

    .section-container {
        padding: 0 24px;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .nav-container {
        padding: 0 24px;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .title-gradient {
        font-size: 2.8rem;
    }

    .hero-cta {
        padding: 14px 28px;
        font-size: 0.95rem;
    }
}

/* --- Nav Tokens --- */
.nav-tokens {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #f59e0b;
}

/* --- Hack Shop Section --- */
.hack-shop-section {
    position: relative;
    z-index: 2;
    padding: var(--section-padding);
    background: linear-gradient(180deg, var(--bg-primary), #0d0a1f, var(--bg-primary));
}

.hack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
}

.hack-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: var(--border-radius-lg);
    padding: 32px 28px;
    text-align: center;
    transition: var(--transition-smooth);
}

.hack-card:hover {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.1);
    transform: translateY(-4px);
}

.hack-card.owned {
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.05);
}

.hack-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.hack-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.hack-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.hack-price {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.hack-buy-btn {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #000;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-spring);
}

.hack-buy-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.hack-buy-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
}

/* --- Buy Tokens Card --- */
.buy-tokens-card {
    max-width: 600px;
    margin: 0 auto 40px;
    padding: 32px;
    background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(239,68,68,0.05));
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--border-radius-lg);
    text-align: center;
}

.buy-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 24px;
    min-width: 260px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 12px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-spring);
}

.buy-btn:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    transform: translateX(4px);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

.buy-amount {
    font-weight: 700;
}

.buy-price {
    font-weight: 800;
    color: #f59e0b;
    font-size: 1rem;
}
