    /* ===== БАЗОВЫЕ СТИЛИ ===== */
    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
      user-select: none;
    }
    body {
      background-color: #07080a;
      color: #ffffff;
      font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
      min-height: 100vh;
      display: flex;
      justify-content: center;
      align-items: flex-start;
      overflow-x: hidden;
      width: 100%;
      max-width: 100vw;
    }
    .app-wrapper {
      width: 100%;
      max-width: 480px;
      min-height: 100vh;
      background-color: #090a0d;
      position: relative;
      box-shadow: 0 0 40px rgba(0, 0, 0, 0.85);
      display: flex;
      flex-direction: column;
      overflow-x: hidden;
      padding-top: 60px;
      padding-bottom: 80px;
      z-index: 1;
      transition: filter 0.3s ease;
    }
    .app-wrapper.blurred {
      filter: blur(8px);
      pointer-events: none;
    }

    /* ===== HEADER ===== */
    .header {
      width: 100%;
      max-width: 480px;
      height: 60px;
      padding: 0 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: #181a21;
      border-bottom: 1px solid rgba(255, 255, 255, 0.07);
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
      position: fixed;
      top: 0;
      left: 50%;
      transform: translateX(-50%);
      z-index: 4000;
    }
    .brand-logo-container {
      display: flex;
      align-items: center;
      width: 140px;
      height: 48px;
      cursor: pointer;
      touch-action: manipulation;
    }
    .brand-logo-container:active { opacity: 0.8; transform: scale(0.98); }
    .brand-png-logo {
      width: 140px;
      height: 48px;
      object-fit: contain;
      object-position: left center;
      margin-left: -4px;
    }
    .balance-widget {
      display: flex;
      align-items: center;
      background: #222530;
      border-radius: 16px;
      padding: 4px 4px 4px 10px;
      gap: 8px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    }
    .gold-icon { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
    .balance-amount { font-size: 15px; font-weight: 800; color: #ffffff; letter-spacing: 0.5px; }
    .add-balance-btn {
      width: 32px; height: 32px;
      background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: none;
      color: #ffffff;
      font-size: 18px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.15s ease;
      box-shadow: 0 3px 10px rgba(59, 130, 246, 0.35);
    }
    .add-balance-btn:active { transform: scale(0.92); }

    /* ===== DROPS ===== */
    .drops-section { width: 100%; position: relative; margin-top: 10px; }
    .section-header { padding: 0 16px 8px 16px; display: flex; justify-content: space-between; align-items: center; }
    .section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: #64748b; }
    .drops-viewport-wrapper { position: relative; width: 100%; overflow: hidden; }
    .drops-viewport-wrapper::after {
      content: '';
      position: absolute;
      top: 0; right: 0; bottom: 0;
      width: 60px;
      background: linear-gradient(to right, rgba(9, 10, 13, 0) 0%, #090a0d 100%);
      pointer-events: none;
      z-index: 10;
    }
    .drops-viewport { width: 100%; padding: 4px 0 10px 16px; overflow: hidden; display: flex; align-items: flex-start; gap: 8px; box-sizing: border-box; }
    .drops-track { flex: 1 1 auto; min-width: 0; display: flex; gap: 8px; transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1); }

    .so2-card {
      --rarity-rgb: 156, 163, 175;
      flex: 0 0 125px;
      height: 86px;
      background-color: #14151a;
      border-radius: 12px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
      animation: dropAppear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
      border: 1px solid rgba(255, 255, 255, 0.05);
    }
    @keyframes dropAppear {
      0% { opacity: 0; transform: translateX(-25px) scale(0.88); }
      100% { opacity: 1; transform: translateX(0) scale(1); }
    }
    .so2-card-body {
      position: relative;
      flex: 1;
      background: radial-gradient(circle at 50% 50%, rgba(var(--rarity-rgb), 0.55) 0%, rgba(var(--rarity-rgb), 0.15) 70%, transparent 100%);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 2px;
    }
    .so2-card-body img { width: 95%; height: 95%; object-fit: contain; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.8)); }
    .so2-card-divider { width: 100%; height: 1px; background-color: rgba(0, 0, 0, 0.35); border-top: 1px solid rgba(var(--rarity-rgb), 0.2); }
    .so2-card-footer {
      height: 25px;
      padding: 0 8px;
      display: flex;
      align-items: center;
      background: linear-gradient(180deg, rgba(var(--rarity-rgb), 0.15) 0%, rgba(12, 13, 16, 0.95) 100%);
    }
    .so2-user-info { display: flex; align-items: center; gap: 5px; width: 100%; }
    .so2-avatar {
      width: 14px; height: 14px;
      border-radius: 50%;
      background: #282a36;
      border: 1px solid rgba(255, 255, 255, 0.15);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      overflow: hidden;
    }
    .so2-avatar-img {
    width:100%;
    height:100%;
    border-radius:50%;
    object-fit:cover;
    object-position:center;
    background:#20232c;
}
    .so2-skin-name { font-size: 10px; font-weight: 600; color: #d1d5db; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .so2-card.nameless  { --rarity-rgb: 245, 196, 68; }
    .so2-card.arcane    { --rarity-rgb: 239, 68, 68; }
    .so2-card.legendary { --rarity-rgb: 236, 72, 153; }
    .so2-card.epic      { --rarity-rgb: 168, 85, 247; }
    .so2-card.rare      { --rarity-rgb: 59, 130, 246; }
    .so2-card.uncommon  { --rarity-rgb: 56, 189, 248; }
    .so2-card.common    { --rarity-rgb: 156, 163, 175; }

    /* ===== CASES ===== */
    #casesSections {
      display: block;
      width: 100%;
      background: #090a0d;
    }
    .cases-section {
      position: relative;
      width: 100%;
      margin-top: 14px;
      padding: 24px 16px 0 16px;
    }
    .cases-section:last-child {
      min-height: calc(100vh - 180px);
      padding-bottom: 100px;
    }
    .cases-section + .cases-section {
      margin-top: 28px;
      padding-top: 0;
    }
    .cases-title-container { margin-bottom: 20px; }
    .cases-main-title {
      font-size: 15px;
      font-weight: 900;
      color: #f5c444;
      text-transform: uppercase;
      letter-spacing: 0.6px;
      line-height: 1.25;
      text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
    }
    .cases-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px 14px; }
    .case-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: transform 0.15s ease; }
    .case-item:active { transform: scale(0.95); }
    .case-image-wrapper { position: relative; width: 100%; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; }
    .case-image { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.8)); }
    .case-price-badge {
      position: absolute;
      bottom: 2px;
      left: 50%;
      transform: translateX(-50%);
      background: linear-gradient(135deg, #ffbe55 0%, #f59e0b 100%);
      color: #0d0e12;
      font-weight: 900;
      font-size: 13px;
      padding: 5px 16px;
      border-radius: 10px;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
      white-space: nowrap;
    }
    .case-title { margin-top: 10px; font-size: 13px; font-weight: 800; color: #ffffff; text-align: center; text-transform: uppercase; }

    /* ===== ОРУЖИЕ: КЕЙСЫ-КАРУСЕЛЬ (одна строка) ===== */
    .weapon-carousel-section { position: relative; }
    .weapon-carousel-wrap {
      position: relative;
      display: flex;
      align-items: center;
      gap: 6px;
      margin: 0 -16px;
      padding: 22px 10px 16px 10px;
      min-height: 200px;
      overflow: hidden;
    }
    .weapon-carousel-bg {
      position: absolute;
      inset: 0;
      z-index: 0;
      overflow: hidden;
    }
    .weapon-carousel-bg img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
      display: block;
      pointer-events: none;
      -webkit-touch-callout: none;
      -webkit-user-drag: none;
      user-select: none;
    }
    /* Прозрачный слой поверх фонового изображения — блокирует
       контекстное меню/долгий тап/перетаскивание, чтобы фон нельзя было сохранить. */
    .weapon-carousel-bg-shield {
      position: absolute;
      inset: 0;
      z-index: 1;
      background: transparent;
      -webkit-touch-callout: none;
      touch-action: manipulation;
    }
    .weapon-arrow {
      position: relative;
      z-index: 3;
      flex: 0 0 auto;
      width: 34px;
      height: 34px;
      border-radius: 50%;
      background: rgba(20, 21, 26, 0.65);
      border: 1px solid rgba(255, 255, 255, 0.16);
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
      transition: opacity 0.15s ease, transform 0.15s ease;
      padding: 0;
    }
    .weapon-arrow:active { transform: scale(0.9); }
    .weapon-arrow:disabled { opacity: 0.3; cursor: default; }
    .weapon-arrow svg { width: 18px; height: 18px; display: block; }
    .weapon-carousel-viewport {
      position: relative;
      z-index: 2;
      flex: 1;
      overflow: hidden;
    }
    .weapon-carousel-track {
      display: flex;
      align-items: center;
      gap: 10px;
      transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
      will-change: transform;
    }
    .weapon-case-item {
      flex: 0 0 118px;
      display: flex;
      flex-direction: column;
      align-items: center;
      opacity: 0.42;
      transform: scale(0.8);
      filter: brightness(0.5);
      transition: opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease;
      pointer-events: none;
      cursor: default;
    }
    .weapon-case-item .case-image-wrapper {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
}
    .weapon-case-item .case-title {
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
  text-transform: uppercase;
  margin-top: 8px;
  white-space: normal; /* перенос строки */
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.2;
  max-width: 100%;
  padding: 0 4px;
  min-height: 24px; /* чтобы все карточки были одинаковой высоты */
  display: -webkit-box;
  -webkit-line-clamp: 2; /* максимум 2 строки */
  -webkit-box-orient: vertical;
  overflow: hidden;
}
    .weapon-case-item .case-price-badge { font-size: 12px; padding: 4px 12px; }
    .weapon-case-item.active {
      opacity: 1;
      transform: scale(1.02);
      filter: brightness(1) drop-shadow(0 8px 20px rgba(0, 0, 0, 0.6));
      pointer-events: auto;
      cursor: pointer;
    }
    .weapon-case-item.active:active { transform: scale(1.02); }

    /* ===== CASE DETAILS ===== */
    .case-details-page {
      position: fixed;
      top: 60px;
      left: 50%;
      transform: translateX(-50%);
      width: 100%;
      max-width: 480px;
      bottom: 0;
      background: #090a0d;
      background-attachment: fixed;
      z-index: 2000;
      display: none;
      flex-direction: column;
      overflow-y: auto;
      padding-bottom: 100px;
    }
    .case-details-page.active { display: flex; }
    .details-header {
      padding: 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: sticky;
      top: 0;
      background: rgba(14, 15, 18, 0.85);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      z-index: 40;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    .details-title-group { display: flex; align-items: center; gap: 12px; }
    .back-btn {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.12);
      width: 38px; height: 38px;
      border-radius: 12px;
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      padding: 0;
      transition: background 0.2s ease, transform 0.15s ease;
    }
    .back-btn:active { transform: scale(0.92); background: rgba(255, 255, 255, 0.15); }
    .back-btn svg { width: 20px; height: 20px; display: block; }
    .details-page-title { font-size: 16px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; color: #ffffff; }
    .case-hero-section { display: flex; flex-direction: column; align-items: center; padding: 12px 16px 0 16px; position: relative; }
    .case-hero-image-wrapper {
      width: 200px; height: 200px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), margin 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
      margin-bottom: 12px;
    }
    .case-hero-img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.8)); }
    .case-hero-image-wrapper.spinning { transform: scale(0.55) translateY(-25px); margin-bottom: -35px; }

    .opening-controls {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: #181a23;
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 20px;
      padding: 4px 6px 4px 10px;
      width: 100%;
      max-width: 340px;
      margin-bottom: 16px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
      transition: opacity 0.3s ease, visibility 0.3s;
    }
    .opening-controls.hidden { opacity: 0; visibility: hidden; pointer-events: none; height: 0; margin-bottom: 0; padding: 0; overflow: hidden; }
    .multiplier-group { display: flex; align-items: center; gap: 2px; }
    .mult-btn {
      background: transparent;
      border: none;
      color: #8b95a5;
      font-size: 11px;
      font-weight: 700;
      padding: 4px 8px;
      border-radius: 10px;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .mult-btn.active { background: #2a2d3d; color: #ffffff; }
    .fast-open-toggle { display: flex; align-items: center; gap: 8px; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, 0.08); }
    .fast-open-label { font-size: 11px; font-weight: 600; color: #8b95a5; }
    .toggle-switch { position: relative; display: inline-block; width: 32px; height: 18px; }
    .toggle-switch input { opacity: 0; width: 0; height: 0; }
    .toggle-slider {
      position: absolute;
      cursor: pointer;
      top: 0; left: 0; right: 0; bottom: 0;
      background-color: #2a2d3d;
      transition: .3s;
      border-radius: 18px;
    }
    .toggle-slider:before {
      position: absolute;
      content: "";
      height: 12px;
      width: 12px;
      left: 3px;
      bottom: 3px;
      background-color: white;
      transition: .3s;
      border-radius: 50%;
    }
    .toggle-switch input:checked + .toggle-slider { background-color: #3b82f6; }
    .toggle-switch input:checked + .toggle-slider:before { transform: translateX(14px); }

    .roulette-container {
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 12px;
      margin: 6px 0 16px 0;
      opacity: 0;
      max-height: 0;
      overflow: hidden;
      transition: opacity 0.4s ease, max-height 0.4s ease;
    }
    .roulette-container.active { opacity: 1; max-height: 800px; overflow: visible; }
    .roulette-row { position: relative; width: 100%; height: 90px; }
    .roulette-pointer {
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      z-index: 35;
      width: 0;
      height: 0;
      filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
    }
    .roulette-pointer.top { top: -5px; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid #f5c444; }
    .roulette-pointer.bottom { bottom: -5px; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 9px solid #f5c444; }
    .roulette-fade-left {
      position: absolute;
      top: 0; bottom: 0; left: 0;
      width: 60px;
      background: linear-gradient(to right, #090a0d 30%, transparent 100%);
      pointer-events: none;
      z-index: 25;
    }
    .roulette-fade-right {
      position: absolute;
      top: 0; bottom: 0; right: 0;
      width: 60px;
      background: linear-gradient(to left, #090a0d 30%, transparent 100%);
      pointer-events: none;
      z-index: 25;
    }
    .roulette-viewport {
      width: 100%;
      height: 100%;
      overflow: hidden;
      position: relative;
      border-top: 1px solid rgba(255, 255, 255, 0.06);
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
      background: rgba(14, 15, 18, 0.6);
      border-radius: 8px;
    }
    .roulette-track {
      display: flex;
      align-items: center;
      height: 100%;
      position: absolute;
      top: 0;
      left: 0;
      will-change: transform;
    }
    .roulette-card {
  --rarity-rgb: 156, 163, 175;
  --rarity-color: #9ca3af;
  flex: 0 0 120px;
  height: 80px;
  margin-right: 8px;
  background: #14161f;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}
.roulette-card-glow { position:absolute; inset:0; background:radial-gradient(ellipse at bottom,var(--rarity-color) 0%,transparent 75%); opacity:.38; pointer-events:none; filter:blur(8px); }
.roulette-card-bottom-pill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--rarity-color);
  box-shadow: 0 -2px 8px var(--rarity-color);
}
.roulette-card-img-wrap { position:relative; width:100%; height:78px; min-height:78px; display:flex; align-items:center; justify-content:center; z-index:2; }
.roulette-card-img-wrap img { max-width:96%; max-height:96%; object-fit:contain; filter:drop-shadow(0 8px 12px rgba(0,0,0,.65)); }
.roulette-card-info { position:relative; z-index:3; min-width:0; display:flex; flex-direction:column; gap:2px; }
.roulette-card-weapon { font-size:9px; font-weight:700; color:#8f96a3; text-transform:uppercase; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.roulette-card-stattrak { color:#ffd700; font-weight:800; margin-right:2px; }
.roulette-card-name { font-size:12px; font-weight:800; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.roulette-card-price { font-size:11px; font-weight:800; color:#10b981; }
.roulette-card.won-card {
  transform: scale(1.06);
  border: 2px solid var(--rarity-color);
  box-shadow: 0 0 22px rgba(var(--rarity-rgb), 0.95);
  z-index: 10;
  opacity: 1 !important;
}
.roulette-card.dimmed-card { opacity: 0.3; filter: brightness(0.5); }
.roulette-card.arcane    { --rarity-rgb: 239, 68, 68;  --rarity-color: #ef4444; }
.roulette-card.legendary { --rarity-rgb: 236, 72, 153; --rarity-color: #ec4899; }
.roulette-card.epic      { --rarity-rgb: 168, 85, 247; --rarity-color: #a855f7; }
.roulette-card.rare      { --rarity-rgb: 59, 130, 246; --rarity-color: #3b82f6; }
.roulette-card.uncommon  { --rarity-rgb: 56, 189, 248; --rarity-color: #38bdf8; }
.roulette-card.common    { --rarity-rgb: 156, 163, 175; --rarity-color: #9ca3af; }

    .action-area {
      width: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-bottom: 20px;
      min-height: 56px;
      justify-content: center;
    }
    .action-state-idle { display: flex; flex-direction: column; align-items: center; width: 100%; }
    .open-case-btn {
      width: 100%;
      max-width: 290px;
      height: 48px;
      background: linear-gradient(135deg, #f5c444 0%, #f59e0b 100%);
      border: none;
      border-radius: 14px;
      color: #0d0e12;
      font-weight: 900;
      font-size: 15px;
      letter-spacing: 0.5px;
      cursor: pointer;
      box-shadow: 0 0 22px rgba(245, 196, 68, 0.45), 0 4px 15px rgba(0, 0, 0, 0.5);
      transition: transform 0.15s ease, box-shadow 0.15s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }
    .open-case-btn:active { transform: scale(0.96); }
    .balance-notice { font-size: 11px; font-weight: 700; color: #f87171; margin-top: 8px; height: 14px; text-align: center; }
    .action-state-opening { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
    .loader-dots { display: flex; gap: 8px; }
    .loader-dots span {
      width: 10px; height: 10px;
      border-radius: 50%;
      background: #f59e0b;
      animation: dotPulse 1.2s infinite ease-in-out both;
    }
    .loader-dots span:nth-child(1) { animation-delay: -0.32s; }
    .loader-dots span:nth-child(2) { animation-delay: -0.16s; }
    @keyframes dotPulse {
      0%, 80%, 100% { transform: scale(0.5); opacity: 0.3; }
      40% { transform: scale(1.2); opacity: 1; }
    }
    .loader-text { font-size: 12px; font-weight: 900; color: #f59e0b; letter-spacing: 1.5px; text-transform: uppercase; }
    .action-state-result { display: flex; gap: 10px; width: 100%; max-width: 340px; }
    .result-btn {
      flex: 1;
      height: 46px;
      border-radius: 12px;
      border: none;
      font-size: 11px;
      font-weight: 800;
      color: #ffffff;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      transition: transform 0.15s ease;
      text-transform: uppercase;
      padding: 0 8px;
    }
    .result-btn:active { transform: scale(0.96); }
    .retry-btn { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); box-shadow: 0 4px 14px rgba(234, 88, 12, 0.4); font-weight: 900 !important; font-size: 13px !important; }
    .sell-btn { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%); box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4); font-weight: 900 !important; font-size: 13px !important; }

    .contents-title-container { width: 100%; margin-bottom: 12px; }
    .contents-title { font-size: 15px; font-weight: 900; color: #ffffff; text-transform: uppercase; letter-spacing: 0.8px; }
    .skins-grid { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 10px; 
  width: 100%; 
  padding: 0 12px 16px; 
  box-sizing: border-box; 
}

    /* ===== UNIFIED SKIN CARDS: CASES ===== */
.skin-card { 
  --card-color:#808080; 
  position:relative; 
  background:#12141c; 
  border-radius:12px; 
  padding:8px; 
  display:flex; 
  flex-direction:column; 
  justify-content:space-between; 
  min-width:0; 
  height:100px; 
  box-sizing:border-box; 
  overflow:hidden; 
  border:1px solid rgba(255,255,255,.06); 
  box-shadow:0 4px 12px rgba(0,0,0,.35); 
}   
    .skin-card:hover { transform:translateY(-3px); }
    .skin-card::before { content:''; position:absolute; bottom:-10%; left:-20%; right:-20%; height:85%; background:radial-gradient(ellipse at bottom,var(--card-color) 0%,transparent 75%); opacity:.45; pointer-events:none; filter:blur(10px); }
    .skin-card::after { content:''; position:absolute; bottom:0; left:0; right:0; height:5px; background:var(--card-color); box-shadow:0 0 15px 2px var(--card-color); }
.skin-card-body { 
  position:relative; 
  flex:1; 
  min-height:0; 
  display:flex; 
  align-items:flex-start; 
  justify-content:center; 
  z-index:1; 
  padding-top:7px;
}
.skin-card-body img { 
  width:100%; 
  height:70px; 
  object-fit:contain; 
  filter:drop-shadow(0 6px 10px rgba(0,0,0,.6)); 
}
    .stattrack-icon,.inv-stattrack-icon,.roulette-stattrack-icon { position:absolute; z-index:5; filter:drop-shadow(0 2px 8px rgba(0,0,0,.9)); }
    .stattrack-icon { bottom:3px; left:3px; width:24px; height:19px; }
    .inv-stattrack-icon { bottom:4px; left:4px; width:28px; height:22px; }
    .roulette-stattrack-icon { bottom:3px; left:3px; width:22px; height:17px; }
    .drop-stattrack-icon { position:absolute; bottom:2px; left:2px; width:18px; height:14px; z-index:5; filter:drop-shadow(0 2px 8px rgba(0,0,0,.9)); }
.skin-card-info { 
  z-index:1; 
  display:flex; 
  flex-direction:column; 
  gap:1px; 
  min-width:0; 
  padding-top:2px;
}
    .skin-card-weapon { 
  font-size:8px; 
  font-weight:800; 
  color:#8b95a5; 
  text-transform:uppercase; 
  letter-spacing:.3px; 
  white-space:nowrap; 
  overflow:hidden; 
  text-overflow:ellipsis; 
}
.skin-card-stattrak { 
  color:#f5c444; 
  font-weight:700; 
  margin-right:2px; 
}
.skin-card-name { 
  font-size:10px; 
  font-weight:650; 
  color:#fff; 
  line-height:1.2; 
  white-space:nowrap; 
  overflow:hidden; 
  text-overflow:ellipsis; 
}
.skin-card-price { 
  font-size:11px; 
  font-weight:900; 
  color:#10b981; 
  white-space:nowrap; 
}
    .skin-card-chance { font-size:10px; font-weight:800; color:#aeb6c7; margin-top:2px; }
    .skin-card-chance-badge { position:absolute; top:5px; right:6px; z-index:3; display:flex; flex-direction:column; align-items:flex-end; line-height:1.1; pointer-events:none; text-shadow:0 1px 4px rgba(0,0,0,.8); }
    .skin-card-chance-label { font-size:6px; font-weight:700; color:#7f8797; letter-spacing:.4px; }
    .skin-card-chance-value { font-size:8px; font-weight:800; color:#d5dae6; }
    .skin-card.nameless { --card-color:#ffaa00; } .skin-card.arcane { --card-color:#ff3333; } .skin-card.legendary { --card-color:#ff2a8d; } .skin-card.epic { --card-color:#a855f7; } .skin-card.rare { --card-color:#1e66ff; } .skin-card.uncommon { --card-color:#00bfff; } .skin-card.common { --card-color:#808080; }
    @media (max-width:330px) { .skins-grid{gap:10px;padding-left:10px;padding-right:10px;} .skin-card{height:205px;padding:10px;} .skin-card-body img{height:104px;} .skin-card-name{font-size:14px;} }

    /* ===== INVENTORY ===== */
    .inventory-skins-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 0 4px 100px 4px; }
    .inventory-unified-card { height:235px; padding:10px; }
    .inventory-unified-image { margin-top:26px; }
    .inventory-unified-image img { height:112px; }
    .inventory-unified-actions { position:absolute; top:10px; left:10px; right:10px; z-index:4; display:flex; gap:6px; justify-content:space-between; }
    .inventory-unified-actions button { border:0; border-radius:9px; padding:6px 8px; font-size:9px; font-weight:900; cursor:pointer; color:#fff; background:rgba(20,22,28,.88); border:1px solid rgba(255,255,255,.08); backdrop-filter:blur(5px); }
    .inventory-unified-actions .inv-sell-btn { color:#ff6b7a; } .inventory-unified-actions .inv-get-btn { color:#45d483; }
    .history-skin-card { background:#14151a; border-radius:12px; padding:8px; min-height:96px; border:1px solid rgba(255,255,255,.05); display:flex; flex-direction:column; justify-content:space-between; }
    .history-skin-img { height:54px; display:flex; align-items:center; justify-content:center; } .history-skin-img img{max-width:90%;max-height:54px;object-fit:contain;}
    .history-skin-name{font-size:10px;font-weight:700;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} .history-skin-price{font-size:10px;font-weight:800;color:#f5c444;}

    .inventory-skin-card {
  --rarity-rgb: 156, 163, 175;
  --rarity-color: #9ca3af;
  position: relative;
  background: linear-gradient(145deg, rgba(var(--rarity-rgb), 0.22) 0%, rgba(14, 15, 20, 0.95) 75%);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(var(--rarity-rgb), 0.2);
  border: 1px solid rgba(var(--rarity-rgb), 0.4);
  min-height: 0;
  height: 190px;
}
.inventory-skin-card.nameless  { --rarity-rgb: 245, 196, 68; --rarity-color: #f5c444; }
.inventory-skin-card.arcane    { --rarity-rgb: 239, 68, 68;  --rarity-color: #ef4444; }
.inventory-skin-card.legendary { --rarity-rgb: 236, 72, 153; --rarity-color: #ec4899; }
.inventory-skin-card.epic      { --rarity-rgb: 168, 85, 247; --rarity-color: #a855f7; }
.inventory-skin-card.rare      { --rarity-rgb: 59, 130, 246; --rarity-color: #3b82f6; }
.inventory-skin-card.uncommon  { --rarity-rgb: 56, 189, 248; --rarity-color: #38bdf8; }
.inventory-skin-card.common    { --rarity-rgb: 156, 163, 175; --rarity-color: #9ca3af; }
.inv-top-bar { width: 100%; display: flex; align-items: center; justify-content: space-between; z-index: 5; }
.inv-sell-btn {
  background: #47c68d;
  color: #0b2217;
  border: none;
  border-radius: 8px;
  font-weight: 900;
  font-size: 11px;
  padding: 6px 12px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(71, 198, 141, 0.3);
  text-transform: uppercase;
}
.inv-sell-btn:active { transform: scale(0.95); }
.inv-price-tag { font-size: 13px; font-weight: 800; color: #47c68d; }
.inv-image-wrapper {
  position: relative;
  width: 100%;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin: 6px 0;
}
.inv-image-wrapper img { max-width: 85%; max-height: 75px; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7)); z-index: 2; }
.inv-get-btn {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  width: 90%;
  padding: 6px 0;
  background: rgba(42, 45, 61, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #fce3c7;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  text-align: center;
  white-space: nowrap;
}
.inv-get-btn:active { transform: translateX(-50%) scale(0.95); }
.inv-title-info { width: 100%; text-align: center; z-index: 5; }
.inv-weapon-stat { font-size: 11px; font-weight: 700; color: var(--rarity-color); margin-bottom: 2px; text-transform: uppercase; }
.inv-skin-title { font-size: 14px; font-weight: 900; color: #ffffff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    /* ===== SIDE MENU ===== */
    .backdrop-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
      z-index: 2800;
      display: none;
      opacity: 0;
      transition: opacity 0.3s ease;
    }
    .backdrop-overlay.active { display: block; opacity: 1; }
    .side-menu {
      position: fixed;
      top: 0px;
      right: -320px;
      width: 300px;
      bottom: 64px;
      background: #12141c;
      z-index: 3000;
      box-shadow: -8px 0 30px rgba(0, 0, 0, 0.85);
      border-left: 1px solid rgba(255, 255, 255, 0.08);
      display: flex;
      flex-direction: column;
      transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
      padding-top: 10px;
      transform: translateX(0);
      will-change: transform;
    }
    .side-menu.open { transform: translateX(-320px); }
    .menu-header { padding: 16px 20px; font-size: 18px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: #ffffff; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
    .menu-items { display: flex; flex-direction: column; padding: 10px 0; }
    .menu-item-btn {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 20px;
      background: transparent;
      border: none;
      color: #d1d5db;
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.2s ease, color 0.2s ease;
      width: 100%;
    }
    .menu-item-btn:active, .menu-item-btn.active { background: rgba(255, 255, 255, 0.05); color: #f5d061; }
    .menu-item-left { display: flex; align-items: center; gap: 14px; }
    .menu-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
    .menu-icon svg { width: 100%; height: 100%; fill: #828282; transition: fill 0.2s ease; }
    .menu-item-btn:hover .menu-icon svg,
    .menu-item-btn.active .menu-icon svg { fill: #f5d061; }
    .withdraw-badge {
      background: #ef4444;
      color: #ffffff;
      font-size: 11px;
      font-weight: 800;
      padding: 2px 8px;
      border-radius: 12px;
      box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    }

    .profile-card {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 18px 20px 16px 20px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
      background: radial-gradient(circle at 0% 0%, rgba(245, 208, 97, 0.09) 0%, transparent 60%);
    }
    .profile-avatar-wrap {
      position: relative;
      width: 62px;
      height: 62px;
      flex-shrink: 0;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      background: conic-gradient(#f5d061 calc(var(--p, 0) * 1%), rgba(255, 255, 255, 0.1) 0);
      cursor: pointer;
      touch-action: manipulation;
    }
    .profile-avatar-wrap:active { transform: scale(0.96); }
    .profile-avatar-img {
      width: 54px;
      height: 54px;
      border-radius: 50%;
      object-fit: cover;
      object-position:center;
      border: 2px solid #12141c;
      background: #1c1e28;
    }
    .avatar-edit-btn {
      position: absolute;
      right: -2px;
      bottom: -2px;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
      border: 2px solid #12141c;
      display: flex;
      align-items: center;
      justify-content: center;
      pointer-events: none;
    }
    .avatar-edit-btn svg { width: 11px; height: 11px; fill: #ffffff; }
    .profile-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
    .profile-name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
    .profile-nickname { font-size: 15px; font-weight: 800; color: #ffffff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .profile-level-badge {
      flex-shrink: 0;
      font-size: 10px;
      font-weight: 900;
      color: #0d0e12;
      background: linear-gradient(135deg, #f5d061 0%, #f59e0b 100%);
      padding: 2px 7px;
      border-radius: 8px;
      letter-spacing: 0.3px;
    }
    .xp-bar-track { width: 100%; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
    .xp-bar-fill {
      height: 100%;
      border-radius: 4px;
      background: linear-gradient(90deg, #f5d061 0%, #f59e0b 100%);
      transition: width 0.5s cubic-bezier(0.25, 1, 0.5, 1);
      width: 0%;
    }
    .xp-bar-label { font-size: 10px; font-weight: 700; color: #8b95a5; letter-spacing: 0.2px; }

    /* ===== NAV AVATAR ===== */
    .nav-avatar-wrap { position: relative; width: 26px; height: 26px; border-radius: 50%; }
    .nav-avatar-img {
      width: 100%; height: 100%;
      border-radius: 50%;
      object-fit: cover;
      border: 1.5px solid rgba(255, 255, 255, 0.15);
      display: block;
    }
    .nav-item.active .nav-avatar-img { border-color: #f5d061; }
    .nav-avatar-level {
      position: absolute;
      right: -5px;
      bottom: -5px;
      min-width: 14px;
      height: 14px;
      padding: 0 3px;
      border-radius: 7px;
      background: #f5d061;
      color: #0d0e12;
      font-size: 9px;
      font-weight: 900;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1.5px solid #10121a;
    }

    /* ===== LEVELS ===== */
    .level-tier-card {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 14px;
      border-radius: 14px;
      background: #14151a;
      border: 1px solid rgba(255, 255, 255, 0.06);
      margin-bottom: 10px;
      opacity: 0.55;
    }
    .level-tier-card.achieved { opacity: 1; }
    .level-tier-card.current {
      border-color: rgba(245, 208, 97, 0.55);
      background: linear-gradient(90deg, rgba(245, 208, 97, 0.1) 0%, #14151a 60%);
      box-shadow: 0 4px 14px rgba(245, 208, 97, 0.12);
    }
    .level-tier-badge {
      flex-shrink: 0;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      font-weight: 900;
      color: #0d0e12;
      background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    }
    .level-tier-card.achieved .level-tier-badge { background: linear-gradient(135deg, #f5d061 0%, #f59e0b 100%); }
    .level-tier-info { flex: 1; min-width: 0; }
    .level-tier-name { font-size: 14px; font-weight: 800; color: #ffffff; }
    .level-tier-req { font-size: 11px; font-weight: 700; color: #64748b; margin-top: 2px; }
    .level-tier-reward { font-size: 12px; font-weight: 600; color: #f5d061; margin-top: 4px; }
    .level-tier-check {
      flex-shrink: 0;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: rgba(34, 197, 94, 0.15);
      color: #22c55e;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      font-weight: 900;
    }

    .levelup-toast {
      position: fixed;
      top: 70px;
      left: 50%;
      transform: translateX(-50%) translateY(-20px);
      max-width: 300px;
      width: calc(100% - 40px);
      display: flex;
      align-items: center;
      gap: 12px;
      background: #181a21;
      border: 1px solid rgba(245, 208, 97, 0.35);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
      border-radius: 14px;
      padding: 12px 14px;
      z-index: 6000;
      opacity: 0;
      transition: opacity 0.35s ease, transform 0.35s ease;
      pointer-events: none;
    }
    .levelup-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
    .levelup-toast-icon { font-size: 24px; }
    .levelup-toast-title { font-size: 13px; font-weight: 900; color: #f5d061; }
    .levelup-toast-sub { font-size: 12px; font-weight: 600; color: #d1d5db; margin-top: 1px; }

    /* ===== GAMES SHEET ===== */
    .games-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 4900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.games-sheet-overlay.open { opacity: 1; pointer-events: auto; }
.games-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  width: 100%;
  max-width: 480px;
  background: #12141c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  z-index: 5000;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom)) 16px;
  transform: translate(-50%, 100%);
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
}
.games-sheet.open { transform: translate(-50%, 0); }
.games-sheet-handle { width: 40px; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.15); margin: 4px auto 14px auto; }
.games-sheet-title { font-size: 15px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.8px; color: #ffffff; margin-bottom: 14px; }
.games-sheet-grid { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 10px; 
  width: 100%;
  box-sizing: border-box;
}

.game-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
  background: #181a21;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.15s ease;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

.game-tile:active { transform: scale(0.97); }

.game-tile-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 10px;
}

.game-tile-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.game-tile-name {
  font-size: clamp(12px, 3vw, 15px);
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #f2c94c;
  text-transform: uppercase;
  line-height: 1;
  /* Убираем обрезание */
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.game-tile-sub {
  font-size: clamp(10px, 2.2vw, 12px);
  color: #9a9fb0;
  line-height: 1.3;
  /* Убираем обрезание */
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.game-tile.tile-cases { 
  background: linear-gradient(135deg, rgba(245, 208, 97, 0.15) 0%, #181a21 65%); 
  border-color: rgba(245, 208, 97, 0.15);
}
.game-tile.tile-upgrade { 
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, #181a21 65%); 
  border-color: rgba(59, 130, 246, 0.15);
}
.game-tile.tile-contracts { 
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, #181a21 65%); 
  border-color: rgba(168, 85, 247, 0.15);
}

    /* ===== ITEM PICKER ===== */
    .item-picker-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 45vh; overflow-y: auto; margin-top: 12px; }
    .item-picker-card { background: #1a1c24; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 10px; padding: 6px; text-align: center; cursor: pointer; }
    .item-picker-card.selected { border-color: #f5d061; background: rgba(245, 208, 97, 0.1); }
    .item-picker-card img { width: 44px; height: 44px; object-fit: contain; }
    .item-picker-card-price { font-size: 10px; font-weight: 800; color: #f5d061; margin-top: 2px; }

    /* ===== CONTRACTS ===== */
.contracts-inventory-grid { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 8px; 
  padding: 2px 0;
}

.contracts-item-card {
  position: relative;
  background: #14151a;
  border: 2px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: 0.25s ease;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.contracts-item-card.selected {
  border-color: var(--rarity-color, #f5c444) !important;
  box-shadow: 0 0 18px rgba(245, 196, 68, 0.45), inset 0 0 18px rgba(245, 196, 68, 0.2);
  transform: translateY(-2px);
}
.contracts-item-card img { 
  width: 40px; 
  height: 40px; 
  object-fit: contain; 
}
.contracts-item-price { 
  font-size: 9px; 
  font-weight: 800; 
  color: #f5d061; 
  margin-top: 2px; 
}
.contracts-item-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #a855f7;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
}
.contracts-item-card.selected .contracts-item-check { display: flex; }
.contracts-summary-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; font-weight: 700; color: #d1d5db; }
.contracts-summary-value { color: #f5d061; font-weight: 900; }

/* Стили для скролла как в апгрейде */
.upgrade-scroll::-webkit-scrollbar {
  width: 4px;
}
.upgrade-scroll::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
}
.upgrade-scroll::-webkit-scrollbar-thumb {
  background: #262f52;
  border-radius: 4px;
}

    /* ===== CONTRACTS RESULT ===== */
    .contracts-result-popup {
      position: fixed; inset: 0; background: rgba(0,0,0,0.78); backdrop-filter: blur(8px);
      display: none; align-items: center; justify-content: center; z-index: 9999;
    }
    .contracts-result-popup.show { display: flex; }
    .contracts-result-card {
      width: 280px; padding: 24px; border-radius: 24px; text-align: center;
      background: #14151a;
      animation: contractReveal .55s cubic-bezier(.2,1.5,.4,1);
      box-shadow: 0 0 40px rgba(245,196,68,.5);
      border: 3px solid #f5c444;
    }
    .contracts-result-card.nameless { border-color: #f5c444 !important; box-shadow: 0 0 60px rgba(245,196,68,0.95) !important; }
    .contracts-result-card.arcane { border-color: #ef4444 !important; box-shadow: 0 0 50px rgba(239,68,68,0.7) !important; }
    .contracts-result-card.legendary { border-color: #ec4899 !important; box-shadow: 0 0 50px rgba(236,72,153,0.7) !important; }
    .contracts-result-card.epic { border-color: #a855f7 !important; box-shadow: 0 0 50px rgba(168,85,247,0.7) !important; }
    .contracts-result-card.rare { border-color: #3b82f6 !important; box-shadow: 0 0 50px rgba(59,130,246,0.7) !important; }
    .contracts-result-card.uncommon { border-color: #38bdf8 !important; box-shadow: 0 0 50px rgba(56,189,248,0.7) !important; }
    .contracts-result-card.common { border-color: #9ca3af !important; box-shadow: 0 0 50px rgba(156,163,175,0.7) !important; }
    .contracts-result-card img { width: 150px; height: 150px; object-fit: contain; filter: drop-shadow(0 10px 20px rgba(0,0,0,.8)); }
    .contracts-result-name { font-size: 20px; font-weight: 900; margin-top: 12px; }
    .contracts-result-price { color: #47c68d; font-weight: 900; margin-top: 8px; }
    @keyframes contractReveal {
      0% { transform: scale(.3) rotate(-15deg); opacity: 0; }
      100% { transform: scale(1) rotate(0); opacity: 1; }
    }

    /* ===== CONTRACT MERGE OVERLAY ===== */
    .contract-merge-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.85);
      backdrop-filter: blur(12px);
      z-index: 9998;
      display: none;
      align-items: center;
      justify-content: center;
      flex-direction: column;
    }
    .contract-merge-overlay.active { display: flex; }
    .merge-container { position: relative; width: 300px; height: 300px; }
    .merge-card {
      position: absolute;
      width: 60px;
      height: 60px;
      border-radius: 12px;
      background: #1a1c24;
      border: 2px solid rgba(255,255,255,0.1);
      overflow: hidden;
      transition: all 0.8s cubic-bezier(0.2, 0.9, 0.3, 1);
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .merge-card img { width: 90%; height: 90%; object-fit: contain; }
    .merge-flash {
      position: absolute;
      inset: 0;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(245,196,68,0.8) 0%, transparent 70%);
      opacity: 0;
      animation: flashPulse 1s ease-in-out infinite;
    }
    @keyframes flashPulse {
      0%, 100% { opacity: 0.3; transform: scale(0.8); }
      50% { opacity: 0.8; transform: scale(1.2); }
    }
    .merge-result {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(0);
      width: 100px;
      height: 100px;
      border-radius: 16px;
      background: #1a1c24;
      border: 3px solid #f5c444;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: transform 0.5s cubic-bezier(0.2, 1.5, 0.4, 1);
      overflow: hidden;
    }
    .merge-result.pop { transform: translate(-50%, -50%) scale(1); }
    .merge-result img { width: 85%; height: 85%; object-fit: contain; }
    .merge-progress { margin-top: 20px; width: 200px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
    .merge-progress-fill {
      height: 100%;
      width: 0%;
      background: linear-gradient(90deg, #f5c444, #f59e0b);
      border-radius: 2px;
      transition: width 0.1s linear;
    }
    .merge-status-text { color: #f5c444; font-size: 14px; font-weight: 700; margin-top: 12px; letter-spacing: 1px; text-transform: uppercase; }


    /* ===== CHAT ===== */
    .app-page.chat-page {
        padding: 20px 16px 0 16px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        height: 100%;
        position: fixed;
        top: 60px;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        max-width: 480px;
        bottom: 64px;
        background: #090a0d;
        z-index: 2200;
        display: none;
        flex-direction: column;
    }

    .app-page.chat-page.active {
        display: flex;
    }

    .app-page .page-title {
        font-size: 18px;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: #ffffff;
        flex-shrink: 0;
    }

    .chat-messages {
        display: flex;
        flex-direction: column;
        gap: 12px;
        flex: 1;
        overflow-y: auto;
        padding: 4px 0 200px 0;
        min-height: 0;
        scrollbar-width: none;
    }

    .chat-messages::-webkit-scrollbar {
        display: none;
    }

    .chat-message-row { display: flex; gap: 8px; align-items: flex-start; }
    .chat-message-row.own { flex-direction: row-reverse; }
    .chat-avatar-img { width:30px;height:30px;border-radius:50%;object-fit:cover;object-position:center;background:#20232c;flex-shrink:0;}
    .chat-message-body { max-width: 74%; }
    .chat-message-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; flex-wrap: wrap; }
    .chat-message-row.own .chat-message-meta { flex-direction: row-reverse; }
    .chat-nickname { font-size: 11px; font-weight: 800; color: #d1d5db; }
    
    /* ===== БЕЙДЖИ В ЧАТЕ ===== */
    .chat-badge {
        font-size: 9px;
        font-weight: 900;
        padding: 2px 8px;
        border-radius: 6px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        display: inline-flex;
        align-items: center;
        gap: 3px;
        animation: badgeAppear 0.3s ease;
    }
    
    @keyframes badgeAppear {
        0% { transform: scale(0.8); opacity: 0; }
        100% { transform: scale(1); opacity: 1; }
    }
    
    .chat-badge.badge-novice { 
        background: rgba(59, 130, 246, 0.18); 
        color: #60a5fa;
        border: 1px solid rgba(59, 130, 246, 0.3);
    }
    
    .chat-badge.badge-pro { 
        background: rgba(168, 85, 247, 0.18); 
        color: #c084fc;
        border: 1px solid rgba(168, 85, 247, 0.3);
    }
    
    .chat-badge.badge-legend { 
        background: linear-gradient(135deg, #f5d061 0%, #f59e0b 100%); 
        color: #0d0e12;
        border: 1px solid rgba(245, 196, 68, 0.5);
        box-shadow: 0 0 15px rgba(245, 196, 68, 0.3);
    }
    
    /* ===== ЭКСКЛЮЗИВНЫЙ БЕЙДЖ АДМИНА ===== */
    .chat-badge.badge-admin {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 1000;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(
        135deg,
        #ffcc33,
        #ff6b00,
        #ff0055,
        #8b5cf6
    );
    background-size: 300% 300%;
    animation: adminGlow 3s ease infinite;
    box-shadow:
        0 0 8px rgba(255, 170, 0, .8),
        0 0 18px rgba(255, 0, 100, .5);
    border: 1px solid rgba(255,255,255,.35);
    overflow: hidden;
}

.chat-badge.badge-admin::before {
    display: none;
}

.chat-badge.badge-admin::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 20%,
        rgba(255,255,255,.8),
        transparent 80%
    );
    transform: translateX(-120%);
    animation: adminShine 2.5s infinite;
}

@keyframes adminGlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes adminShine {
    100% {
        transform: translateX(120%);
    }
}

    .chat-bubble { 
        background: #181a21; 
        border: 1px solid rgba(255, 255, 255, 0.06); 
        border-radius: 12px; 
        padding: 8px 12px; 
        font-size: 13px; 
        color: #e5e7eb; 
        line-height: 1.4; 
        word-break: break-word; 
    }
    .chat-message-row.own .chat-bubble { 
        background: linear-gradient(135deg, rgba(245, 208, 97, 0.16) 0%, #181a21 100%); 
        border-color: rgba(245, 208, 97, 0.3); 
    }

    .chat-input-bar {
        position: fixed;
        bottom: 64px;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        max-width: 480px;
        display: flex;
        gap: 8px;
        padding: 10px 16px;
        background: rgba(16, 18, 23, 0.97);
        backdrop-filter: blur(14px);
        border-top: 1px solid rgba(255, 255, 255, 0.07);
        z-index: 3500;
        height: 60px;
    }
    .chat-input-bar.hidden { display: none; }
    .chat-text-input {
        flex: 1;
        background: #14151a;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 20px;
        padding: 10px 16px;
        color: #ffffff;
        font-size: 13px;
        outline: none;
    }
    .chat-text-input:focus {
        border-color: #f5c444;
    }
    .chat-send-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: none;
        background: linear-gradient(135deg, #f5c444 0%, #f59e0b 100%);
        color: #0d0e12;
        font-size: 16px;
        font-weight: 900;
        cursor: pointer;
        flex-shrink: 0;
        transition: transform 0.15s ease;
    }
    .chat-send-btn:active {
        transform: scale(0.92);
    }

    /* ===== APP PAGES ===== */
    .app-page {
      position: fixed;
      top: 60px;
      left: 50%;
      transform: translateX(-50%);
      width: 100%;
      max-width: 480px;
      bottom: 0;
      background: #090a0d;
      z-index: 2200;
      display: none;
      flex-direction: column;
      overflow-y: auto;
      padding: 20px 16px 100px 16px;
    }
    .app-page.active { display: flex; }
    .page-title { font-size: 18px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.8px; color: #ffffff; margin-bottom: 16px; }

    /* ===== TOP UP PAGE ===== */
    .topup-page-content {
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 18px;
    }
    .topup-description {
      background: #181a21;
      border: 1px solid rgba(255,255,255,0.07);
      border-radius: 16px;
      padding: 16px;
      color: #cbd5e1;
      font-size: 13px;
      line-height: 1.55;
      font-weight: 600;
    }
    .topup-label {
      font-size: 12px;
      font-weight: 800;
      color: #8b95a5;
      text-transform: uppercase;
      letter-spacing: .5px;
    }
    .topup-bot-balance {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 14px 16px;
      border-radius: 14px;
      background: #14161c;
      border: 1px solid rgba(255,255,255,0.07);
    }
    .topup-bot-balance strong {
      color: #f5c444;
      font-size: 17px;
      white-space: nowrap;
    }
    .topup-input-wrap {
      position: relative;
      width: 100%;
    }
    .topup-input {
      width: 100%;
      height: 52px;
      padding: 0 54px 0 16px;
      border-radius: 14px;
      border: 1px solid rgba(255,255,255,0.09);
      background: #181a21;
      color: #fff;
      outline: none;
      font-size: 16px;
      font-weight: 800;
      font-family: inherit;
      user-select: text;
    }
    .topup-input:focus {
      border-color: rgba(59,130,246,.7);
      box-shadow: 0 0 0 3px rgba(59,130,246,.12);
    }
    .topup-input::placeholder { color: #64748b; font-size: 12px; font-weight: 600; }
    .topup-input-suffix {
      position: absolute;
      right: 16px;
      top: 50%;
      transform: translateY(-50%);
      color: #f5c444;
      font-size: 14px;
      font-weight: 900;
      pointer-events: none;
    }
    .topup-transfer-btn {
      width: 100%;
      height: 50px;
      border: none;
      border-radius: 14px;
      background: #3a3d45;
      color: #8b95a5;
      font-size: 14px;
      font-weight: 900;
      cursor: pointer;
      transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
    }
    .topup-transfer-btn.ready {
      background: linear-gradient(135deg,#3b82f6 0%,#2563eb 100%);
      color: #fff;
      box-shadow: 0 5px 18px rgba(59,130,246,.3);
    }
    .topup-transfer-btn:active { transform: scale(.97); }
    .topup-transfer-btn:disabled { cursor: not-allowed; opacity: 1; }
    .topup-message {
      min-height: 20px;
      text-align: center;
      font-size: 12px;
      line-height: 1.4;
      font-weight: 700;
    }
    .topup-message.error { color: #f87171; }
    .topup-message.success { color: #4ade80; }
    .topup-message.info { color: #94a3b8; }
    .topup-back-btn {
      width: 100%;
      height: 44px;
      border: 1px solid rgba(255,255,255,.08);
      border-radius: 13px;
      background: rgba(255,255,255,.05);
      color: #cbd5e1;
      font-weight: 800;
      cursor: pointer;
    }

    .empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; margin-top: 60px; text-align: center; gap: 16px; }
    .empty-state-text { font-size: 14px; color: #8b95a5; font-weight: 600; }
    .go-home-btn {
      background: linear-gradient(135deg, #f5c444 0%, #f59e0b 100%);
      color: #0d0e12;
      font-weight: 900;
      font-size: 14px;
      padding: 12px 28px;
      border-radius: 12px;
      border: none;
      cursor: pointer;
      box-shadow: 0 4px 15px rgba(245, 196, 68, 0.35);
    }

    /* ===== BOTTOM NAV ===== */
    .bottom-nav {
      position: fixed;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 100%;
      max-width: 480px;
      height: 64px;
      background: rgba(16, 18, 23, 0.96);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border-top: 1px solid rgba(255, 255, 255, 0.07);
      display: flex;
      align-items: center;
      justify-content: space-around;
      z-index: 4000;
      padding-bottom: env(safe-area-inset-bottom);
      box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.5);
    }
    .nav-item {
      flex: 1;
      height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: #64748b;
      background: transparent;
      border: none;
      cursor: pointer;
      position: relative;
      transition: color 0.25s ease, filter 0.25s ease, transform 0.15s ease;
    }
    .nav-item:active { transform: scale(0.92); }
    .nav-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
    .nav-icon svg { width: 100%; height: 100%; fill: currentColor; }
    .nav-label { font-size: 11px; font-weight: 700; margin-top: 3px; letter-spacing: 0.3px; }
    .nav-item.active { color: #f5d061; filter: drop-shadow(0 0 7px rgba(245, 208, 97, 0.6)); }
    .nav-item.active .nav-label { text-shadow: 0 0 8px rgba(245, 208, 97, 0.5); color: #f5d061; }
    .nav-item.active::after {
      content: '';
      position: absolute;
      bottom: 4px;
      width: 16px;
      height: 3px;
      background: #f5d061;
      border-radius: 4px;
      box-shadow: 0 0 10px #f5d061;
    }

    .game-card-box {
    background: #14151a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 16px;
}

.game-sub-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748b;
    margin-bottom: 10px;
}

.upgrade-go-btn,
.contracts-go-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    background: linear-gradient(135deg, #f5c444 0%, #f59e0b 100%);
    color: #0d0e12;
    box-shadow: 0 6px 18px rgba(245, 196, 68, 0.3);
}

.upgrade-go-btn:disabled,
.contracts-go-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

    /* ===== UPGRADE PAGE ===== */
    .upgrade-wheel-section {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-bottom: 16px;
    }
    .upgrade-wheel-wrap {
      position: relative;
      width: 200px;
      height: 200px;
      filter: drop-shadow(0 8px 24px rgba(0,0,0,0.5));
    }
    .upgrade-wheel-wrap svg {
      width: 100%;
      height: 100%;
      display: block;
    }
    .needle-pointer {
      opacity: 0;
      transition: opacity 0.2s ease;
    }
    #upgNeedle.active .needle-pointer {
      opacity: 1;
    }
    .upgrade-center-readout {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      pointer-events: none;
    }
    .upgrade-chance {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 26px;
      font-weight: 600;
      color: #ffb020;
      text-shadow: 0 0 20px rgba(255,176,32,0.35);
      transition: color 0.2s ease;
    }
    .upgrade-chance-label {
      font-size: 8px;
      letter-spacing: 1.5px;
      text-transform: uppercase;
      color: #64708f;
      margin-top: 2px;
    }
    .upgrade-cta {
      width: 100%;
      max-width: 200px;
      margin-top: 14px;
      padding: 12px;
      border: none;
      border-radius: 8px;
      background: linear-gradient(180deg, #ffd23f, #ffb020);
      color: #1a1200;
      font-family: 'Chakra Petch', sans-serif;
      font-weight: 700;
      letter-spacing: 1.2px;
      text-transform: uppercase;
      font-size: 13px;
      cursor: pointer;
      box-shadow: 0 6px 18px -4px rgba(255,176,32,0.45);
      transition: transform 0.12s ease, box-shadow 0.12s ease;
    }
    .upgrade-cta:not(:disabled):active { transform: scale(0.97); }
    .upgrade-cta:disabled {
      background: #1c2140;
      color: #565d80;
      cursor: not-allowed;
      box-shadow: none;
    }
    .upgrade-result {
      text-align: center;
      margin-top: 10px;
      font-size: 12px;
      min-height: 18px;
      font-weight: 700;
      letter-spacing: 0.3px;
      transition: color 0.15s ease;
    }
    .upgrade-result.win { color: #33e18a; text-shadow: 0 0 14px rgba(51,225,138,0.3); }
    .upgrade-result.loss { color: #ff4d5e; }
    .upgrade-summary {
      display: flex;
      gap: 8px;
      justify-content: space-between;
      width: 100%;
      max-width: 200px;
      margin-top: 8px;
      background: rgba(12, 15, 26, 0.7);
      border: 1px solid rgba(255,255,255,0.05);
      border-radius: 8px;
      padding: 8px 10px;
    }
    .upgrade-stat {
      text-align: center;
      flex: 1;
      position: relative;
    }
    .upgrade-stat + .upgrade-stat::before {
      content: '';
      position: absolute;
      left: 0;
      top: 2px;
      bottom: 2px;
      width: 1px;
      background: rgba(255,255,255,0.06);
    }
    .upgrade-stat-val {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 13px;
      font-weight: 600;
      color: #eef1fb;
    }
    .upgrade-stat-label {
      font-size: 8px;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: #64708f;
      display: block;
      margin-top: 2px;
    }

    .upgrade-rows {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
      margin-top: 4px;
    }
    @media (max-width: 700px) {
      .upgrade-rows { grid-template-columns: 1fr; }
    }
    .upgrade-row {
      background: linear-gradient(180deg, #161c34, #10152a);
      border: 1px solid #262f52;
      border-radius: 12px;
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .upgrade-row-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 1.2px;
      color: #8f97b8;
      flex-shrink: 0;
    }
    .upgrade-row-hint {
      font-size: 10px;
      font-weight: 600;
      color: #64708f;
      text-transform: none;
      letter-spacing: 0.3px;
    }
    .upgrade-filter-btns {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      flex-shrink: 0;
      transition: opacity 0.15s ease;
    }
    .upgrade-filter-btns.disabled {
      opacity: 0.4;
      pointer-events: none;
    }
    .upgrade-filter-btn {
      flex: 1 1 auto;
      min-width: 40px;
      background: linear-gradient(180deg, #1a2038, #131829);
      border: 1px solid #262f52;
      border-radius: 7px;
      color: #9aa4c4;
      font-family: 'IBM Plex Mono', monospace;
      font-size: 10px;
      font-weight: 700;
      padding: 6px 4px;
      text-align: center;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .upgrade-filter-btn:active { transform: scale(0.94); }
    .upgrade-filter-btn.active {
      background: linear-gradient(180deg, #2a3a6e, #1a2348);
      border-color: #4f8bff;
      color: #ffffff;
      box-shadow: 0 0 0 1px #4f8bff, 0 0 14px -4px rgba(79,139,255,0.5);
    }
    .upgrade-scroll {
      max-height: 220px;
      overflow-y: auto;
      padding-right: 4px;
      margin-right: -4px;
    }
    .upgrade-scroll::-webkit-scrollbar {
      width: 4px;
    }
    .upgrade-scroll::-webkit-scrollbar-track {
      background: rgba(255,255,255,0.03);
      border-radius: 4px;
    }
    .upgrade-scroll::-webkit-scrollbar-thumb {
      background: #262f52;
      border-radius: 4px;
    }
    .upgrade-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
      gap: 6px;
      padding: 2px 0;
    }
    .upgrade-grid .empty-hint {
      grid-column: 1 / -1;
      text-align: center;
      padding: 18px 10px;
      color: #64708f;
      font-size: 12px;
      font-weight: 600;
    }
    .upgrade-item {
      --rc: #9ca3af;
      position: relative;
      background: linear-gradient(180deg, #141a2e, #0c0f1e);
      border: 1px solid rgba(255,255,255,0.06);
      border-top: 2px solid var(--rc);
      border-radius: 8px;
      padding: 6px 4px 4px;
      text-align: center;
      cursor: pointer;
      transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
      min-height: 80px;
    }
    .upgrade-item:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 18px -8px rgba(0,0,0,0.6);
    }
    .upgrade-item.selA {
      border-color: #ffb020;
      box-shadow: 0 0 0 1px #ffb020, 0 0 20px -4px rgba(255,176,32,0.35);
    }
    .upgrade-item.selB {
      border-color: #4f8bff;
      box-shadow: 0 0 0 1px #4f8bff, 0 0 20px -4px rgba(79,139,255,0.35);
    }
    .upgrade-item .uimg-wrap {
      width: 100%;
      height: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 2px;
    }
    .upgrade-item .uimg-wrap img {
      max-width: 90%;
      max-height: 44px;
      object-fit: contain;
      filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
    }
    .upgrade-item .uname {
      font-size: 8px;
      color: #d1d5db;
      line-height: 1.15;
      min-height: 16px;
      word-break: break-word;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .upgrade-item .uprice {
      font-size: 9px;
      font-family: 'IBM Plex Mono', monospace;
      color: #ffb020;
      margin-top: 2px;
      font-weight: 600;
    }
    .upgrade-item .uchance {
      position: absolute;
      top: 2px;
      right: 2px;
      font-family: 'IBM Plex Mono', monospace;
      font-size: 7px;
      font-weight: 700;
      padding: 1px 4px;
      border-radius: 3px;
      background: rgba(0,0,0,0.7);
      border: 1px solid rgba(255,255,255,0.06);
    }
  
    /* ================= MINI APP WITHDRAWAL UI ================= */
    .withdraw-card { position:relative; margin:10px 0; padding:14px; border-radius:16px; background:linear-gradient(145deg,#171a24,#10121a); border:1px solid rgba(255,255,255,.07); box-shadow:0 8px 25px rgba(0,0,0,.22); cursor:pointer; }
    .withdraw-card-top { display:flex; align-items:center; gap:12px; }
    .withdraw-card-img { width:66px; height:66px; border-radius:12px; object-fit:contain; background:#0c0e14; }
    .withdraw-card-info { min-width:0; flex:1; }
    .withdraw-card-name { font-weight:900; color:#fff; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .withdraw-card-sub { color:#8f96a8; font-size:11px; margin-top:4px; }
    .withdraw-card-price { color:#f5d061; font-size:15px; font-weight:900; margin-top:6px; }
    .withdraw-status { flex-shrink:0; display:inline-flex; align-items:center; gap:5px; border:0; border-radius:12px; padding:6px 8px; font-size:10px; font-weight:900; cursor:pointer; }
    .withdraw-status.pending { color:#ffb020; background:rgba(255,176,32,.12); }
    .withdraw-status.success { color:#45d483; background:rgba(69,212,131,.12); }
    .withdraw-status.cancelled { color:#9ca3af; background:rgba(156,163,175,.12); }
    .withdraw-status svg { width:17px; height:17px; fill:currentColor; }
    .withdraw-detail { margin-top:12px; padding-top:12px; border-top:1px solid rgba(255,255,255,.06); display:grid; gap:8px; }
    .withdraw-detail-row { display:flex; justify-content:space-between; gap:12px; font-size:12px; }
    .withdraw-detail-row span:first-child { color:#858c9c; }
    .withdraw-detail-row strong { color:#fff; text-align:right; }
    .withdraw-admin-user { display:flex; align-items:center; gap:9px; margin-bottom:10px; }
    .withdraw-admin-avatar { width:38px; height:38px; border-radius:50%; object-fit:cover; background:#1d2130; }
    .withdraw-admin-actions { display:flex; gap:8px; margin-top:12px; }
    .withdraw-admin-actions button { flex:1; border:0; border-radius:11px; padding:10px 8px; font-weight:900; cursor:pointer; }
    .withdraw-admin-actions .complete { background:#45d483; color:#07170e; }
    .withdraw-admin-actions .cancel { background:#2b2f39; color:#d1d5db; }
    .cancel-reason-btn { display:block; width:100%; margin-top:10px; padding:14px 16px; border:1px solid rgba(255,255,255,.08); border-radius:14px; background:#191c25; color:#fff; font-size:13px; font-weight:800; line-height:1.4; text-align:left; cursor:pointer; }
    .cancel-reason-btn:active { background:#232736; }
    .cancel-reason-close { display:block; width:100%; margin-top:14px; padding:12px; border:0; border-radius:12px; background:#2b2f39; color:#d1d5db; font-weight:900; cursor:pointer; }
    .withdraw-modal { position:fixed; inset:0; z-index:5000; display:none; align-items:flex-end; justify-content:center; background:rgba(0,0,0,.72); backdrop-filter:blur(7px); padding:12px; }
    .withdraw-modal.active { display:flex; }
    .withdraw-modal-card { width:min(520px,100%); max-height:92vh; overflow:auto; background:#12141c; border:1px solid rgba(255,255,255,.08); border-radius:24px 24px 18px 18px; padding:20px; box-shadow:0 -15px 50px rgba(0,0,0,.5); }
    .withdraw-modal-title { color:#fff; font-size:21px; font-weight:900; margin-bottom:7px; }
    .withdraw-modal-sub { color:#9ca3af; font-size:12px; line-height:1.45; margin-bottom:16px; }
    .withdraw-step { display:none; }
    .withdraw-step.active { display:block; }
    .withdraw-modal-avatar-wrap { display:flex; align-items:center; gap:13px; padding:13px; border-radius:15px; background:#191c25; }
    .withdraw-modal-avatar { width:62px; height:62px; border-radius:50%; object-fit:cover; background:#222634; border:2px solid #f5d061; }
    .withdraw-avatar-change { margin-left:auto; border:0; border-radius:10px; padding:10px 12px; background:#286ef1; color:#fff; font-weight:800; cursor:pointer; }
    .withdraw-primary { width:100%; margin-top:15px; border:0; border-radius:13px; padding:13px; background:#286ef1; color:#fff; font-size:15px; font-weight:900; cursor:pointer; }
    .withdraw-primary:disabled { background:#3a3d45; color:#858b96; cursor:not-allowed; }
    .withdraw-market-card { padding:14px; border-radius:16px; background:#191c25; }
    .withdraw-market-img { width:100%; height:140px; object-fit:contain; display:block; margin-bottom:10px; }
    .withdraw-price-copy { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:12px; border-radius:12px; background:#0f1118; cursor:pointer; }
    .withdraw-price-copy strong { color:#45d483; font-size:18px; }
    .withdraw-price-copy span { color:#858c9c; font-size:11px; }
    .withdraw-pattern {
      width:100%; box-sizing:border-box; margin-top:12px;
      border:1px solid rgba(255,255,255,.1); border-radius:12px;
      background:#0f1118; color:#fff; padding:12px; outline:none;
      font-size:16px; font-weight:700; letter-spacing:1px;
      user-select:text; -webkit-user-select:text;
    }
    .withdraw-pattern:focus { border-color:rgba(59,130,246,.65); box-shadow:0 0 0 3px rgba(59,130,246,.12); }

    /* ===== WITHDRAW CONFIRM CHECKBOX ===== */
    .withdraw-confirm-row {
      position:relative; display:flex; align-items:center; gap:12px;
      margin-top:13px; color:#b7bdc9; font-size:12px; line-height:1.4;
      cursor:pointer; user-select:none; -webkit-user-select:none;
    }
    .withdraw-confirm-row input {
      position:absolute; opacity:0; width:18px; height:18px; margin:0;
      cursor:pointer;
    }
    .withdraw-checkbox-box {
      width:18px; height:18px; border-radius:5px;
      border:2px solid rgba(255,255,255,.25); background:transparent;
      display:flex; align-items:center; justify-content:center; flex-shrink:0;
      transition:background .2s ease,border-color .2s ease,transform .15s ease;
    }
    .withdraw-checkbox-box svg { width:12px; height:10px; }
    .withdraw-checkbox-box path {
      stroke-dasharray:30; stroke-dashoffset:30;
      transition:stroke-dashoffset .25s ease;
    }
    .withdraw-confirm-row input:checked + .withdraw-checkbox-box {
      background:#22c55e; border-color:#22c55e;
    }
    .withdraw-confirm-row input:checked + .withdraw-checkbox-box path { stroke-dashoffset:0; }
    .withdraw-confirm-row input:active + .withdraw-checkbox-box { transform:scale(.9); }

    .withdraw-copy-btn {
      display:flex; align-items:center; gap:8px; padding:10px 16px;
      border-radius:12px; border:1px solid rgba(255,255,255,.06);
      background:rgba(255,255,255,.06); color:#fff; font-size:15px;
      font-weight:600; font-family:inherit; cursor:pointer;
      transition:all .2s ease; flex-shrink:0;
    }
    .withdraw-copy-icon-wrap { position:relative; width:18px; height:18px; flex-shrink:0; }
    .withdraw-copy-icon-wrap svg {
      position:absolute; top:0; left:0; opacity:1; transform:scale(1);
      transition:opacity .2s ease,transform .2s ease;
    }
    .withdraw-copy-icon-check { opacity:0 !important; transform:scale(.4) !important; }
    .withdraw-copy-btn.copied .withdraw-copy-icon-copy { opacity:0; transform:scale(.4); }
    .withdraw-copy-btn.copied .withdraw-copy-icon-check { opacity:1 !important; transform:scale(1) !important; }
    .withdraw-copy-btn.copied { border-color:rgba(34,197,94,.4); background:rgba(34,197,94,.1); color:#22c55e; }

    .withdraw-success-icon { width:56px; height:56px; border-radius:50%; display:grid; place-items:center; margin:0 auto 13px; background:rgba(69,212,131,.12); color:#45d483; }
    .withdraw-success-icon svg { width:30px; height:30px; fill:currentColor; }
    .withdraw-empty { padding:30px 16px; text-align:center; color:#7f8797; }

    /* ===== TOP DROP ===== */
    .top-drop-slot { flex: 0 0 auto; display: none; position: relative; }
    .top-drop-slot.has-top { display: flex; }
    .top-drop-crown {
      position: absolute; top: 1px; left: 1px;
      width: 20px; height: 20px; z-index: 6;
      filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.9));
      pointer-events: none;
    }
    .top-drop-crown svg { width: 100%; height: 100%; display: block; }

    /* ===== LEADERBOARD ===== */
    .lb-list { display: flex; flex-direction: column; gap: 8px; }
    .lb-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #14151a; border: 1px solid rgba(255,255,255,.05); border-radius: 16px; }
    .lb-row.first { background: rgba(245, 196, 68, 0.08); border-color: rgba(245, 196, 68, 0.18); margin-bottom: 8px; padding: 14px; }
    .lb-crown { width: 36px; height: 36px; border-radius: 10px; background: rgba(245, 196, 68, 0.14); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .lb-crown svg { width: 24px; height: 24px; display: block; }
    .lb-avatar { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: #20232c; flex-shrink: 0; }
    .lb-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: #fff; }
    .lb-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .lb-amount { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 900; color: #fff; white-space: nowrap; flex-shrink: 0; }
    .lb-row.first .lb-amount { color: #f5c444; }
    .lb-gold { width: 20px; height: 20px; object-fit: contain; }
    .lb-empty { text-align: center; color: #828282; font-size: 13px; font-weight: 700; padding: 30px 0; }
    .lb-note { text-align: center; color: #5d6270; font-size: 11px; font-weight: 700; margin-top: 14px; }

    /* ===== PROMO ===== */
    .case-promo-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 6px; width: 100%; }
    .case-promo-link { background: none; border: none; padding: 4px; color: #8d95a5; font-size: 12px; font-weight: 700; font-family: inherit; text-decoration: underline; cursor: pointer; }
    .case-promo-form { display: none; width: 100%; gap: 8px; }
    .case-promo-input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.09); background: #181a21; color: #fff; outline: none; font-size: 14px; font-weight: 800; font-family: inherit; text-transform: uppercase; user-select: text; }
    .case-promo-input::placeholder { color: #64748b; font-size: 12px; font-weight: 600; text-transform: none; }
    .case-promo-btn { height: 42px; padding: 0 14px; border: 0; border-radius: 12px; background: #f5c444; color: #111; font-size: 12px; font-weight: 900; font-family: inherit; cursor: pointer; }
    .case-promo-btn:disabled { opacity: .6; }
    .case-promo-msg { min-height: 14px; font-size: 12px; font-weight: 700; text-align: center; }
    .case-promo-msg.error { color: #f87171; }
    .case-promo-msg.success { color: #4ade80; }

    /* ===================================================================
       НОВАЯ СТРАНИЦА ПОПОЛНЕНИЯ (#topupPage)
       Картинки лежат в папке topupimg/ в корне сайта (путь из css/ -> ../topupimg/)
       =================================================================== */
    #topupPage {
      --tp-card: #121319;
      --tp-field: #1a1c25;
      --tp-gold: #f5c444;
      --tp-text-muted: #8d95a5;
      padding: 0 0 100px 0;
      font-family: 'Montserrat', 'Chakra Petch', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    }
    #topupPage, #topupPage *, #topupPage *::before, #topupPage *::after { box-sizing: border-box; }
    #topupPage h1, #topupPage p { margin: 0; }
    #topupPage .topup-banner, #topupPage .topup-content { flex-shrink: 0; }

/* =========================================================
   БАННЕР
   ========================================================= */
.topup-banner {
  /* --- настройки баннера --- */
  --banner-height: 200px;     /* высота баннера */
  --person-rise: 40px;        /* на сколько пикселей персонаж "поднимается" при открытии */
  --person-duration: .9s;     /* длительность появления персонажа */

  position: relative;
  height: var(--banner-height);
  overflow: hidden;
  background:
    url('../topupimg/topup-banner.webp') center / cover no-repeat,
    radial-gradient(120% 90% at 72% 42%, #4d2a96 0%, #251346 55%, #0d0a1c 100%);
}
/* мягкое затемнение снизу, как на макете */
.topup-banner::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 34px;
  background: linear-gradient(to bottom, rgba(9,10,13,0), rgba(9,10,13,.85));
  z-index: 4; pointer-events: none;
}

/* персонаж (кейс внутри картинки) */
.topup-person {
  position: absolute; right: 0; left: auto; bottom: 0;
  width: 420px; max-width: none; height: 100%;
  object-fit: contain; object-position: 250% bottom;
  z-index: 3;
  pointer-events: none;
}
.topup-banner.intro .topup-person {
  animation: tpPersonRise var(--person-duration) cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes tpPersonRise {
  from { transform: translateY(var(--person-rise)); }
  to   { transform: translateY(0); }
}

/* летающие слитки */
.float-bars { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.float-bar {
  position: absolute;
  animation: tpBarFloat var(--dur, 4s) ease-in-out var(--delay, 0s) infinite;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.45));
}
.float-bar svg, .float-bar img { width: 100%; height: auto; display: block; }
@keyframes tpBarFloat {
  0%, 100% { transform: scaleX(var(--flip, 1)) translateY(0) rotate(var(--rot, 0deg)); }
  50%      { transform: scaleX(var(--flip, 1)) translateY(var(--amp, -12px)) rotate(calc(var(--rot, 0deg) + 4deg)); }
}

/* текст на баннере */
.topup-banner-text { position: relative; z-index: 5; padding: 26px 18px 0; max-width: min(300px, calc(100% - 100px)); }
.topup-title { display: flex; flex-direction: column; font-weight: 900; font-style: italic; font-size: clamp(26px, 8.1vw, 34px); line-height: .98; letter-spacing: -.5px; text-transform: uppercase; }
.topup-title .t1 { background: linear-gradient(#ffffff, #afb0b8); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 3px 10px rgba(255, 255, 255, 0.568)); }
.topup-title .t2 { background: linear-gradient(#ffe590, #eba118); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 10px rgba(255, 255, 255, 0.466)); }
.topup-desc { margin-top: 1px; font-size: 10px; font-weight: 300; line-height: 1; color: #d9d4ea; text-shadow: 0 1px 6px rgba(0,0,0,.6); }

/* =========================================================
   КАРТОЧКИ
   ========================================================= */
.topup-content { padding: 6px 12px 0; display: flex; flex-direction: column; gap: 12px; }

.tp-card { border-radius: 18px; }

/* --- сумма --- */
.tp-amount-card {
  padding: 12px 14px 16px;
  background: linear-gradient(180deg, #15161c, #0e0f13);
  border: 1.5px solid rgba(245,196,68,.85);
  box-shadow: inset 0 0 0 1px rgba(245,196,68,.08), 0 0 7px rgba(245,196,68,.22);
  transform: translateY(-15px);
  z-index: 10;
}
.tp-amount-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.tp-gold-icon { width: 58px; height: auto; flex-shrink: 0; filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
.tp-amount-title { font-size: 15px; font-weight: 800; color: #d4d7ea; }

.tp-input-wrap { position: relative; }
.tp-input {
  width: 100%; height: 48px; padding: 0 16px;
  border-radius: 14px; border: 1px solid rgba(255,255,255,.07);
  background: var(--tp-field); color: #fff; outline: none;
  font-family: inherit; font-size: 15px; font-weight: 800;
}
.tp-input::placeholder { color: #66708a; font-size: 12.5px; font-weight: 600; }
.tp-input:focus { border-color: rgba(245,196,68,.55); box-shadow: 0 0 0 3px rgba(245,196,68,.1); }
.tp-amount-card .tp-input { padding-right: 46px; }
.tp-input-suffix { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--tp-gold); font-size: 17px; font-weight: 900; pointer-events: none; }

/* --- баланс в боте --- */
.tp-bot-card {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px 11px 12px;
  background: linear-gradient(135deg, rgba(92,62,190,.38), rgba(26,20,52,.95));
  border: 1px solid rgba(139,92,246,.38);
}
.tp-bot-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #9b6dff, #6a45e6);
  box-shadow: 0 4px 14px rgba(124,77,255,.4);
  color: #fff;
}
.tp-bot-icon svg { width: 22px; height: 22px; }
.tp-bot-label { flex: 1; font-size: 14px; font-weight: 700; color: #eceefa; }
.tp-bot-amount { font-size: 20px; font-weight: 800; color: var(--tp-gold); }

/* --- промокод --- */
.tp-promo-card { padding: 14px; background: var(--tp-card); border: 1px solid rgba(255,255,255,.07); }
.tp-promo-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tp-promo-icon { width: 26px; height: 26px; color: #9d7bff; filter: drop-shadow(0 2px 8px rgba(139,92,246,.45)); flex-shrink: 0; }
.tp-promo-title { font-size: 15.5px; font-weight: 800; color: #eceefa; }
.tp-promo-title span { font-weight: 500; color: var(--tp-text-muted); font-size: 14px; }

.tp-promo-row { display: flex; gap: 10px; }
.tp-promo-input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .5px; }
.tp-promo-input::placeholder { text-transform: none; letter-spacing: 0; }
.tp-promo-input:focus { border-color: rgba(139,92,246,.6); box-shadow: 0 0 0 3px rgba(139,92,246,.14); }

.tp-promo-apply {
  height: 48px; padding: 0 16px; flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  border: 0; border-radius: 14px; cursor: pointer;
  background: linear-gradient(180deg, #ffd45c, #f2a91d);
  box-shadow: 0 4px 14px rgba(245,184,46,.3), inset 0 1px 0 rgba(255,255,255,.45);
  color: #1b1200; font-family: inherit; font-size: 13.5px; font-weight: 900;
  transition: transform .15s ease, opacity .2s ease;
}
.tp-promo-apply svg { width: 20px; height: 20px; }
.tp-promo-apply:active { transform: scale(.96); }
.tp-promo-apply:disabled { opacity: .6; }

/* плашка с бонусом */
.tp-promo-chip {
  display: none; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 10px; padding: 10px 12px;
  border-radius: 12px;
  background: rgba(139,92,246,.1);
  border: 1px solid rgba(139,92,246,.5);
  color: #cfc0ff; font-size: 13px; font-weight: 600;
  animation: tpChipIn .3s ease both;
}
.tp-promo-chip.show { display: flex; }
.tp-promo-chip-close { width: 22px; height: 22px; flex-shrink: 0; border: 0; background: transparent; color: #cfc0ff; cursor: pointer; padding: 3px; }
.tp-promo-chip-close svg { width: 100%; height: 100%; display: block; }
@keyframes tpChipIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* --- кнопка перевода --- */
.tp-transfer-btn {
  position: relative; padding: 0;
  height: 54px; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 16px; cursor: pointer; overflow: hidden;
  background: linear-gradient(180deg, #ffd35a 0%, #f5b82e 45%, #e9960f 100%);
  box-shadow: 0 6px 20px rgba(245,184,46,.35), inset 0 1px 0 rgba(255,255,255,.5);
  color: #1b1200; font-family: inherit; font-size: 16px; font-weight: 900;
  transition: transform .15s ease;
}
.tp-transfer-btn:active { transform: scale(.98); }
.tp-transfer-btn:disabled { opacity: .7; cursor: wait; }
.tp-transfer-icon { width: 26px; height: 26px; }
.tp-arrows { position: absolute; top: 50%; transform: translateY(-50%); display: flex; gap: 1px; font-size: 30px; font-weight: 700; line-height: 1; color: rgba(120,70,0,.4); font-style: normal; }
.tp-arrows i { font-style: normal; }
.tp-arrows-left { left: 14px; }
.tp-arrows-right { right: 14px; }
.tp-arrows-left i:nth-child(1) { opacity: .35; } .tp-arrows-left i:nth-child(2) { opacity: .6; } .tp-arrows-left i:nth-child(3) { opacity: 1; }
.tp-arrows-right i:nth-child(1) { opacity: 1; } .tp-arrows-right i:nth-child(2) { opacity: .6; } .tp-arrows-right i:nth-child(3) { opacity: .35; }

.tp-message { min-height: 20px; text-align: center; font-size: 12px; font-weight: 700; line-height: 1.4; }
.tp-message.error { color: #f87171; }
.tp-message.success { color: #4ade80; }