/* ═══════════════════════════════════════════════════════════════
   CRAZYHUB — PRODUCTION DESIGN SYSTEM v2
   Premium casino aesthetic. Deep surfaces, restrained gold, layered
   elevation, semantic color, 8px spacing grid, 1.125 type scale.

   Rule set:
   · Mobile-first (content max-width 600px, Telegram WebApp)
   · All animations use transform/opacity only (GPU friendly)
   · UI motion 200-400ms, entertainment 600-1000ms
   · Every selector below matches markup produced by frontend/js/*
   ═══════════════════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────────────────────
   1. DESIGN TOKENS
   ──────────────────────────────────────────────────────────────── */
:root {
  /* ── Palette: deep neutral base (blue-black, warm cast) ── */
  --bg-base:      #0A0D14;   /* page ground                  */
  --bg-deep:      #07090E;   /* footer / nav ground          */
  --bg-elev:      #10141E;   /* elevated surfaces            */

  /* ── Surfaces (step 1→3 increasing elevation) ── */
  --surface-1:    #141926;
  --surface-2:    #1A2132;
  --surface-3:    #232C42;

  /* ── Gold: restrained, warm (primary brand) ── */
  --gold-main:    #C9A84C;
  --gold-light:   #E2C777;
  --gold-dark:    #9A7B33;
  --gold-pale:    rgba(201, 168, 76, 0.16);

  /* ── Secondary accents (communicate intent, not decoration) ── */
  --accent:       #2FD4A7;   /* cool emerald — positive secondary */
  --accent-deep:  #1FA883;
  --violet:       #8B7CF6;   /* premium / x10 tier           */
  --blue:         #4C9AFF;   /* info                         */

  /* ── Semantic (WCAG-friendly, not neon) ── */
  --success:      #2EB67D;
  --success-soft: rgba(46, 182, 125, 0.14);
  --danger:       #E5484D;
  --danger-soft:  rgba(229, 72, 77, 0.14);
  --warning:      #F0A63A;
  --warning-soft: rgba(240, 166, 58, 0.14);
  --info:         #4C9AFF;

  /* ── Text scale ── */
  --text-hi:      #F3F5FA;
  --text-md:      #A6B0C4;
  --text-lo:      #6E7894;

  /* ── Lines / borders ── */
  --border:        #222A3B;
  --border-strong: #2F3A54;

  /* ── Legacy aliases (used by inline styles in JS) ── */
  --gold:          var(--gold-main);
  --gold-dark-2:   var(--gold-dark);
  --orange:        var(--warning);
  --orange-dark:   #C97F1F;
  --black:         #000000;
  --dark:          #1A2132;
  --dark-gray:     #1A2132;
  --gray:          #6E7894;
  --gray-light:    #232C42;
  --light-gray:    #A6B0C4;
  --white:         #FFFFFF;
  --danger-dark:   #C0392B;
  --success-dark:  #1FA883;
  --silver:        #C0C0C0;
  --silver-light:  #E8E8E8;
  --primary-dark:  #0A0D14;
  --primary-black: #000000;
  --secondary-dark:#1A2132;
  --tertiary-dark: #232C42;
  --text-primary:  #F3F5FA;
  --text-secondary:#A6B0C4;
  --text-tertiary: #6E7894;
  --text:          #A6B0C4;
  --border-light:  #222A3B;
  --card-bg:       linear-gradient(160deg, #1A2132 0%, #141926 100%);
  --bg-gradient:   radial-gradient(120% 60% at 50% -20%, #171E31 0%, #0A0D14 55%, #07090E 100%);

  /* ── Layered elevation system (ambient + key, warm-cool mix) ── */
  --e-1: 0 1px 2px rgba(3, 6, 12, 0.45);
  --e-2: 0 1px 2px rgba(3, 6, 12, 0.4), 0 2px 8px -1px rgba(3, 6, 12, 0.5);
  --e-3: 0 2px 6px -2px rgba(3, 6, 12, 0.5), 0 10px 24px -6px rgba(3, 6, 12, 0.6);
  --e-4: 0 4px 12px -4px rgba(3, 6, 12, 0.55), 0 24px 48px -12px rgba(3, 6, 12, 0.68);
  --e-5: 0 8px 20px -6px rgba(3, 6, 12, 0.6), 0 36px 72px -20px rgba(3, 6, 12, 0.78);
  --e-gold: 0 0 0 1px rgba(201, 168, 76, 0.28), 0 8px 28px -8px rgba(201, 168, 76, 0.4);
  --glow-soft: 0 0 18px -2px rgba(201, 168, 76, 0.28);
  --inset-hi: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --inset-lo: inset 0 1px 3px rgba(0, 0, 0, 0.35);

  /* ── Shadow aliases (back-compat) ── */
  --shadow-sm:    var(--e-2);
  --shadow-md:    var(--e-3);
  --shadow-lg:    var(--e-4);
  --shadow-xl:    var(--e-5);
  --shadow-inset: var(--inset-lo);
  --shadow-gold:  0 0 20px -4px rgba(201, 168, 76, 0.35);
  --shadow-gold-lg: 0 0 44px -8px rgba(201, 168, 76, 0.4);

  /* ── 8px spacing grid ── */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;
  --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --sp-7: 48px; --sp-8: 64px;

  /* ── Radius ── */
  --radius-sm: 6px;  --radius-md: 10px;
  --radius-lg: 14px; --radius-xl: 20px;
  --radius-full: 9999px;

  /* ── Type scale (1.125x) ── */
  --fs-h1: clamp(28px, 7vw, 48px);
  --fs-h2: clamp(26px, 6.5vw, 42px);
  --fs-h3: clamp(24px, 6vw, 36px);
  --fs-h4: clamp(22px, 5.5vw, 32px);
  --fs-h5: clamp(20px, 5vw, 28px);
  --fs-h6: clamp(18px, 4.5vw, 24px);
  --fs-body-lg: 18px; --fs-body: 16px; --fs-body-sm: 14px;
  --fs-caption: 12px; --fs-label: 11px;

  --lh-tight: 1.25; --lh-base: 1.55; --lh-loose: 1.7;

  /* ── Typography families ── */
  --font-display: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

  /* ── Motion ── */
  --t-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --t-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

/* ────────────────────────────────────────────────────────────────
   2. BASE / RESET
   ──────────────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

html, body {
  width: 100%;
  min-height: 100%;
  background: var(--bg-gradient);
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-base);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-touch-callout: none;
  user-select: none;
}

/* Ambient vignette — subtle depth, no clutter */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(90% 45% at 50% 0%, rgba(201, 168, 76, 0.05), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

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

/* ────────────────────────────────────────────────────────────────
   3. ACCESSIBILITY PRIMITIVES
   ──────────────────────────────────────────────────────────────── */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid rgba(201, 168, 76, 0.7);
  outline-offset: 2px;
}

/* Touch targets — never below 48px for interactive chrome */
button { touch-action: manipulation; }

/* Hover effects only on devices that can hover (avoids sticky-tap on mobile) */
@media (hover: hover) {
  .card:hover,
  .game-slot:hover,
  .bet-preset:hover,
  .top-item:hover,
  .inv-item:hover,
  .case-card:hover { transform: translateY(-2px); }
}

/* ────────────────────────────────────────────────────────────────
   4. TYPOGRAPHY
   ──────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  margin: var(--sp-3) 0 var(--sp-1);
  background: linear-gradient(120deg, var(--gold-light) 0%, var(--gold-main) 55%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--sp-4);
}

.section-title {
  font-size: var(--fs-body-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--gold-main);
  margin: var(--sp-3) 0 var(--sp-2);
}

code {
  font-family: var(--font-mono);
  background: var(--gold-pale);
  color: var(--gold-light);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-body-sm);
}

b, strong { color: var(--gold-light); font-weight: 700; }

.font-mono { font-family: var(--font-mono); }

/* ────────────────────────────────────────────────────────────────
   5. LAYOUT
   ──────────────────────────────────────────────────────────────── */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: var(--sp-4);
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

.page-enter { animation: pageEnter 0.4s var(--t-base); }

/* ────────────────────────────────────────────────────────────────
   6. HEADER / TOP BAR
   ──────────────────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 13, 20, 0.94);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-3) var(--sp-4);
  animation: slideDown 0.4s var(--t-base);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  max-width: 600px;
  margin: 0 auto;
}

.logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--gold-light), var(--gold-main));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
  white-space: nowrap;
}

.logo .svg-icon { margin-right: 4px; color: var(--gold-main); }
.logo .svg-icon svg {
  width: 22px;
  height: 22px;
  transform: translateY(-2px);
  filter: drop-shadow(0 1px 4px rgba(245, 197, 24, 0.55));
}

/* Balance — prominent but calm */
.balance-display {
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(160deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--gold-dark);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  box-shadow: var(--e-2), var(--glow-soft);
  transition: box-shadow var(--t-base), border-color var(--t-base);
  white-space: nowrap;
}

.balance-display .coin { font-size: 15px; color: var(--gold-light); }

.balance-display .balance-value {
  font-size: var(--fs-body-sm);
  font-weight: 700;
  color: var(--gold-light);
  min-width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  transition: color var(--t-base);
}

.balance-display .balance-value.bump {
  animation: bumpBalance 0.35s var(--ease-out-quart);
}

@keyframes bumpBalance {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.22); color: var(--gold-light); }
  100% { transform: scale(1); }
}

.header-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: linear-gradient(160deg, var(--surface-3), var(--surface-2));
  color: var(--gold-main);
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--e-1), var(--inset-hi);
  transition: color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.header-btn:hover {
  border-color: var(--gold-dark);
  color: var(--gold-light);
  box-shadow: var(--e-2), var(--glow-soft);
}

/* ────────────────────────────────────────────────────────────────
   7. SURFACES / CARDS
   ──────────────────────────────────────────────────────────────── */
.card {
  position: relative;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
  box-shadow: var(--e-2), var(--inset-hi);
  transition: box-shadow var(--t-base), border-color var(--t-base), transform var(--t-base);
}

/* Hairline gold seam on top edge */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.35), transparent);
  opacity: 0.6;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--e-3), var(--inset-hi);
}

.card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-main);
  margin-bottom: var(--sp-2);
}

/* ────────────────────────────────────────────────────────────────
   8. BUTTONS
   ──────────────────────────────────────────────────────────────── */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  text-decoration: none;
  transition: transform var(--t-fast), box-shadow var(--t-base), background-color var(--t-base), border-color var(--t-base), color var(--t-fast), opacity var(--t-fast);
}

/* Micro ripple (refined — fade only, GPU cheap) */
.btn::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: width 0.45s var(--t-base), height 0.45s var(--t-base), opacity 0.5s;
  pointer-events: none;
}

.btn:active::after {
  width: 320px; height: 320px;
  opacity: 1;
  transition: width 0s, height 0s, opacity 0.15s;
}

.btn:active { transform: scale(0.975); }

/* Primary — gold */
.btn-gold, .btn-primary {
  background: linear-gradient(160deg, var(--gold-light) 0%, var(--gold-main) 60%, var(--gold-dark) 100%);
  color: var(--bg-deep);
  border-color: var(--gold-dark);
  box-shadow: var(--e-3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-gold:hover, .btn-primary:hover {
  box-shadow: var(--e-4), var(--glow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-gold:active, .btn-primary:active {
  transform: scale(0.975);
  box-shadow: var(--e-2), inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Secondary — dark surface */
.btn-dark, .btn-secondary {
  background: linear-gradient(160deg, var(--surface-3), var(--surface-2));
  color: var(--gold-main);
  border-color: var(--border-strong);
  box-shadow: var(--e-1), var(--inset-hi);
}

.btn-dark:hover, .btn-secondary:hover {
  color: var(--gold-light);
  border-color: var(--gold-dark);
  box-shadow: var(--e-2), var(--glow-soft);
}

.btn-dark:active, .btn-secondary:active {
  transform: scale(0.975);
  box-shadow: var(--e-1), var(--inset-lo);
}

/* Destructive */
.btn-danger {
  background: linear-gradient(160deg, #E5484D 0%, #C2353A 100%);
  color: #fff;
  border-color: #8F262A;
  box-shadow: var(--e-2), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-danger:hover {
  box-shadow: var(--e-3), 0 0 20px -6px rgba(229, 72, 77, 0.55);
}

.btn-danger:active { transform: scale(0.975); }

/* Sizes */
.btn-xs { padding: 6px 10px; font-size: var(--fs-caption); border-radius: var(--radius-sm); }
.btn-sm { padding: 10px 16px; font-size: var(--fs-body-sm); }
.btn-md { padding: 14px 22px; font-size: var(--fs-body); }
.btn-lg { padding: 16px 28px; font-size: var(--fs-body-lg); }

.btn-icon {
  width: 48px; height: 48px;
  padding: 0;
  border-radius: var(--radius-full);
  font-size: 18px;
}

/* Clear disabled state (structure preserved, affordance communicated) */
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: saturate(0.6);
  box-shadow: none;
  transform: none !important;
}

/* Ripple suppressed for disabled */
.btn:disabled::after { display: none; }

.btn-group { display: flex; gap: var(--sp-2); }
.btn-group .btn { flex: 1; }

/* ────────────────────────────────────────────────────────────────
   9. FORMS / INPUTS
   ──────────────────────────────────────────────────────────────── */
input, select {
  width: 100%;
  padding: 12px 14px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  box-shadow: var(--inset-lo);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}

input::placeholder { color: var(--text-tertiary); }

input:hover, select:hover { border-color: rgba(201, 168, 76, 0.45); }

input:focus, select:focus {
  border-color: var(--gold-main);
  box-shadow: var(--inset-lo), 0 0 0 3px rgba(201, 168, 76, 0.18);
}

input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Semantic input states */
.input-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.16) !important;
}

.input-success {
  border-color: var(--success) !important;
  box-shadow: 0 0 0 3px rgba(46, 182, 125, 0.16) !important;
}

label {
  display: block;
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: var(--sp-3) 0 var(--sp-2);
}

/* ────────────────────────────────────────────────────────────────
   10. BACK / RULES LINKS
   ──────────────────────────────────────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: var(--fs-body-sm);
  font-weight: 500;
  padding: 8px 10px;
  margin-bottom: var(--sp-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--t-fast), background-color var(--t-fast);
}

.back-btn:hover { color: var(--gold-main); background: var(--gold-pale); }

.rules-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--t-fast), background-color var(--t-fast), border-color var(--t-fast);
}

.rules-btn:hover {
  color: var(--gold-main);
  background: var(--gold-pale);
  border-color: var(--gold-dark);
}

/* ────────────────────────────────────────────────────────────────
   11. GAME GRID (HOME / GAMES)
   ──────────────────────────────────────────────────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.game-slot {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--sp-3);
  background: linear-gradient(160deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--e-2), var(--inset-hi);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}

/* Faint gold bloom from top-left corner (restrained) */
.game-slot::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(130% 100% at 25% 0%, rgba(201, 168, 76, 0.14), transparent 55%);
  opacity: 0;
  transition: opacity var(--t-base);
  pointer-events: none;
}

.game-slot:hover {
  border-color: var(--gold-dark);
  box-shadow: var(--e-3), var(--glow-soft), var(--inset-hi);
}

.game-slot:hover::before { opacity: 1; }

.game-slot:active { transform: translateY(-1px) scale(0.985); }

.game-slot .game-icon {
  font-size: 34px;
  line-height: 1;
  margin-bottom: var(--sp-2);
  animation: float 3.5s ease-in-out infinite;
}

.game-slot .game-name {
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.game-slot .game-desc {
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-lo);
}

.game-slot .game-badge {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-label);
  font-weight: 700;
  z-index: 2;
  background: var(--gold-pale);
  color: var(--gold-light);
  border: 1px solid var(--gold-dark);
}

/* Subtle float — barely moves, purposeful breathing */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* ────────────────────────────────────────────────────────────────
   12. BOTTOM NAVIGATION
   ──────────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  z-index: 200;
  background: linear-gradient(180deg, rgba(16, 20, 30, 0.97), rgba(7, 9, 14, 0.99));
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 32px -12px rgba(0, 0, 0, 0.6);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
}

.nav-btn {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 56px;
  padding: 6px 2px;
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  color: var(--text-lo);
  transition: color var(--t-fast);
}

.nav-btn .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-lo);
  transition: color var(--t-fast), transform var(--t-fast);
}

.nav-btn .nav-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-btn .nav-label {
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Active state — gold tint + underline indicator */
.nav-btn.active { color: var(--gold-light); }
.nav-btn.active .nav-icon { color: var(--gold-light); transform: translateY(-1px); }
.nav-btn.active .nav-label { color: var(--gold-main); }

.nav-btn::after {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  width: 36px; height: 3px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--gold-main), var(--gold-light));
  box-shadow: 0 2px 10px rgba(201, 168, 76, 0.55);
  transform: translateX(-50%) scaleX(0);
  opacity: 0;
  transition: transform var(--t-base), opacity var(--t-base);
}

.nav-btn.active::after { transform: translateX(-50%) scaleX(1); opacity: 1; }

.nav-btn:active { transform: scale(0.94); }

/* ────────────────────────────────────────────────────────────────
   12B. SVG ICONS
   ──────────────────────────────────────────────────────────────── */
.svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 0;
}

.svg-icon svg {
  display: block;
  width: 1em;
  height: 1em;
}

/* Back / rules buttons */
.back-btn .svg-icon svg { width: 18px; height: 18px; }
.rules-btn .svg-icon svg { width: 14px; height: 14px; }
.rules-btn { color: var(--text-secondary); }
.rules-btn:hover .svg-icon { color: var(--gold-main); }

/* Game grid icons (home / games) */
.game-slot .game-icon { font-size: 34px; }
.game-slot .game-icon .svg-icon { color: var(--gold-light); }
.game-slot .game-icon .svg-icon svg {
  width: 34px; height: 34px;
  stroke-width: 1.5;
  filter: drop-shadow(0 4px 10px rgba(201, 168, 76, 0.25));
}

/* Result banners */
.result-display .svg-icon { margin-right: 8px; }
.result-display .svg-icon svg { width: 18px; height: 18px; }
.result-win .svg-icon { color: var(--success); }
.result-lose .svg-icon { color: var(--danger); }
.result-push .svg-icon { color: var(--gold-light); }

/* Page titles with icon */
.page-title > .svg-icon { color: var(--gold-light); margin-right: 6px; }
.page-title > .svg-icon svg { width: 20px; height: 20px; }

/* Currency star */
.balance-display .coin .svg-icon svg { width: 15px; height: 15px; transform: translateY(-1px); }

/* Case tabs */
.case-tab .svg-icon { margin-right: 4px; }
.case-tab .svg-icon svg { width: 15px; height: 15px; }

/* Cart button */
.case-cart-btn .svg-icon svg { width: 22px; height: 22px; }

/* Buttons with leading icon */
.btn .svg-icon { margin-right: 6px; }
.btn .svg-icon svg { width: 15px; height: 15px; }
.btn.btn-sm .svg-icon svg { width: 13px; height: 13px; }

/* Dice faces (pips inherit die color) */
.dice svg { width: 44px; height: 44px; }

/* Slot symbols */
.slot-symbol { display: inline-flex; align-items: center; justify-content: center; }
.slot-symbol svg { width: 46px; height: 46px; }
.slot-reel .slot-symbol svg { display: block; }

/* Multiplier table symbols */
.multiplier-row .sym { display: inline-flex; gap: 4px; align-items: center; }
.multiplier-row .sym .svg-icon svg { width: 18px; height: 18px; }

/* Blackjack cards: rank + suit */
.bj-card { flex-direction: column; gap: 1px; }
.bj-card .bj-card-suit { line-height: 0; }
.bj-card .bj-card-suit svg { width: 20px; height: 20px; }
.bj-card.hidden .bj-card-suit { display: none; }

/* Coin flip */
.coinflip-coin {
  width: 116px; height: 116px;
  margin: var(--sp-4) auto;
  position: relative;
  transform-style: preserve-3d;
  cursor: pointer;
  user-select: none;
}

.coinflip-coin .coin-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, var(--gold-light), var(--gold-main) 55%, #8F7430);
  border: 3px solid var(--gold-dark);
  box-shadow: var(--e-4), var(--glow-soft), inset 0 -5px 10px rgba(0, 0, 0, 0.28);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.coinflip-coin .coin-face-back { transform: rotateY(180deg); }
.coinflip-coin .coin-face svg { width: 92px; height: 92px; display: block; }

/* Wheel pointer */
.wheel-pointer .svg-icon svg {
  width: 30px; height: 30px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

/* Case / inventory icons */
.case-open-icon .svg-icon svg { width: 64px; height: 64px; }
.case-reveal-label .svg-icon { margin-right: 4px; }
.case-reveal-label .svg-icon svg { width: 16px; height: 16px; }
.case-win-marker .svg-icon svg { width: 14px; height: 14px; }

/* Profile pickers */
.emoji-option .svg-icon svg { width: 24px; height: 24px; }
.emoji-option { display: inline-flex; align-items: center; justify-content: center; }
.lang-option .flag .svg-icon svg { width: 26px; height: 26px; }

/* Admin */
.admin-card .section-title .svg-icon { margin-right: 6px; }
.admin-card .section-title .svg-icon svg { width: 18px; height: 18px; }
.admin-mini-btn .svg-icon { margin-right: 4px; }
.admin-mini-btn .svg-icon svg { width: 12px; height: 12px; }
.top-avatar-ph .svg-icon svg { width: 20px; height: 20px; }
.top-rank .svg-icon svg { width: 26px; height: 26px; }
.profile-avatar-placeholder .svg-icon svg { width: 46px; height: 46px; }
.admin-user-crown { color: var(--gold-main); }
.admin-user-crown .svg-icon svg { width: 13px; height: 13px; }
.case-icon .svg-icon svg { width: 96px; height: 96px; }
.toast .toast-ico .svg-icon svg { width: 16px; height: 16px; }

/* Daily bonus / auth card */
.daily-bonus-btn .svg-icon { margin-right: 6px; }
.daily-bonus-btn .svg-icon svg { width: 18px; height: 18px; transform: translateY(-1.5px); }
.auth-card .svg-icon svg { width: 64px; height: 64px; }

/* Status icons */
.status-ok { color: var(--success); }
.status-err { color: var(--danger); }
.status-ok .svg-icon svg, .status-err .svg-icon svg { width: 13px; height: 13px; }

/* ────────────────────────────────────────────────────────────────
   13. BET INPUT / PRESETS
   ──────────────────────────────────────────────────────────────── */
.bet-input-group { display: flex; gap: var(--sp-2); align-items: center; }
.bet-input-group input { flex: 1; }

.bet-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: var(--sp-2) 0;
}

.bet-preset {
  flex: 1;
  min-width: 50px;
  text-align: center;
  padding: 10px 8px;
  background: linear-gradient(160deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--gold-main);
  font-family: var(--font-mono);
  font-size: var(--fs-body-sm);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--e-1), var(--inset-hi);
  transition: color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

.bet-preset:hover {
  border-color: var(--gold-dark);
  color: var(--gold-light);
  box-shadow: var(--e-2), var(--glow-soft);
}

.bet-preset.active {
  background: linear-gradient(160deg, var(--gold-light), var(--gold-main) 70%, var(--gold-dark));
  color: var(--bg-deep);
  border-color: var(--gold-dark);
  box-shadow: var(--e-2), var(--glow-soft);
}

/* ────────────────────────────────────────────────────────────────
   14. RESULT DISPLAY
   ──────────────────────────────────────────────────────────────── */
.result-display {
  text-align: center;
  padding: var(--sp-3) var(--sp-4);
  margin: var(--sp-3) 0;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: var(--fs-body-lg);
  font-weight: 700;
  animation: resultPop 0.4s var(--t-spring);
}

@keyframes resultPop {
  0%   { transform: scale(0.82); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.result-win {
  background: var(--success-soft);
  border: 1px solid rgba(46, 182, 125, 0.4);
  color: var(--success);
  box-shadow: 0 0 24px -8px rgba(46, 182, 125, 0.45);
}

.result-lose {
  background: var(--danger-soft);
  border: 1px solid rgba(229, 72, 77, 0.35);
  color: var(--danger);
}

.result-push {
  background: var(--gold-pale);
  border: 1px solid rgba(201, 168, 76, 0.35);
  color: var(--gold-light);
}

/* ────────────────────────────────────────────────────────────────
   15. DICE
   ──────────────────────────────────────────────────────────────── */
.dice-container {
  display: flex;
  justify-content: center;
  gap: var(--sp-6);
  margin: var(--sp-5) 0;
  perspective: 700px;
}

.dice {
  position: relative;
  width: 84px; height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #FFFFFF, #E8E8EA);
  border-radius: 18px;
  font-size: 42px;
  font-weight: 800;
  color: var(--bg-deep);
  box-shadow: var(--e-3), inset 0 -2px 5px rgba(0, 0, 0, 0.12), inset 0 2px 5px rgba(255, 255, 255, 0.6);
  transition: transform var(--t-fast);
}

.dice::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 21px;
  background: linear-gradient(150deg, rgba(201, 168, 76, 0.55), transparent 45%, rgba(201, 168, 76, 0.4));
  z-index: -1;
  opacity: 0.35;
}

/* Toss-and-bounce roll — dice fly up, tumble, land and bounce to rest */
.dice.rolling { animation: diceToss 1.4s cubic-bezier(0.37, 0, 0.18, 1); }

@keyframes diceToss {
  0%   { transform: translateY(0) rotate(0deg); }
  18%  { transform: translateY(-54px) rotate(210deg); }
  38%  { transform: translateY(0) rotate(430deg); }
  52%  { transform: translateY(-28px) rotate(470deg); }
  66%  { transform: translateY(0) rotate(600deg); }
  78%  { transform: translateY(-14px) rotate(630deg); }
  88%  { transform: translateY(0) rotate(690deg); }
  95%  { transform: translateY(-5px) rotate(705deg); }
  100% { transform: translateY(0) rotate(720deg); }
}

/* ────────────────────────────────────────────────────────────────
   16. SLOTS
   ──────────────────────────────────────────────────────────────── */
.slots-container {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: var(--sp-4) 0;
  padding: var(--sp-4);
  background: linear-gradient(160deg, var(--surface-1), var(--bg-base));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--inset-lo);
}

.slot-reel {
  width: 92px; height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 46px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--inset-lo);
}

.slot-symbol { position: relative; }
.slot-symbol.tick { animation: slotTick 0.1s linear; }
.slot-symbol.landing { animation: symbolLand 0.5s var(--t-spring); }

@keyframes symbolLand {
  0%   { transform: translateY(110%) scale(0.6); opacity: 0; }
  60%  { transform: translateY(-8px) scale(1.12); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes slotTick {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  40%  { transform: translateY(55%) scale(0.7); opacity: 0.35; }
  60%  { transform: translateY(-55%) scale(0.7); opacity: 0.35; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.slot-reel.spinning .slot-symbol { animation: slotRapid 0.1s linear infinite; }

@keyframes slotRapid {
  0%   { transform: translateY(-2px); opacity: 0.75; }
  50%  { transform: translateY(2px); opacity: 0.95; }
  100% { transform: translateY(-2px); opacity: 0.75; }
}

/* Win glow — restrained, communicates outcome */
.slot-reel.win-glow { animation: slotWin 0.9s ease-in-out 2; }

@keyframes slotWin {
  0%, 100% { box-shadow: var(--inset-lo), 0 0 6px -2px rgba(201, 168, 76, 0.35); border-color: var(--border-strong); }
  50%      { box-shadow: var(--inset-lo), 0 0 22px -2px rgba(201, 168, 76, 0.65); border-color: var(--gold-dark); }
}

/* ────────────────────────────────────────────────────────────────
   17. BLACKJACK
   ──────────────────────────────────────────────────────────────── */
.bj-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: var(--sp-2) 0;
  min-height: 84px;
  perspective: 500px;
}

.bj-card {
  position: relative;
  width: 54px; height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #FFFFFF, #F0F0F2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  box-shadow: var(--e-2), 0 0 0 1px rgba(0, 0, 0, 0.06);
  animation: cardDeal 0.4s var(--t-spring) both;
}

/* Staggered dealing — each card lands a beat after the previous */
.bj-cards .bj-card:nth-child(1) { animation-delay: 0.05s; }
.bj-cards .bj-card:nth-child(2) { animation-delay: 0.18s; }
.bj-cards .bj-card:nth-child(3) { animation-delay: 0.31s; }
.bj-cards .bj-card:nth-child(4) { animation-delay: 0.44s; }
.bj-cards .bj-card:nth-child(5) { animation-delay: 0.57s; }
.bj-cards .bj-card:nth-child(6) { animation-delay: 0.7s; }

@keyframes cardDeal {
  0%   { transform: translateY(-24px) rotate(-6deg) scale(0.82); opacity: 0; }
  100% { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
}

.bj-card.hidden {
  background: linear-gradient(150deg, var(--surface-3), var(--surface-2));
  color: transparent;
  border: 1px solid var(--gold-dark);
  box-shadow: var(--e-2), inset 0 0 14px rgba(0, 0, 0, 0.4);
}

.bj-card.hidden::after {
  content: '?';
  color: var(--gold-main);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
}

.bj-card.red { color: #C62828; }
.bj-card.black { color: #1A1A1A; }

.bj-value {
  font-family: var(--font-display);
  font-size: var(--fs-h5);
  font-weight: 800;
  color: var(--gold-main);
  text-align: center;
  margin: var(--sp-1) 0;
}

/* ────────────────────────────────────────────────────────────────
   18. COINFLIP
   ──────────────────────────────────────────────────────────────── */
/* ────────────────────────────────────────────────────────────────
   19. WHEEL
   ──────────────────────────────────────────────────────────────── */
.wheel-wrapper { position: relative; margin: var(--sp-4) auto; }

.wheel { position: relative; border-radius: 50%; overflow: hidden; }

.wheel-pointer {
  position: absolute;
  top: -16px; left: 50%;
  transform: translateX(-50%);
  font-size: 26px;
  line-height: 1;
  color: var(--gold-light);
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

/* ────────────────────────────────────────────────────────────────
   20. MULTIPLIER TABLE
   ──────────────────────────────────────────────────────────────── */
.multiplier-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  font-size: var(--fs-body-sm);
}

.multiplier-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.multiplier-row .sym { font-size: 16px; }
.multiplier-row .mult { font-family: var(--font-mono); color: var(--gold-main); font-weight: 700; }

/* ────────────────────────────────────────────────────────────────
   21. PROFILE
   ──────────────────────────────────────────────────────────────── */
.profile-header { text-align: center; padding: var(--sp-5) 0 var(--sp-3); }

.profile-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-main);
  box-shadow: var(--e-3), var(--glow-soft);
  margin-bottom: var(--sp-3);
}

.profile-avatar-placeholder {
  width: 96px; height: 96px;
  margin: 0 auto var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--gold-dark);
  box-shadow: var(--e-2);
  font-size: 46px;
}

.profile-name {
  font-family: var(--font-display);
  font-size: var(--fs-h6);
  font-weight: 800;
}

.profile-balance {
  font-family: var(--font-mono);
  font-size: var(--fs-body-lg);
  font-weight: 700;
  color: var(--gold-main);
  margin-top: var(--sp-1);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-2);
  margin: var(--sp-4) 0;
}

.stat-item {
  text-align: center;
  padding: var(--sp-3) var(--sp-2);
  background: linear-gradient(160deg, rgba(201, 168, 76, 0.07), transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--t-fast), transform var(--t-fast);
}

.stat-item:hover { border-color: var(--gold-dark); }

.stat-value {
  font-family: var(--font-display);
  font-size: var(--fs-h6);
  font-weight: 700;
  color: var(--gold-main);
  margin-bottom: var(--sp-1);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Pickers */
.color-options { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: var(--sp-2) 0; }

.color-option {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.color-option::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color var(--t-fast);
}

.color-option:hover { transform: scale(1.1); }
.color-option.active { transform: scale(1.12); box-shadow: var(--glow-soft); }
.color-option.active::after { border-color: var(--text-hi); }

.emoji-options { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-2) 0; }

.emoji-option {
  font-size: 26px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  transition: transform var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}

.emoji-option:hover { transform: scale(1.08); border-color: var(--gold-dark); }
.emoji-option.active {
  border-color: var(--gold-main);
  background: var(--gold-pale);
  box-shadow: var(--glow-soft);
}

.lang-options { display: flex; gap: var(--sp-2); margin: var(--sp-2) 0; }

.lang-option {
  flex: 1;
  padding: var(--sp-3);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 700;
  font-size: var(--fs-body);
  cursor: pointer;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  transition: border-color var(--t-fast), background-color var(--t-fast);
}

.lang-option:hover { border-color: var(--gold-dark); }
.lang-option.active { border-color: var(--gold-main); background: var(--gold-pale); }

.lang-option .flag { font-size: 22px; display: block; margin-bottom: 2px; }
.lang-option .lang-name { font-size: var(--fs-body-sm); color: var(--text-secondary); }

/* ────────────────────────────────────────────────────────────────
   22. LEADERBOARD / ADMIN LISTS
   ──────────────────────────────────────────────────────────────── */
.top-list { display: flex; flex-direction: column; gap: var(--sp-2); }

.top-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: linear-gradient(160deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--e-1), var(--inset-hi);
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-base);
}

.top-item:hover { border-color: var(--gold-dark); box-shadow: var(--e-2), var(--inset-hi); }

.top-rank {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--gold-main);
  min-width: 34px;
  text-align: center;
}

.top-info { flex: 1; min-width: 0; }
.top-name { font-weight: 600; font-size: var(--fs-body); }
.top-balance { font-family: var(--font-mono); color: var(--gold-main); font-weight: 700; font-variant-numeric: tabular-nums; }

.top-avatar {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(201, 168, 76, 0.4);
  background: rgba(0, 0, 0, 0.3);
}

.top-avatar-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.admin-card {
  background: var(--card-bg);
  border: 1px solid rgba(240, 166, 58, 0.25);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}

.admin-card input { font-size: var(--fs-body-sm); padding: 10px 12px; }

.admin-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-caption);
  color: var(--text);
}

.admin-stats-table th {
  text-align: left;
  padding: 8px 6px;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid rgba(240, 166, 58, 0.3);
  white-space: nowrap;
}

.admin-stats-table td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.admin-stats-table td:not(:first-child),
.admin-stats-table th:not(:first-child) { text-align: right; }

.admin-mini-btn { width: auto; padding: 8px 10px; font-size: var(--fs-caption); line-height: 1; white-space: nowrap; }

.admin-am-label { color: #fff; font-weight: 700; }

.admin-stats-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: var(--sp-2);
  font-size: var(--fs-caption);
  color: var(--text-secondary);
}

.admin-stats-summary i { font-style: normal; }
.admin-stats-summary b { color: var(--gold-main); }
.admin-stats-summary .admin-sub { color: var(--text-secondary); }

/* ────────────────────────────────────────────────────────────────
   23. DAILY BONUS
   ──────────────────────────────────────────────────────────────── */
.daily-bonus-btn {
  position: relative;
  overflow: hidden;
  display: block;
  background: linear-gradient(120deg, rgba(201, 168, 76, 0.16), rgba(240, 166, 58, 0.08));
  border: 1px solid rgba(201, 168, 76, 0.35);
  color: var(--gold-light);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--e-2), var(--inset-hi);
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-base);
}

/* Purposeful pulse — draws attention to claimable reward */
.daily-bonus-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(201, 168, 76, 0.09), transparent);
  animation: bonusPulse 2.6s ease-in-out infinite;
}

.daily-bonus-btn:hover { border-color: rgba(201, 168, 76, 0.6); transform: translateY(-1px); box-shadow: var(--e-3), var(--glow-soft); }
.daily-bonus-btn:active { transform: scale(0.985); }

.daily-bonus-btn.claimed {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border);
  color: var(--text-secondary);
  cursor: not-allowed;
  box-shadow: none;
}

.daily-bonus-btn.claimed::before { display: none; }

@keyframes bonusPulse {
  0%, 100% { opacity: 0.2; }
  50%      { opacity: 0.9; }
}

/* ────────────────────────────────────────────────────────────────
   24. CASES
   ──────────────────────────────────────────────────────────────── */
.case-tabs {
  display: flex;
  gap: var(--sp-4);
  margin: var(--sp-3) 0 var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.case-tab {
  position: relative;
  flex: 1;
  text-align: center;
  padding: var(--sp-3) var(--sp-2);
  font-weight: 700;
  font-size: var(--fs-body);
  cursor: pointer;
  color: var(--text-secondary);
  background: none;
  border: none;
  transition: color var(--t-fast);
}

/* Underline indicator instead of color box — calm, clear */
.case-tab::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, var(--gold-main), var(--gold-light));
  box-shadow: 0 -2px 10px rgba(201, 168, 76, 0.4);
  transform: scaleX(0);
  transition: transform var(--t-base);
}

.case-tab.active { color: var(--gold-light); }
.case-tab.active::after { transform: scaleX(1); }

.case-tab:hover { color: var(--gold-main); }

.case-card {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: var(--sp-5) var(--sp-4);
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-4);
  box-shadow: var(--e-2), var(--inset-hi);
  animation: popIn 0.4s var(--t-base);
  transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
}

.case-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(226, 199, 119, 0.4), transparent);
}

.case-card:hover { border-color: var(--gold-dark); box-shadow: var(--e-3), var(--glow-soft), var(--inset-hi); }

.case-card.premium {
  border-color: rgba(201, 168, 76, 0.5);
  box-shadow: var(--e-3), var(--e-gold), var(--inset-hi);
}

.case-icon {
  font-size: 96px;
  line-height: 1;
  margin: var(--sp-4) 0 var(--sp-2);
  animation: float 3.5s ease-in-out infinite;
}

.case-icon-img {
  width: 96px; height: 96px;
  object-fit: contain;
  margin: var(--sp-4) 0 var(--sp-2);
  animation: float 3.5s ease-in-out infinite;
}

.case-name {
  font-family: var(--font-display);
  font-size: var(--fs-h6);
  font-weight: 800;
  color: var(--gold-main);
  margin-bottom: var(--sp-3);
}

.case-drops {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}

.case-drop-img {
  width: 44px; height: 44px;
  object-fit: contain;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
}

.case-drop-chance {
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--sp-3);
}

.case-open-btn { width: 100%; }

.case-open-row { display: flex; gap: var(--sp-2); align-items: stretch; }
.case-open-row .case-open-btn { flex: 1; }

.case-cart-btn {
  width: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-deep);
  border: 1px solid var(--gold-dark);
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, var(--gold-light), var(--gold-main) 60%, var(--gold-dark));
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--e-1);
  transition: filter var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

.case-cart-btn:hover { filter: brightness(1.07); box-shadow: var(--e-2), var(--glow-soft); }
.case-cart-btn:active { transform: scale(0.94); }

.case-buy-menu {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  padding: var(--sp-3);
  border: 1px solid var(--gold-dark);
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, rgba(201, 168, 76, 0.12), rgba(0, 0, 0, 0.28));
  animation: fadeIn 0.25s var(--t-base);
}

.case-buy-menu .case-buy-title {
  font-family: var(--font-display);
  font-size: var(--fs-body-sm);
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.04em;
}

.case-owned-badge {
  display: inline-block;
  font-size: var(--fs-caption);
  font-weight: 700;
  color: var(--gold-light);
  background: var(--gold-pale);
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  margin-bottom: var(--sp-3);
}

.case-buy-row { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.case-buy-btn { flex: 1; white-space: nowrap; }

/* ────────────────────────────────────────────────────────────────
   25. CASE REVEAL (MODAL)
   ──────────────────────────────────────────────────────────────── */
.case-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  background: rgba(7, 9, 14, 0.88);
  animation: fadeIn 0.25s ease;
}

.case-reveal-box {
  width: 84%;
  max-width: 360px;
  max-height: 82vh;
  overflow-y: auto;
  text-align: center;
  padding: var(--sp-6) var(--sp-5);
  border-radius: var(--radius-xl);
  background: var(--card-bg);
  border: 1px solid var(--gold-dark);
  box-shadow: var(--e-5), var(--e-gold), var(--inset-hi);
  animation: popIn 0.45s var(--t-spring);
  -webkit-overflow-scrolling: touch;
}

.case-reveal-label {
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: var(--sp-2);
}

.case-reveal-img {
  width: 120px; height: 120px;
  object-fit: contain;
  animation: revealDrop 0.6s var(--t-spring);
}

@keyframes revealDrop {
  0%   { transform: scale(0.2) rotate(-18deg) translateY(-70px); opacity: 0; }
  55%  { transform: scale(1.12) rotate(5deg) translateY(6px); opacity: 1; }
  100% { transform: scale(1) rotate(0) translateY(0); }
}

.case-reveal-name {
  font-family: var(--font-display);
  font-size: var(--fs-h6);
  font-weight: 800;
  color: var(--gold-main);
  margin: var(--sp-3) 0 var(--sp-1);
}

.case-reveal-value {
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  margin-bottom: var(--sp-5);
}

.case-reveal-actions { display: flex; gap: var(--sp-2); }
.case-reveal-actions .btn { flex: 1; }

/* ────────────────────────────────────────────────────────────────
   26. CASE OPENING ANIMATION
   ──────────────────────────────────────────────────────────────── */
.case-open-box {
  width: 84%;
  max-width: 360px;
  text-align: center;
  padding: var(--sp-6) var(--sp-5);
  border-radius: var(--radius-xl);
  background: var(--card-bg);
  border: 1px solid var(--gold-dark);
  box-shadow: var(--e-5), var(--e-gold), var(--inset-hi);
  animation: popIn 0.4s var(--t-base);
}

.case-open-icon { font-size: 64px; line-height: 1; margin-bottom: var(--sp-2); animation: caseShake 0.5s ease-in-out infinite; }
.case-open-icon-img { width: 64px; height: 64px; object-fit: contain; margin-bottom: var(--sp-2); animation: caseShake 0.5s ease-in-out infinite; }

@keyframes caseShake {
  0%, 100% { transform: translateY(0) rotate(0); }
  25%      { transform: translateY(-5px) rotate(-4deg); }
  75%      { transform: translateY(5px) rotate(4deg); }
}

.case-open-label {
  font-family: var(--font-display);
  font-size: var(--fs-body-sm);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: var(--sp-4);
}

.case-open-window {
  position: relative;
  width: 160px; height: 228px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-strong);
  box-shadow: var(--inset-lo);
}

.case-win-marker {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 36px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(180deg, #2B2B33, #16161C);
  border: 2px solid var(--gold-main);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 12px -2px rgba(201, 168, 76, 0.5);
  pointer-events: none;
  animation: markerPulse 1.1s ease-in-out infinite;
}

.case-win-marker-left { left: 6px; }
.case-win-marker-right { right: 6px; }

@keyframes markerPulse {
  0%, 100% { box-shadow: 0 0 6px -2px rgba(201, 168, 76, 0.35); }
  50%      { box-shadow: 0 0 18px -2px rgba(201, 168, 76, 0.7); }
}

.case-open-window::before,
.case-open-window::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 34px;
  z-index: 2;
  pointer-events: none;
}

.case-open-window::before { top: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent); }
.case-open-window::after  { bottom: 0; background: linear-gradient(0deg, rgba(0, 0, 0, 0.55), transparent); }

.case-open-strip {
  display: flex;
  flex-direction: column;
  transition: transform 4.2s var(--ease-out-quart);
}

.case-open-slot {
  width: 84px; height: 68px;
  margin: 4px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.case-open-strip-img {
  width: 56px; height: 56px;
  object-fit: contain;
  margin: 0 auto;
  opacity: 0.88;
}

.case-open-reel { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); padding: var(--sp-2); border-radius: var(--radius-md); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border); min-height: 64px; }

.case-open-reel-img {
  width: 44px; height: 44px;
  object-fit: contain;
  opacity: 0.18;
  transform: scale(0.85);
  filter: grayscale(1) brightness(0.5);
  transition: all 0.08s ease;
}

.case-open-reel-img.on {
  opacity: 1;
  transform: scale(1.15);
  filter: none;
}

/* ────────────────────────────────────────────────────────────────
   27. INVENTORY
   ──────────────────────────────────────────────────────────────── */
.inv-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-3);
  box-shadow: var(--e-1), var(--inset-hi);
  animation: popIn 0.3s var(--t-base);
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-base);
}

.inv-item:hover { border-color: var(--gold-dark); box-shadow: var(--e-2), var(--inset-hi); }

.inv-img {
  width: 52px; height: 52px;
  flex-shrink: 0;
  object-fit: contain;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
}

.inv-info { flex: 1; min-width: 0; }

.inv-name {
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-sub { font-size: var(--fs-body-sm); color: var(--text-secondary); margin-top: 2px; }

.inv-sell-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.inv-qty {
  width: 72px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--fs-body-sm);
  font-weight: 700;
  text-align: center;
}

.inv-sell-btn { width: auto; padding: 10px 14px; font-size: var(--fs-body-sm); flex-shrink: 0; }

/* ────────────────────────────────────────────────────────────────
   28. TOAST / SPINNER / SKELETON / CONFETTI
   ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 92px; left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  max-width: 90%;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-full);
  background: rgba(26, 33, 50, 0.96);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: var(--fs-body-sm);
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--e-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base), transform var(--t-base);
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

.spinner {
  display: inline-block;
  width: 30px; height: 30px;
  margin: var(--sp-5) auto;
  border: 3px solid var(--border-strong);
  border-top-color: var(--gold-main);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton screens — shimmer placeholders for async content */
.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
}

.skeleton-row {
  position: relative;
  overflow: hidden;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.skeleton-row::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer { to { transform: translateX(100%); } }

.confetti-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 8px; height: 8px;
  animation: confettiFall 2.8s ease-out forwards;
}

@keyframes confettiFall {
  0%   { transform: translateY(-10px) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg) scale(0.5); opacity: 0; }
}

/* ────────────────────────────────────────────────────────────────
   29. KEYFRAMES (SHARED)
   ──────────────────────────────────────────────────────────────── */
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.86); }
  55%  { opacity: 1; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

/* ────────────────────────────────────────────────────────────────
   30. RESPONSIVE
   ──────────────────────────────────────────────────────────────── */
@media (max-width: 400px) {
  .games-grid { grid-template-columns: 1fr 1fr; }
  .slot-reel { width: 82px; height: 82px; font-size: 40px; }
  .dice { width: 76px; height: 76px; font-size: 38px; }
  .balance-display { padding: 7px 12px; }
  .game-slot .game-icon { font-size: 30px; }
  .card { padding: var(--sp-4); }
}

@media (max-width: 340px) {
  .games-grid { grid-template-columns: 1fr; }
  .logo { font-size: 17px; }
  .balance-display .balance-value { font-size: 13px; }
}

/* ────────────────────────────────────────────────────────────────
   TOP UP (Telegram Stars)
   ──────────────────────────────────────────────────────────────── */
.pay-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-preset {
  flex: 1;
  min-width: 60px;
  text-align: center;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--gold-main);
  cursor: pointer;
  transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
}
.pay-preset:hover { border-color: rgba(201, 168, 76, 0.5); }
.pay-preset.active {
  background: var(--gold-main);
  color: var(--primary-dark);
  border-color: var(--gold-main);
  box-shadow: var(--shadow-gold);
}

/* ────────────────────────────────────────────────────────────────
   ADMIN TABS
   ──────────────────────────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: var(--sp-2);
  margin: var(--sp-3) 0 var(--sp-4);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.admin-tab {
  position: relative;
  flex: 1;
  white-space: nowrap;
  text-align: center;
  padding: var(--sp-3) var(--sp-2);
  font-weight: 700;
  font-size: var(--fs-body);
  cursor: pointer;
  color: var(--text-secondary);
  background: none;
  border: none;
  transition: color var(--t-fast);
}

.admin-tab::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, var(--gold-main), var(--gold-light));
  box-shadow: 0 -2px 10px rgba(201, 168, 76, 0.4);
  transform: scaleX(0);
  transition: transform var(--t-base);
}

.admin-tab.active { color: var(--gold-light); }
.admin-tab.active::after { transform: scaleX(1); }
.admin-tab:hover { color: var(--gold-main); }
.admin-tab .svg-icon { margin-right: 4px; }
.admin-tab .svg-icon svg { width: 15px; height: 15px; }

/* ────────────────────────────────────────────────────────────────
   PERFORMANCE: снижаем нагрузку на слабых WebView/Telegram
   ──────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
