/* ============================================================
   GIFTVERSE V2 — уютный, человеческий стиль.
   Тёплая кремовая палитра, мягкие карточки, крупные изображения
   на однотонном пастельном фоне БЕЗ рамок. Без неона и стекла.
   ============================================================ */

:root {
  --bg: #F6F1E8;
  --bg-soft: #FBF7F0;
  --card: #FFFFFF;
  --card-soft: #FDF8F0;
  --ink: #3A322C;
  --ink-2: #8A7D72;
  --ink-3: #C0B3A6;
  --line: #EDE4D7;
  --line-strong: #E0D3C2;
  --star: #E8A020;
  --star-soft: #FDF3DC;
  --accent: #FF7A59;
  --accent-ink: #FFFFFF;
  --accent-soft: #FFEDE7;
  --green: #4CAF7D;
  --green-soft: #E6F2EA;
  --red: #E05B4B;
  --red-soft: #FBE8E5;
  --amber: #E8A020;
  --dial-fail: #2E2823;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;

  --shadow-soft: 0 2px 10px rgba(95, 70, 40, .06), 0 1px 2px rgba(95, 70, 40, .04);
  --shadow-lift: 0 8px 24px rgba(95, 70, 40, .10);

  /* Треки, затемнения, тёмные плашки — для дружелюбного контраста в любой теме */
  --track: #EFE9E1;
  --scrim: rgba(58, 50, 44, .45);
  --badge-bg: #3A322C;
  --badge-ink: #FFFFFF;
  --toast-bg: #3A322C;
  --toast-ink: #FFFFFF;

  /* Пастельные фоны ред ких ценностей — однотон, без градиента */
  --pastel-common: #EFEBE4;
  --pastel-uncommon: #E6F2EA;
  --pastel-rare: #E7EEF8;
  --pastel-epic: #EFE7F6;
  --pastel-legendary: #F9EFD9;
  --pastel-mythic: #FBE6ED;
}

/* ============================================================
   Темы: светлая (дефолт в :root) / тёмная + отдельные акценты.
   Акценты для светлой — html[data-accent="…"]; для тёмной —
   html[data-mode="dark"][data-accent="…"] (побеждает по весу).
   ============================================================ */
html[data-mode="dark"] {
  --bg: #221E1A; --bg-soft: #2A2520;
  --card: #2E2823; --card-soft: #332C26;
  --ink: #EDE3D7; --ink-2: #B5A796; --ink-3: #857A6C;
  --line: #3A332C; --line-strong: #4A4138;
  --star: #E5A93E; --star-soft: #3A3226;
  --accent: #E0684F; --accent-soft: #452E24;
  --accent-ink: #FFFFFF;
  --green: #5EAA7C; --green-soft: #243A2E;
  --red: #E56B5C; --red-soft: #422B26; --amber: #E5A93E;
  --track: #3A332C; --scrim: rgba(0, 0, 0, .55);
  --badge-bg: #EDE3D7; --badge-ink: #221E1A;
  --toast-bg: #EDE3D7; --toast-ink: #221E1A;
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, .18);
  --shadow-lift: 0 8px 24px rgba(0, 0, 0, .32);
}
/* Акценты для светлой темы */
html[data-accent="rose"] {
  --accent: #E8666F; --accent-soft: #FDE9E9; --star: #E05A6A; --star-soft: #FCE7E9; --amber: #E05A6A;
}
html[data-accent="violet"] {
  --accent: #8F6BDB; --accent-soft: #F1EAFB; --star: #8A5ADB; --star-soft: #F0EAFB; --amber: #8A5ADB;
}
html[data-accent="mint"] {
  --accent: #2FA98B; --accent-soft: #E4F4EE; --star: #1FA785; --star-soft: #E3F4EE; --amber: #1FA785;
}
html[data-accent="ocean"] {
  --accent: #2F8FD9; --accent-soft: #E4F0FA; --star: #2187C9; --star-soft: #E3F0F9; --amber: #2187C9;
}
/* Акценты для тёмной темы (перекрывают светлый набор) */
html[data-mode="dark"][data-accent="orange"] { --accent: #FF9A6B; --accent-soft: #452E24; --star: #EFB64C; --star-soft: #3A3226; --amber: #EFB64C; }
html[data-mode="dark"][data-accent="rose"]   { --accent: #FF6D81; --accent-soft: #45242B; --star: #F45A6E; --star-soft: #45242B; --amber: #F45A6E; }
html[data-mode="dark"][data-accent="violet"] { --accent: #9D6BFF; --accent-soft: #2E2440; --star: #9A63FA; --star-soft: #2E2440; --amber: #9A63FA; }
html[data-mode="dark"][data-accent="mint"]   { --accent: #3DDC97; --accent-soft: #1E3329; --star: #37D08E; --star-soft: #1E3329; --amber: #37D08E; }
html[data-mode="dark"][data-accent="ocean"]  { --accent: #4AA7FF; --accent-soft: #1E2E3F; --star: #4AA0F5; --star-soft: #1E2E3F; --amber: #4AA0F5; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; }
button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}
button:focus-visible {
  outline: 2px solid var(--star);
  outline-offset: 2px;
  border-radius: 6px;
}
input, textarea {
  font-family: inherit;
}
::selection { background: var(--star-soft); }

/* ---------------- App shell ---------------- */
#app {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 14px calc(96px + env(safe-area-inset-bottom));
  position: relative;
}

/* ---------------- Top bar ---------------- */
#top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 2px 14px;
}
.tb-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--pastel-legendary);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex: none;
  overflow: hidden;
}
.tb-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.tb-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.tb-name { font-weight: 900; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-sub { font-size: 11px; color: var(--ink-2); }
.tb-actions { display: flex; align-items: center; gap: 8px; }
.tb-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.tb-online {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 900; color: #3DFF8C; line-height: 1;
  text-shadow: 0 0 6px rgba(61,255,140,.85), 0 0 14px rgba(61,255,140,.45);
  animation: neonPulse 2.6s ease-in-out infinite;
  padding-right: 10px;
}
.cp-person {
  display: block; flex: none;
  filter: drop-shadow(0 0 3px #3DFF8C) drop-shadow(0 0 7px #3DFF8C);
}
@keyframes neonPulse {
  0%, 100% { opacity: .7; }
  50% { opacity: 1; }
}
.balance-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--star-soft);
  border: 1px solid var(--line);
  color: var(--star);
  font-weight: 900;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  transition: transform .12s ease;
}
.balance-pill:active { transform: scale(.96); }
.pill-ton { background: rgba(91,143,217,.14); color: #5B8FD9; padding: 6px 12px; font-size: 14px; }
.cp-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cp-stars { background: var(--star); box-shadow: 0 0 0 3px rgba(232,160,32,.18); }
.cp-ton { background: #5B8FD9; box-shadow: 0 0 0 3px rgba(91,143,217,.18); }
.cp-star { font-size: 14px; line-height: 1; flex: none; }
.cp-ico { width: 16px; height: 16px; border-radius: 50%; display: block; flex: none; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease;
}
.icon-btn:active { transform: scale(.92); }

/* ---------------- Bottom nav ---------------- */
#bottom-nav {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: calc(100% - 24px);
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  display: flex;
  padding: 6px;
  z-index: 40;
}
.nav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 2px;
  border-radius: 16px;
  color: var(--ink-3);
  font-weight: 800;
  font-size: 10.5px;
  transition: color .15s ease, background .15s ease;
}
.nav-btn .nb-ico { font-size: 21px; line-height: 1; filter: grayscale(1); opacity: .85; transition: filter .15s ease, opacity .15s ease; }
.nav-btn.active { color: var(--star); background: var(--star-soft); }
.nav-btn.active .nb-ico { filter: none; opacity: 1; }

/* ---------------- Typography ---------------- */
.h1 { font-size: 24px; font-weight: 900; letter-spacing: -.02em; }
.h2 { font-size: 18px; font-weight: 900; }
.h3 { font-size: 15px; font-weight: 800; }
.muted { color: var(--ink-2); font-size: 13px; }
.small { font-size: 12px; }
.mt-6 { margin-top: 6px; } .mt-10 { margin-top: 10px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  padding: 16px;
}
.card-soft { background: var(--card-soft); border: 1px solid var(--line); }
.panel-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 22px 2px 12px; }
.section-title .h2 { font-size: 17px; }
.section-title .em { margin-left: auto; font-size: 12px; color: var(--ink-3); font-weight: 800; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 15px;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(255,122,89,.28); }
.btn-gold { background: var(--star); color: #fff; box-shadow: 0 6px 16px rgba(232,160,32,.28); }
.btn-ton { background: linear-gradient(135deg, #0098EA, #4B7BEC); color: #fff; box-shadow: 0 6px 16px rgba(0,152,234,.28); }
.btn-soft { background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: var(--shadow-soft); }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 6px 16px rgba(76,175,125,.28); }
.btn-block { width: 100%; }
.btn-mini { padding: 8px 14px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 800; font-size: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

/* ---------------- Gift media (large, NO frame) ---------------- */
.gift-media {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  position: relative;
  font-size: clamp(52px, 22vw, 64px);
  line-height: 1;
}
.gift-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
}
.gift-media.is-img { background: transparent; }
.pastel-common { background: var(--pastel-common); }
.pastel-uncommon { background: var(--pastel-uncommon); }
.pastel-rare { background: var(--pastel-rare); }
.pastel-epic { background: var(--pastel-epic); }
.pastel-legendary { background: var(--pastel-legendary); }
.pastel-mythic { background: var(--pastel-mythic); }

/* Rarity tag */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 900;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: .02em;
}
.tag-common { background: #F1EDE7; color: #6E6258; }
.tag-uncommon { background: var(--green-soft); color: #3E8E64; }
.tag-rare { background: #E9F0FA; color: #4E7FC4; }
.tag-epic { background: #F0E8F8; color: #8A5BC4; }
.tag-legendary { background: var(--star-soft); color: #B87D14; }
.tag-mythic { background: var(--red-soft); color: #C94A6B; }

/* Gift card grid item */
.gift-item {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  padding: 10px;
  text-align: left;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .12s ease;
  min-width: 0;
}
.gift-item:active { transform: scale(.97); }
.gift-item .gift-media { border-radius: var(--radius-sm); }
.gift-item .gi-name { font-weight: 900; font-size: 13.5px; line-height: 1.2; }
.gift-item .gi-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.gift-item .gi-value { font-weight: 900; font-size: 12.5px; color: var(--star); }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ---------------- Cases ---------------- */
.cases-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .cases-grid { grid-template-columns: repeat(3, 1fr); } }
.case-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  padding: 10px;
  text-align: left;
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
.case-card:active { transform: scale(.965); }
.case-card.tier-bronze  { border-color: rgba(201, 130, 59, .5);  box-shadow: 0 2px 16px rgba(201, 130, 59, .12); }
.case-card.tier-silver  { border-color: rgba(169, 180, 194, .5); box-shadow: 0 2px 16px rgba(169, 180, 194, .14); }
.case-card.tier-gold    { border-color: rgba(232, 160, 32, .55); box-shadow: 0 2px 16px rgba(232, 160, 32, .16); }
.case-card.tier-diamond { border-color: rgba(127, 184, 201, .6); box-shadow: 0 2px 16px rgba(127, 184, 201, .18); }
.case-card.tier-royal   { border-color: rgba(182, 139, 217, .6); box-shadow: 0 2px 16px rgba(182, 139, 217, .2); }
.case-card.tier-aon     { border-color: rgba(232, 180, 70, .6); box-shadow: 0 2px 18px rgba(255, 193, 7, .18); background: linear-gradient(180deg, #241A10, #17120C); }
.case-card.tier-chest   { border-color: rgba(232, 130, 20, .65); box-shadow: 0 2px 18px rgba(232, 130, 20, .22); background: linear-gradient(180deg, #1E1408, #120C05); }
.case-card.tier-ton     { border-color: rgba(0, 170, 255, .5); box-shadow: 0 2px 18px rgba(0, 152, 234, .2); background: linear-gradient(180deg, #0B1D33, #060F1E); }

.case-media {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}
.case-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.case-media-lg { aspect-ratio: 2 / 1; border: 1px solid var(--line); }
.case-name { font-weight: 900; font-size: 13.5px; line-height: 1.2; }
.case-desc {
  font-size: 10.5px; color: var(--ink-2); font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.case-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.case-price {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--star-soft); color: var(--star);
  font-weight: 900; font-size: 14px;
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.case-price.price-ton { background: rgba(91,143,217,.16); color: #5B8FD9; border-color: rgba(91,143,217,.35); }
.cat-title { margin-top: 26px; }
.cat-title .h2 { letter-spacing: .01em; }

.case-drops { display: flex; gap: 6px; flex-wrap: wrap; }
.drop-dot {
  width: 30px; height: 30px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.drop-dot.stars { background: var(--star-soft); }

/* ---------------- Home ---------------- */
.hero {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.hero-title { font-size: 22px; font-weight: 900; letter-spacing: -.02em; line-height: 1.25; }
.hero-title em { font-style: normal; color: var(--star); }
.wallet-summary {
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.ws-row { display: flex; align-items: center; gap: 10px; }
.ws-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none;
  overflow: hidden;
}
.ws-icon.stars { background: var(--star-soft); }
.ws-icon.ton { background: #5B8FD9; }
.ico-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; mix-blend-mode: multiply; }
.ws-val { font-weight: 900; font-size: 16px; }
.ws-label { font-size: 11px; color: var(--ink-2); font-weight: 700; }
.ws-actions { display: flex; gap: 8px; }
.ws-actions .btn { flex: 1; }

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 8px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-align: center;
  transition: transform .12s ease;
}
.quick-card:active { transform: scale(.96); }
.quick-card .qc-ico { font-size: 20px; }
.quick-card .qc-title { font-weight: 900; font-size: 11.5px; }
.quick-card .qc-sub { font-size: 9.5px; color: var(--ink-3); font-weight: 700; }

/* ---------------- Reel / case open ---------------- */
.reel-top {
  display: flex; align-items: center; gap: 10px;
}
.reel-title { font-weight: 900; font-size: 17px; }
.reel-speed {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 900; font-size: 11.5px; letter-spacing: .02em;
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-3);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.reel-speed:active { transform: scale(.96); }
.reel-speed.on {
  background: var(--star); color: #1B1206;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(232, 160, 32, .45);
}
.reel-stage {
  position: relative;
  overflow: hidden;
  padding: 8px 0 10px;
}
.reel-stage::before,
.reel-stage::after {
  content: '';
  position: absolute; top: 0; bottom: 0; width: 46px; z-index: 2;
  pointer-events: none;
}
.reel-stage::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.reel-stage::after { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }
.reel-track {
  display: flex; flex-direction: row; flex-wrap: nowrap;
  align-items: center; justify-content: flex-start;
  gap: 10px;
  padding: 4px 0;
  will-change: transform;
}
.reel-track::-webkit-scrollbar { display: none; }
.reel-marker {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 0; transform: translateX(-50%);
  z-index: 3; pointer-events: none;
}
.reel-marker::before {
  content: '';
  position: absolute; top: 6px; left: -6px;
  width: 12px; height: 12px;
  border-radius: 3px;
  background: var(--star);
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(232, 160, 32, .6);
}
.reel-marker::after {
  content: '';
  position: absolute; top: 16px; bottom: 0; left: -1.5px;
  width: 3px;
  background: linear-gradient(var(--star), rgba(232, 160, 32, .22));
  border-radius: 999px;
}
.reel-tile {
  flex: none;
  width: 64px; height: 64px;
  border-radius: 18px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .05);
  overflow: hidden;
  line-height: 0;
}
.reel-tile img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
}
.reel-tile .reel-amount {
  position: absolute;
  right: 4px; bottom: 4px;
  font-size: 10px; font-weight: 900; line-height: 1.05;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  padding: 2px 5px;
  border-radius: 7px;
  z-index: 2;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.reel-tile.hit {
  transform: scale(1.12);
  border-color: var(--star);
  box-shadow: 0 0 0 2px var(--star), 0 6px 18px rgba(232, 160, 32, .35);
}

/* Reveal modal */
.reveal-wrap { text-align: center; }
.reveal-badge {
  width: 40px; height: 40px; margin: 0 auto 8px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.reveal-badge.stars { background: var(--star-soft); }
.reveal-badge.gift { background: var(--green-soft); }
.reveal-badge.ton { background: rgba(0, 152, 234, .18); }
.reveal-title { font-size: 18px; font-weight: 900; }
.reveal-sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.reveal-media {
  width: 160px; margin: 16px auto;
}
.reveal-media .gift-media { border-radius: 24px; font-size: 76px; }
.reveal-value {
  font-weight: 900; font-size: 20px; color: var(--star);
  margin-top: 10px;
}
.reveal-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

/* Jackpot — «Все или ничего» (Pepe 1%): контрастный reveal */
.reveal-wrap.jackpot { position: relative; padding-top: 6px; }
.jackpot-tag {
  display: inline-flex; margin: 0 auto 12px;
  background: linear-gradient(135deg, #FFC107, #E8A020);
  color: #241A10;
  font-weight: 900; font-size: 12px; letter-spacing: .18em;
  padding: 4px 12px; border-radius: 999px;
  animation: jpTag 1.2s ease-out infinite alternate;
}
@keyframes jpTag { from { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,193,7,.5); } to { transform: scale(1.06); box-shadow: 0 0 22px 4px rgba(255,193,7,.45); } }
.jackpot-media {
  position: relative;
  width: 172px; height: 172px; margin: 12px auto 14px;
  border-radius: 28px;
  background: radial-gradient(circle at 50% 30%, rgba(255,193,7,.22), rgba(24,20,16,.1) 60%);
  display: flex; align-items: center; justify-content: center;
}
.jackpot-media img {
  position: relative; z-index: 2;
  width: 132px; height: 132px; object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(255,193,7,.45));
  animation: urWin .7s cubic-bezier(.2, .9, .3, 1.3) both;
}
.jackpot-glow {
  position: absolute; inset: -22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,193,7,.5), rgba(255,46,151,.18) 50%, transparent 68%);
  filter: blur(2px);
  animation: jpPulse 1.1s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes jpPulse { from { opacity: .65; transform: scale(.97); } to { opacity: 1; transform: scale(1.06); } }
.jackpot-name {
  font-weight: 900; font-size: 22px;
  background: linear-gradient(90deg, #FFD54F, #FFC107, #FFE082);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: urWin .5s ease both;
}
.jackpot-sub { font-size: 12.5px; color: var(--ink-2); font-weight: 700; margin-top: 6px; }
.confetti {
  position: fixed; inset: 0; z-index: 5; pointer-events: none;
  overflow: hidden;
}
.confetti i {
  position: absolute; top: -12px;
  border-radius: 2px; opacity: 0;
  animation: confettiFall 2.6s linear infinite;
}
@keyframes confettiFall {
  0% { transform: translateY(-12px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(760deg); opacity: .9; }
}

/* ---------------- Upgrade (redesign): static wheel + rotating pointer ---------------- */
.upg-hero { display: flex; flex-direction: column; gap: 2px; }

.wheel-wrap {
  position: relative;
  width: 200px; height: 200px;
  margin: 0 auto;
}
.wheel-static { display: block; }
.wtrack { stroke-width: 20; }
.wwin { stroke-width: 20; stroke-linecap: butt; }
/* rotating pointer: pivot at wheel center (0,0), the tip is driven OUT onto the
   grey ring's median. Ring geometry (SVG 200×200): cx=cy=100, r=82, stroke-width=20
   → radial band [72..92], thickness 20, median radius 82 = R_circle + gap + t/2
   (43 + 29 + 10). */
.wheel-pointer {
  position: absolute;
  left: 100px; top: 100px;
  width: 0; height: 0;
  z-index: 6;
  pointer-events: none;
  transform-origin: 0 0;   /* stays at geometric center of the wheel */
  will-change: transform;
}
/* tip: slim pointer riding the ring's median, apex OUTWARD (points at the
   segment), base width ~8px. Box apex at radius 90, base at radius 74, vertical
   midpoint exactly on the median (r=82). Height 16 ≤ ring thickness 20. */
.wp-tip {
  position: absolute;
  left: -4px; top: -90px;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 16px solid var(--ink);
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, .35));
  transition: border-bottom-color .2s ease;
}
.wheel-core {
  position: absolute; inset: 0;
  z-index: 3;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  pointer-events: none;
}
.wc-pct { font-size: 34px; font-weight: 900; line-height: 1; letter-spacing: -.5px; }
.wc-pct.off { color: var(--ink-3); }

.wheel-wrap.spinning .wheel-static { filter: drop-shadow(0 0 10px rgba(232, 160, 32, .5)); }
.wheel-wrap.spinning[data-speed="fast"] .wheel-static { filter: drop-shadow(0 0 18px rgba(232, 160, 32, .8)); }
.wheel-wrap.spinning[data-speed="med"] .wheel-static { filter: drop-shadow(0 0 10px rgba(232, 160, 32, .6)); }
.wheel-wrap.spinning[data-speed="slow"] .wheel-static { filter: drop-shadow(0 0 3px rgba(232, 160, 32, .35)); }
.wheel-wrap.is-win .wp-tip { border-bottom-color: #37C37E; }
.wheel-wrap.is-win .wheel-static { filter: drop-shadow(0 0 18px rgba(55, 195, 126, .8)); }
.wheel-wrap.is-lose .wp-tip { border-bottom-color: #E05B4B; }
.wheel-wrap.is-lose { animation: upgShake .5s ease; }
@keyframes upgGlow { from { filter: drop-shadow(0 0 8px rgba(232, 160, 32, .4)); } to { filter: drop-shadow(0 0 26px rgba(232, 160, 32, .8)); } }

.upg-pair { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.upg-cell {
  position: relative;
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 9px 8px;
}
.upg-cell .gift-media { width: 44px; height: 44px; border-radius: var(--radius-sm); }
.upg-cell-name {
  font-size: 11.5px; font-weight: 800; color: var(--ink);
  line-height: 1.25; text-align: center;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.upg-ph { font-size: 22px; opacity: .55; }
.upg-extra {
  position: absolute; top: 5px; right: 5px;
  background: var(--star-soft); color: var(--star);
  font-size: 10px; font-weight: 900;
  border-radius: 999px; padding: 1px 7px;
}
.upg-arrow { font-size: 20px; color: var(--ink-3); flex: none; }

.upg-cta { margin-top: 6px; }

.seg-tabs {
  display: flex;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  margin-top: 14px;
}
.seg-tab {
  flex: 1;
  border: none; background: transparent;
  color: var(--ink-2); font-size: 12px; font-weight: 900;
  padding: 8px 6px; border-radius: 999px;
  transition: all .15s ease;
  cursor: pointer;
}
.seg-tab.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-soft); }
.seg-tab:disabled { opacity: .45; cursor: default; }

.gift-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.g-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 8px 6px 9px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
.g-card:active { transform: scale(.95); }
.g-card.sel { border-color: var(--star); box-shadow: 0 0 0 1px var(--star), 0 0 14px rgba(232, 160, 32, .22); }
.g-card.poor { opacity: .55; filter: saturate(.6); }
.g-card .gift-media { width: 44px; height: 44px; border-radius: var(--radius-sm); }
.g-name { font-size: 10px; font-weight: 800; color: var(--ink); line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-val { font-size: 10.5px; font-weight: 900; color: var(--star); }
.g-ch { font-size: 10.5px; font-weight: 900; color: var(--ink-2); }
.g-qty {
  position: absolute; top: 5px; left: 5px;
  background: var(--badge-bg); color: var(--badge-ink);
  font-size: 10px; font-weight: 900;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
}
.g-idx {
  position: absolute; top: 5px; right: 5px;
  background: var(--star); color: #fff;
  font-size: 10px; font-weight: 900;
  min-width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.g-check {
  position: absolute; top: 5px; right: 5px;
  background: var(--star); color: #fff;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900;
}

.qty-stepper {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin-top: 14px;
}
.qty-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 22px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-soft);
  transition: transform .12s ease;
}
.qty-btn:active { transform: scale(.92); }
.qty-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--badge-bg); color: var(--badge-ink);
  font-size: 10px; font-weight: 900;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--card);
}
.qty-num { font-size: 26px; font-weight: 900; color: var(--ink); min-width: 40px; text-align: center; }
.shop-total {
  margin: 12px auto 0; text-align: center;
  font-size: 15px; font-weight: 900; color: var(--star);
}

.mult-row { display: flex; gap: 8px; margin-top: 10px; padding-bottom: 4px; }
.mult-chip {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 4px 6px;
  transition: all .15s ease;
}
.mult-chip.active { border-color: var(--star); background: var(--star-soft); }
.mult-chip.dim { opacity: .38; }
.mc-m { font-size: 14px; font-weight: 900; }
.mc-pct { font-size: 9.5px; font-weight: 800; color: var(--ink-3); }
.mult-chip.active .mc-pct { color: var(--ink-2); }

.burst-bit {
  position: fixed; bottom: 40%; left: 50%;
  font-size: 20px; pointer-events: none; z-index: 60;
  animation: burstUp .85s cubic-bezier(.2,.8,.4,1) forwards;
}
@keyframes burstUp { from { transform: translate(0,0) scale(.4); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(1.1); opacity: 0; } }

.upg-result {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: var(--scrim);
}
.upg-result .ur-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
  max-width: 340px; width: 100%;
  padding: 24px;
  text-align: center;
  animation: urPop .45s cubic-bezier(.2, .9, .32, 1.25) both;
}
.ur-icon { width: 90px; height: 90px; margin: 0 auto 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 44px; }
.ur-icon.ok { background: var(--green-soft); animation: urWin .5s cubic-bezier(.2, .9, .32, 1.3) .12s both; }
.ur-icon.fail { background: var(--red-soft); animation: upgShake .5s ease .12s both; }
.ur-title { font-size: 19px; font-weight: 900; }
.ur-sub { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.ur-cta { margin-top: 18px; display: flex; flex-direction: column; gap: 9px; }

/* ---------------- Inventory ---------------- */
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px; -webkit-overflow-scrolling: touch; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-weight: 800; font-size: 12.5px;
  color: var(--ink-2);
  transition: all .15s ease;
}
.filter-chip.active { background: var(--star); border-color: var(--star); color: #fff; }

/* ---------------- Friends ---------------- */
.referal-box {
  background: var(--card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.referal-link {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-2);
  word-break: break-all;
}
.friend-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
}
.friend-row + .friend-row { margin-top: 10px; }
.f-ava {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex: none;
  overflow: hidden;
}
.f-ava-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.f-name { font-weight: 900; font-size: 13.5px; }
.f-star { font-size: 12px; color: var(--star); font-weight: 900; }
.rank-badge { margin-left: 6px; font-size: 12px; }

/* ---------------- Leaderboard ---------------- */
.lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.lb-row:last-child { border-bottom: none; }
.lb-row.me {
  background: var(--accent-soft);
  border-radius: var(--radius);
  border-bottom-color: transparent;
}
.lb-rank {
  width: 30px; flex: none;
  font-size: 15px; font-weight: 900; text-align: center;
  color: var(--ink-2);
}
.lb-name { font-weight: 900; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-val { font-weight: 900; font-size: 13.5px; white-space: nowrap; }
.lb-sub { font-size: 11px; color: var(--ink-2); white-space: nowrap; }

/* ---------------- Промокоды (настройки) ---------------- */
.promo-row { display: flex; gap: 8px; align-items: center; }
.promo-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  outline: none;
}
.promo-input:focus { border-color: var(--accent); }
.promo-msg { margin-top: 8px; color: var(--ink-3); font-weight: 700; }
.promo-msg.ok { color: var(--green); }
.promo-msg.err { color: var(--red); }

/* ---------------- Wallet ---------------- */
.pack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pack {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: transform .12s ease;
}
.pack:active { transform: scale(.96); }
.pack .pk-val { font-weight: 900; font-size: 15px; color: var(--star); }
.pack .pk-bonus { font-size: 10.5px; font-weight: 800; color: var(--ink-3); }
.pack.best { border-color: var(--star); background: var(--star-soft); }
.field {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  width: 100%;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.field::placeholder { color: var(--ink-3); font-weight: 600; }
.field-label { font-size: 12px; font-weight: 900; color: var(--ink-2); margin: 0 2px 6px; display: block; }
.tx-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.tx-row:last-child { border-bottom: none; }
.tx-ico { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; overflow: hidden; }
.tx-ico.in { background: var(--green-soft); }
.tx-ico.ton { background: #5B8FD9; }
.tx-ico.out { background: var(--red-soft); }
.tx-ico.stars { background: var(--star-soft); }
.tx-title { font-weight: 800; font-size: 13px; }
.tx-sub { font-size: 10.5px; color: var(--ink-3); font-weight: 700; }
.tx-amt { margin-left: auto; font-weight: 900; font-size: 13.5px; }
.tx-amt.in { color: var(--green); }
.tx-amt.out { color: var(--red); }

/* ---------------- Overlay / sheet ---------------- */
#overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
#overlay[hidden] { display: none; }
.overlay-scrim { position: absolute; inset: 0; background: var(--scrim); animation: fade .18s ease; }
.overlay-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 32px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lift);
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  animation: slideUp .22s ease;
  -webkit-overflow-scrolling: touch;
}
.overlay-panel.center {
  border-radius: var(--radius-lg);
  margin: auto 14px auto 14px;
  max-height: calc(100dvh - 32px);
  max-height: calc(100vh - 32px);
}
/* reel sheet: flush to the bottom of the screen (normal tab look) */
.overlay-panel.reel-sheet {
  padding-top: 8px;
}
/* upgrade: обычный bottom sheet (не растягиваем на весь экран) */
.overlay-panel.upg-sheet {
  padding-top: 14px;
}
.overlay-panel.reel-sheet .sheet-grip { margin: 2px auto 4px; }
.overlay-panel.reel-sheet .reel-stage { padding: 4px 0 8px; }
.overlay-panel.reel-sheet .cs-divider { margin: 12px 0 8px; padding-top: 8px; }
.sheet-grip { width: 38px; height: 4px; border-radius: 999px; background: var(--line-strong); margin: 2px auto 8px; }
.sheet-close {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--card); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--ink-2);
}
@keyframes slideUp { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------------- Settings sheet ---------------- */
.set-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  box-shadow: var(--shadow-soft);
}
.set-item + .set-item { margin-top: 10px; }
.set-ico { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; flex: none; }
.set-ico.s { background: var(--star-soft); }
.set-ico.v { background: var(--green-soft); }
.set-ico.m { background: #E9F0FA; }
.set-body { flex: 1; min-width: 0; }
.set-title { font-weight: 900; font-size: 14px; }
.set-sub { font-size: 11px; color: var(--ink-2); font-weight: 700; }
.switch {
  position: relative; width: 46px; height: 26px; flex: none;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background .18s ease;
}
.switch::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .18s ease;
}
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(20px); }
.mode-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.mode-opt {
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 13px;
  text-align: left;
  transition: border-color .15s ease, background .15s ease;
}
.mode-opt.active { border-color: var(--star); background: var(--star-soft); }
.mode-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.mode-name { font-weight: 900; font-size: 13.5px; }
.mode-desc { font-size: 11px; color: var(--ink-2); font-weight: 700; }
.mode-url { font-size: 10.5px; color: var(--ink-3); font-weight: 700; word-break: break-all; }

/* Тема */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-opt {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 10px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  text-align: center;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.theme-opt:active { transform: scale(.96); }
.theme-opt.active { border-color: var(--star); background: var(--star-soft); }
.th-prev { display: flex; gap: 4px; }
.th-swatch { width: 22px; height: 22px; border-radius: 7px; border: 1px solid rgba(0, 0, 0, .08); }
.th-name { font-weight: 900; font-size: 11.5px; }
.th-check { font-size: 11px; font-weight: 900; color: var(--star); }

/* ---------------- Toasts ---------------- */
#toasts {
  position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex; flex-direction: column; gap: 8px;
  width: calc(100% - 28px); max-width: 400px;
  pointer-events: none;
}
.toast {
  background: var(--toast-bg);
  color: var(--toast-ink);
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  font-size: 13px; font-weight: 800;
  box-shadow: var(--shadow-lift);
  display: flex; align-items: center; gap: 8px;
  animation: slideDown .2s ease;
}
.toast .t-ico { font-size: 15px; }
.toast.err { background: #D9534F; color: #fff; }
.toast.ok { background: var(--green); color: #fff; }
@keyframes slideDown { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes urPop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes urWin { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: none; opacity: 1; } }
@keyframes upgShake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }

/* ---------------- Empty state ---------------- */
.empty-box { text-align: center; padding: 34px 16px; color: var(--ink-2); }
.empty-box .eb-ico { font-size: 44px; margin-bottom: 8px; }
.empty-box .eb-title { font-weight: 900; font-size: 15px; color: var(--ink); }
.empty-box .eb-sub { font-size: 12.5px; margin-top: 4px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 339px) {
  #app { padding-left: 10px; padding-right: 10px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .pack-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { gap: 8px; }
}
@media (min-width: 1025px) {
  #app { max-width: 560px; }
  #bottom-nav { max-width: 520px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
/* ---------------- Case showcase: ���� ��� ������ ---------------- */
.cs-head {
  display: flex; justify-content: flex-end;
  padding-bottom: 2px;
}
.cs-head .sheet-close { position: static; }
.cs-hero {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 0 6px;
  text-align: center;
}
.cs-case-wrap {
  position: relative;
  width: 128px; height: 128px;
  display: flex; align-items: center; justify-content: center;
}
.cs-case {
  position: relative; z-index: 2;
  width: 108px; height: 108px; object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(255, 193, 7, .45));
  animation: urWin .6s cubic-bezier(.2, .9, .3, 1.3) both;
}
.cs-case-glow {
  position: absolute; inset: -18px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 193, 7, .4), rgba(255, 46, 151, .12) 52%, transparent 68%);
  filter: blur(3px);
  animation: jpPulse 1.4s ease-in-out infinite alternate;
  pointer-events: none;
}
.cs-title {
  font-weight: 900; font-size: 24px; letter-spacing: -.01em;
  background: linear-gradient(90deg, #FFD54F, #FFC107, #FFE082);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cs-sub { font-size: 12.5px; color: var(--ink-2); font-weight: 700; max-width: 330px; }
.cs-open { width: 100%; margin-top: 12px; }

.cs-mode {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.cs-mode-btn {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.cs-mode-btn.on {
  background: var(--ink);
  color: var(--card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.cs-mode-btn:active { transform: scale(.97); }

.cs-divider {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 20px 0 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.cs-divider > span {
  font-weight: 900; font-size: 12px; letter-spacing: .16em; color: var(--ink-2);
}
.cs-sort-select {
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 10px; font-size: 11.5px; font-weight: 800;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='6'><path d='M0 0l4 6 4-6z' fill='%23999'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center;
  padding-right: 24px;
}

.cs-grid,
.catch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 440px) { .cs-grid, .catch-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 760px) { .cs-grid, .catch-grid { grid-template-columns: repeat(5, 1fr); } }

/* Showcase item card */
.sc-item {
  position: relative;
  min-height: 150px;
  border-radius: 16px;
  background:
    radial-gradient(120% 90% at 50% -15%, var(--gr, transparent), transparent 55%),
    linear-gradient(180deg, #1A1613, #12100D);
  border: 1px solid rgba(255, 255, 255, .06);
  overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 6px 7px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.sc-item::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: var(--gr2, linear-gradient(90deg, #888, #aaa));
  box-shadow: 0 -2px 10px var(--gr2, rgba(150, 150, 150, .5));
}
.sc-item:hover, .sc-item:active {
  transform: scale(1.04);
  box-shadow: 0 0 16px var(--gr-glow, rgba(255,255,255,.18));
  border-color: var(--gr-glow, rgba(255,255,255,.22));
}
.sc-value {
  align-self: flex-start;
  font-size: 12px; font-weight: 900; color: var(--star);
  padding: 2px 7px; border-radius: 7px;
  background: rgba(0, 0, 0, .35);
  z-index: 2;
}
.sc-glow {
  position: absolute; inset: 15% 8% 26%; border-radius: 14px; z-index: 1;
  background: radial-gradient(circle at 50% 45%, var(--gr-core, transparent), transparent 65%);
  pointer-events: none;
}
.sc-img {
  position: relative; z-index: 2;
  width: 58%; height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .5));
  flex: 0 0 auto;
}
.sc-labels {
  display: flex; flex-direction: column; align-items: center; text-align: center; z-index: 2;
  margin-top: auto; width: 100%; gap: 2px;
  padding-top: 2px;
}
.sc-sys {
  font-size: 9px; color: var(--ink-3); font-weight: 800; letter-spacing: .02em;
  line-height: 1.2;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.sc-name {
  font-size: 11px; font-weight: 900; color: var(--ink); line-height: 1.2;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Grade neon palette */
.grade-base  { --gr: rgba(150,150,150,.22);  --gr2: linear-gradient(90deg,#8a8f98,#b9bec7); --gr-core: rgba(170,175,184,.5);  --gr-glow: rgba(160,165,175,.5); }
.grade-mid   { --gr: rgba(56,160,224,.22);   --gr2: linear-gradient(90deg,#1e9ad4,#6fd3ff); --gr-core: rgba(80,180,235,.55);  --gr-glow: rgba(80,190,255,.55); }
.grade-high  { --gr: rgba(232,64,150,.25);   --gr2: linear-gradient(90deg,#e0409b,#ff7ac4); --gr-core: rgba(240,90,170,.55); --gr-glow: rgba(255,90,190,.55); }
.grade-ultra { --gr: rgba(232,160,32,.3);    --gr2: linear-gradient(90deg,#c98a00,#ffd54f); --gr-core: rgba(255,199,44,.6); --gr-glow: rgba(255,200,50,.7); }
.grade-top   { --gr: rgba(255,59,48,.28);    --gr2: linear-gradient(90deg,#d91f1f,#ff6b5e); --gr-core: rgba(255,80,70,.6); --gr-glow: rgba(255,75,65,.75); }

/* Catch animation */
.catch-stage { padding: 6px 0 2px; }
.catch-grid .sc-item.catch-on {
  outline: 2px solid var(--gr-glow, #fff);
  outline-offset: -2px;
  box-shadow: 0 0 18px var(--gr-glow, rgba(255,255,255,.4));
  transform: scale(1.03);
}
.catch-grid .sc-item.catch-win {
  outline: 3px solid var(--gr-glow, #fff);
  animation: catchWin .6s cubic-bezier(.2, .9, .3, 1.3) both;
}
@keyframes catchWin {
  0% { transform: scale(1); box-shadow: 0 0 0 0 var(--gr-glow, rgba(255,255,255,.5)); }
  55% { transform: scale(1.1); box-shadow: 0 0 26px 6px var(--gr-glow, rgba(255,255,255,.5)); }
  100% { transform: scale(1); }
}

/* Royal jackpot accent */
.reveal-wrap.jackpot-royal .jackpot-tag { background: linear-gradient(135deg, #FF3B30, #d91f1f); box-shadow: 0 0 18px rgba(255,59,48,.55); }
.reveal-wrap.jackpot-royal .jackpot-media img { filter: drop-shadow(0 6px 18px rgba(255, 59, 48, .5)); }
.reveal-wrap.jackpot-royal .jackpot-name { background: linear-gradient(90deg, #FF6B5E, #FF3B30, #FFD54F); -webkit-background-clip: text; background-clip: text; }
.reveal-wrap.jackpot-royal .jackpot-glow { background: radial-gradient(circle, rgba(255,59,48,.55), rgba(255,193,7,.2) 50%, transparent 68%); }

/* Real Telegram gifts collection (TON inventory) */
.section-title.db-title { border-top: 1px dashed var(--line-strong); padding-top: 18px; margin-top: 24px; }
.gift-item[data-dblocked] .gift-media img { filter: grayscale(1); opacity: .8; }
