* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #000; --bg-card: #15152a; --bg-hover: #1f1f3a;
  --primary: #ff3377; --primary-hover: #ff5599; --gold: #ffdd44;
  --text: #fff; --text-muted: #9999bb; --border: #2a2a4a;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
  overflow-x: hidden;
}
.hidden { display: none !important; }

/* HEADER */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: linear-gradient(180deg, rgba(0,0,0,0.8), transparent);
  pointer-events: none;
}
.navbar > * { pointer-events: auto; }
.logo { font-size: 20px; font-weight: 900; color: var(--primary); text-decoration: none; }
.nav-right { display: flex; gap: 8px; align-items: center; }
.coin-badge {
  background: rgba(255,221,68,0.2); color: var(--gold);
  padding: 6px 12px; border-radius: 20px; font-weight: 700; font-size: 13px;
  backdrop-filter: blur(10px);
}
.icon-btn {
  background: rgba(255,255,255,0.1); color: var(--text); border: none;
  width: 40px; height: 40px; border-radius: 50%; font-size: 18px;
  cursor: pointer; backdrop-filter: blur(10px); display: flex;
  align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(255,255,255,0.2); }

/* TIKTOK FEED */
.feed {
  height: 100vh; overflow-y: scroll; scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.feed::-webkit-scrollbar { display: none; }
.feed-item {
  height: 100vh; scroll-snap-align: start; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: #000;
}
.feed-video {
  width: 100%; height: 100%; object-fit: contain;
}
.feed-video iframe {
  width: 100%; height: 100%; border: none;
}
.feed-overlay {
  position: absolute; bottom: 120px; left: 16px; right: 80px;
  z-index: 10; pointer-events: none;
}
.feed-overlay > * { pointer-events: auto; }
.feed-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.feed-subtitle { font-size: 13px; color: var(--text-muted); }
.feed-actions {
  position: absolute; right: 12px; bottom: 140px;
  display: flex; flex-direction: column; gap: 20px; z-index: 10;
}
.feed-action {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; color: white; font-size: 11px;
}
.feed-action-icon {
  width: 50px; height: 50px; border-radius: 50%;
  background: rgba(255,255,255,0.15); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.feed-action:hover .feed-action-icon { background: rgba(255,255,255,0.3); }
.feed-action.liked .feed-action-icon { background: rgba(255,51,119,0.8); }

/* COIN REWARD OVERLAY */
.coin-reward-float {
  position: absolute; top: 80px; right: 16px; z-index: 10;
  background: linear-gradient(135deg, #ffdd44, #ff9933);
  color: #000; padding: 8px 16px; border-radius: 20px;
  font-weight: 700; font-size: 13px;
  box-shadow: 0 4px 12px rgba(255,221,68,0.4);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* IKLAN BANNER */
.ad-banner-bottom {
  position: fixed;
  bottom: 60px;
  left: 0;
  right: 0;
  height: 50px;
  background: rgba(10,10,20,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 99;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.ad-banner-bottom .ad-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 320px;
  height: 50px;
}

/* BOTTOM NAV */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-around; align-items: center;
  background: rgba(10,10,20,0.95); backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-muted); text-decoration: none;
  font-size: 11px; padding: 6px 20px;
  transition: color 0.2s;
}
.nav-item.active { color: var(--primary); }
.nav-item-icon { font-size: 22px; }

/* PAGE */
.page {
  padding: 80px 16px 120px; max-width: 600px; margin: 0 auto;
}
.page-title {
  font-size: 24px; font-weight: 900; margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.page-subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }

/* STORE */
.store-section { margin-bottom: 24px; }
.store-section-title {
  font-size: 16px; font-weight: 700; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.game-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.game-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; display: flex; flex-direction: column;
  gap: 8px; cursor: pointer; transition: all 0.2s;
}
.game-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.game-icon { font-size: 32px; text-align: center; }
.game-name { font-size: 13px; font-weight: 600; text-align: center; }
.game-price {
  font-size: 11px; color: var(--gold); text-align: center;
  font-weight: 700;
}

/* AUTH */
.auth-container {
  display: flex; justify-content: center; align-items: center;
  min-height: 100vh; padding: 20px; background: var(--bg);
}
.auth-box {
  background: var(--bg-card); padding: 32px 24px;
  border-radius: 20px; width: 100%; max-width: 400px;
  border: 1px solid var(--border);
}
.auth-box h1 { font-size: 24px; margin-bottom: 24px; text-align: center; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; }
.form-group label { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.form-group input, .form-group select {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); padding: 14px; border-radius: 10px; font-size: 14px;
}
.form-group input:focus, .form-group select:focus {
  outline: none; border-color: var(--primary);
}
.btn-primary {
  background: var(--primary); color: white; border: none;
  padding: 16px; border-radius: 10px; font-size: 15px;
  font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-google {
  background: white; color: #000; border: none;
  padding: 16px; border-radius: 10px; font-size: 15px;
  font-weight: 700; cursor: pointer; display: flex;
  align-items: center; justify-content: center; gap: 10px;
  width: 100%;
}
.btn-google:hover { background: #f0f0f0; }
.auth-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted); font-size: 12px;
  margin: 8px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-switch {
  text-align: center; margin-top: 20px;
  font-size: 14px; color: var(--text-muted);
}
.auth-switch a { color: var(--primary); text-decoration: none; font-weight: 600; }

/* PROFILE */
.profile-card {
  background: var(--bg-card); padding: 30px;
  border-radius: 20px; text-align: center; margin-bottom: 16px;
  border: 1px solid var(--border);
}
.avatar {
  width: 88px; height: 88px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; margin: 0 auto 16px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-card h1 { font-size: 22px; margin-bottom: 4px; }
.profile-card .user-id {
  font-size: 11px; color: var(--text-muted);
  font-family: monospace; margin-top: 8px;
  padding: 4px 12px; background: var(--bg); border-radius: 20px;
  display: inline-block;
}
.profile-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 16px;
}
.stat-box {
  background: var(--bg-card); padding: 16px 8px;
  border-radius: 12px; text-align: center;
  border: 1px solid var(--border);
}
.stat-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.stat-value { font-size: 18px; font-weight: 800; color: var(--gold); }

/* COIN */
.coin-hero {
  background: linear-gradient(135deg, #ff3377, #ff9933);
  border-radius: 20px; padding: 30px 20px; text-align: center;
  margin-bottom: 16px;
}
.balance-big { font-size: 48px; font-weight: 900; line-height: 1; }
.balance-sub { font-size: 14px; margin-top: 4px; opacity: 0.9; }
.balance-value { font-size: 13px; margin-top: 8px; opacity: 0.9; }

.withdraw-section, .history-section {
  background: var(--bg-card); padding: 20px;
  border-radius: 16px; margin-bottom: 16px;
  border: 1px solid var(--border);
}
.withdraw-section h2, .history-section h2 {
  font-size: 16px; margin-bottom: 12px;
}
.withdraw-info { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.withdraw-form { display: flex; flex-direction: column; gap: 12px; }
.transaction-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px; background: var(--bg); border-radius: 10px;
  font-size: 13px; margin-bottom: 6px;
}
.transaction-item .amount.positive { color: #44ff44; font-weight: 700; }
.transaction-item .amount.negative { color: #ff4444; font-weight: 700; }

/* ADMIN BADGE */
.admin-badge {
  background: linear-gradient(135deg, #ff3377, #ff9933);
  color: white; padding: 4px 10px; border-radius: 20px;
  font-size: 10px; font-weight: 700; margin-left: 6px;
}

/* TOAST */
.toast {
  position: fixed; bottom: 140px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: white; padding: 12px 24px;
  border-radius: 25px; font-weight: 600; z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  animation: slideUp 0.3s;
}
@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* LOADING */
.loading-screen {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 16px; z-index: 9999;
}
.spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
