:root {
  --text: #f5f5f7;
  --text-dim: #a7a7b0;
  --text-soft: #e6e6ea;
  --accent: #9ad9ff;
  --bg: #000000;
  --raised: rgba(255, 255, 255, 0.07);
  --strong: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.22);
  --holo-a: #00f6ff;
  --holo-b: #6a8bff;
  --holo-c: #ff2bd6;
  --holo-d: #39ffb6;
  --holo-border: conic-gradient(
    from 200deg,
    var(--holo-a),
    var(--holo-b),
    var(--holo-c),
    var(--holo-d),
    var(--holo-a)
  );
  --glass: rgba(6, 8, 16, 0.55);
  --glass-strong: rgba(12, 14, 24, 0.72);
  --glass-edge: rgba(255, 255, 255, 0.38);
  --glass-shine: rgba(255, 255, 255, 0.55);
  --glass-blur: blur(10px) saturate(1.25);
  --glass-shadow:
    0 0 16px rgba(0, 246, 255, 0.12),
    0 0 24px rgba(255, 43, 214, 0.08),
    0 12px 28px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  --radius-xs: 10px;
  --radius-sm: 22px;
  --radius-md: 999px;
  /* Fixed insets: auto-cropped gift art fits inside these margins. */
  --gift-inset: 10px;
  --gift-inset-mini: 8px;
  --gift-inset-bag: 8px;
  --gift-inset-win: 24px;
  --font: Manrope, "Avenir Next", "Segoe UI", sans-serif;
  --display: Unbounded, Manrope, sans-serif;
  color-scheme: dark;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 400;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html {
  height: var(--tg-viewport-stable-height, 100%);
  -webkit-text-size-adjust: 100%;
}
body {
  color: var(--text);
  background: #000;
  min-height: var(--tg-viewport-stable-height, 100dvh);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button, a, [role="button"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 18% 12%, rgba(109, 78, 194, 0.55), transparent 60%),
    radial-gradient(ellipse 60% 45% at 82% 40%, rgba(196, 169, 255, 0.28), transparent 62%),
    radial-gradient(ellipse 70% 50% at 42% 88%, rgba(45, 20, 104, 0.7), transparent 64%),
    #000;
}
.logo-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("/brand/logo.png") center 42% / min(72vw, 420px) auto no-repeat;
  opacity: 0.2;
}
.app { position: relative; z-index: 1; }

/* Decorative holo border — only on non-interactive surfaces.
   Masked ::before overlays steal taps in Telegram WebView. */
.glass,
.top,
.balance,
.panel,
.prize-card,
.bag-card,
.admin-card,
.bet-value,
.modal-card,
.mini,
.avatar {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(255, 255, 255, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
    var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  border: 0;
}

.glass::before,
.top::before,
.balance::before,
.panel::before,
.prize-card::before,
.bag-card::before,
.admin-card::before,
.bet-value::before,
.modal-card::before,
.mini::before,
.avatar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--holo-border);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.82;
  pointer-events: none;
  z-index: 0;
}

/* Interactive glass: solid edge via box-shadow, no tap-blocking overlay */
.bet-btn,
.btn,
.btn-ghost,
.tabs {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow:
    var(--glass-shadow),
    0 0 0 1px rgba(255, 255, 255, 0.28),
    0 0 18px rgba(0, 246, 255, 0.12);
  border: 0;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app {
  width: min(480px, 100%);
  margin: 0 auto;
  min-height: var(--tg-viewport-stable-height, 100dvh);
  padding:
    calc(8px + env(safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px))
    16px
    calc(118px + env(safe-area-inset-bottom, 0px) + var(--tg-safe-area-inset-bottom, 0px));
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
  padding: 10px 12px 10px 10px;
  border-radius: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.brand-mark-wrap {
  position: relative;
  flex: 0 0 auto;
  padding: 2px;
  border-radius: 16px;
  background: var(--holo-border);
  box-shadow:
    0 0 18px rgba(0, 246, 255, 0.28),
    0 0 28px rgba(255, 43, 214, 0.16);
}
.brand-mark-wrap::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 40%, rgba(0, 246, 255, 0.28), transparent 68%);
  z-index: -1;
  pointer-events: none;
}
.brand-mark {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 14px;
  background: #05030a;
}
.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.brand-name {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #ffffff 18%, #d7ecff 62%, #9ad9ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(154, 217, 255, 0.78);
}
.balance {
  display: grid;
  justify-items: end;
  gap: 3px;
  min-width: 92px;
  padding: 8px 14px;
  border-radius: 18px;
}
.balance-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.48);
}
.balance-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1;
}
.star-icon { width: 15px; height: 15px; flex: 0 0 15px; display: block; }
.star-icon.lg { width: 34px; height: 34px; flex-basis: 34px; }
.star-icon.xl { width: 42px; height: 42px; flex-basis: 42px; }

.kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.display {
  margin: 0;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.lede {
  margin: 10px 0 0;
  color: var(--text-dim);
  line-height: 1.45;
}

.win-ticker {
  position: relative;
  margin: 2px 0 6px;
  height: 42px;
  overflow: hidden;
}
.win-ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  width: max-content;
  white-space: nowrap;
  animation: ticker-scroll var(--ticker-duration, 28s) linear infinite;
  pointer-events: none;
}
.win-ticker.is-paused .win-ticker-track {
  animation-play-state: paused;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: #1b1e28;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-soft);
}
.ticker-user { color: var(--text); font-weight: 700; }
.ticker-sep {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 11px;
}
.ticker-prize { color: var(--accent); font-weight: 700; }
.ticker-item.ticker-rare .ticker-prize { color: #8ec5ff; }
.ticker-item.ticker-epic .ticker-prize { color: #ffa6f0; }
.ticker-item.ticker-legendary .ticker-prize { color: #ffd56a; }

@keyframes ticker-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .win-ticker-track { animation: none; }
}

.reel-wrap { margin-top: 14px; position: relative; }
.reel {
  height: 148px;
  overflow: hidden;
  border-radius: 18px;
  background: #101218;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  contain: content;
}
.reel-marker {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translate3d(-50%, 0, 0);
  background: #fff;
  pointer-events: none;
}
.reel-track {
  display: flex;
  gap: 8px;
  height: 100%;
  align-items: center;
  padding-left: 8px;
}
.reel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, #101218 0%, transparent 18%, transparent 82%, #101218 100%);
}
.reel.is-spinning .reel-card img {
  pointer-events: none;
}
.reel-card {
  width: 104px;
  flex: 0 0 104px;
  padding: 6px;
  border-radius: 12px;
  background: #1b1e28;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.reel-card.rarity-rare { box-shadow: inset 0 0 0 1px rgba(120, 190, 255, 0.7); }
.reel-card.rarity-epic { box-shadow: inset 0 0 0 1px rgba(220, 130, 255, 0.75); }
.reel-card.rarity-legendary { box-shadow: inset 0 0 0 1px rgba(255, 210, 120, 0.85); }
.reel-card.is-landed { box-shadow: inset 0 0 0 2px #fff; }
.reel-art, .gift-face {
  height: 92px;
  padding: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
}
.reel-art img, .gift-face img, .win-stage img, .win-photo {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
}
.reel-name, .gift-name {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reel-miss .reel-art {
  background: radial-gradient(circle at 50% 40%, #4a2038, #160910 78%);
  color: #ffb4c0;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
}
.reel-chips .reel-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--gift-inset);
  background:
    radial-gradient(circle at 50% 32%, #ffe38a 0%, #f6c445 28%, #7a4de0 100%);
  color: #1a1020;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}
.reel-chips .reel-art .star-icon {
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 3px rgba(80, 40, 0, 0.25));
}
.empty-reel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  text-align: center;
  padding: 0 36px;
}

.btn {
  width: 100%;
  margin-top: 14px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  color: #fff;
  position: relative;
  z-index: 1;
  cursor: pointer;
}
.btn .star-icon { width: 15px; height: 15px; flex-basis: 15px; }
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled {
  cursor: default;
  color: var(--text-dim);
  opacity: 0.72;
}

.bet-bar {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  gap: 10px;
  align-items: stretch;
}
.bet-btn {
  border-radius: var(--radius-sm);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}
.bet-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}
.bet-btn:active:not(:disabled) {
  transform: translateY(1px);
}
.bet-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.bet-value {
  display: grid;
  place-content: center;
  gap: 2px;
  text-align: center;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.bet-value .bet-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.bet-value strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 18px;
  font-weight: 800;
}
.bet-value .star-icon {
  width: 15px;
  height: 15px;
}
.btn-spin {
  margin-top: 10px;
}
.btn-ghost {
  color: var(--text-soft);
}
.btn-ghost:hover:not(:disabled) { filter: brightness(1.1); }
.btn-danger {
  width: auto;
  margin: 0;
  padding: 10px 12px;
  background: transparent;
  color: #ffb4c0;
  box-shadow: rgba(255, 180, 192, 0.45) 0 0 0 1px inset;
}

@property --neon-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.neon-run:not(:disabled) {
  position: relative;
  isolation: isolate;
  overflow: visible;
  --neon-color: #00f6ff;
  --neon-soft: rgba(0, 246, 255, 0.4);
}
.btn-spin.neon-run:not(:disabled)::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from var(--neon-angle),
    transparent 0%,
    transparent 62%,
    var(--neon-soft) 78%,
    var(--neon-color) 88%,
    #fff 93%,
    transparent 100%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: neon-orbit 4.2s linear infinite;
  pointer-events: none;
  z-index: 0;
}
.btn-spin.neon-run:not(:disabled) {
  --neon-color: #00f6ff;
  --neon-soft: rgba(0, 246, 255, 0.45);
}
@keyframes neon-orbit {
  to { --neon-angle: 360deg; }
}
.mystery-tag {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffe9a8;
}
.confirm-card { text-align: center; }
.confirm-card .confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.confirm-card .confirm-actions .btn { margin-top: 0; }
.confirm-price {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  color: #fff6c8;
}

.section { margin-top: 22px; }
.section h2 {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}
.mystery-lede {
  margin: -2px 0 14px;
  font-size: 13px;
}
.mystery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.mystery-card {
  position: relative;
  isolation: isolate;
  appearance: none;
  border: 0;
  padding: 12px 8px 14px;
  border-radius: 18px;
  color: inherit;
  text-align: center;
  cursor: pointer;
  background: #1b1e28;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 140ms ease;
}
.mystery-card.tone-violet { box-shadow: inset 0 0 0 1px rgba(220, 130, 255, 0.55); }
.mystery-card.tone-silver { box-shadow: inset 0 0 0 1px rgba(200, 215, 255, 0.5); }
.mystery-card.tone-gold { box-shadow: inset 0 0 0 1px rgba(255, 210, 120, 0.6); }
.mystery-card > * {
  position: relative;
  z-index: 1;
  pointer-events: none;
}
.mystery-card:active:not(:disabled) { transform: scale(0.96); }
.mystery-card:disabled {
  opacity: 0.45;
  cursor: default;
}
.mystery-visual {
  height: 102px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}
.mystery-name {
  display: block;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}
.mystery-price {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #fff6c8;
}
.mystery-price .star-icon { width: 12px; height: 12px; flex-basis: 12px; }

.mbox {
  position: relative;
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
}
.mbox-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
  user-select: none;
  pointer-events: none;
}
.mbox-tier-badge {
  position: absolute;
  right: 2px;
  bottom: 6px;
  z-index: 2;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.06)),
    rgba(8, 10, 18, 0.82);
  box-shadow:
    0 0 0 1px rgba(0, 246, 255, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.35);
}
.mbox-glow {
  position: absolute;
  inset: 22% -8% -12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 246, 255, 0.32), rgba(255, 43, 214, 0.14), transparent 72%);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}
.tone-silver .mbox-glow {
  background: radial-gradient(circle, rgba(220, 230, 255, 0.5), transparent 70%);
}
.tone-gold .mbox-glow {
  background: radial-gradient(circle, rgba(255, 214, 120, 0.55), transparent 70%);
}
.tone-violet .mbox-glow {
  background: radial-gradient(circle, rgba(255, 43, 214, 0.28), rgba(0, 246, 255, 0.22), transparent 72%);
}

.mystery-open {
  text-align: center;
  overflow: visible;
}
.box-stage {
  position: relative;
  min-height: 240px;
  display: grid;
  place-items: center;
  margin: 8px 0 4px;
}
.mystery-open .mbox {
  width: 168px;
  height: 168px;
  z-index: 2;
}
.mystery-open .mbox-tier-badge {
  right: 18px;
  bottom: 22px;
  min-width: 26px;
  height: 26px;
  font-size: 13px;
}
.mbox-art {
  will-change: transform;
}
.mbox.is-charging .mbox-art {
  animation: box-charge 900ms ease-in-out infinite;
}
.mbox.is-charging .mbox-glow {
  animation: box-breathe 900ms ease-in-out infinite;
}
.mbox.is-open .mbox-art {
  animation: box-pop 620ms cubic-bezier(.16, 1.2, .3, 1) both;
}
.mbox.is-open .mbox-glow {
  animation: box-flare 700ms ease-out both;
}
.mbox-burst {
  position: absolute;
  inset: -24%;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 55%, rgba(255, 244, 200, 0.9), transparent 42%),
    radial-gradient(circle at 30% 40%, rgba(0, 246, 255, 0.55), transparent 28%),
    radial-gradient(circle at 70% 35%, rgba(255, 43, 214, 0.45), transparent 26%);
}
.mbox.is-open .mbox-burst {
  animation: box-burst 780ms ease-out both;
}
.mbox.is-reveal-prize {
  opacity: 0;
  transform: scale(0.7) translateY(12px);
  transition: opacity 360ms ease, transform 360ms ease;
  pointer-events: none;
}
@keyframes box-pop {
  0% { transform: scale(1) rotate(0deg); }
  35% { transform: scale(1.08) rotate(-3deg); }
  70% { transform: scale(0.96) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.box-prize {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(18px) scale(0.82);
  pointer-events: none;
  z-index: 3;
}
.box-prize.is-show {
  opacity: 1;
  transform: none;
  transition: opacity 420ms ease, transform 520ms cubic-bezier(.16, 1.2, .3, 1);
}
.box-prize .win-stage {
  width: min(220px, 78vw);
  height: auto;
  aspect-ratio: 1;
  box-shadow: none;
}
.box-prize.is-multi {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 8px;
}
.box-prize.is-multi .win-stage {
  width: min(112px, 28vw);
  height: auto;
  aspect-ratio: 1;
  flex: 0 0 auto;
}
.box-status { margin-top: 8px; }

.multi-wins {
  display: grid;
  gap: 12px;
  margin: 14px 0 4px;
  max-height: min(52vh, 420px);
  overflow: auto;
}
.multi-win {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.multi-win .win-stage {
  width: 88px;
  height: 88px;
  margin: 0;
  border-radius: 14px;
}
.multi-win-copy { min-width: 0; text-align: left; }
.multi-win-copy strong {
  display: block;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.multi-win-copy .meta { margin: 4px 0 0; }
.multi-decline {
  width: auto;
  margin-top: 8px;
  padding: 8px 12px;
  font-size: 12px;
}

@keyframes box-charge {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  25% { transform: translate3d(-5px, 0, 0) rotate(-3deg) scale(1.01); }
  50% { transform: translate3d(0, -3px, 0) rotate(0deg) scale(1.03); }
  75% { transform: translate3d(5px, 0, 0) rotate(3deg) scale(1.01); }
}
@keyframes box-breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.94); }
  50% { opacity: 0.9; transform: scale(1.06); }
}
@keyframes box-flare {
  from { opacity: 0.4; transform: scale(0.7); }
  40% { opacity: 1; transform: scale(1.35); }
  to { opacity: 0.55; transform: scale(1.1); }
}
@keyframes box-burst {
  from { opacity: 0; transform: scale(0.4); }
  35% { opacity: 1; }
  to { opacity: 0; transform: scale(1.55); }
}

.pool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.mini {
  width: auto;
  min-width: 0;
  padding: 6px;
  border-radius: 16px;
}
.mini .gift-face {
  height: auto;
  aspect-ratio: 1;
  padding: 0;
  border-radius: 12px;
}
.mini .gift-name {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 500;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.25;
}
.avatar {
  width: 56px;
  height: 56px;
  margin: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 56px;
  color: #fff;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
}
.profile-title {
  font-size: 26px;
  margin: 0;
}
.profile-head .kicker { margin-bottom: 4px; }
.note {
  margin: 16px 0 0;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.45;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.prize-card, .bag-card, .admin-card, .panel {
  border-radius: var(--radius-sm);
}
.prize-card { padding: 10px; }
.prize-card .gift-face { height: 120px; }
.meta { margin: 4px 0 0; color: var(--text-dim); font-size: 11px; line-height: 1.4; }
.tag {
  display: inline-flex;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: var(--radius-md);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  backdrop-filter: none;
}
.mini.rarity-legendary,
.bag-card.rarity-legendary { box-shadow: inset 0 0 0 1px rgba(245, 208, 254, 0.45), var(--glass-shadow); }
.mini.rarity-epic,
.bag-card.rarity-epic { box-shadow: inset 0 0 0 1px rgba(196, 169, 255, 0.4), var(--glass-shadow); }
.mini.rarity-rare,
.bag-card.rarity-rare { box-shadow: inset 0 0 0 1px rgba(196, 169, 255, 0.28), var(--glass-shadow); }

.bag-card, .admin-card { display: flex; gap: 12px; padding: 12px; margin-bottom: 10px; }
.bag-card .gift-face, .admin-card .gift-face {
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  padding: var(--gift-inset-bag);
}
.bag-card h3, .admin-card h3, .panel h3 { margin: 0; font-family: var(--display); font-size: 16px; font-weight: 600; }
.bag-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.bag-actions .btn { width: auto; margin: 0; padding: 8px 14px; font-size: 13px; }
.bag-actions .star-icon { width: 13px; height: 13px; flex-basis: 13px; }
.tag-out {
  color: #fff;
  background: rgba(196, 169, 255, 0.22);
  box-shadow: rgba(196, 169, 255, 0.7) 0 0 0 1px inset;
}
.grow { min-width: 0; flex: 1; }

.panel { padding: 14px; margin-bottom: 14px; }
.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
}
.profile-row span { color: var(--text-dim); }
.profile-row strong { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.with-star { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
.star-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #fff6c8;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}
.star-face .star-icon {
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 6px rgba(240, 180, 40, 0.45));
}
.star-face strong {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.profile-row:last-child { border-bottom: 0; padding-bottom: 0; }
label { display: block; margin-bottom: 8px; font-size: 12px; color: var(--text-dim); }
input, select {
  width: 100%;
  border-radius: 16px;
  padding: 13px 14px;
  outline: none;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(255, 255, 255, 0.14), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--glass);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow:
    0 0 0 1px rgba(0, 246, 255, 0.28),
    0 0 16px rgba(255, 43, 214, 0.12),
    var(--glass-shadow);
  border: 0;
}
input:focus, select:focus {
  box-shadow:
    0 0 0 1px rgba(0, 246, 255, 0.55),
    0 0 22px rgba(0, 246, 255, 0.28),
    0 0 28px rgba(255, 43, 214, 0.16),
    var(--glass-shadow);
}
.controls { display: flex; gap: 8px; margin-top: 10px; align-items: end; }
.chance-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 76px;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.chance-field input { width: 100%; }
.controls select, .controls input { margin: 0; }
.proof {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 11px;
}
.proof img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  background: var(--strong);
  object-fit: contain;
}
.hint { margin: 8px 0 0; color: var(--text-dim); font-size: 12px; line-height: 1.45; }
.error { color: #ffb4c0; }

.tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 40;
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 8px 8px calc(10px + env(safe-area-inset-bottom, 0px) + var(--tg-safe-area-inset-bottom, 0px));
  border-radius: 1.15rem 1.15rem 0 0;
  overflow: visible;
}
.tabs-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  height: calc(100% - 18px - env(safe-area-inset-bottom, 0px) - var(--tg-safe-area-inset-bottom, 0px));
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.35), rgba(106, 139, 255, 0.55), rgba(255, 43, 214, 0.4));
  box-shadow:
    0 0 20px rgba(0, 246, 255, 0.35),
    0 0 28px rgba(255, 43, 214, 0.22),
    inset 0 0 12px rgba(200, 240, 255, 0.35);
  opacity: 0;
  transition:
    transform 0.5s cubic-bezier(0.37, 1.95, 0.66, 0.56),
    width 0.5s cubic-bezier(0.37, 1.95, 0.66, 0.56),
    background 0.4s ease-in-out,
    box-shadow 0.4s ease-in-out,
    opacity 180ms ease;
  pointer-events: none;
  z-index: 0;
}
.tabs-pill.is-ready { opacity: 1; }
.tabs button {
  position: relative;
  z-index: 2;
  border: 0;
  background: transparent;
  color: #e5e5e5;
  padding: 12px 0 10px;
  min-height: 52px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: color 0.3s ease-in-out, transform 200ms ease;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.tabs button:hover { color: #fff; }
.tabs button[hidden] { display: none; }
.tabs svg { width: 22px; height: 22px; transition: transform 220ms ease; }
.tabs button[aria-current="page"] { color: #fff; }
.tabs button[aria-current="page"] svg { transform: translateY(-1px) scale(1.06); }
.tabs button[aria-current="page"]::after { display: none; }

#screen.is-leave {
  animation: screen-out 140ms ease forwards;
}
#screen.is-enter {
  animation: screen-in 280ms cubic-bezier(.16,1,.3,1) both;
}
@keyframes screen-out {
  to { opacity: 0; transform: translateY(8px) scale(.985); }
}
@keyframes screen-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.topup-title {
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
}
.fold {
  padding-top: 4px;
  padding-bottom: 4px;
}
.fold-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fold-toggle:active { opacity: 0.85; }
.fold-chevron {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--text-dim);
  transition: transform 280ms cubic-bezier(.16, 1, .3, 1);
}
.fold.is-open .fold-chevron { transform: rotate(180deg); color: var(--holo-a); }
.fold-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 280ms cubic-bezier(.16, 1, .3, 1);
}
.fold.is-open .fold-body { grid-template-rows: 1fr; }
.fold-inner {
  overflow: hidden;
  min-height: 0;
}
.fold.is-open .fold-inner { padding-bottom: 10px; }
.fold-inner label { margin-top: 2px; }
.fold-inner .btn { margin-top: 12px; }
.fold-inner .hint { margin: 10px 0 0; }

.tx-list {
  display: grid;
  gap: 0;
}
.tx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.tx-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.tx-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.tx-kind {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.tx-when {
  font-size: 12px;
  color: var(--text-dim);
}
.tx-plus { color: #9dffb0; font-weight: 700; white-space: nowrap; }
.tx-out { color: var(--text-soft); font-weight: 600; white-space: nowrap; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.78);
  animation: fade-in 180ms ease;
  -webkit-overflow-scrolling: touch;
}
.modal[hidden],
.modal.hidden,
.toast[hidden] { display: none !important; }
.modal-card {
  position: relative;
  width: min(420px, 100%);
  padding: 18px;
  overflow: hidden;
  border-radius: 26px;
}
.modal-card.is-reveal { animation: card-in 460ms cubic-bezier(.16, 1.2, .3, 1); }
.win-stage {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  padding: 0;
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  background: transparent;
  box-shadow: none;
}
.is-reveal .win-stage { animation: stage-flash 900ms ease both; }
.is-reveal .win-stage img { animation: model-pop 780ms cubic-bezier(.16, 1.45, .28, 1) both; }
.win-stage img {
  position: relative;
  z-index: 1;
}
.win-glow {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 190, 0.85), rgba(196, 169, 255, 0.35) 42%, transparent 70%);
  animation: glow-pulse 1s ease-out both;
  pointer-events: none;
}
.win-ring {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 36px;
  height: 36px;
  margin: -18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 244, 200, 0.9);
  animation: ring-out 980ms ease-out both;
  pointer-events: none;
}
.win-ring.late { animation-delay: 140ms; border-color: rgba(196, 169, 255, 0.9); }
.win-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.55) 48%, transparent 64%);
  transform: translateX(-130%);
  animation: sheen 860ms ease 180ms both;
  pointer-events: none;
}
.reveal-copy { animation: rise 420ms ease 200ms both; }
.win-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.win-actions .btn { margin-top: 0; }
.win-actions .btn-ghost { font-weight: 600; }
.modal-card h3 {
  margin: 14px 0 0;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.04em;
}
.chips-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--display);
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
  color: #f6c445;
}
.sparks { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sparks i {
  position: absolute;
  left: 50%;
  top: 36%;
  width: 8px;
  height: 8px;
  margin: -4px;
  border-radius: 2px;
  background: #f6c445;
  animation: spark 1100ms cubic-bezier(.15, .7, .2, 1) forwards;
}
.sparks i:nth-child(3n) {
  background: #c4a9ff;
  clip-path: polygon(50% 0, 62% 36%, 100% 36%, 68% 58%, 80% 100%, 50% 74%, 20% 100%, 32% 58%, 0 36%, 38% 36%);
  border-radius: 0;
}
.sparks i:nth-child(3n + 1) { background: #ff8ad4; width: 6px; height: 6px; }

.toast {
  position: fixed;
  left: 50%;
  top: calc(12px + env(safe-area-inset-top));
  transform: translateX(-50%);
  z-index: 30;
  width: min(420px, calc(100% - 24px));
  padding: 12px 14px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06)),
    rgba(20, 14, 32, 0.55);
  color: var(--text);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: var(--glass-shadow);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes card-in {
  from { opacity: 0; transform: translateY(28px) scale(.86); }
  to { opacity: 1; transform: none; }
}
@keyframes stage-flash {
  0% { filter: brightness(1.8) saturate(1.3); }
  100% { filter: none; }
}
@keyframes model-pop {
  0% { opacity: 0; transform: scale(.35) rotate(-10deg); }
  58% { opacity: 1; transform: scale(1.06) rotate(3deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes glow-pulse {
  0% { opacity: 0; transform: scale(.4); }
  40% { opacity: 1; transform: scale(1.05); }
  100% { opacity: .55; transform: scale(1); }
}
@keyframes ring-out {
  from { transform: scale(.3); opacity: 1; }
  to { transform: scale(8); opacity: 0; }
}
@keyframes sheen {
  to { transform: translateX(130%); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes spark {
  0% { transform: translate(0, 0) scale(.4) rotate(0deg); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) scale(1.15) rotate(160deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .modal, .modal-card.is-reveal, .is-reveal .win-stage, .is-reveal .win-stage img, .win-glow, .win-ring, .win-stage::after, .reveal-copy, .sparks i, .reel-card, #screen.is-leave, #screen.is-enter, .tabs-pill,
  .neon-run:not(:disabled)::after {
    animation: none;
    transition: none;
  }
}

/* Phone / Telegram Mini App */
@media (max-width: 480px) {
  .mystery-grid {
    gap: 8px;
  }
  .mystery-card {
    padding: 10px 6px 12px;
  }
  .mystery-name {
    font-size: 11px;
  }
  .mbox-art {
    width: 72px;
    height: 72px;
  }
  .btn,
  .btn-ghost,
  .btn-spin {
    min-height: 48px;
  }
  .confirm-actions .btn {
    min-height: 46px;
  }
}

.maintenance {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 28px;
  text-align: center;
  background: #000;
}
.maintenance img {
  width: min(42vw, 160px);
  height: auto;
}
.maintenance h1 {
  margin: 8px 0 0;
  font-family: Unbounded, Manrope, sans-serif;
  font-size: 26px;
  letter-spacing: -0.04em;
}
.maintenance p {
  margin: 0;
  max-width: 280px;
  color: rgba(255, 255, 255, 0.72);
}
