/* ═══════════════════════════════════════════════
   DEGEN CASINO — Main Styles
   Solana color palette: #9945FF / #14F195 / #000
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --sol-purple:  #9945FF;
  --sol-green:   #14F195;
  --sol-pink:    #FF6B9D;
  --bg:          #050508;
  --bg-card:     rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);
  --border:      rgba(255,255,255,0.08);
  --border-glow: rgba(153,69,255,0.4);
  --text:        #FFFFFF;
  --text-muted:  rgba(255,255,255,0.45);
  --text-dim:    rgba(255,255,255,0.65);
  --radius:      12px;
  --radius-lg:   18px;
  --shadow-glow: 0 0 30px rgba(153,69,255,0.25);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Background noise texture ── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(153,69,255,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(20,241,149,0.06) 0%, transparent 50%);
  pointer-events: none;
}

/* ── Typography ── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page { position: relative; z-index: 1; }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5,5,8,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.navbar-brand {
  font-size: 1.3rem; font-weight: 700;
  background: linear-gradient(135deg, var(--sol-purple), var(--sol-green));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}
.navbar-right { display: flex; align-items: center; gap: 16px; }

/* ── Balance chip ── */
.balance-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.9rem; font-weight: 600;
}
.balance-chip .amount { color: var(--sol-green); }
.balance-chip .currency { color: var(--text-muted); font-size: 0.8rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--sol-purple), #7B2FE0);
  color: #fff;
  box-shadow: 0 4px 20px rgba(153,69,255,0.35);
}
.btn-primary:hover { box-shadow: 0 4px 30px rgba(153,69,255,0.55); filter: brightness(1.1); }

.btn-green {
  background: linear-gradient(135deg, var(--sol-green), #0FC77A);
  color: #000;
  box-shadow: 0 4px 20px rgba(20,241,149,0.3);
}
.btn-green:hover { box-shadow: 0 4px 30px rgba(20,241,149,0.5); filter: brightness(1.1); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.btn-ghost:hover { border-color: var(--sol-purple); color: var(--text); }

.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.2s;
}
.card:hover { border-color: rgba(153,69,255,0.3); }
.card-glow { box-shadow: var(--shadow-glow); border-color: var(--border-glow); }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label { font-size: 0.85rem; font-weight: 500; color: var(--text-dim); }

.form-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: inherit; font-size: 0.95rem; color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none; width: 100%;
}
.form-input:focus {
  border-color: var(--sol-purple);
  box-shadow: 0 0 0 3px rgba(153,69,255,0.15);
}
.form-input::placeholder { color: var(--text-muted); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
  padding: 24px;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  background: #0D0D14;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%; max-width: 440px;
  transform: translateY(20px);
  transition: transform 0.25s;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(153,69,255,0.15);
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-title { font-size: 1.3rem; margin-bottom: 6px; }
.modal-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.4rem; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text); }

/* ── Credential box (после регистрации) ── */
.cred-box {
  background: rgba(20,241,149,0.07);
  border: 1px solid rgba(20,241,149,0.25);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
  font-family: 'Courier New', monospace;
}
.cred-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cred-row:last-child { margin-bottom: 0; }
.cred-label { font-size: 0.8rem; color: var(--text-muted); font-family: 'Space Grotesk', sans-serif; }
.cred-value { font-size: 1rem; color: var(--sol-green); font-weight: 600; }
.cred-copy { cursor: pointer; color: var(--text-muted); font-size: 0.8rem; transition: color 0.15s; }
.cred-copy:hover { color: var(--sol-green); }

.cred-warning {
  font-size: 0.82rem; color: var(--sol-pink);
  text-align: center; margin-bottom: 16px;
}

/* ── Топап кнопки ── */
.topup-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.topup-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center; cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}
.topup-btn:hover, .topup-btn.active {
  border-color: var(--sol-green);
  background: rgba(20,241,149,0.08);
}
.topup-btn .amount { display: block; font-size: 1.2rem; font-weight: 700; color: var(--sol-green); }
.topup-btn .label  { font-size: 0.75rem; color: var(--text-muted); }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; background: var(--bg-card); border-radius: var(--radius); padding: 4px; margin-bottom: 24px; }
.tab {
  flex: 1; padding: 9px; text-align: center;
  border-radius: 8px; cursor: pointer;
  font-size: 0.9rem; font-weight: 500; color: var(--text-muted);
  transition: all 0.18s; border: none; background: none; font-family: inherit;
}
.tab.active { background: rgba(153,69,255,0.2); color: var(--text); border: 1px solid rgba(153,69,255,0.3); }

/* ── Badge / tag ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 50px;
  font-size: 0.75rem; font-weight: 600;
}
.badge-green  { background: rgba(20,241,149,0.15);  color: var(--sol-green); }
.badge-purple { background: rgba(153,69,255,0.15);  color: var(--sol-purple); }
.badge-red    { background: rgba(255,80,80,0.15);   color: #FF5050; }

/* ── Glow text ── */
.glow-text {
  background: linear-gradient(135deg, #fff 30%, var(--sol-purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.glow-green {
  background: linear-gradient(135deg, var(--sol-green), #0FC77A);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Toast notifications ── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: #1A1A2E;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  min-width: 220px; max-width: 360px;
  font-size: 0.9rem; font-weight: 500;
  animation: slideIn 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast.success { border-color: rgba(20,241,149,0.4); color: var(--sol-green); }
.toast.error   { border-color: rgba(255,80,80,0.4);  color: #FF5050; }
.toast.info    { border-color: rgba(153,69,255,0.4); color: #C990FF; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

/* ── Divider ── */
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 0.85rem; margin: 20px 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Utility ── */
.flex    { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8   { gap: 8px; }
.gap-12  { gap: 12px; }
.gap-16  { gap: 16px; }
.mt-8    { margin-top: 8px; }
.mt-16   { margin-top: 16px; }
.mt-24   { margin-top: 24px; }
.mb-8    { margin-bottom: 8px; }
.mb-16   { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-green  { color: var(--sol-green); }
.text-purple { color: var(--sol-purple); }
.text-sm     { font-size: 0.85rem; }
.font-mono   { font-family: 'Courier New', monospace; }
.w-full  { width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(153,69,255,0.4); border-radius: 3px; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .navbar { padding: 0 16px; }
  .container { padding: 0 16px; }
  .modal { padding: 24px 20px; }
  .topup-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}

.navbar-brand{
  display:inline-block;
  width:610px;                 
  height:134px;
  background:url('/assets/img/logo-moonreels.png') left center / contain no-repeat;
  text-indent:-9999px;         
  overflow:hidden;
  white-space:nowrap;
}
@media(max-width:640px){ .navbar-brand{ display:none !important; } }

/* ══════════════ МОБИЛЬНЫЕ ФИКСЫ (навбар / модалка / тосты / попапы) ══════════════ */
@media (max-width: 640px) {
  /* ── 1. Навбар: баланс виден; действия — РАЗНЫЕ SVG-иконки ── */
  /* Withdraw убран с мобильного — Deposit(кошелёк) ведёт туда же, вывод внутри страницы */
  .navbar-right a.btn[href*="withdraw"] { display: none !important; }
  .navbar { justify-content: flex-end; }
  .navbar-right { gap: 7px; width: 100%; justify-content: flex-end; }
  [data-auth="show"] { gap: 7px !important; }
  [data-auth="show"] [data-username] { display: none !important; }
  [data-auth="show"] .balance-chip { padding: 5px 10px; font-size: 0.8rem; }

  /* превращаем кнопки/ссылки действий в иконки (текст прячем) */
  .navbar-right a.btn[href="/wallet.php"],
  .navbar-right a.btn[href*="withdraw"],
  .navbar-right a.btn[href="/"],
  [data-auth="show"] button[onclick*="wallet"],
  [data-auth="show"] button[onclick*="logout"] {
    font-size: 0 !important;
    width: 38px; height: 34px; padding: 0 !important;
    position: relative; overflow: hidden;
  }
  .navbar-right a.btn[href="/wallet.php"]::before,
  .navbar-right a.btn[href*="withdraw"]::before,
  .navbar-right a.btn[href="/"]::before,
  [data-auth="show"] button[onclick*="wallet"]::before,
  [data-auth="show"] button[onclick*="logout"]::before {
    content: ''; position: absolute; inset: 0;
    background-repeat: no-repeat; background-position: center; background-size: 18px;
  }
  /* Deposit / Wallet → карта */
  .navbar-right a.btn[href="/wallet.php"]::before,
  [data-auth="show"] button[onclick*="wallet"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='2'/%3E%3Cpath d='M2 10h20'/%3E%3C/svg%3E"); }
  /* Withdraw → стрелка вверх (вывод) */
  .navbar-right a.btn[href*="withdraw"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20V8'/%3E%3Cpath d='M6 14l6-6 6 6'/%3E%3Cpath d='M5 4h14'/%3E%3C/svg%3E"); }
  /* Lobby → домик (отдельная, понятная) */
  .navbar-right a.btn[href="/"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-8 9 8'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3C/svg%3E"); }
  /* Exit/logout → дверь */
  [data-auth="show"] button[onclick*="logout"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E"); }

  /* Переключатель языка (где есть) — видимый, компактный */
  .navbar-right select { font-size: 12px; padding: 4px 6px; max-width: 68px; }
  /* Вейджер-бар — компактнее */
  #wager-bar { min-width: 76px !important; }
  #wager-label { font-size: 0.5rem !important; margin-bottom: 1px !important; }
  /* Логотип скрыт на мобильном — освобождаем место под иконки */
  .navbar-brand { display: none !important; }

  /* ── 2. Модалка: центр + прокрутка, если выше экрана ── */
  .modal-overlay {
    align-items: flex-start; overflow-y: auto;
    -webkit-overflow-scrolling: touch; padding: 16px;
  }
  .modal { margin-top: auto; margin-bottom: auto; max-width: 100%; }

  /* ── 4. Тосты: сверху по центру, на всю ширину, поверх всего ── */
  #toast-container {
    top: 12px; bottom: auto; left: 12px; right: 12px;
    align-items: stretch; z-index: 100000;
  }
  .toast { min-width: 0; max-width: 100%; text-align: center; }

  /* ── Попапы уведомлений и вейджера: на весь экран, не обрезаются ── */
  #notif-dropdown {
    position: fixed !important;
    top: 58px !important; left: 8px !important; right: 8px !important;
    width: auto !important; max-width: none !important; max-height: 72vh !important;
  }
  #wager-tip {
    position: fixed !important;
    top: 58px !important; left: 8px !important; right: 8px !important;
    width: auto !important;
  }
}
