:root {
  --bg: #071018;
  --card: rgba(16, 28, 40, 0.88);
  --stroke: rgba(255, 255, 255, 0.08);
  --text: #f4f8fb;
  --muted: #8ea0b3;
  --blue: #2aabee;
  --gold: #ffd76a;
  --common: #9aa8b8;
  --uncommon: #3dd68c;
  --rare: #4aa3ff;
  --epic: #c084fc;
  --legendary: #ffb020;
  --item: 108px;
  --gap: 10px;
  --dock: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { min-height: 100%; background: var(--bg); color: var(--text); font-family: "Manrope", "SF Pro Display", sans-serif; }
body { overflow-x: hidden; }
button { font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:active { transform: scale(0.98); }

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: .04;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.auth, .app { position: relative; z-index: 1; }
.auth {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 48px;
  text-align: center;
  background:
    radial-gradient(700px 420px at 50% 20%, rgba(42,171,238,.22), transparent 60%),
    var(--bg);
}
.auth-logo {
  width: 112px;
  height: 112px;
  border-radius: 28px;
  object-fit: cover;
  background: #071018;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: none;
  margin-bottom: 16px;
}
.auth h1 { font-size: 28px; letter-spacing: -.04em; }
.auth-sub, .auth-status, .auth-hint { color: var(--muted); }
.auth-sub { margin: 6px 0 18px; }
.auth-status { margin-bottom: 16px; font-weight: 700; color: #c9d7e4; }
.auth .promo-bar,
.auth .give-bar {
  width: min(100%, 340px);
  margin: 0 0 16px;
  text-align: left;
}
.auth-hint { margin-top: 14px; font-size: 12px; max-width: 280px; }
.auth-hint:empty { display: none; }

.btn-tg {
  border: 0;
  height: 52px;
  padding: 0 22px;
  border-radius: 16px;
  background: #2aabee;
  color: #fff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(42,171,238,.35);
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 14px calc(var(--dock) + 22px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.brand {
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  min-width: 0;
  flex: 1 1 auto;
}
.logo-img {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  background: #071018;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: none;
}
.brand span { min-width: 0; }
.brand b {
  display: block;
  font-size: 15px;
  letter-spacing: -.03em;
  white-space: nowrap;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn, .plus, .avatar-btn, .dock-btn, .spin, .ghost, .pack, .close-x, .support-link, .btn-claim {
  cursor: pointer;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  font-weight: 800;
}
.balance {
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  border-radius: 999px;
  padding: 5px 6px 5px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.balance b { font-variant-numeric: tabular-nums; }
.plus {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.avatar-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #173044 center/cover no-repeat;
  overflow: hidden;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

.online-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 215, 106, .1);
  border: 1px solid rgba(255, 215, 106, .28);
  color: #ffe9a8;
  font-size: 12px;
  font-weight: 800;
}
.online-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3dd68c;
  box-shadow: 0 0 0 4px rgba(61, 214, 140, .18);
}
.online-chip b { font-variant-numeric: tabular-nums; color: #fff; }
.live-bar { margin: -2px 0 12px; }
.live-head {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}
.drop-feed {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow: hidden;
}
.drop-card {
  position: relative;
  flex: 0 0 78px;
  width: 78px;
  height: 78px;
  border-radius: 16px;
  background: #12202c;
  border: 1px solid var(--stroke);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.drop-card.common { background: linear-gradient(180deg, #1a2630, #101820); }
.drop-card.uncommon { background: linear-gradient(180deg, #123528, #0d1c18); }
.drop-card.rare { background: linear-gradient(180deg, #12324a, #0d1824); }
.drop-card.epic { background: linear-gradient(180deg, #2a1a40, #140e1c); }
.drop-card.legendary { background: linear-gradient(180deg, #3a2a10, #1a1408); }
.drop-card.gold {
  background:
    linear-gradient(180deg, #ffe08a 0%, #f0b429 42%, #b8860b 100%);
  border-color: #ffd76a;
  box-shadow: 0 8px 18px rgba(255, 183, 32, .28);
}
.drop-card img.drop-pic {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.35));
}
.drop-ava {
  position: absolute;
  left: 6px;
  bottom: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
  color: #1a1200;
  background: #ffd76a;
  border: 1px solid rgba(0,0,0,.2);
}
.drop-card:not(.gold) .drop-ava {
  color: #fff;
  background: #2aabee;
  border-color: rgba(255,255,255,.2);
}
.drop-mask { flex: 1; min-width: 0; overflow: hidden; }
.drop-track {
  display: flex;
  gap: 8px;
  width: max-content;
  animation: feed-scroll 32s linear infinite;
}
@keyframes feed-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.hero, .profile-card, .stat, .card, .sheet-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 22px;
}
.hero { padding: 16px 12px 14px; }
.hero-head, .page-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.hero-head h2, .page-head h2 { font-size: 16px; }
.hero-head span, .page-head p, .sub { color: var(--muted); font-size: 12px; }
.page-head { flex-direction: column; align-items: flex-start; padding: 6px 2px 10px; }
.page-head.tight { margin-top: 16px; }

.roulette-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(54vh, 560px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.roulette-stack[data-count="1"] { max-height: none; overflow: visible; }
.roulette-wrap {
  position: relative;
  overflow: hidden;
  height: 148px;
  border-radius: 18px;
  background: #09131c;
  border: 1px solid rgba(255,255,255,.06);
  flex: 0 0 auto;
}
.roulette-stack[data-count="2"] .roulette-wrap,
.roulette-stack[data-count="3"] .roulette-wrap { height: 108px; }
.roulette-stack[data-count="4"] .roulette-wrap,
.roulette-stack[data-count="5"] .roulette-wrap { height: 86px; }
.roulette-stack[data-count="6"] .roulette-wrap,
.roulette-stack[data-count="7"] .roulette-wrap { height: 72px; }
.roulette-stack[data-count="8"] .roulette-wrap,
.roulette-stack[data-count="9"] .roulette-wrap,
.roulette-stack[data-count="10"] .roulette-wrap { height: 62px; }
.roulette-stack:not([data-count="1"]) .cell { height: 100%; border-radius: 12px; }
.roulette-stack:not([data-count="1"]) .cell img { width: 52px; height: 52px; }
.roulette-stack[data-count="6"] .cell img,
.roulette-stack[data-count="7"] .cell img { width: 42px; height: 42px; }
.roulette-stack[data-count="8"] .cell img,
.roulette-stack[data-count="9"] .cell img,
.roulette-stack[data-count="10"] .cell img { width: 36px; height: 36px; }
.roulette-wrap::before, .roulette-wrap::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; width: 64px; z-index: 3; pointer-events: none;
}
.roulette-wrap::before { left: 0; background: linear-gradient(90deg, #09131c, transparent); }
.roulette-wrap::after { right: 0; background: linear-gradient(270deg, #09131c, transparent); }
.pointer {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
  box-shadow: 0 0 16px rgba(255,215,106,.7);
  z-index: 4;
  pointer-events: none;
}
.pointer::before, .pointer::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  border-left: 8px solid transparent; border-right: 8px solid transparent;
}
.pointer::before { top: 0; border-top: 10px solid var(--gold); }
.pointer::after { bottom: 0; border-bottom: 10px solid var(--gold); }
.track { display: flex; align-items: center; height: 100%; gap: var(--gap); padding: 0 12px; will-change: transform; }

.cell {
  flex: 0 0 var(--item);
  width: var(--item);
  height: 120px;
  border-radius: 16px;
  background: #101c28;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.cell img { width: 78px; height: 78px; object-fit: contain; }
.cell .rarity-bar { position: absolute; left: 10px; right: 10px; bottom: 8px; height: 3px; border-radius: 99px; }
.cell.common { box-shadow: inset 0 0 0 1px rgba(154,168,184,.2); }
.cell.uncommon { box-shadow: inset 0 0 0 1px rgba(61,214,140,.35); }
.cell.rare { box-shadow: inset 0 0 0 1px rgba(74,163,255,.4); }
.cell.epic { box-shadow: inset 0 0 0 1px rgba(192,132,252,.45); }
.cell.legendary { box-shadow: inset 0 0 0 1px rgba(255,176,32,.55), 0 0 22px rgba(255,176,32,.16); }
.rarity-bar.common { background: var(--common); }
.rarity-bar.uncommon { background: var(--uncommon); }
.rarity-bar.rare { background: var(--rare); }
.rarity-bar.epic { background: var(--epic); }
.rarity-bar.legendary { background: linear-gradient(90deg, #ffb020, #ffe08a, #ffb020); }

.spin-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.spin-count {
  display: flex;
  align-items: center;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  overflow: hidden;
}
.spin-step {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  font-size: 20px;
  font-weight: 800;
  color: #7ec8ee;
}
.spin-count b {
  min-width: 22px;
  text-align: center;
  font-size: 16px;
}
.spin-count.is-locked { opacity: .5; pointer-events: none; }
.spin-meta-hint { color: var(--muted); font-size: 12px; font-weight: 700; }
.actions { display: flex; gap: 10px; margin-top: 10px; }
.win-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin: 4px 0 16px;
}
.win-item {
  background: #101c28;
  border-radius: 12px;
  padding: 8px 6px;
}
.win-item img { width: 56px; height: 56px; object-fit: contain; }
.win-item b { display: block; font-size: 11px; margin-top: 4px; line-height: 1.25; }
.win-item small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.spin, .ghost {
  height: 54px;
  border-radius: 16px;
  border: 0;
  font-weight: 800;
}
.spin {
  flex: 1;
  background: linear-gradient(180deg, #3bbcff, #1e96d1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 24px rgba(42,171,238,.32);
}
.spin:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.spin .cost {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(0,0,0,.18); border-radius: 999px; padding: 4px 9px; font-size: 13px;
}
.spin .cost s, .cost-line s {
  opacity: .55;
  text-decoration: line-through;
  font-weight: 700;
  margin-right: 2px;
}
.ghost {
  padding: 0 16px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
}
.hint { margin-top: 10px; text-align: center; color: var(--muted); font-size: 12px; }

.page { display: none; }
.page.active { display: block; }

.admin-grant {
  margin-top: 14px;
  padding: 16px 12px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 22px;
}
.admin-grant h2 { font-size: 16px; margin-bottom: 12px; }
.admin-grant .spin { width: 100%; margin-top: 8px; }
.admin-inv-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.admin-inv-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #101c28;
  border-radius: 14px;
  padding: 8px 10px;
}
.admin-inv-row img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 40px; }
.admin-inv-row b { display: block; font-size: 13px; }
.admin-inv-row small { color: var(--muted); font-size: 11px; }
.admin-inv-row .ghost { height: 36px; padding: 0 12px; margin-left: auto; }

.case-shop { margin-bottom: 8px; }
.case-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.case-card {
  border: 1px solid var(--stroke);
  background: var(--card);
  border-radius: 22px;
  padding: 0 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  overflow: hidden;
}
.case-card img {
  width: 100%;
  height: 148px;
  object-fit: cover;
  background: #09131c;
}
.case-card b { font-size: 15px; letter-spacing: -.02em; }
.case-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(42,171,238,.16);
  color: #7ec8ee;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 800;
  font-size: 13px;
}
.case-play { position: relative; }
.case-play-title { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.case-play-title img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  background: #09131c;
}
.case-back {
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  height: 36px;
  padding: 0 12px;
  font-weight: 800;
  margin-bottom: 10px;
}
@media (min-width: 640px) {
  .case-grid { grid-template-columns: repeat(3, 1fr); }
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.card {
  padding: 12px;
  min-height: 196px;
  cursor: pointer;
  position: relative;
}
.card .up-buy-btn { cursor: pointer; }
.card.common { box-shadow: inset 0 0 0 1px rgba(154,168,184,.16); }
.card.uncommon { box-shadow: inset 0 0 0 1px rgba(61,214,140,.28); }
.card.rare { box-shadow: inset 0 0 0 1px rgba(74,163,255,.3); }
.card.epic { box-shadow: inset 0 0 0 1px rgba(192,132,252,.32); }
.card.legendary { box-shadow: inset 0 0 0 1px rgba(255,176,32,.4); }
.card > img { width: 100%; height: 92px; object-fit: contain; }
.card .name { font-size: 13px; font-weight: 800; margin-top: 8px; }
.card .meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.card .meta span { display: inline-flex; align-items: center; gap: 4px; }
.card .styles-count { margin-top: 6px; font-size: 11px; color: #7ec8ee; font-weight: 700; }

.badge { font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.badge.common { color: var(--common); }
.badge.uncommon { color: var(--uncommon); }
.badge.rare { color: var(--rare); }
.badge.epic { color: var(--epic); }
.badge.legendary { color: var(--legendary); }

.empty { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 28px 8px; }

.profile-card { padding: 18px; display: flex; gap: 14px; align-items: center; }
.profile-card img, .profile-ava {
  width: 64px; height: 64px; border-radius: 20px; object-fit: cover; background: #173044;
  display: grid; place-items: center; font-weight: 800; font-size: 22px;
}
.profile-card h3 { font-size: 20px; }
.profile-card p { color: var(--muted); font-size: 13px; }
.tg-badge { display: inline-block; margin-top: 6px; font-size: 11px; color: #7ec8ee; font-weight: 800; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.stat { padding: 14px; }
.stat b { display: block; font-size: 20px; margin-top: 4px; }
.stat span { color: var(--muted); font-size: 12px; }

.support-link {
  display: block;
  text-align: center;
  text-decoration: none;
  background: #2aabee;
  color: #fff;
  font-weight: 800;
  border-radius: 16px;
  padding: 14px;
  margin: 14px 0 4px;
}
.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
  background: rgba(7,16,24,.92);
  border-top: 1px solid var(--stroke);
  backdrop-filter: blur(16px);
}
.dock-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.dock-btn svg { width: 20px; height: 20px; }
.dock-btn.active { color: #fff; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(4,8,12,.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.sheet[hidden] { display: none !important; }
.sheet-card {
  width: min(440px, 100%);
  max-height: 88dvh;
  overflow: auto;
  padding: 20px 16px 16px;
  text-align: center;
  position: relative;
}
.sheet-card.wide { width: min(720px, 100%); text-align: left; }
.close-x {
  position: absolute; top: 10px; right: 12px;
  width: 36px; height: 36px; border: 0; background: rgba(255,255,255,.06);
  border-radius: 50%; font-size: 22px;
}
#winAnim { width: 210px; height: 210px; margin: 0 auto 6px; }
.sheet-card h3 { font-size: 22px; margin-bottom: 4px; }
.value {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,193,74,.12); color: var(--gold);
  border-radius: 999px; padding: 6px 12px; font-weight: 800; margin: 10px 0 16px;
}
.btn-claim {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 54px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #3bbcff, #1e96d1);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  text-align: center;
  box-shadow: 0 10px 24px rgba(42,171,238,.32);
}
.promo-bar, .promo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #3bbcff, #1e96d1);
  color: #fff;
  font-weight: 800;
  text-align: left;
}
.promo-bar span, .promo-card span { font-size: 13px; }
.promo-bar b, .promo-card b {
  font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,.2);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
}
.promo-card { margin-top: 10px; }
.give-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  padding: 13px 14px;
  border: 0;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 215, 106, .22), rgba(42, 171, 238, .16) 48%, rgba(255, 140, 64, .2)),
    linear-gradient(180deg, #1a2a38, #101820);
  color: #fff;
  font-weight: 800;
  text-align: left;
  box-shadow: 0 10px 26px rgba(255, 183, 77, .18);
  cursor: pointer;
}
.give-bar span { font-size: 14px; letter-spacing: -.02em; }
.give-bar b {
  font-variant-numeric: tabular-nums;
  background: rgba(255, 215, 106, .18);
  color: #ffe7a8;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}
.packs { display: grid; gap: 8px; margin-top: 12px; }
.pack {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  border-radius: 14px;
  padding: 14px;
  font-weight: 800;
}
.pack.promo-pack {
  border-color: rgba(42,171,238,.55);
  background: linear-gradient(180deg, #3bbcff, #1e96d1);
  color: #fff;
}
.gift-pay {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 215, 106, .12);
  border: 1px solid rgba(255, 215, 106, .35);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}
.gift-pay small { color: var(--gold); font-size: 12px; }
.pack-timer {
  font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,.22);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
}
.styles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.style-card {
  border: 1px solid var(--stroke);
  background: #101c28;
  border-radius: 14px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
}
.style-card img { width: 100%; height: 72px; object-fit: contain; }
.style-card span { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; line-height: 1.3; }
.star, .tg-star {
  width: 14px;
  height: 14px;
  max-width: 14px;
  max-height: 14px;
  display: inline-block;
  vertical-align: -2px;
  object-fit: contain;
}
.star-live {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-grid;
  place-items: center;
  pointer-events: none;
}
.star-live svg { width: 20px !important; height: 20px !important; }
.cost .star-live, .cost-line .star-live, .card .star-live, .meta .star-live, .value .star-live, .up-num .star-live, .up-extra .star-live {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}
.cost .star-live svg, .cost-line .star-live svg, .card .star-live svg, .meta .star-live svg, .value .star-live svg, .up-extra .star-live svg {
  width: 14px !important;
  height: 14px !important;
}
@keyframes star-twinkle {
  0%, 100% { transform: rotate(0deg) scale(1); filter: drop-shadow(0 0 2px rgba(255,215,106,.4)); }
  45% { transform: rotate(14deg) scale(1.14); filter: drop-shadow(0 0 7px rgba(255,226,122,.95)); }
  70% { transform: rotate(-6deg) scale(.96); filter: drop-shadow(0 0 3px rgba(255,193,74,.7)); }
}
.tg-star, .star-live > img {
  animation: star-twinkle 1.7s ease-in-out infinite;
}
.cost-line { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.row-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; }
.row-scroll .card { min-width: 132px; flex: 0 0 132px; min-height: 168px; }
.card.picked { outline: 2px solid #2aabee; }

.up-arena {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  padding: 14px 10px 14px;
  margin-bottom: 12px;
  text-align: center;
}
.up-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}
.up-box {
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.up-box small { color: var(--muted); font-size: 11px; font-weight: 700; }
.up-box-pic {
  width: 100%;
  max-width: 104px;
  aspect-ratio: 1;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,.12);
  background: #0b1520;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.up-box-pic .up-ph { width: 36%; opacity: .95; filter: drop-shadow(0 0 8px rgba(42,171,238,.4)); }
.up-box-pic.filled { border-style: solid; border-color: rgba(42,171,238,.45); background: #0b1520; }
.up-box-pic.filled img { width: 78%; height: 78%; object-fit: contain; }
.up-anim {
  width: 86%;
  height: 86%;
  display: grid;
  place-items: center;
}
.up-anim svg, .up-anim img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

.up-gauge {
  position: relative;
  width: 100%;
  max-width: 268px;
  margin: 0 auto;
  aspect-ratio: 1;
  filter: drop-shadow(0 16px 32px rgba(42,171,238,.2));
}
.up-gauge-glow {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(42,171,238,.32), rgba(42,171,238,.05) 46%, transparent 72%);
  pointer-events: none;
}
.up-gauge-bg, .up-gauge-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.up-logo {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 20%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 16px rgba(42,171,238,.55));
  z-index: 2;
  pointer-events: none;
}
.up-chance {
  position: absolute;
  left: 0;
  right: 0;
  top: 56%;
  z-index: 2;
  color: #e8f7ff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.04em;
  text-shadow: 0 0 18px rgba(42,171,238,.7);
  pointer-events: none;
}
.up-pointer-rotor {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  transform-origin: 50% 50%;
}
.up-pointer {
  position: absolute;
  left: 50%;
  bottom: 0.4%;
  width: 11%;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 8px rgba(42,171,238,.75));
}
.hint:empty { display: none; }
.up-btn {
  width: 100%;
  height: 48px;
  margin-top: 12px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #3bbcff, #1e96d1);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(42,171,238,.32);
}
.up-btn img { width: 12px; height: 12px; filter: brightness(0) invert(1); }
.up-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.up-arena .hint { margin-top: 10px; }
.up-controls { margin-top: 12px; text-align: left; }
.up-kicker {
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.up-kicker:first-child { margin-top: 0; }
.up-mults { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.up-chip {
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: 999px;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  flex: 0 0 auto;
}
.up-chip.active {
  background: rgba(42,171,238,.18);
  border-color: #2aabee;
  color: #7ec8ee;
}
.up-custom {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.up-custom label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.up-num {
  display: flex;
  align-items: center;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #0b1520;
  padding: 0 8px;
  color: #7ec8ee;
  font-weight: 800;
}
.up-num input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  outline: none;
}
.up-slider { display: block; margin-top: 12px; }
.up-slider span { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.up-slider b { color: #7ec8ee; }
.up-slider input[type="range"] {
  width: 100%;
  accent-color: #2aabee;
  height: 4px;
}
.up-extra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.up-extra input {
  width: 96px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #0b1520;
  color: #fff;
  padding: 0 10px;
  font: inherit;
  font-weight: 800;
}
.up-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 4px 0 8px;
}
.up-buy-btn {
  width: 100%;
  height: 34px;
  margin-top: 8px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #3bbcff, #1e96d1);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}
.inv-actions {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.inv-actions .up-buy-btn { margin-top: 0; }
.out-btn {
  width: 100%;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #3dd68c, #1f9d5f);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(61, 214, 140, .22);
}
.out-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.out-preview img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}
.out-dest {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 14px;
}
.out-chip {
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  font-weight: 800;
  cursor: pointer;
}
.out-chip.active {
  border-color: transparent;
  background: linear-gradient(180deg, #3dd68c, #1f9d5f);
  color: #fff;
  box-shadow: 0 8px 18px rgba(61, 214, 140, .22);
}
#outSendBtn, #outDone .btn-claim {
  width: 100%;
  flex: none;
  margin-top: 4px;
}
#outDone .sub { margin: 8px 0 16px; line-height: 1.4; }
.out-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
  background: #2a3642;
}
.battle-hero { padding-bottom: 18px; }
.battle-search {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 168px;
  margin: 4px 0 12px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: #09131c;
}
.battle-search[hidden] { display: none !important; }
.battle-search b { font-size: 16px; }
.search-orb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2aabee;
  box-shadow: 0 0 0 0 rgba(42,171,238,.45);
  animation: search-pulse 1.1s ease-out infinite;
}
@keyframes search-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(42,171,238,.45); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 14px rgba(42,171,238,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(42,171,238,0); }
}
.battle-seats {
  display: grid;
  grid-template-columns: repeat(var(--seats, 2), minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 12px;
}
.battle-slot {
  min-height: 168px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(8, 16, 24, .88);
  padding: 10px 6px;
  text-align: center;
}
.battle-slot.me { box-shadow: inset 0 0 0 1px rgba(42,171,238,.35); }
.battle-slot.win { box-shadow: inset 0 0 0 1px rgba(255,215,106,.45); }
.battle-slot .who { font-size: 11px; font-weight: 800; color: var(--muted); margin-bottom: 8px; }
.battle-slot .sum { margin-top: 8px; font-size: 12px; font-weight: 800; color: #ffe7a8; }
.v-stack {
  display: flex;
  justify-content: center;
}
.v-wrap {
  --v-cell: 72px;
  box-sizing: content-box;
  position: relative;
  overflow: hidden;
  width: calc(var(--v-cell) + 8px);
  height: calc(var(--v-cell) * 3);
  border-radius: 18px;
  background: #09131c;
  border: 1px solid rgba(255,255,255,.06);
}
.v-wrap::before, .v-wrap::after {
  content: "";
  position: absolute;
  left: 0; right: 0; height: var(--v-cell); z-index: 3; pointer-events: none;
}
.v-wrap::before { top: 0; background: linear-gradient(180deg, #09131c 0%, #09131c 42%, transparent); }
.v-wrap::after { bottom: 0; background: linear-gradient(0deg, #09131c 0%, #09131c 42%, transparent); }
.v-window {
  position: absolute;
  left: 4px;
  top: var(--v-cell);
  width: var(--v-cell);
  height: var(--v-cell);
  border: 2px solid #f5c518;
  border-radius: 16px;
  box-shadow: none;
  z-index: 4;
  pointer-events: none;
}
.v-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0;
  will-change: transform;
}
.v-track .cell,
.v-track .cell.common,
.v-track .cell.uncommon,
.v-track .cell.rare,
.v-track .cell.epic,
.v-track .cell.legendary {
  flex: 0 0 var(--v-cell);
  width: var(--v-cell);
  height: var(--v-cell);
  border-radius: 16px;
  box-shadow: none;
  background: #101c28;
}
.v-track .cell img { width: 56px; height: 56px; }
.v-track .rarity-bar { display: none; }
.battle-hist {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 28px;
  margin-top: 8px;
}
.battle-hist img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 6px;
  background: #101c28;
}
.battle-status {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--stroke);
  font-weight: 800;
  margin-bottom: 12px;
}
.battle-setup { display: grid; gap: 10px; margin-bottom: 12px; }
.battle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
}
.battle-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.up-buy-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}
.up-tab {
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  font-weight: 800;
  cursor: pointer;
}
.up-tab.active {
  background: rgba(42,171,238,.16);
  border-color: #2aabee;
  color: #7ec8ee;
}
.up-shop-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 8px;
  margin-bottom: 10px;
}
.up-shop-bar input, .up-shop-bar select {
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #0b1520;
  color: #fff;
  padding: 0 12px;
  font: inherit;
}
.card .up-odds {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #7ec8ee;
}

.upgrade-box { background: var(--card); border: 1px solid var(--stroke); border-radius: 18px; padding: 14px; margin-bottom: 12px; }
.field { display: block; margin-bottom: 10px; text-align: left; }
.field span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.field input {
  width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--stroke);
  background: #0b1520; color: #fff; padding: 0 12px; font: inherit;
}
.field-row { display: flex; gap: 8px; }
.field-row input {
  flex: 1; min-width: 0; height: 44px; border-radius: 12px; border: 1px solid var(--stroke);
  background: #0b1520; color: #fff; padding: 0 12px; font: inherit;
}
.footer { margin-top: 22px; color: var(--muted); font-size: 11px; text-align: center; line-height: 1.5; }

@media (max-width: 520px) {
  .roulette-wrap { height: 136px; }
  .brand b { font-size: 14px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .brand small { display: none; }
  .online-chip { display: none; }
}
