/* ============================================
           CSS RESET & BASE
           ============================================ */
        *, *::before, *::after {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --bg-primary: #0a0a1a;
            --bg-secondary: #12122a;
            --bg-card: #1a1a3e;
            --bg-card-hover: #222255;
            --text-primary: #ffffff;
            --text-secondary: #a0a0c0;
            --text-muted: #6a6a8a;
            --accent-1: #7c3aed;
            --accent-2: #06b6d4;
            --accent-3: #f59e0b;
            --accent-4: #ef4444;
            --accent-5: #10b981;
            --accent-6: #ec4899;
            --gradient-1: linear-gradient(135deg, #7c3aed, #06b6d4);
            --gradient-2: linear-gradient(135deg, #f59e0b, #ef4444);
            --gradient-3: linear-gradient(135deg, #10b981, #06b6d4);
            --gradient-4: linear-gradient(135deg, #ec4899, #7c3aed);
            --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
            --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
            --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
            --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.3);
            --radius-sm: 12px;
            --radius-md: 16px;
            --radius-lg: 24px;
            --radius-full: 9999px;
            --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        html {
            scroll-behavior: smooth;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            min-height: 100vh;
            min-height: 100dvh;
            overflow-x: hidden;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        /* ============================================
           ANIMATED BACKGROUND
           ============================================ */
        .bg-effects {
            position: fixed;
            inset: 0;
            z-index: 0;
            pointer-events: none;
            overflow: hidden;
        }

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

        .bg-orb-1 {
            width: 300px;
            height: 300px;
            background: var(--accent-1);
            top: -100px;
            right: -100px;
            animation-delay: 0s;
        }

        .bg-orb-2 {
            width: 250px;
            height: 250px;
            background: var(--accent-2);
            bottom: 20%;
            left: -80px;
            animation-delay: -7s;
        }

        .bg-orb-3 {
            width: 200px;
            height: 200px;
            background: var(--accent-6);
            top: 50%;
            right: -60px;
            animation-delay: -14s;
        }

        @keyframes float {
            0%, 100% { transform: translate(0, 0) scale(1); }
            25% { transform: translate(30px, -30px) scale(1.1); }
            50% { transform: translate(-20px, 20px) scale(0.95); }
            75% { transform: translate(20px, 10px) scale(1.05); }
        }

        /* Grid pattern overlay */
        .bg-grid {
            position: fixed;
            inset: 0;
            z-index: 0;
            pointer-events: none;
            background-image:
                linear-gradient(rgba(124, 58, 237, 0.03) 1px, transparent 1px),
                linear-gradient(90deg, rgba(124, 58, 237, 0.03) 1px, transparent 1px);
            background-size: 40px 40px;
        }

        /* ============================================
           MAIN CONTAINER
           ============================================ */
        .app-container {
            position: relative;
            z-index: 1;
            max-width: 480px;
            margin: 0 auto;
            padding: 0 16px;
            padding-bottom: 24px;
        }

        /* ============================================
           HEADER / NAVBAR
           ============================================ */
        .navbar {
            position: sticky;
            top: 0;
            z-index: 100;
            padding: 12px 0;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            background: rgba(10, 10, 26, 0.8);
            border-bottom: 1px solid rgba(124, 58, 237, 0.1);
            margin: 0 -16px;
            padding: 12px 16px;
        }

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

        .logo {
            display: flex;
            align-items: center;
            gap: 10px;
            text-decoration: none;
        }

        .logo-icon {
            width: 40px;
            height: 40px;
            background: var(--gradient-1);
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            box-shadow: var(--shadow-glow);
        }

        .logo-text {
            font-size: 20px;
            font-weight: 800;
            background: var(--gradient-1);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            letter-spacing: -0.5px;
        }

        .nav-actions {
            display: flex;
            gap: 8px;
        }

        .nav-btn {
            width: 40px;
            height: 40px;
            border-radius: var(--radius-sm);
            border: 1px solid rgba(255,255,255,0.1);
            background: rgba(255,255,255,0.05);
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: var(--transition);
            font-size: 18px;
        }

        .nav-btn:active {
            transform: scale(0.92);
            background: rgba(124, 58, 237, 0.2);
        }

        /* ============================================
           HERO SECTION
           ============================================ */
        .hero {
            padding: 24px 0 20px;
        }

        .hero-card {
            background: var(--gradient-1);
            border-radius: var(--radius-lg);
            padding: 28px 24px;
            position: relative;
            overflow: hidden;
        }

        .hero-card::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -30%;
            width: 200px;
            height: 200px;
            background: rgba(255,255,255,0.1);
            border-radius: 50%;
        }

        .hero-card::after {
            content: '';
            position: absolute;
            bottom: -40%;
            left: -20%;
            width: 150px;
            height: 150px;
            background: rgba(255,255,255,0.05);
            border-radius: 50%;
        }

        .hero-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: rgba(255,255,255,0.2);
            backdrop-filter: blur(10px);
            padding: 6px 12px;
            border-radius: var(--radius-full);
            font-size: 12px;
            font-weight: 600;
            margin-bottom: 16px;
        }

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

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

        .hero-title {
            font-size: 26px;
            font-weight: 900;
            line-height: 1.2;
            margin-bottom: 8px;
            position: relative;
            z-index: 1;
            letter-spacing: -0.5px;
        }

        .hero-subtitle {
            font-size: 14px;
            opacity: 0.85;
            line-height: 1.5;
            position: relative;
            z-index: 1;
            margin-bottom: 20px;
        }

        .hero-stats {
            display: flex;
            gap: 20px;
            position: relative;
            z-index: 1;
        }

        .hero-stat {
            text-align: center;
        }

        .hero-stat-value {
            font-size: 22px;
            font-weight: 800;
        }

        .hero-stat-label {
            font-size: 11px;
            opacity: 0.75;
            margin-top: 2px;
            font-weight: 500;
        }

        /* ============================================
           SEARCH BAR
           ============================================ */
        .search-section {
            padding: 16px 0;
        }

        .search-wrapper {
            position: relative;
        }

        .search-input {
            width: 100%;
            height: 52px;
            background: var(--bg-secondary);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: var(--radius-md);
            padding: 0 20px 0 48px;
            font-size: 15px;
            font-family: inherit;
            color: var(--text-primary);
            outline: none;
            transition: var(--transition);
        }

        .search-input::placeholder {
            color: var(--text-muted);
        }

        .search-input:focus {
            border-color: var(--accent-1);
            box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
        }

        .search-icon {
            position: absolute;
            left: 16px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            font-size: 18px;
            pointer-events: none;
        }

        .search-clear {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: rgba(255,255,255,0.1);
            border: none;
            color: var(--text-secondary);
            display: none;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 14px;
            transition: var(--transition);
        }

        .search-clear.visible {
            display: flex;
        }

        /* ============================================
           CATEGORIES / FILTER
           ============================================ */
        .categories-section {
            padding: 4px 0 16px;
        }

        .categories-scroll {
            display: flex;
            gap: 8px;
            overflow-x: auto;
            scrollbar-width: none;
            -ms-overflow-style: none;
            padding: 4px 0;
        }

        .categories-scroll::-webkit-scrollbar {
            display: none;
        }

        .category-chip {
            flex-shrink: 0;
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 10px 16px;
            border-radius: var(--radius-full);
            border: 1px solid rgba(255,255,255,0.08);
            background: rgba(255,255,255,0.04);
            color: var(--text-secondary);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            white-space: nowrap;
            user-select: none;
        }

        .category-chip:active {
            transform: scale(0.95);
        }

        .category-chip.active {
            background: var(--gradient-1);
            border-color: transparent;
            color: white;
            box-shadow: var(--shadow-glow);
        }

        .category-chip .cat-icon {
            font-size: 16px;
        }

        .category-chip .cat-count {
            font-size: 11px;
            background: rgba(255,255,255,0.15);
            padding: 2px 7px;
            border-radius: var(--radius-full);
        }

        .category-chip.active .cat-count {
            background: rgba(255,255,255,0.25);
        }

        /* ============================================
           SECTION HEADER
           ============================================ */
        .section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 0 16px;
        }

        .section-title {
            font-size: 18px;
            font-weight: 800;
            letter-spacing: -0.3px;
        }

        .section-count {
            font-size: 13px;
            color: var(--text-muted);
            font-weight: 500;
        }

        /* ============================================
           FEATURED / BANNER GAME
           ============================================ */
        .featured-section {
            padding: 0 0 24px;
        }

        .featured-scroll {
            display: flex;
            gap: 14px;
            overflow-x: auto;
            scrollbar-width: none;
            -ms-overflow-style: none;
            scroll-snap-type: x mandatory;
            padding: 4px 0;
        }

        .featured-scroll::-webkit-scrollbar {
            display: none;
        }

        .featured-card {
            flex-shrink: 0;
            width: 280px;
            border-radius: var(--radius-lg);
            overflow: hidden;
            position: relative;
            cursor: pointer;
            scroll-snap-align: start;
            transition: var(--transition);
        }

        .featured-card:active {
            transform: scale(0.97);
        }

        .featured-img {
            width: 100%;
            height: 160px;
            object-fit: cover;
            display: block;
        }

        .featured-placeholder {
            width: 100%;
            height: 160px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 48px;
        }

        .featured-overlay {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 40px 16px 16px;
            background: linear-gradient(transparent, rgba(0,0,0,0.85));
        }

        .featured-tag {
            display: inline-block;
            padding: 4px 10px;
            border-radius: var(--radius-full);
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 8px;
        }

        .featured-tag.hot {
            background: var(--gradient-2);
        }

        .featured-tag.new {
            background: var(--gradient-3);
        }

        .featured-tag.popular {
            background: var(--gradient-4);
        }

        .featured-name {
            font-size: 16px;
            font-weight: 700;
            margin-bottom: 4px;
        }

        .featured-meta {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 12px;
            color: rgba(255,255,255,0.7);
        }

        .featured-meta span {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        /* Dots indicator */
        .scroll-dots {
            display: flex;
            justify-content: center;
            gap: 6px;
            margin-top: 14px;
        }

        .scroll-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: rgba(255,255,255,0.15);
            transition: var(--transition);
        }

        .scroll-dot.active {
            width: 24px;
            border-radius: 4px;
            background: var(--accent-1);
        }

        /* ============================================
           GAME GRID
           ============================================ */
        .games-section {
            padding: 0 0 24px;
        }

        .games-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 14px;
        }

        .game-card {
            background: var(--bg-card);
            border-radius: var(--radius-md);
            overflow: hidden;
            cursor: pointer;
            transition: var(--transition);
            border: 1px solid rgba(255,255,255,0.05);
            text-decoration: none;
            color: inherit;
            display: block;
            position: relative;
        }

        .game-card:active {
            transform: scale(0.96);
        }

        .game-card:hover {
            border-color: rgba(124, 58, 237, 0.3);
            box-shadow: var(--shadow-glow);
        }

        .game-thumb {
    width: 100%;
    aspect-ratio: 2 / 3;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--bg-card); /* Fallback color */
}

.game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Gambar terpotong rapi sesuai rasio */
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

/* Zoom effect saat hover */
.game-card:hover .game-thumb img {
    transform: scale(1.05);
}

/* Badge tetap di atas */
.game-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    backdrop-filter: blur(4px);
}

        .game-badge {
            position: absolute;
            top: 8px;
            left: 8px;
            padding: 3px 8px;
            border-radius: var(--radius-full);
            font-size: 9px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            z-index: 2;
        }

        .game-badge.new { background: var(--accent-5); color: #fff; }
        .game-badge.hot { background: var(--accent-4); color: #fff; }
        .game-badge.popular { background: var(--accent-3); color: #000; }

        .game-info {
            padding: 12px;
        }

        .game-name {
            font-size: 14px;
            font-weight: 700;
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .game-category {
            font-size: 11px;
            color: var(--text-muted);
            font-weight: 500;
            margin-bottom: 8px;
        }

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

        .game-rating {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 12px;
            font-weight: 600;
            color: var(--accent-3);
        }

        .game-plays {
            font-size: 11px;
            color: var(--text-muted);
        }

        .play-btn-mini {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0);
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: var(--gradient-1);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            box-shadow: var(--shadow-lg);
            transition: var(--transition);
            z-index: 3;
        }

        .game-card:active .play-btn-mini {
            transform: translate(-50%, -50%) scale(1);
        }

        /* ============================================
           EMPTY STATE
           ============================================ */
        .empty-state {
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 60px 20px;
            text-align: center;
        }

        .empty-state.visible {
            display: flex;
        }

        .empty-icon {
            font-size: 64px;
            margin-bottom: 16px;
            opacity: 0.5;
        }

        .empty-title {
            font-size: 18px;
            font-weight: 700;
            margin-bottom: 8px;
        }

        .empty-text {
            font-size: 14px;
            color: var(--text-muted);
            line-height: 1.5;
        }


        /* ============================================
           SKELETON LOADING
           ============================================ */
        .skeleton {
            background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.05) 50%, var(--bg-card) 75%);
            background-size: 200% 100%;
            animation: shimmer 1.5s ease-in-out infinite;
            border-radius: var(--radius-md);
        }

        @keyframes shimmer {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }

        /* ============================================
           ANIMATIONS
           ============================================ */
        .fade-in {
            animation: fadeIn 0.5s ease-out both;
        }

        .fade-in-up {
            animation: fadeInUp 0.5s ease-out both;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .game-card {
            animation: fadeInUp 0.4s ease-out both;
        }

        .game-card:nth-child(1) { animation-delay: 0.05s; }
        .game-card:nth-child(2) { animation-delay: 0.1s; }
        .game-card:nth-child(3) { animation-delay: 0.15s; }
        .game-card:nth-child(4) { animation-delay: 0.2s; }
        .game-card:nth-child(5) { animation-delay: 0.25s; }
        .game-card:nth-child(6) { animation-delay: 0.3s; }
        .game-card:nth-child(7) { animation-delay: 0.35s; }
        .game-card:nth-child(8) { animation-delay: 0.4s; }
        .game-card:nth-child(9) { animation-delay: 0.45s; }
        .game-card:nth-child(10) { animation-delay: 0.5s; }

        /* ============================================
           MODAL / GAME PREVIEW
           ============================================ */
        .modal-overlay {
            position: fixed;
            inset: 0;
            z-index: 200;
            background: rgba(0,0,0,0.7);
            backdrop-filter: blur(8px);
            display: none;
            align-items: flex-end;
            justify-content: center;
        }

        .modal-overlay.open {
            display: flex;
        }

        .modal-content {
            background: var(--bg-secondary);
            border-radius: var(--radius-lg) var(--radius-lg) 0 0;
            width: 100%;
            max-width: 480px;
            max-height: 85vh;
            overflow-y: auto;
            animation: slideUp 0.3s ease-out;
        }

        @keyframes slideUp {
            from { transform: translateY(100%); }
            to { transform: translateY(0); }
        }

        .modal-handle {
            width: 40px;
            height: 4px;
            background: rgba(255,255,255,0.2);
            border-radius: 2px;
            margin: 12px auto;
        }

        .modal-game-thumb {
            width: 100%;
            height: 200px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 72px;
            position: relative;
        }

        .modal-body {
            padding: 20px;
        }

        .modal-game-name {
            font-size: 22px;
            font-weight: 800;
            margin-bottom: 6px;
        }

        .modal-game-desc {
            font-size: 14px;
            color: var(--text-secondary);
            line-height: 1.6;
            margin-bottom: 20px;
        }

        .modal-play-btn {
            width: 100%;
            height: 56px;
            border: none;
            border-radius: var(--radius-md);
            background: var(--gradient-1);
            color: white;
            font-size: 16px;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            box-shadow: var(--shadow-glow);
        }

        .modal-play-btn:active {
            transform: scale(0.97);
        }

        /* ============================================
           TOAST NOTIFICATION
           ============================================ */
        .toast {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%) translateY(-100px);
            z-index: 300;
            background: var(--bg-card);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: var(--radius-md);
            padding: 14px 20px;
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 14px;
            font-weight: 600;
            box-shadow: var(--shadow-lg);
            transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            max-width: 90%;
        }

        .toast.show {
            transform: translateX(-50%) translateY(0);
        }

        .toast-icon {
            font-size: 20px;
        }

        /* ============================================
           RESPONSIVE TWEAKS
           ============================================ */
        @media (min-width: 380px) {
            .games-grid {
                gap: 16px;
            }
        }

        @media (min-width: 420px) {
            .app-container {
                padding: 0 20px;
            }
        }

        /* Dark scrollbar */
        ::-webkit-scrollbar {
            width: 0;
            height: 0;
        }

        /* ============================================
   PROMO / MUSIC PROMPT BANNER
   ============================================ */
.promo-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: rgba(10, 10, 26, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(124, 58, 237, 0.2);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
  pointer-events: none;
}

.promo-banner.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.promo-banner-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.promo-banner-icon {
  width: 44px;
  height: 44px;
  background: var(--gradient-1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.promo-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
  line-height: 1.3;
}

.promo-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.promo-btn {
  padding: 10px 16px;
  background: var(--gradient-1);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.promo-btn:active {
  transform: scale(0.95);
}