:root {
  --bg: #0a0612;
  --card: rgba(32, 14, 54, 0.88);
  --line: rgba(244, 114, 182, 0.2);
  --text: #fff7fb;
  --muted: #c4aed6;
  --pink: #f472b6;
  --pink2: #f9a8d4;
  --violet: #a855f7;
  --green: #34d399;
  --red: #fb7185;
  --font: "Montserrat", system-ui, -apple-system, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --tg-safe-t: var(--tg-safe-area-inset-top, 0px);
  --tg-safe-b: var(--tg-safe-area-inset-bottom, 0px);
  --tg-content-t: var(--tg-content-safe-area-inset-top, 0px);
  --tg-js-safe-t: 0px;
  --tg-js-content-t: 0px;
  --pad-t: 5px;
  --pad-b: calc(10px + var(--safe-b) + var(--tg-safe-b));
  --app-h: var(--tg-viewport-stable-height, 100dvh);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #05030a;
  font-family: var(--font);
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.hidden {
  display: none !important;
}

/* Desktop: phone frame for recording */
.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(700px 480px at 20% 0%, rgba(168, 85, 247, 0.28), transparent 55%),
    radial-gradient(600px 420px at 90% 20%, rgba(244, 114, 182, 0.22), transparent 50%),
    #05030a;
}

.phone {
  position: relative;
  width: min(390px, 100%);
  height: min(844px, calc(100dvh - 32px));
  max-height: 900px;
  border-radius: 36px;
  overflow: hidden;
  background:
    radial-gradient(420px 280px at 50% -10%, rgba(244, 114, 182, 0.28), transparent 60%),
    radial-gradient(380px 260px at 100% 40%, rgba(168, 85, 247, 0.2), transparent 55%),
    linear-gradient(180deg, #12081f, #0a0612 55%, #0d0718);
  border: 1px solid rgba(244, 114, 182, 0.28);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 80px rgba(168, 85, 247, 0.12);
  display: flex;
  flex-direction: column;
  padding: var(--pad-t) max(16px, var(--safe-r)) var(--pad-b) max(16px, var(--safe-l));
}

/* Real phone / Telegram WebApp: fill viewport, respect notch + TG chrome */
@media (max-width: 480px) {
  html,
  body {
    height: var(--app-h);
    overflow: hidden;
    background: var(--bg);
  }

  .stage {
    padding: 0;
    min-height: var(--app-h);
    height: var(--app-h);
    background: var(--bg);
    place-items: stretch;
  }

  .phone {
    width: 100%;
    height: var(--app-h);
    max-height: none;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    padding-top: var(--pad-t);
  }

  .head {
    margin: 2px 0 10px;
  }
}

html.in-tg.tg-no-inset .phone {
  padding-top: 5px;
}

.head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 4px 0 10px;
  flex-shrink: 0;
  gap: 10px;
}

.head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.mode {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(244, 114, 182, 0.22);
}

.mode button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.mode button.on {
  color: #1a0614;
  background: linear-gradient(135deg, #f9a8d4, #c084fc);
}

.brand {
  display: inline-block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.15;
  padding: 2px 0 1px;
  background: linear-gradient(120deg, #fff, #f9a8d4 45%, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 160ms ease;
}

.mode.hidden,
.mode[hidden] {
  display: none !important;
}

.tag {
  margin: 6px 0 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--pink2);
  background: rgba(244, 114, 182, 0.12);
  border: 1px solid rgba(244, 114, 182, 0.28);
}

.live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pink);
  animation: ping 1.4s infinite;
}

@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 rgba(244, 114, 182, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(244, 114, 182, 0);
  }
}

.hero-balance {
  flex-shrink: 0;
  text-align: center;
  padding: 12px 10px 12px;
  margin-bottom: 8px;
  border-radius: 20px;
  background:
    radial-gradient(280px 120px at 50% 0%, rgba(244, 114, 182, 0.22), transparent 70%),
    rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.hero-balance > span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-balance > strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(28px, 8vw, 34px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.hero-balance > strong.flash {
  animation: flash 700ms ease;
}

@keyframes flash {
  0% {
    text-shadow: 0 0 24px rgba(244, 114, 182, 0.8);
    transform: scale(1.03);
  }
  100% {
    text-shadow: none;
    transform: none;
  }
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.mini-stats div {
  padding: 8px 6px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.mini-stats em {
  display: block;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.mini-stats b {
  font-size: 14px;
  font-weight: 700;
}

.mini-stats b.up {
  color: var(--green);
}

.mini-stats b.down {
  color: var(--red);
}

.mini-stats b.bump,
.kpi-bump {
  animation: bump 420ms ease;
}

@keyframes bump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.12);
    color: #fff;
  }
  100% {
    transform: scale(1);
  }
}

.card {
  border-radius: 22px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.phone-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  padding-bottom: 4px;
}

.phone-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.bet-strip {
  flex-shrink: 0;
  margin-bottom: 8px;
  padding: 10px 12px;
}

.bet-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.bet-row label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.bet-strip .stakes,
.mines-pick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.strip-hint {
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 500;
  color: rgba(196, 174, 214, 0.8);
  line-height: 1.35;
}

.strip-hint b {
  color: #f9a8d4;
  font-weight: 700;
}

.bet-strip .stakes button,
.mines-pick button {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px 4px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.bet-strip .stakes button.on,
.mines-pick button.on {
  color: #1a0614;
  background: linear-gradient(135deg, #f9a8d4, #c084fc);
  border-color: transparent;
}

.mult-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.mult-row div {
  text-align: center;
  padding: 8px 4px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.mult-row em {
  display: block;
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

.mult-row b {
  font-size: 13px;
  font-weight: 800;
}

.mult-row b.up {
  color: var(--green);
}

.board-card {
  flex-shrink: 0;
  margin-bottom: 8px;
}

.grid,
.mini-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.grid {
  margin-bottom: 8px;
}

.cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(244, 114, 182, 0.16);
  cursor: default;
  user-select: none;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.cell.hint {
  border-color: rgba(244, 114, 182, 0.65);
  box-shadow: 0 0 0 1px rgba(244, 114, 182, 0.25), 0 0 18px rgba(168, 85, 247, 0.25);
  color: #f9a8d4;
  animation: hintPulse 1.4s ease-in-out infinite;
}

.cell.next {
  border-color: #f472b6;
  box-shadow: 0 0 22px rgba(244, 114, 182, 0.45);
}

@keyframes hintPulse {
  50% {
    box-shadow: 0 0 0 1px rgba(244, 114, 182, 0.4), 0 0 26px rgba(168, 85, 247, 0.35);
  }
}

.cell.gem {
  color: #052e1a;
  background: radial-gradient(circle at 35% 30%, #a7f3d0, #34d399 55%, #059669);
  border-color: rgba(52, 211, 153, 0.6);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.28);
  font-size: 15px;
  font-weight: 800;
}

.cell.gem.hint {
  animation: none;
}

.cell.gem.next {
  box-shadow: 0 0 0 2px #fff, 0 8px 22px rgba(16, 185, 129, 0.45);
}

.cell.gem.pop {
  animation: cellPop 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cell.bomb {
  color: #fff;
  background: radial-gradient(circle at 35% 30%, #fda4af, #e11d48 60%);
  border-color: rgba(251, 113, 133, 0.55);
  font-size: 15px;
}

.cell.dim {
  opacity: 0.4;
}

.cell.playable {
  cursor: pointer;
}

.cell.playable:active {
  transform: scale(0.96);
}

@keyframes cellPop {
  from {
    transform: scale(0.65);
    opacity: 0.35;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.mini-grid {
  gap: 4px;
  margin: 12px auto 14px;
  max-width: 220px;
}

.mini-grid .cell {
  font-size: 12px;
  border-radius: 8px;
}

.dock-split {
  display: grid;
  gap: 8px;
}

.btn-cashout {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 15px 16px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  color: #04140a;
  cursor: pointer;
  background: linear-gradient(135deg, #6ee7b7, #34d399 45%, #10b981);
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.35);
}

.btn-cashout:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-cashout.hidden {
  display: none;
}

.btn-cashout:not(:disabled) {
  animation: cashPulse 1.6s ease-in-out infinite;
}

@keyframes cashPulse {
  50% {
    filter: brightness(1.08);
    box-shadow: 0 14px 36px rgba(16, 185, 129, 0.45);
  }
}

.feed-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.soft {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.chip {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.chip.idle {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.chip.yes {
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.28);
}

.chip.no {
  color: #fda4af;
  background: rgba(251, 113, 133, 0.14);
  border-color: rgba(251, 113, 133, 0.28);
}

.chip.pending {
  color: #f9a8d4;
  background: rgba(244, 114, 182, 0.14);
  border-color: rgba(244, 114, 182, 0.35);
  animation: pendingPulse 1.6s ease-in-out infinite;
}

@keyframes pendingPulse {
  50% {
    box-shadow: 0 0 0 4px rgba(244, 114, 182, 0.12);
  }
}

.pending-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 9px 12px;
  border-radius: 14px;
  background: rgba(244, 114, 182, 0.1);
  border: 1px solid rgba(244, 114, 182, 0.28);
  font-size: 11px;
  font-weight: 600;
  color: #f9a8d4;
  flex-shrink: 0;
}

.pending-bar.hidden {
  display: none;
}

.pending-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 0 rgba(244, 114, 182, 0.6);
  animation: ping 1.4s infinite;
  flex-shrink: 0;
}

.mode-hint,
.modal-sub {
  margin: 10px 0 0;
  font-size: 11px;
  font-weight: 500;
  color: rgba(196, 174, 214, 0.75);
}

/* Toasts — delayed 1win settlements */
.toasts {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 52px;
  z-index: 40;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  padding: 11px 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(42, 18, 68, 0.96), rgba(16, 8, 30, 0.98));
  border: 1px solid rgba(52, 211, 153, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 24px rgba(52, 211, 153, 0.12);
  transform: translateY(-12px) scale(0.96);
  opacity: 0;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), opacity 280ms ease;
}

.toast.show {
  transform: none;
  opacity: 1;
}

.toast-top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-badge {
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #052e1a;
  background: var(--green);
}

.toast-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.toast-body strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.toast-body span {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 2px;
}

.toast-amt {
  grid-row: 2;
  grid-column: 2;
  align-self: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--green);
}

/* 1win slip */
.redirect-logo {
  display: inline-block;
  margin: 8px auto 6px;
  padding: 10px 18px;
  border-radius: 14px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.ow-chrome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ow-brand {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.ow-pill {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #f9a8d4;
  background: rgba(244, 114, 182, 0.14);
  border: 1px solid rgba(244, 114, 182, 0.28);
}

.ow-slip {
  display: grid;
  gap: 8px;
  margin: 4px 0 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  text-align: left;
}

.ow-slip div {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.ow-slip b {
  color: #fff;
  font-weight: 800;
}

.ow-slip b.up {
  color: var(--green);
}

.ow-btn {
  background: linear-gradient(135deg, #22c55e, #16a34a 50%, #15803d) !important;
  color: #04140a !important;
  box-shadow: 0 12px 28px rgba(34, 197, 94, 0.35) !important;
}

.btn-ghost {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(244, 114, 182, 0.25);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.btn-ghost:active {
  transform: scale(0.98);
}

.cat {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pink2);
}

#sigQ,
#mQ {
  margin: 8px 0 14px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.28;
}

.odds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.odds > div {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.odds > div.idle-odds {
  border-style: dashed;
  opacity: 0.85;
}

.odds span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 4px;
}

.odds b {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.odds > div.lean-yes {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.12);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.1);
}

.odds > div.lean-no {
  border-color: rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.12);
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.1);
}

.conf-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.conf-row b {
  color: #fff;
}

.bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f472b6, #a855f7);
  transition: width 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.bar i.high {
  background: linear-gradient(90deg, #34d399, #a855f7);
}

.bar i.mid {
  background: linear-gradient(90deg, #f472b6, #a855f7);
}

.bar i.low {
  background: linear-gradient(90deg, #fb7185, #c084fc);
}

.conf-note {
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 500;
  color: rgba(196, 174, 214, 0.8);
  line-height: 1.35;
}

.modal-bar {
  margin: 0 0 14px;
}

.scan-progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin: 14px 8px 0;
}

.scan-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f472b6, #a855f7);
  transition: width 400ms ease;
}

.payout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.22);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.payout b {
  color: var(--green);
  font-size: 15px;
  font-weight: 800;
}

.lean-line .dot {
  margin: 0 4px;
  opacity: 0.5;
}

.stage-view.enter {
  animation: stageIn 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes stageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.win-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 0 16px;
}

.win-meta div {
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(244, 114, 182, 0.14);
}

.win-meta em {
  display: block;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.win-meta b {
  font-size: 14px;
  font-weight: 800;
}

.win-meta b.up {
  color: var(--green);
}

.win-meta b.down {
  color: var(--red);
}

.feed {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 6px;
  align-content: start;
}

.feed::-webkit-scrollbar {
  width: 0;
}

.feed-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(244, 114, 182, 0.12);
  font-size: 11.5px;
  font-weight: 500;
  animation: up 280ms ease;
}

.feed-item .t {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.feed-item .body {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #edd8f7;
}

.feed-item .tag {
  display: inline-block;
  margin-right: 5px;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.feed-item .tag.fill {
  background: rgba(52, 211, 153, 0.16);
  color: #6ee7b7;
}

.feed-item .tag.info {
  background: rgba(168, 85, 247, 0.18);
  color: #e9d5ff;
}

.feed-item .tag.scan {
  background: rgba(244, 114, 182, 0.16);
  color: #f9a8d4;
}

.feed-item .tag.edge {
  background: rgba(192, 132, 252, 0.2);
  color: #e9d5ff;
}

.feed-item .delta {
  font-weight: 700;
  white-space: nowrap;
}

.feed-item .delta.ok {
  color: var(--green);
}

@keyframes up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dock {
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  margin-top: auto;
  padding-top: 8px;
  padding-bottom: calc(6px + var(--safe-b) + var(--tg-safe-b));
  background: linear-gradient(180deg, transparent, rgba(10, 6, 18, 0.92) 28%);
}

.btn-primary {
  position: relative;
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 17px 18px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #1a0614;
  cursor: pointer;
  background: linear-gradient(135deg, #fbcfe8, #f472b6 40%, #c084fc);
  box-shadow:
    0 14px 36px rgba(244, 114, 182, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 160ms ease, filter 160ms ease;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-primary.solid {
  margin-top: 4px;
}

.pulse-ring {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 2px solid rgba(244, 114, 182, 0.45);
  animation: ringPulse 1.8s ease-out infinite;
  pointer-events: none;
}

@keyframes ringPulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.06);
    opacity: 0;
  }
}

/* Sheet / modal */
.sheet {
  position: absolute;
  inset: 0;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.sheet.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet.open .sheet-panel {
  transform: translateY(0);
}

.sheet-bg {
  position: absolute;
  inset: 0;
  background: rgba(5, 2, 12, 0.72);
  backdrop-filter: blur(10px);
}

.sheet-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-b));
  max-height: calc(100% - 72px);
  overflow: auto;
  border-radius: 28px;
  padding: 22px 18px 18px;
  text-align: center;
  background:
    radial-gradient(420px 180px at 50% 0%, rgba(244, 114, 182, 0.26), transparent 60%),
    linear-gradient(180deg, rgba(42, 18, 68, 0.98), rgba(14, 7, 28, 0.99));
  border: 1px solid rgba(244, 114, 182, 0.32);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  transform: translateY(24px);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.stage-view h3 {
  margin: 14px 0 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

#scanSub,
.lean-line,
.stake-label,
.win-sub,
.win-bal {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.lean-line {
  margin-bottom: 14px;
}

.lean-line b,
.win-bal b {
  color: #fff;
  font-weight: 700;
}

.steps {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.steps li {
  padding: 10px 6px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(196, 174, 214, 0.45);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
}

.steps li.active {
  color: #fff;
  background: rgba(244, 114, 182, 0.14);
  border-color: rgba(244, 114, 182, 0.3);
}

.steps li.done {
  color: var(--pink2);
}

/* Sonar */
.sonar {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 4px auto 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 28%, rgba(244, 114, 182, 0.07) 29%, transparent 30%),
    radial-gradient(circle, transparent 48%, rgba(168, 85, 247, 0.09) 49%, transparent 50%),
    radial-gradient(circle, transparent 68%, rgba(244, 114, 182, 0.06) 69%, transparent 70%);
}

.sonar .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(244, 114, 182, 0.25);
}

.sonar .core {
  position: absolute;
  inset: 62px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fce7f3, #f472b6 45%, #a855f7 88%);
  box-shadow: 0 0 36px rgba(244, 114, 182, 0.55);
  animation: core 1.5s ease-in-out infinite;
}

.sonar .wave {
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  border: 2px solid rgba(244, 114, 182, 0.8);
  animation: wave 1.9s ease-out infinite;
}

.sonar .wave:nth-child(2) {
  animation-delay: 0.6s;
  border-color: rgba(168, 85, 247, 0.75);
}

.sonar .wave:nth-child(3) {
  animation-delay: 1.2s;
}

@keyframes wave {
  0% {
    transform: scale(0.4);
    opacity: 0.95;
  }
  100% {
    transform: scale(1.7);
    opacity: 0;
  }
}

@keyframes core {
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 48px rgba(168, 85, 247, 0.7);
  }
}

.found-badge {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #f472b6, #a855f7);
  box-shadow: 0 10px 28px rgba(244, 114, 182, 0.35);
  animation: pop 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pop {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.stake-label {
  margin: 4px 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stakes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.stakes button {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 8px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.stakes button.on {
  border-color: rgba(244, 114, 182, 0.55);
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.28), rgba(168, 85, 247, 0.28));
  box-shadow: 0 8px 24px rgba(244, 114, 182, 0.2);
}

.stakes button:active {
  transform: scale(0.97);
}

/* Settle — delayed profit drip */
.settle-pulse {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 4px auto 10px;
}

.settle-pulse span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(244, 114, 182, 0.55);
  animation: settleRing 1.8s ease-out infinite;
}

.settle-pulse span:nth-child(2) {
  animation-delay: 0.55s;
}

.settle-pulse span:nth-child(3) {
  animation-delay: 1.1s;
}

@keyframes settleRing {
  0% {
    transform: scale(0.45);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.found-badge.soft {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.55), rgba(168, 85, 247, 0.65));
  box-shadow: 0 8px 22px rgba(168, 85, 247, 0.28);
}

.settle-list {
  display: grid;
  gap: 6px;
  margin: 14px 0 12px;
  text-align: left;
  min-height: 112px;
}

.settle-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(244, 114, 182, 0.14);
  font-size: 12px;
  font-weight: 600;
  animation: settleIn 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.settle-row .who {
  color: #edd8f7;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settle-row .amt {
  color: var(--green);
  font-weight: 800;
  white-space: nowrap;
}

@keyframes settleIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.settle-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 12px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.28);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.settle-total b {
  color: var(--green);
  font-size: 18px;
  font-weight: 800;
}

/* Win */
#stageWin {
  position: relative;
  overflow: hidden;
  padding-top: 8px;
}

.win-burst {
  display: inline-block;
  margin-top: 18px;
  font-size: 56px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  background: linear-gradient(135deg, #fff, #f9a8d4 40%, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: winPop 500ms cubic-bezier(0.22, 1, 0.36, 1);
  text-shadow: 0 0 40px rgba(244, 114, 182, 0.35);
}

@keyframes winPop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.win-sub {
  margin-top: 10px !important;
}

.win-delta {
  display: block;
  margin: 12px 0 6px;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--green);
}

.win-bal {
  margin-bottom: 0 !important;
}

/* Short phones — keep CTA + hero readable */
@media (max-height: 740px) {
  .hero-balance {
    padding: 12px 10px 12px;
    margin-bottom: 8px;
  }

  .hero-balance > strong {
    font-size: 32px;
  }

  .cell {
    font-size: 9px;
    border-radius: 8px;
  }

  .sonar {
    width: 140px;
    height: 140px;
  }

  .sonar .core {
    inset: 52px;
  }

  .win-burst {
    font-size: 46px;
    margin-top: 8px;
  }
}

.confetti {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.confetti i {
  position: absolute;
  top: -10px;
  width: 7px;
  height: 12px;
  border-radius: 2px;
  opacity: 0.9;
  animation: fall linear forwards;
}

@keyframes fall {
  to {
    transform: translateY(340px) rotate(520deg);
    opacity: 0;
  }
}

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