/* ===================================================================
   IMPERADOR 888 — Imperial Chinese Casino Theme
   Mobile-first, premium, high-conversion
   =================================================================== */

:root {
  /* Paleta Imperial */
  --bg: #07020a;
  --bg-1: #120308;
  --bg-2: #1a0a0c;
  --bg-card: rgba(255, 215, 0, 0.04);
  --bg-card-hover: rgba(255, 215, 0, 0.08);
  --bg-overlay: rgba(7, 2, 10, 0.92);

  --primary: #c8102e;     /* Vermelho imperial */
  --primary-2: #8b0000;   /* Vermelho escuro */
  --primary-glow: #ff2a4a;

  --gold: #ffd700;        /* Dourado puro */
  --gold-2: #d4af37;      /* Dourado escuro */
  --gold-3: #b8860b;      /* Dourado bronze */
  --gold-soft: #fff5cc;

  --jade: #00a86b;
  --jade-2: #007f4f;

  --text: #ffffff;
  --text-2: #f0e6c8;
  --text-mute: #9a8e75;
  --text-dim: #5d5648;

  --border: rgba(255, 215, 0, 0.18);
  --border-strong: rgba(255, 215, 0, 0.42);

  --shadow-gold: 0 0 24px rgba(255, 215, 0, 0.32);
  --shadow-red: 0 0 24px rgba(200, 16, 46, 0.4);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.6);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --font-display: 'Cinzel', 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --z-header: 100;
  --z-bottom-nav: 90;
  --z-modal: 1000;
  --z-toast: 2000;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Patterned imperial background */
  background:
    radial-gradient(ellipse at top, rgba(200, 16, 46, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse at bottom, rgba(255, 215, 0, 0.08) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* Texture overlay (subtle pattern of clouds) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'><g fill='%23ffd700' fill-opacity='0.025'><circle cx='15' cy='15' r='1'/><circle cx='50' cy='30' r='1'/><circle cx='85' cy='15' r='1'/><circle cx='30' cy='60' r='1'/><circle cx='70' cy='75' r='1'/></g></svg>");
  pointer-events: none;
  z-index: 0;
}

img, svg { display: block; max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 16px; }
a { color: var(--gold); text-decoration: none; transition: color .15s; }
a:hover { color: var(--gold-soft); }

::selection { background: var(--gold); color: var(--bg); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--gold-2), var(--gold-3)); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ===================================================================
   HEADER (sticky, mobile-first)
   =================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: linear-gradient(180deg, rgba(7, 2, 10, 0.97) 0%, rgba(26, 10, 12, 0.95) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
  cursor: pointer;
  flex-shrink: 0;
}
.logo-icon {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
  animation: gentle-float 3s ease-in-out infinite;
}
.logo-text { font-size: 18px; }
.logo-text .accent { color: var(--primary-glow); }

@keyframes gentle-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-3px) rotate(2deg); }
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.balance-pill {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  border: 1px solid var(--gold-2);
  border-radius: 100px;
  font-weight: 700;
  font-size: 14px;
  color: var(--gold-soft);
  box-shadow: var(--shadow-red);
}
.balance-pill.active { display: inline-flex; }
.balance-pill .label { font-size: 11px; opacity: .8; }
.balance-pill .value { color: var(--gold); }

.btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--gold);
  transition: all .2s;
}
.btn-icon:hover { background: var(--bg-card-hover); border-color: var(--gold-2); }
.btn-icon svg { width: 20px; height: 20px; }

/* ===================================================================
   BUTTONS
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .3px;
  transition: all .2s ease;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: var(--gold-soft);
  border: 1px solid var(--gold-2);
  box-shadow: 0 4px 16px rgba(200, 16, 46, 0.45), inset 0 1px 0 rgba(255, 215, 0, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(200, 16, 46, 0.6), inset 0 1px 0 rgba(255, 215, 0, 0.5);
}
.btn-primary:active { transform: translateY(0); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-3) 100%);
  color: #2a1a00;
  border: 1px solid var(--gold);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  font-weight: 800;
}
.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255, 215, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-2);
}
.btn-ghost:hover { background: var(--bg-card); }

.btn-block { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-sm { padding: 8px 14px; font-size: 12px; }

/* ===================================================================
   HERO
   =================================================================== */
.hero {
  position: relative;
  padding: 32px 16px 36px;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.18) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-888 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(80px, 22vw, 160px);
  line-height: 1;
  background: linear-gradient(180deg, var(--gold-soft) 0%, var(--gold) 30%, var(--gold-3) 70%, var(--primary-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
  filter: drop-shadow(0 4px 12px rgba(200, 16, 46, 0.4));
  margin-bottom: 4px;
  position: relative;
  letter-spacing: -4px;
}
.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(14px, 4vw, 20px);
  color: var(--gold);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 18px;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}
.hero-bonus {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 28px;
  margin: 14px auto 18px;
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.95) 0%, rgba(139, 0, 0, 0.95) 100%);
  border: 2px solid var(--gold);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-gold), 0 8px 24px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 1;
}
.hero-bonus .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-soft);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.hero-bonus .multiplier {
  font-family: var(--font-display);
  font-size: clamp(28px, 8vw, 44px);
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.hero-bonus .multiplier strong { color: var(--gold-soft); font-size: 1.4em; }
.hero-bonus .desc {
  font-size: 13px;
  color: var(--gold-soft);
  margin-top: 4px;
}
.hero-cta {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

/* Lanternas SVG flutuantes */
.lantern {
  position: absolute;
  pointer-events: none;
  animation: lantern-sway 4s ease-in-out infinite;
  opacity: .7;
}
.lantern-l { top: 12px; left: 8%; animation-delay: 0s; width: 50px; }
.lantern-r { top: 12px; right: 8%; animation-delay: 1s; width: 50px; }
@keyframes lantern-sway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

/* ===================================================================
   SECTIONS
   =================================================================== */
section { padding: 24px 16px; position: relative; z-index: 1; }
.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 1px;
}
.section-title::before { content: ''; width: 4px; height: 22px; background: linear-gradient(180deg, var(--gold), var(--primary)); border-radius: 2px; }

.section-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.section-header { display: flex; align-items: center; margin-bottom: 16px; }

/* ===================================================================
   CATEGORY PILLS
   =================================================================== */
.cat-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 0 12px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  scrollbar-width: none;
}
.cat-bar::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cat-pill:hover { border-color: var(--gold-2); color: var(--gold); }
.cat-pill.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  border-color: var(--gold);
  color: var(--gold-soft);
  box-shadow: var(--shadow-red);
}

/* ===================================================================
   GAMES GRID
   =================================================================== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (min-width: 480px) { .games-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; } }
@media (min-width: 768px) { .games-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 1100px) { .games-grid { grid-template-columns: repeat(8, 1fr); } }

.game-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-1);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  aspect-ratio: 3 / 4;
}
.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}
.game-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.game-card:hover img { transform: scale(1.05); }
.game-card .badge {
  position: absolute;
  top: 6px; left: 6px;
  padding: 3px 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: var(--gold-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-radius: 100px;
  text-transform: uppercase;
  border: 1px solid var(--gold);
}
.game-card .badge-new { background: linear-gradient(135deg, var(--jade), var(--jade-2)); }
.game-card .name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 8px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-soft);
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.9) 60%);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===================================================================
   PROVIDERS GRID
   =================================================================== */
.prov-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (min-width: 480px) { .prov-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 768px) { .prov-grid { grid-template-columns: repeat(8, 1fr); } }

.prov-card {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  cursor: pointer;
  transition: all .2s;
}
.prov-card:hover {
  border-color: var(--gold-2);
  background: linear-gradient(135deg, var(--bg-2), var(--primary-2));
}
.prov-card img { max-height: 100%; object-fit: contain; filter: brightness(1.1); }

/* ===================================================================
   WINNERS LIVE
   =================================================================== */
.winners {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 8px;
  scrollbar-width: none;
}
.winners::-webkit-scrollbar { display: none; }
.winner {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(200, 16, 46, 0.08));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 200px;
}
.winner-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--gold-3));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--gold-soft); font-size: 13px;
  flex-shrink: 0;
}
.winner-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.winner-name { font-size: 11px; color: var(--text-mute); }
.winner-amount { font-size: 14px; color: var(--gold); font-weight: 800; }
.winner-game { font-size: 10px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===================================================================
   BOTTOM NAV (mobile)
   =================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: var(--z-bottom-nav);
  background: linear-gradient(0deg, var(--bg) 0%, rgba(26, 10, 12, 0.97) 100%);
  border-top: 1px solid var(--gold-2);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.6);
}
.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-mute);
  cursor: pointer;
  transition: color .15s;
  border-radius: 8px;
}
.bn-item svg { width: 22px; height: 22px; }
.bn-item.active, .bn-item:hover { color: var(--gold); }
.bn-item.deposit-cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: var(--gold);
  border: 1px solid var(--gold);
  margin: -10px 4px 0;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  align-self: center;
  justify-self: center;
  box-shadow: var(--shadow-red);
  font-size: 9px;
}
.bn-item.deposit-cta svg { width: 26px; height: 26px; }

main { padding-bottom: 100px; }
@media (min-width: 1024px) {
  .bottom-nav { display: none; }
  main { padding-bottom: 32px; }
}

/* ===================================================================
   MODALS
   =================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  overflow-y: auto;
  animation: fade-in .2s;
}
.modal-overlay.active { display: flex; }
@media (min-width: 768px) { .modal-overlay { align-items: center; padding: 24px; } }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.8);
  animation: slide-up .3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (min-width: 768px) { .modal { border-radius: var(--radius-xl); padding: 32px 28px; } }

.modal::before {
  content: '';
  position: absolute;
  top: 8px; left: 50%;
  width: 40px; height: 4px;
  background: var(--text-dim);
  border-radius: 2px;
  transform: translateX(-50%);
}
@media (min-width: 768px) { .modal::before { display: none; } }

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  font-weight: 300;
  border: 1px solid var(--border);
  z-index: 1;
}
.modal-close:hover { background: var(--bg-card-hover); }

.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
  margin-top: 8px;
  text-align: center;
}
.modal-subtitle {
  font-size: 13px;
  color: var(--text-mute);
  text-align: center;
  margin-bottom: 22px;
}

/* ===================================================================
   FORMS
   =================================================================== */
.form-group { margin-bottom: 14px; position: relative; }
.form-label {
  display: block;
  font-size: 12px;
  color: var(--gold-2);
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-input,
.form-select {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  transition: border-color .15s, background .15s;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--bg-1);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}
.form-input::placeholder { color: var(--text-dim); }

/* Phone input combo */
.phone-combo {
  display: flex;
  gap: 8px;
}
.phone-combo .country-select {
  width: 110px;
  flex-shrink: 0;
}
.phone-combo .form-input {
  flex: 1;
}

/* Password toggle */
.pwd-wrap { position: relative; }
.pwd-toggle {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute);
  background: transparent;
  border: none;
}
.pwd-toggle:hover { color: var(--gold); }
.pwd-toggle svg { width: 20px; height: 20px; }

.form-help {
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 4px;
}

.tab-group {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 22px;
}
.tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-mute);
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  transition: all .15s;
}
.tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: var(--gold-soft);
  box-shadow: 0 2px 8px rgba(200, 16, 46, 0.4);
}

/* Auth modal switch link */
.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-mute);
  margin-top: 16px;
}
.auth-switch a { color: var(--gold); font-weight: 600; }

/* Bonus card inside register */
.register-bonus {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.18), rgba(255, 215, 0, 0.08));
  border: 1px solid var(--gold-2);
  border-radius: var(--radius);
}
.register-bonus .icon {
  font-size: 28px;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}
.register-bonus .info { flex: 1; }
.register-bonus .info strong {
  display: block;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 16px;
}
.register-bonus .info span { font-size: 12px; color: var(--text-mute); }

/* ===================================================================
   DEPOSIT MODAL — Quick amounts
   =================================================================== */
.amt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.amt-pill {
  padding: 14px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.amt-pill.popular::before {
  content: '⭐';
  position: absolute;
  top: -8px; right: -4px;
  font-size: 14px;
}
.amt-pill:hover { border-color: var(--gold-2); }
.amt-pill.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: var(--gold);
  color: var(--gold-soft);
  box-shadow: var(--shadow-red);
}

.deposit-bonus-info {
  padding: 10px 14px;
  background: rgba(0, 168, 107, 0.12);
  border: 1px solid var(--jade-2);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.deposit-bonus-info strong { color: var(--gold); }

/* QR / PIX result */
.pix-result { padding: 16px; background: var(--bg-1); border: 1px solid var(--gold-2); border-radius: var(--radius); margin-top: 14px; text-align: center; }
.pix-qr { width: 180px; height: 180px; margin: 0 auto 14px; padding: 8px; background: white; border-radius: var(--radius); }
.pix-qr img { width: 100%; height: 100%; }
.pix-code { padding: 10px; background: var(--bg); border: 1px dashed var(--border); border-radius: 8px; font-family: monospace; font-size: 11px; word-break: break-all; max-height: 80px; overflow-y: auto; margin-bottom: 10px; color: var(--gold-soft); }
.pix-copy { width: 100%; }

/* ===================================================================
   TOASTS
   =================================================================== */
#toasts {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 90%;
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-card);
  animation: toast-in .3s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  max-width: 100%;
}
.toast.success { border-color: var(--jade); color: var(--jade); }
.toast.error { border-color: var(--primary); color: #ff7a8e; }
.toast.warning { border-color: var(--gold-2); color: var(--gold); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===================================================================
   GAME PLAYER
   =================================================================== */
#game-frame {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: black;
  display: none;
  flex-direction: column;
}
#game-frame.active { display: flex; }
.game-bar {
  display: flex; align-items: center; padding: 8px 12px;
  background: var(--bg-1); border-bottom: 1px solid var(--border);
  gap: 8px;
}
.game-bar button { padding: 8px 14px; background: var(--bg-card); border-radius: 8px; color: var(--gold); font-weight: 600; }
#game-iframe { flex: 1; width: 100%; border: none; }

/* ===================================================================
   UTILITY
   =================================================================== */
.hidden { display: none !important; }
.text-gold { color: var(--gold); }
.text-mute { color: var(--text-mute); }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--gold-3);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-mute);
}
.empty-state .icon { font-size: 36px; margin-bottom: 8px; opacity: .5; }

/* Confetti container (for wins) */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

/* Avatar (header) */
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-3), var(--gold));
  color: #2a1a00;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}

/* Mobile drawer (profile menu) */
.drawer {
  position: fixed;
  top: 0; right: -100%;
  width: 90%;
  max-width: 360px;
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border-strong);
  z-index: var(--z-modal);
  transition: right .3s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow-y: auto;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.drawer.active { right: 0; }
.drawer-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  background: linear-gradient(180deg, var(--primary-2) 0%, var(--bg) 100%);
}
.drawer-header .avatar { width: 60px; height: 60px; font-size: 24px; }
.drawer-balances {
  padding: 16px 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.drawer-balance {
  padding: 10px;
  background: var(--bg-card);
  border-radius: var(--radius);
  text-align: center;
}
.drawer-balance .label { font-size: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.5px; }
.drawer-balance .value { font-size: 16px; color: var(--gold); font-weight: 800; margin-top: 2px; }

.drawer-menu { padding: 8px 0; }
.drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
  font-size: 15px;
  transition: background .15s;
  border-left: 3px solid transparent;
}
.drawer-item:hover, .drawer-item.active {
  background: var(--bg-card);
  border-left-color: var(--gold);
  color: var(--gold);
}
.drawer-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.drawer-item.danger { color: #ff7a8e; }
.drawer-item.danger:hover { background: rgba(200, 16, 46, 0.1); border-left-color: var(--primary); }

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  z-index: calc(var(--z-modal) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.drawer-overlay.active { opacity: 1; pointer-events: auto; }

/* Hero CTA shake on mobile to grab attention */
@media (max-width: 767px) {
  .hero-cta .btn-gold { animation: subtle-pulse 2.5s ease-in-out infinite; }
}
@keyframes subtle-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
  50% { box-shadow: 0 4px 24px rgba(255, 215, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
}

/* Banner / promo carousel */
.banner-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 16px 12px;
  margin: 0 -16px;
  scrollbar-width: none;
}
.banner-row::-webkit-scrollbar { display: none; }
.banner {
  flex: 0 0 86%;
  scroll-snap-align: start;
  aspect-ratio: 16 / 7;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: 1px solid var(--gold-2);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
@media (min-width: 768px) { .banner { flex: 0 0 60%; } }
@media (min-width: 1100px) { .banner { flex: 0 0 40%; } }

.banner-content {
  position: absolute;
  inset: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 1;
}
.banner-content h3 { font-family: var(--font-display); font-size: 22px; color: var(--gold); margin-bottom: 4px; }
.banner-content p { font-size: 13px; color: var(--gold-soft); }
.banner-icon {
  position: absolute;
  right: 0; bottom: 0;
  font-size: 96px;
  opacity: .3;
  line-height: 1;
}

/* Wallet/withdraw helpers */
.balance-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.balance-row:last-child { border-bottom: none; }
.balance-row .label { color: var(--text-mute); font-size: 13px; }
.balance-row .value { color: var(--gold); font-weight: 700; }

/* PIX keys list */
.pix-key-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .15s;
}
.pix-key-item.selected { border-color: var(--gold); background: rgba(255, 215, 0, 0.05); }
.pix-key-item:hover { border-color: var(--gold-2); }
.pix-key-info .type { font-size: 11px; color: var(--text-mute); text-transform: uppercase; }
.pix-key-info .value { font-size: 14px; color: var(--text); font-weight: 500; }

/* Country select with flags */
.country-option { display: flex; align-items: center; gap: 6px; }

/* Featured / hot game ribbon */
.hot-ribbon {
  position: absolute;
  top: 0; left: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-glow));
  color: var(--gold);
  padding: 3px 10px 3px 8px;
  font-size: 10px;
  font-weight: 800;
  border-radius: 0 0 12px 0;
  z-index: 1;
  text-transform: uppercase;
}

/* History / transaction list */
.tx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.tx-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tx-info .type { font-size: 13px; font-weight: 600; }
.tx-info .meta { font-size: 11px; color: var(--text-mute); }
.tx-amount { font-weight: 800; font-size: 15px; }
.tx-amount.positive { color: var(--jade); }
.tx-amount.negative { color: #ff7a8e; }

/* Affiliate stats */
.aff-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.aff-stat {
  padding: 14px;
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.aff-stat .label { font-size: 11px; color: var(--text-mute); text-transform: uppercase; }
.aff-stat .value { font-size: 22px; color: var(--gold); font-weight: 800; margin-top: 4px; font-family: var(--font-display); }

.aff-link-box {
  padding: 14px;
  background: var(--bg-1);
  border: 1px dashed var(--gold-2);
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.aff-link-box input { flex: 1; background: transparent; border: none; color: var(--gold-soft); font-family: monospace; font-size: 12px; padding: 4px; }
.aff-link-box input:focus { outline: none; }

/* Loader fullscreen */
.loader {
  position: fixed; inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  gap: 14px;
}
.loader.hidden { display: none; }
.loader .logo-icon { width: 80px; height: 80px; animation: pulse-glow 1.4s ease-in-out infinite; }
@keyframes pulse-glow {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 12px var(--gold)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 28px var(--gold)); }
}
.loader-text { font-family: var(--font-display); color: var(--gold); letter-spacing: 4px; font-size: 14px; }
