:root {
  --bg: #0b0a0f;
  --bg2: #121018;
  --panel: #17141f;
  --panel2: #1e1a27;
  --line: rgba(231, 181, 77, .18);
  --line-soft: rgba(255, 255, 255, .07);
  --gold: #e7b54d;
  --gold-hi: #fff0bd;
  --gold-lo: #9c6b1c;
  --gold-grad: linear-gradient(135deg, #fff0bd 0%, #f0c968 28%, #d59a32 62%, #a36f1f 100%);
  --text: #f4efe4;
  --muted: #9a93a6;
  --ok: #4fd18b;
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(231, 181, 77, .16), transparent 60%),
    radial-gradient(80% 50% at 50% 110%, rgba(120, 70, 200, .12), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
[hidden] { display: none !important; }

#app { max-width: 480px; margin: 0 auto; min-height: 100%; padding: 0 16px calc(84px + var(--safe-b)); }

/* ---------- шапка ---------- */
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; }
.brand { display: flex; align-items: baseline; gap: 6px; font-weight: 800; letter-spacing: .08em; }
.brand-bosh { font-size: 15px; color: var(--text); }
.brand-spin {
  font-size: 15px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.top-right { display: flex; align-items: center; gap: 8px; }
.timer {
  display: flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; font-variant-numeric: tabular-nums;
  color: var(--gold-hi);
}
.timer-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 8px #ff5a5a; animation: blink 1.6s infinite; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line-soft); display: grid; place-items: center; }
.icon-btn svg { width: 17px; height: 17px; fill: var(--muted); }
.icon-btn .wave { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.icon-btn .ic-off { display: none; }
.icon-btn.muted .ic-on { display: none; }
.icon-btn.muted .ic-off { display: block; }

.demo-banner {
  margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; font-size: 12.5px; text-align: center;
  background: rgba(120, 90, 255, .12); border: 1px dashed rgba(150, 130, 255, .4); color: #c9c0ff;
}

/* ---------- баланс ---------- */
.balance {
  display: flex; align-items: stretch; gap: 14px; padding: 14px 16px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.balance-main { min-width: 86px; padding-right: 14px; border-right: 1px solid var(--line-soft); }
.balance-label, .progress-label { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.balance-num {
  font-size: 40px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.balance-num.bump { animation: bump .5s ease; }
.balance-side { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 7px; min-width: 0; }
.progress { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.progress-bar { height: 100%; width: 0; border-radius: 99px; background: var(--gold-grad); box-shadow: 0 0 10px rgba(231, 181, 77, .6); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.progress-sub { font-size: 12.5px; color: var(--muted); }
.progress-sub b { color: var(--text); font-weight: 600; }

/* ---------- колесо ---------- */
.wheel-wrap { position: relative; width: min(92vw, 380px); aspect-ratio: 1; margin: 22px auto 18px; }
.wheel-glow {
  position: absolute; inset: -8%; border-radius: 50%;
  background: radial-gradient(circle, rgba(231, 181, 77, .28), rgba(231, 181, 77, 0) 62%);
  filter: blur(6px); animation: breathe 4s ease-in-out infinite;
}
.wheel-rotor { position: absolute; inset: 0; will-change: transform; }
#wheel { width: 100%; height: 100%; display: block; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .55)); }
.pointer {
  position: absolute; left: 50%; top: -14px; width: 36px; z-index: 3; transform: translateX(-50%);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .6)); transform-origin: 50% 30%;
}
.pointer.tick { animation: tick .12s ease-out; }
.hub {
  position: absolute; left: 50%; top: 50%; width: 21%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; padding: 4px; background: var(--gold-grad); z-index: 2;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .6), 0 0 0 4px rgba(0, 0, 0, .35);
}
.hub-inner {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #2a2433, #0d0b12 70%);
}
.hub-inner span { font-weight: 900; font-size: clamp(11px, 3.4vw, 14px); letter-spacing: .12em; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.bulb { fill: #fff3c4; }
.bulbs.run .bulb { animation: bulb 1s infinite; }
.bulbs .bulb:nth-child(2n) { animation-delay: .5s; }

/* ---------- кнопка ---------- */
.spin-btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 60px; border-radius: 18px; overflow: hidden;
  background: var(--gold-grad); color: #1b1305; font-weight: 800; font-size: 18px; letter-spacing: .14em; text-transform: uppercase;
  box-shadow: 0 10px 28px rgba(231, 181, 77, .35), inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -3px 0 rgba(0, 0, 0, .18);
  transition: transform .12s ease, filter .2s ease, opacity .2s;
}
.spin-btn::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg); animation: shine 3.2s ease-in-out infinite;
}
.spin-btn:active { transform: scale(.97); }
.spin-btn-count {
  min-width: 28px; height: 28px; padding: 0 8px; border-radius: 99px; display: grid; place-items: center;
  background: rgba(27, 19, 5, .85); color: var(--gold-hi); font-size: 14px; letter-spacing: 0;
}
.spin-btn:disabled { filter: grayscale(.85) brightness(.55); box-shadow: none; cursor: default; }
.spin-btn:disabled::after { display: none; }
.spin-btn.busy { pointer-events: none; }
.hint { margin: 12px 4px 0; text-align: center; font-size: 13px; color: var(--muted); min-height: 18px; }
.hint b { color: var(--gold-hi); }

/* ---------- лента ---------- */
.feed { margin-top: 18px; padding: 12px 0 10px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line-soft); overflow: hidden; }
.feed-title { display: flex; align-items: center; gap: 8px; padding: 0 14px 8px; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: blink 1.6s infinite; }
.feed-track { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.feed-row { display: flex; gap: 10px; width: max-content; animation: marquee 40s linear infinite; }
.feed-item { display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line-soft); font-size: 13px; white-space: nowrap; }
.feed-item .fi { width: 22px; height: 22px; }
.feed-item b { color: var(--gold-hi); font-weight: 600; }

/* ---------- экраны ---------- */
.screen-title { margin: 8px 0 4px; font-size: 22px; font-weight: 800; letter-spacing: .01em; }
.screen-sub { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.prize-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prize {
  position: relative; padding: 14px 12px 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 6px; min-height: 150px;
}
.prize .pi { width: 44px; height: 44px; padding: 9px; border-radius: 12px; background: rgba(231, 181, 77, .1); border: 1px solid var(--line); }
.prize-name { font-weight: 700; font-size: 14px; line-height: 1.25; }
.prize-desc { font-size: 12px; color: var(--muted); line-height: 1.35; }
.prize-left { position: absolute; top: 12px; right: 10px; font-size: 11px; padding: 3px 8px; border-radius: 99px; background: rgba(255, 90, 90, .12); color: #ff9b9b; border: 1px solid rgba(255, 90, 90, .25); }
.prize.sup { grid-column: span 2; min-height: 0; flex-direction: row; align-items: center; gap: 14px; background: linear-gradient(135deg, rgba(231, 181, 77, .22), rgba(231, 181, 77, .04) 60%), var(--panel); border-color: rgba(231, 181, 77, .5); }
.prize.sup .pi { width: 60px; height: 60px; padding: 12px; flex: none; background: var(--gold-grad); border: 0; }
.prize.sup .pi * { stroke: #1b1305 !important; }
.prize.sup .prize-name { font-size: 17px; }
.prize.sup .prize-left { position: static; align-self: flex-start; }

.rules { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.rules-title { font-weight: 700; margin-bottom: 6px; }
.rules ol { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; }
.rules li { margin: 4px 0; }
.rules li b { color: var(--gold-hi); }
.rules-dates { margin-top: 8px; font-size: 12.5px; color: var(--gold-hi); }

.wins { display: flex; flex-direction: column; gap: 10px; }
.win-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-soft); }
.win-row .pi { width: 44px; height: 44px; padding: 9px; border-radius: 12px; background: rgba(231, 181, 77, .1); border: 1px solid var(--line); flex: none; }
.win-row-body { flex: 1; min-width: 0; }
.win-row-name { font-weight: 700; font-size: 14px; }
.win-row-date { font-size: 12px; color: var(--muted); }
.chip { flex: none; font-size: 12px; padding: 7px 11px; border-radius: 99px; border: 1px solid var(--line-soft); color: var(--muted); }
.chip.ok { color: var(--ok); border-color: rgba(79, 209, 139, .35); background: rgba(79, 209, 139, .08); }
.chip.btn { color: #1b1305; background: var(--gold-grad); border: 0; font-weight: 700; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 54px; height: 54px; margin-bottom: 10px; opacity: .6; }

/* ---------- вкладки ---------- */
.tabs {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 10;
  display: flex; padding: 8px 12px calc(8px + var(--safe-b));
  background: rgba(11, 10, 15, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-soft);
}
.tab { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11.5px; color: var(--muted); }
.tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--gold-hi); }
.badge { position: absolute; top: 2px; left: 56%; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: #ff5a5a; color: #fff; font-style: normal; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }

/* ---------- окно выигрыша ---------- */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(5, 4, 8, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .25s ease; }
.modal-card {
  position: relative; width: 100%; max-width: 360px; padding: 26px 22px 20px; border-radius: 26px; text-align: center; overflow: hidden;
  background: linear-gradient(180deg, #221c2c, #141119); border: 1px solid rgba(231, 181, 77, .45);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px rgba(231, 181, 77, .18);
  animation: pop .5s cubic-bezier(.2, 1.4, .4, 1);
}
.win-rays { position: absolute; left: 50%; top: 92px; width: 520px; height: 520px; margin: -260px 0 0 -260px; background: repeating-conic-gradient(rgba(231, 181, 77, .13) 0 10deg, transparent 10deg 20deg); border-radius: 50%; animation: spinrays 18s linear infinite; mask-image: radial-gradient(circle, #000 20%, transparent 60%); -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 60%); pointer-events: none; }
.win-kicker { position: relative; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.win-icon { position: relative; width: 104px; height: 104px; margin: 16px auto 14px; padding: 22px; border-radius: 30px; background: var(--gold-grad); box-shadow: 0 12px 30px rgba(231, 181, 77, .45); }
.win-icon svg * { stroke: #1b1305 !important; }
.win-name { position: relative; font-size: 22px; font-weight: 800; line-height: 1.2; }
.win-desc { position: relative; margin: 8px 0 18px; color: var(--muted); font-size: 14px; }
.modal-card.sup .win-kicker { font-size: 14px; font-weight: 800; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.btn-gold { position: relative; width: 100%; height: 52px; border-radius: 15px; background: var(--gold-grad); color: #1b1305; font-weight: 800; font-size: 16px; box-shadow: 0 8px 22px rgba(231, 181, 77, .35); }
.btn-gold:disabled { filter: grayscale(.4) brightness(.8); }
.btn-ghost { position: relative; width: 100%; height: 48px; margin-top: 8px; border-radius: 15px; border: 1px solid var(--line); color: var(--gold-hi); font-weight: 700; }
.win-note { position: relative; margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); z-index: 30; max-width: 88%; padding: 11px 16px; border-radius: 14px; background: #2a2433; border: 1px solid var(--line); font-size: 13.5px; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: fade .2s ease; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 25; }

/* иконки призов */
.pi, .fi, .win-icon svg { display: block; }
.pi *, .fi *, .win-icon svg * { fill: none; stroke: var(--gold); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

@keyframes blink { 50% { opacity: .35; } }
@keyframes breathe { 50% { opacity: .55; transform: scale(.97); } }
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes bulb { 50% { opacity: .25; } }
@keyframes tick { 0% { transform: translateX(-50%) rotate(0); } 40% { transform: translateX(-50%) rotate(-14deg); } 100% { transform: translateX(-50%) rotate(0); } }
@keyframes bump { 40% { transform: scale(1.25); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.7) translateY(20px); } }
@keyframes spinrays { to { transform: rotate(360deg); } }

@media (max-width: 360px) {
  .balance-num { font-size: 34px; }
  .spin-btn { height: 56px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .spin-btn::after, .feed-row, .wheel-glow, .win-rays { animation: none; }
}
