/* ============ AKELLA GAME — minimal liquid glass (b/w) ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #0a0a0c;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4f5;
  --text-dim: rgba(244, 244, 245, 0.48);
  --gold: #f2c94c;
  --ok: #7ddba3;
  --danger: #ff7d92;
  --radius: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', -apple-system, 'Segoe UI', sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ---------- мягкие серые свечения на фоне (без неона) ---------- */
.glow {
  position: fixed; border-radius: 50%; z-index: 0; pointer-events: none;
  filter: blur(110px);
}
.glow-1 {
  width: 480px; height: 480px; top: -180px; left: -140px;
  background: rgba(255, 255, 255, 0.055);
  animation: drift1 20s ease-in-out infinite alternate;
}
.glow-2 {
  width: 420px; height: 420px; bottom: -160px; right: -140px;
  background: rgba(255, 255, 255, 0.04);
  animation: drift2 26s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(60px, 50px) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-50px, -60px) scale(1.12); } }

/* ---------- стекло ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-radius: var(--radius);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

#app { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: 14px 14px 100px; }

/* ---------- иконки ---------- */
.tic { display: inline-flex; vertical-align: middle; }
.tic svg { width: 1.1em; height: 1.1em; stroke: currentColor; }

/* ---------- шапка ---------- */
.header { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px 18px; }
/* на мобиле в fullscreen сверху висят кнопки Telegram (закрыть/меню) —
   опускаем шапку под них: статус-бар + ряд кнопок */
body.mobile .header { padding-top: calc(env(safe-area-inset-top, 0px) + 84px); }
.logo { font-family: 'Unbounded', sans-serif; font-weight: 900; font-size: 19px; letter-spacing: 1.5px; }
.logo span { color: var(--text-dim); font-weight: 500; }

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

.icon-btn {
  width: 40px; height: 40px; border-radius: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 19px; border: 1px solid var(--border);
  background: var(--glass); transition: all 0.2s var(--ease);
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn.on { color: var(--text); }

.balance {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 13px; cursor: pointer;
  color: var(--gold); font-weight: 800; font-size: 15px; font-family: inherit;
}
.balance .plus {
  background: var(--text); color: #0a0a0c; border-radius: 8px;
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
}
.star-ic { width: 19px; height: 19px; object-fit: contain; display: block; flex-shrink: 0; }

/* ---------- вкладки ---------- */
.view { display: none; }
.view.active { display: block; animation: fadeup 0.35s var(--ease); }
@keyframes fadeup { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.section-title {
  font-weight: 800; font-size: 15px; margin: 4px 2px 14px;
  display: flex; align-items: center; gap: 8px; color: var(--text);
}
.section-title .tic { color: var(--text-dim); font-size: 18px; }

/* ---------- кейсы: компактная сетка ---------- */
.cases-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* анти-мерцание: на анимированных карточках убираем дорогой blur */
.case-card.glass, .nft-card.glass, .cm-prize {
  backdrop-filter: none; -webkit-backdrop-filter: none;
  background: rgba(255, 255, 255, 0.05);
}

.case-card {
  position: relative; overflow: hidden; padding: 16px 14px 14px;
  text-align: center; cursor: pointer;
  transition: transform 0.18s var(--ease), border-color 0.25s, background 0.25s;
  animation: fadeup 0.4s var(--ease) backwards;
  will-change: transform;
}
.case-card:nth-child(2) { animation-delay: 0.06s; }
.case-card:nth-child(3) { animation-delay: 0.12s; }
.case-card:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--glass-strong); }
.case-card:active { transform: scale(0.97); }

.case-card:first-child { grid-column: 1 / -1; }
.case-card:first-child .case-img { height: 108px; }

.case-img {
  height: 84px; max-width: 100%; object-fit: contain; margin: 0 auto 10px; display: block;
  animation: float 5s ease-in-out infinite;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}
.case-card:nth-child(2) .case-img { animation-delay: 1.2s; }
.case-card:nth-child(3) .case-img { animation-delay: 2.4s; }
@keyframes float { 50% { transform: translateY(-6px); } }

.case-name { font-weight: 800; font-size: 14px; margin-bottom: 8px; }

.case-price {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 4px 12px; font-weight: 800; font-size: 12px; color: var(--text);
  background: rgba(255, 255, 255, 0.05); margin-bottom: 10px;
}
.case-price.free { color: var(--text-dim); }
.case-price .star-ic { width: 13px; height: 13px; }

.case-open-btn {
  width: 100%; padding: 10px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.07);
  color: var(--text); font-family: inherit; font-weight: 700; font-size: 13px;
  transition: all 0.18s var(--ease);
}
.case-open-btn:hover { background: var(--text); color: #0a0a0c; }
.case-open-btn:active { transform: scale(0.96); }
.case-open-btn.ghost { background: transparent; color: var(--text-dim); }
.case-open-btn.ghost:hover { background: rgba(255,255,255,.09); color: var(--text); }

/* ---------- кнопки ---------- */
.btn {
  border: none; cursor: pointer; font-family: inherit; font-weight: 700;
  border-radius: 15px; padding: 13px 20px; font-size: 14px;
  transition: transform 0.15s var(--ease), opacity 0.2s, background 0.25s, color 0.25s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn[hidden] { display: none !important; }
.btn-primary { background: var(--text); color: #0a0a0c; box-shadow: 0 8px 26px rgba(255, 255, 255, 0.12); }
.btn-primary:hover { opacity: 0.9; }
.btn-ghost { background: var(--glass); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--glass-strong); }
.btn-mini { padding: 9px 14px; font-size: 13px; border-radius: 12px; background: var(--text); color: #0a0a0c; white-space: nowrap; }
.btn-mini .tic { font-size: 15px; }
.wide { width: 100%; margin-top: 10px; }

/* ---------- нижняя навигация ---------- */
.bottom-nav {
  position: fixed; bottom: max(14px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  width: min(452px, calc(100% - 28px));
  display: flex; padding: 7px; z-index: 50; border-radius: 22px;
}
.nav-btn {
  flex: 1; background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-family: inherit; font-size: 11px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 0; border-radius: 16px; transition: all 0.25s var(--ease);
}
.nav-btn[hidden] { display: none !important; }
.nav-btn .tic { font-size: 21px; }
.nav-btn.active { color: var(--text); background: rgba(255, 255, 255, 0.08); }

/* ---------- профиль ---------- */
.profile-card { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 14px; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--glass-strong); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Unbounded'; font-weight: 700; font-size: 20px; color: var(--text); flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-weight: 800; font-size: 16px; }
.profile-username { color: var(--text-dim); font-size: 13px; }
.profile-balance { display: flex; align-items: center; gap: 6px; color: var(--gold); font-size: 17px; }

.block { padding: 16px; margin-top: 14px; }
.block-title { font-weight: 800; font-size: 14.5px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.block-title .tic { color: var(--text-dim); font-size: 17px; }
.block-text { color: var(--text-dim); font-size: 13px; line-height: 1.55; margin-bottom: 12px; }
.block-text b { color: var(--text); }

.ref-link-row { display: flex; gap: 8px; margin-bottom: 10px; }
.ref-link-row[hidden] { display: none !important; }
.ref-link {
  flex: 1; min-width: 0; background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); padding: 11px 12px; font-size: 12px; font-family: inherit; outline: none;
  transition: border-color 0.2s;
}
.ref-link:focus { border-color: var(--border-strong); }
.ref-stats { color: var(--text-dim); font-size: 13px; margin-top: 10px; }
.ref-stats b { color: var(--text); }

.progress { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin: 10px 0 6px; }
.progress-fill {
  height: 100%; width: 0%; border-radius: 999px; background: var(--text);
  transition: width 0.5s var(--ease);
}
.progress-text { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }

.promo-msg { font-size: 13px; margin-top: 2px; min-height: 18px; }
.promo-msg.ok { color: var(--ok); }
.promo-msg.err { color: var(--danger); }

/* ---------- история ---------- */
.history-list { display: flex; flex-direction: column; gap: 7px; }
.history-item {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.035); border-radius: 12px; padding: 10px 12px;
}
.history-ic {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 16px;
}
.history-body { flex: 1; min-width: 0; }
.history-title { font-size: 13px; font-weight: 700; }
.history-date { font-size: 11px; color: var(--text-dim); }
.history-amount { font-weight: 800; font-size: 14px; }
.history-amount.pos { color: var(--ok); }
.history-amount.neg { color: var(--danger); }

/* ---------- инвентарь ---------- */
.inventory-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nft-card { padding: 16px 12px; text-align: center; animation: fadeup 0.35s var(--ease) backwards;
  min-width: 0; overflow: hidden; }
.nft-card img { width: 76px; height: 76px; object-fit: contain; margin-bottom: 8px; }
.nft-name { font-weight: 800; font-size: 13px; margin-bottom: 4px; }
.nft-value { color: var(--gold); font-size: 13px; font-weight: 700; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center; gap: 4px; line-height: 1; }
.nft-value .star-ic { width: 13px; height: 13px; }
.nft-status { font-size: 12px; color: var(--text-dim); }
.nft-status.requested { color: var(--text); }
.nft-actions { display: flex; gap: 6px; align-items: stretch; }
.nft-actions .btn {
  flex: 1 1 0; min-width: 0; margin-top: 0;
  padding-left: 5px; padding-right: 5px; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
/* кнопка продажи: две строки, мелкий текст, не вылезает за рамки */
.nft-actions .btn-sell {
  flex-direction: column; gap: 1px; line-height: 1.2; padding-top: 6px; padding-bottom: 6px;
}
.btn-sell .sell-t { font-size: 9.5px; font-weight: 700; color: var(--text-dim); }
.btn-sell .sell-v { display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 800; }
.btn-sell .sell-v .star-ic { width: 12px; height: 12px; }
.btn-sell { background: rgba(255, 255, 255, 0.05); color: var(--gold); border: 1px solid rgba(242, 201, 76, 0.35); }
.btn-sell .star-ic { width: 13px; height: 13px; display: block; }

/* анимация продажи: карточка плавно исчезает */
.nft-card.sold-out {
  transition: opacity 0.45s ease, transform 0.45s ease, max-height 0.45s ease 0.15s,
              margin 0.45s ease 0.15s, padding 0.45s ease 0.15s;
  opacity: 0; transform: scale(0.82);
  max-height: 0; margin: 0; padding: 0 12px; overflow: hidden;
  pointer-events: none;
}

/* предупреждение «напишите складу» при выводе */
.wd-vault-note {
  display: flex; align-items: flex-start; gap: 11px;
  background: rgba(242, 201, 76, 0.07); border: 1px solid rgba(242, 201, 76, 0.3);
  border-radius: 14px; padding: 12px 13px; margin: 10px 0 2px;
}
.wd-vault-note[hidden] { display: none !important; }
.wd-vault-ic {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: rgba(242, 201, 76, 0.12); color: var(--gold);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.wd-vault-title { font-weight: 800; font-size: 13px; margin-bottom: 3px; }
.wd-vault-text { font-size: 12px; color: var(--text-dim); line-height: 1.45; }
#wd-vault-btn { margin-top: 8px; }
#wd-vault-btn[hidden] { display: none !important; }

/* превью экземпляра NFT: фон → паттерн → модель */
.wd-nft-preview {
  position: relative; width: 76px; height: 76px; border-radius: 16px;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.wd-pattern {
  position: absolute; inset: 0; z-index: 1; opacity: 0.55;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr;
  padding: 3px; pointer-events: none;
}
.wd-pat-tile { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.wd-pat-tile svg { width: 100% !important; height: 100% !important; }
.wd-model { position: relative; z-index: 2; }
.wd-pick { width: 100%; margin-top: 2px; }
/* кулдаун передачи: замок на экземпляре */
.wd-inst.locked { opacity: 0.55; cursor: not-allowed; }
.wd-lock {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 5, 8, 0.55); color: #fff;
}
.wd-locked-note { font-size: 10px; color: var(--text-dim); margin-top: 4px; }

/* ---------- пустые состояния ---------- */
.empty { text-align: center; color: var(--text-dim); padding: 44px 20px; font-size: 14px; line-height: 1.6; }
.empty-ic { font-size: 42px; margin-bottom: 12px; opacity: 0.5; }
.empty.small { padding: 12px; font-size: 13px; }

/* ---------- модалки ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 5, 8, 0.7); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadein 0.22s ease;
}
.modal[hidden], .toast[hidden] { display: none !important; }
@keyframes fadein { from { opacity: 0; } }
.modal > div { animation: popin 0.3s var(--ease); }
@keyframes popin { from { transform: scale(0.94) translateY(8px); opacity: 0; } }

/* рулетка */
.roulette-window { width: 100%; max-width: 420px; overflow: hidden; position: relative; padding: 26px 0; }
.roulette-pointer {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: 2px; height: 100%;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.9), transparent);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.5); z-index: 2;
}
.roulette-strip { display: flex; gap: 10px; will-change: transform; padding: 12px; }
.r-card {
  flex: 0 0 92px; height: 112px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  transition: transform 0.35s var(--ease), opacity 0.35s, border-color 0.35s, box-shadow 0.35s;
}
/* выпавшая карточка: увеличение и подсветка, остальные затухают */
.roulette-strip.done .r-card:not(.win) { opacity: 0.35; }
.r-card.win {
  transform: scale(1.18);
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 26px rgba(255, 255, 255, 0.35);
  z-index: 2;
}
.r-card img { width: 50px; height: 50px; object-fit: contain; }
.r-card .r-ic { font-size: 34px; color: var(--text-dim); }
.r-card .r-val { font-size: 12px; font-weight: 800; color: var(--text-dim);
  display: flex; align-items: center; gap: 3px; }
.r-card .r-val .star-ic { width: 11px; height: 11px; }
.r-card .r-val.gold { color: var(--gold); }
.r-card .r-val.gold .star-ic { width: 12px; height: 12px; }
/* карточка звёзд: иконка и число по центру в одну строку */
.r-card .r-star { display: flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 800; color: var(--gold); }
.r-card .r-star .star-ic { width: 18px; height: 18px; }
/* звёзды в плитке содержимого кейса: маленькая иконка слева от числа, по центру */
.cm-prize .r-star { margin: 0 auto; display: inline-flex; align-items: center;
  gap: 5px; font-size: 15px; font-weight: 800; color: var(--gold); }
.cm-prize .r-star .star-ic { width: 14px; height: 14px; }

/* большая звезда в окне результата */
.result-star-img { width: 92px; height: 92px; object-fit: contain;
  margin: 0 auto 4px; display: block;
  animation: pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1);
  filter: drop-shadow(0 10px 24px rgba(242, 201, 76, 0.35)); }

/* результат */
.result-card { width: 100%; max-width: 330px; padding: 28px 22px; text-align: center; position: relative; overflow: hidden; }
.result-ic { font-size: 54px; margin-bottom: 10px; color: var(--text); display: flex; justify-content: center; }
.result-img { width: 124px; height: 124px; object-fit: contain; margin: 0 auto 10px; display: block;
  animation: pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } }
.result-title { font-family: 'Unbounded'; font-size: 18px; font-weight: 700; margin-bottom: 6px; letter-spacing: 0.5px; }
.result-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 20px; line-height: 1.5; }
.result-sub b { color: var(--text); }
.result-buttons { display: flex; flex-direction: column; gap: 8px; }

.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute; top: -10px; width: 6px; height: 10px; border-radius: 2px;
  animation: fall linear forwards; opacity: 0.9;
}
@keyframes fall { to { transform: translateY(420px) rotate(680deg); opacity: 0; } }

/* пополнение */
.deposit-card { width: 100%; max-width: 350px; padding: 22px; }
.method-switch { display: flex; gap: 8px; margin: 12px 0 10px; }
.method-btn {
  flex: 1; padding: 11px 6px; border-radius: 13px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border);
  color: var(--text-dim); font-family: inherit; font-weight: 700; font-size: 12.5px;
  transition: all 0.25s var(--ease);
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.method-btn .m-ic { width: 18px; height: 18px; object-fit: contain; display: block; flex-shrink: 0; }
.method-btn .m-ic-svg { display: inline-flex; }
.method-btn .m-ic-svg svg { width: 18px; height: 18px; }
.method-btn.active { background: var(--text); color: #0a0a0c; border-color: var(--text); }
.method-btn.active .bonus-tag { color: #0a0a0c; opacity: 0.7; }
.bonus-tag { color: var(--ok); font-weight: 800; }

.packs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 12px 0 4px; }
.pack-btn {
  padding: 13px; border-radius: 15px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-weight: 800; font-size: 15px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  transition: all 0.18s var(--ease);
}
.pack-btn:hover { border-color: var(--border-strong); background: var(--glass-strong); }
.pack-btn > div { display: flex; align-items: center; gap: 5px; line-height: 1; }
.pack-btn .pack-bonus { color: var(--ok); font-weight: 800; }
.pack-btn small { font-size: 11px; color: var(--text-dim); font-weight: 700; }
.pack-btn:active { transform: scale(0.95); }
.pack-btn .star-ic { width: 16px; height: 16px; }

.custom-row { display: flex; gap: 8px; margin-top: 10px; }
.custom-hint { font-size: 11.5px; color: var(--text-dim); margin-top: 6px; min-height: 14px; }

/* содержимое кейса */
.case-modal-card { width: 100%; max-width: 370px; padding: 18px; max-height: 86vh; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.cm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cm-image { width: 62px; height: 62px; object-fit: contain; }
.cm-head-info { flex: 1; min-width: 0; }
.cm-name { font-weight: 800; font-size: 16px; }
.cm-price { color: var(--gold); font-weight: 800; font-size: 13px; margin-top: 2px;
  display: flex; align-items: center; gap: 5px; }
.cm-price .star-ic { width: 14px; height: 14px; }
.cm-prizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 4px; }
.cm-prize {
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 6px; text-align: center;
  animation: fadeup 0.3s var(--ease) backwards;
  min-width: 0; overflow: hidden;
  /* единая высота и центровка для всех плиток: подарок, звёзды, пусто */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; min-height: 108px;
}
.cm-prize img { width: 44px; height: 44px; object-fit: contain; }
.cm-prize .p-ic { font-size: 30px; color: var(--text-dim); display: flex; justify-content: center; margin-bottom: 5px; }
.cm-prize .p-emoji { font-size: 30px; line-height: 1.4; margin-bottom: 5px; }
.cm-prize .p-name { font-size: 10px; font-weight: 700; color: var(--text-dim); line-height: 1.3;
  overflow-wrap: break-word; }
.cm-prize .p-val { font-size: 11px; font-weight: 800; color: var(--text); margin-top: 2px;
  display: flex; align-items: center; justify-content: center; gap: 3px; }
.cm-prize .p-val .star-ic { width: 10px; height: 10px; }

/* выбор экземпляра при выводе */
.wd-inst { cursor: pointer; transition: all 0.18s var(--ease); }
.wd-inst:hover { border-color: var(--border-strong); }
.wd-inst.selected {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 1px var(--text) inset;
}

/* lottie-анимации NFT */
.lottie-box { display: inline-flex; align-items: center; justify-content: center; margin: 0 auto; }
.lottie-box svg { width: 100% !important; height: 100% !important; }
.result-lottie { width: 140px; height: 140px; margin: 0 auto 10px;
  animation: pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); }

/* тост */
.toast {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%);
  background: rgba(18, 18, 22, 0.96); border: 1px solid var(--border-strong);
  padding: 12px 20px; border-radius: 14px; font-size: 13.5px; font-weight: 700;
  z-index: 200; animation: fadein 0.2s ease; max-width: 90%; text-align: center;
}

/* ==================================================================
   Загрузочный экран
   ================================================================== */
#loader {
  position: fixed; inset: 0; z-index: 1000;
  background: #050506;
  display: flex; flex-direction: column;
  padding: 22px 22px 0;
  transition: opacity 0.55s ease;
  overflow: hidden;
}
#loader.done { opacity: 0; pointer-events: none; }
#loader[hidden] { display: none !important; }

.loader-glow {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0) 62%);
  filter: blur(55px);
}
.lg-1 {
  width: 520px; height: 520px; top: -160px; left: -180px;
  animation: loaderDrift1 9s ease-in-out infinite alternate;
}
.lg-2 {
  width: 460px; height: 460px; bottom: -180px; right: -160px; opacity: 0.7;
  animation: loaderDrift2 12s ease-in-out infinite alternate;
}
@keyframes loaderDrift1 {
  to { transform: translate(140px, 110px) scale(1.15); }
}
@keyframes loaderDrift2 {
  to { transform: translate(-130px, -120px) scale(1.2); }
}

.loader-logo {
  position: absolute; z-index: 1;
  left: 50%; top: 34%;
  transform: translate(-50%, -50%) scale(1.75);
  font-family: 'Unbounded', sans-serif; font-weight: 900; font-size: 19px; letter-spacing: 1.5px;
  color: var(--text);
  transition: left 0.65s var(--ease), top 0.65s var(--ease), transform 0.65s var(--ease);
  white-space: nowrap;
}
/* после загрузки логотип уезжает на своё место слева сверху */
#loader.to-corner .loader-logo {
  left: 22px; top: 22px;
  transform: translate(0, 0) scale(1);
}
body.mobile #loader.to-corner .loader-logo { top: calc(22px + env(safe-area-inset-top, 0px) + 60px); }
.loader-logo span { color: var(--text-dim); font-weight: 500; }

.loader-bottom {
  position: relative; z-index: 1;
  margin-top: auto; margin-bottom: 72px;
}
.loader-bar-wrap {
  height: 3px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); overflow: hidden;
}
.loader-bar {
  height: 100%; width: 0%; border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}
.loader-pct {
  margin-top: 12px; font-size: 13px; font-weight: 800; letter-spacing: 2px;
  color: var(--text-dim); font-variant-numeric: tabular-nums;
}

/* ==================================================================
   Админка в приложении
   ================================================================== */
.adm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.adm-stat {
  background: var(--glass); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px 6px; text-align: center;
}
.adm-stat b { display: block; font-size: 16px; }
.adm-stat span { font-size: 10px; color: var(--text-dim); }

.adm-tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.adm-tab {
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--glass); color: var(--text-dim); font-family: inherit;
  font-weight: 700; font-size: 12.5px; cursor: pointer; white-space: nowrap;
  transition: all 0.2s var(--ease);
}
.adm-tab.active { background: var(--text); color: #0a0a0c; border-color: var(--text); }

.adm-list { display: flex; flex-direction: column; gap: 8px; }
.adm-item {
  background: var(--glass); border: 1px solid var(--border); border-radius: 16px;
  padding: 12px 14px;
}
.adm-item-head { display: flex; align-items: center; gap: 10px; }
.adm-item-head img, .adm-item-head .lottie-box { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.adm-item-title { flex: 1; min-width: 0; font-weight: 800; font-size: 13.5px; }
.adm-item-sub { color: var(--text-dim); font-size: 11.5px; margin-top: 2px; }
.adm-item-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.adm-btn {
  padding: 8px 12px; border-radius: 10px; cursor: pointer; font-family: inherit;
  font-size: 12px; font-weight: 700; border: 1px solid var(--border-strong);
  background: rgba(255,255,255,.07); color: var(--text); transition: all 0.15s var(--ease);
}
.adm-btn:active { transform: scale(0.95); }
.adm-btn.primary { background: var(--text); color: #0a0a0c; }
.adm-btn.danger { color: var(--danger); border-color: rgba(255,125,146,.4); }
.adm-btn:disabled { opacity: .4; cursor: default; }
.adm-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10px;
  font-weight: 800; border: 1px solid var(--border-strong); color: var(--text-dim);
}
.adm-badge.bad { color: var(--danger); border-color: rgba(255,125,146,.4); }
.adm-badge.warn { color: var(--gold); border-color: rgba(242,201,76,.4); }

/* редактор кейса */
.case-edit-card { width: 100%; max-width: 400px; padding: 18px; max-height: 88vh; overflow-y: auto; scrollbar-width: thin; }
.ce-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ce-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--text-dim); font-weight: 700; }
.ce-grid label[hidden] { display: none !important; }
.ce-grid label:first-child { grid-column: 1 / -1; }
select.ref-link { appearance: none; }
.ce-image-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ce-image-preview { width: 54px; height: 54px; object-fit: contain; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--border); }
.ce-upload { padding: 9px 14px; font-size: 12px; margin: 0; width: auto; }

.ce-prize {
  display: grid; grid-template-columns: 78px 1fr 56px 52px 26px; gap: 6px; align-items: center;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px; margin-top: 6px;
}
.ce-prize select, .ce-prize input { padding: 8px; font-size: 12px; }
.ce-prize .ce-del {
  background: none; border: none; color: var(--danger); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.ce-prize .gift-pick { grid-column: 2 / 4; }
.ce-rtp-row { display: flex; gap: 8px; margin-top: 12px; }

/* страница блокировки */
#banned-screen {
  position: fixed; inset: 0; z-index: 500;
  background: radial-gradient(ellipse at 50% 30%, #17171d 0%, #0a0a0c 70%);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadein 0.3s ease;
}
#banned-screen[hidden] { display: none !important; }
.banned-card { text-align: center; max-width: 320px; }
.banned-ic {
  width: 88px; height: 88px; margin: 0 auto 20px; border-radius: 26px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--danger); font-size: 40px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.08);
}
.banned-title { font-family: 'Unbounded'; font-weight: 700; font-size: 20px; margin-bottom: 10px; }
.banned-text { color: var(--text-dim); font-size: 14px; line-height: 1.6; margin-bottom: 22px; }
.banned-card .btn { display: inline-flex; text-decoration: none; }

/* ==================================================================
   ПК: колонна на всю высоту окна (без «рамки»), мобила — fullscreen
   ================================================================== */
body.desktop { height: 100vh; overflow: hidden; }
body.desktop #app {
  width: 430px; max-width: 100vw; margin: 0 auto;
  height: 100vh;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding-bottom: 100px; /* место под закреплённую нижнюю панель */
}
body.desktop .bottom-nav {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  width: min(402px, calc(100vw - 28px));
  margin: 0;
}
body.desktop .modal { position: absolute; }
body.desktop .toast { position: absolute; bottom: 90px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
