:root {
  --bg: #0a0a0a;
  --bg-soft: #121212;
  --bg-card: #161616;
  --bg-elevated: #1e1e1e;
  --gold: #ffd700;
  --gold-soft: #ffcc00;
  --gold-dark: #b8860b;
  --text: #ffffff;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 40px rgba(0,0,0,0.5);
  --shadow-gold: 0 0 20px rgba(255,215,0,0.15);
  --header-h: 110px;
  --bottom-nav-h: 70px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-top: var(--header-h);
  padding-bottom: var(--bottom-nav-h);
  overflow-x: hidden;
}

button, input { font-family: inherit; }

#app { position: relative; min-height: 100vh; }

/* Header */
.top-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(10,10,10,0.98) 0%, rgba(10,10,10,0.95) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,215,0,0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  height: 56px;
}
.brand { display: flex; align-items: center; gap: 4px; font-weight: 900; font-size: 18px; letter-spacing: 0.5px; }
.brand-text { color: var(--text); }
.brand-gold { color: var(--gold); text-shadow: 0 0 10px rgba(255,215,0,0.3); }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,215,0,0.15);
  background: var(--bg-card);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .2s;
}
.icon-btn:active { transform: scale(0.95); background: rgba(255,215,0,0.1); }

.balance-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px 12px;
}
.balance-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid rgba(255,215,0,0.12);
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.balance-pill i { color: var(--gold); font-size: 14px; }
.balance-label { font-size: 10px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px; }
.balance-amount { font-size: 14px; font-weight: 800; color: var(--success); margin-left: auto; }
.btn-deposit {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #000;
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-gold);
  display: flex; align-items: center; gap: 6px;
}
.btn-deposit:active { transform: scale(0.97); }

/* Sidebar */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1100;
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.sidebar-overlay.active { opacity: 1; pointer-events: auto; }
.sidebar {
  position: fixed; top: 0; right: 0;
  width: min(300px, 85vw);
  height: 100vh;
  background: var(--bg-soft);
  border-left: 1px solid rgba(255,215,0,0.12);
  z-index: 1101;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(0.16,1,0.3,1);
  display: flex; flex-direction: column;
}
.sidebar.active { transform: translateX(0); }
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(255,215,0,0.08);
}
.sidebar-user {
  padding: 28px 16px;
  text-align: center;
  border-bottom: 1px solid rgba(255,215,0,0.08);
}
.avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #000;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 28px;
}
.user-name { font-size: 18px; font-weight: 800; }
.user-code { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px; font-weight: 600;
  transition: all .2s;
  border-left: 3px solid transparent;
}
.sidebar-nav a i { width: 22px; text-align: center; }
.sidebar-nav a.active, .sidebar-nav a:active { color: var(--gold); background: rgba(255,215,0,0.06); border-left-color: var(--gold); }
.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,215,0,0.08); }

/* Main content */
.main-content { padding: 12px 12px 24px; max-width: 1200px; margin: 0 auto; }

/* Hero */
.hero-section { margin-bottom: 16px; position: relative; }
/* width:100% keeps max-height from shrinking the width through aspect-ratio (banner was half-width on desktop) */
.hero-slider { position: relative; width: 100%; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; max-height: 220px; }
.hero-slide {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  padding: 20px;
  opacity: 0; transition: opacity .5s;
}
.hero-slide.active { opacity: 1; }
.hero-content { position: relative; z-index: 2; max-width: 60%; }
.hero-tag {
  display: inline-block;
  background: rgba(255,215,0,0.15);
  color: var(--gold);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px; font-weight: 800;
  margin-bottom: 8px;
  border: 1px solid rgba(255,215,0,0.2);
}
.hero-content h2 { font-size: 22px; font-weight: 900; margin: 0 0 6px; line-height: 1.1; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.hero-content p { font-size: 12px; color: rgba(255,255,255,0.85); margin: 0 0 14px; }
.hero-cta { font-size: 11px; padding: 8px 16px; }
.hero-glow {
  position: absolute; right: -40px; top: 50%; transform: translateY(-50%);
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,215,0,0.25) 0%, transparent 70%);
  filter: blur(20px);
}
.hero-dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px;
}
.hero-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
}
.hero-dots span.active { background: var(--gold); box-shadow: 0 0 8px var(--gold); }

/* Buttons */
.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--shadow-gold);
  transition: transform .15s, box-shadow .15s;
}
.btn-gold:active { transform: scale(0.98); }
.btn-block { width: 100%; border-radius: var(--radius-sm); }
.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

/* Categories */
.category-section { margin-bottom: 16px; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.category-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,215,0,0.08);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: all .2s;
}
.category-card:active { background: rgba(255,215,0,0.08); border-color: rgba(255,215,0,0.2); transform: translateY(-2px); }
.cat-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,215,0,0.15) 0%, rgba(184,134,11,0.1) 100%);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px;
  font-size: 18px;
}
.category-card span { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; }

/* Jackpot */
.jackpot-section { margin-bottom: 20px; }
.jackpot-card {
  background: linear-gradient(135deg, #0d1f0d 0%, #1a3a1a 50%, #0d1f0d 100%);
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(255,215,0,0.05);
}
.jackpot-card::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 2l8 18h18l-14 11 5 18-17-11-17 11 5-18-14-11h18z' fill='%23ffd700' fill-opacity='0.03'/%3E%3C/svg%3E");
  opacity: .5;
}
.jackpot-label { font-size: 11px; color: var(--gold); font-weight: 800; letter-spacing: 1px; position: relative; }
.jackpot-amount { font-size: 24px; font-weight: 900; color: var(--gold); text-shadow: 0 0 15px rgba(255,215,0,0.4); position: relative; margin-top: 4px; }

/* Sections */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-header h3 { font-size: 14px; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 8px; color: var(--gold); }
.section-header h3 i { color: var(--gold); }
.search-box {
  position: relative;
  width: 140px;
}
.search-box i {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); font-size: 12px;
}
.search-box input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(255,215,0,0.1);
  border-radius: 999px;
  padding: 7px 10px 7px 28px;
  color: var(--text);
  font-size: 12px;
  outline: none;
}
.search-box input:focus { border-color: var(--gold); }

/* Providers */
.provider-section { margin-bottom: 16px; }
.provider-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.provider-tabs::-webkit-scrollbar { display: none; }
.provider-tab {
  flex: 0 0 auto;
  background: var(--bg-card);
  border: 1px solid rgba(255,215,0,0.08);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
}
.provider-tab.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #000;
  border-color: transparent;
  box-shadow: var(--shadow-gold);
}
.provider-loading { color: var(--text-muted); font-size: 12px; padding: 8px 0; }

/* Games */
.games-section { margin-bottom: 24px; }
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.game-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255,215,0,0.06);
  transition: transform .2s, box-shadow .2s;
  position: relative;
}
.game-card:active { transform: translateY(-3px); box-shadow: var(--shadow-gold); }
.game-thumb {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: var(--bg-elevated);
}
.game-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s;
}
.game-card:active .game-thumb img { transform: scale(1.05); }
.game-fav {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: var(--text-muted);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 12px;
}
.game-fav.active { color: var(--danger); }
.game-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 9px; font-weight: 800;
  padding: 3px 7px;
  border-radius: 4px;
}
.game-info { padding: 10px; }
.game-name {
  font-size: 11px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 8px;
}
.game-rtp {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.game-rtp-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--danger) 0%, var(--warning) 50%, var(--success) 100%);
  width: 0; transition: width .5s ease;
}
.game-rtp-label {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--text-muted);
  margin-bottom: 6px;
}
.btn-play {
  width: 100%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 9px;
  font-weight: 800;
  font-size: 11px;
  cursor: pointer;
}

/* Skeleton */
.game-skeleton {
  display: contents;
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.game-skeleton::before {
  content: '';
  display: block;
  aspect-ratio: 1/1;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  grid-column: span 1;
}

/* Load more */
.load-more { text-align: center; margin-top: 20px; }

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: rgba(10,10,10,0.98);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,215,0,0.08);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  z-index: 1000;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 9px;
  font-weight: 600;
  height: 100%;
  transition: color .2s;
}
.nav-item i { font-size: 18px; }
.nav-item.active { color: var(--gold); }
.nav-item.nav-center { position: relative; }
.center-btn {
  position: absolute;
  top: -22px;
  left: 50%; transform: translateX(-50%);
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #000;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow-gold);
  border: 3px solid var(--bg);
}
.nav-item.nav-center span { margin-top: 26px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay:not([hidden]) { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--bg-soft);
  border: 1px solid rgba(255,215,0,0.12);
  border-radius: var(--radius);
  width: 100%;
  max-width: 380px;
  padding: 24px;
  position: relative;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  transition: transform .25s;
}
.modal-overlay:not([hidden]) .modal { transform: translateY(0); }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
}
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid rgba(255,215,0,0.08);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-weight: 700;
  cursor: pointer;
}
.auth-tab.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #000;
  border-color: transparent;
}
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 11px; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.form-group input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(255,215,0,0.1);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.form-group input:focus { border-color: var(--gold); }

.modal-title { font-size: 16px; font-weight: 800; margin: 0 0 4px; text-align: center; color: var(--gold); }
.modal-subtitle { text-align: center; font-size: 12px; color: var(--text-muted); margin-bottom: 18px; }

.deposit-form { margin-bottom: 8px; }
.deposit-amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.deposit-amounts button {
  background: var(--bg-card);
  border: 1px solid rgba(255,215,0,0.1);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
}
.deposit-amounts button.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #000;
  border-color: transparent;
}
.deposit-coins {
  background: rgba(255,215,0,0.06);
  border: 1px solid rgba(255,215,0,0.1);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 12px;
}
.deposit-coins strong { color: var(--gold); font-size: 16px; }
.deposit-qris { text-align: center; }
.deposit-instruction { font-size: 11px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.deposit-qris-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.deposit-qris-wrap img {
  max-width: 260px;
  width: 100%;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 8px;
}
.deposit-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  text-align: left;
  font-size: 12px;
  margin-bottom: 16px;
}
.deposit-detail span { color: var(--text-muted); }
.deposit-detail strong { color: var(--text); text-align: right; }

/* Player modal */
.player-overlay { padding: 0; align-items: flex-end; }
.player-overlay:not([hidden]) { opacity: 1; pointer-events: auto; }
.player-modal {
  width: 100%; height: 100%;
  background: #000;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s;
}
.player-overlay:not([hidden]) .player-modal { transform: translateY(0); }
.player-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid rgba(255,215,0,0.08);
}
.player-title { font-weight: 700; font-size: 14px; }
.player-frame-wrap { flex: 1; position: relative; }
.player-frame-wrap iframe {
  width: 100%; height: 100%;
  border: none;
  background: #000;
}
.player-loader {
  position: absolute; inset: 0;
  background: #000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-muted);
  z-index: 2;
}
.player-loader.hidden { display: none; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,215,0,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast {
  position: fixed;
  top: 16px; left: 50%; transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 13px; font-weight: 600;
  z-index: 1300;
  box-shadow: var(--shadow);
  min-width: 200px;
  text-align: center;
}
.toast.success { border-color: rgba(34,197,94,0.4); color: var(--success); }
.toast.error { border-color: rgba(239,68,68,0.4); color: var(--danger); }

/* Desktop */
@media (min-width: 768px) {
  body { --header-h: 90px; }
  .header-inner { height: 50px; }
  .balance-bar { padding-top: 6px; padding-bottom: 10px; }
  .brand { font-size: 22px; }
  .hero-slider { max-height: 320px; }
  .hero-content { max-width: 45%; }
  .hero-content h2 { font-size: 34px; }
  .hero-content p { font-size: 14px; }
  .category-grid { grid-template-columns: repeat(4, minmax(100px, 1fr)); max-width: 600px; margin: 0 auto; }
  .games-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .game-name { font-size: 12px; }
  .bottom-nav { display: none; }
  body { padding-bottom: 20px; }
  .main-content { padding: 16px 24px 24px; }
}
@media (min-width: 1024px) {
  .games-grid { grid-template-columns: repeat(6, 1fr); }
}

/* Hide scrollbars but keep functionality */
* { scrollbar-width: thin; scrollbar-color: rgba(255,215,0,0.2) transparent; }
*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-thumb { background: rgba(255,215,0,0.2); border-radius: 4px; }
