/* innerswap — шуточный «обменник» $ → 💎. Тёмная тема, крупные кнопки под телефон. */
:root {
  color-scheme: dark;
  --bg: #0b0b12;
  --card: rgba(22, 21, 34, .86);
  --card-2: #1c1b2b;
  --line: rgba(255, 255, 255, .08);
  --text: #f1f0f7;
  --muted: #9a97ae;
  --yes: #2fd67a;
  --yes-2: #1fb6a3;
  --no: #ff5a67;
  --gem: #7cc7ff;
  --twitch: #9146ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100svh;
  display: flex; flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 'Segoe UI', Roboto, -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 420px at 15% 10%, rgba(47, 214, 122, .14), transparent 70%),
    radial-gradient(700px 520px at 90% 25%, rgba(124, 92, 255, .20), transparent 70%),
    radial-gradient(600px 500px at 50% 110%, rgba(124, 199, 255, .12), transparent 70%);
}

/* ---------- шапка ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; max-width: 560px; width: 100%; margin: 0 auto; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.logo-mark { position: relative; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, #2fd67a, #7c5cff); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(124, 92, 255, .35); overflow: hidden; }
.logo-mark span { position: absolute; font-weight: 800; font-size: 19px; color: #fff; animation: flip 4s ease-in-out infinite; }
.logo-mark span + span { font-size: 17px; animation-delay: -2s; }
@keyframes flip { 0%, 40% { transform: translateY(0); opacity: 1; } 50%, 90% { transform: translateY(-140%); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
.logo-name { font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.logo-name b { font-weight: 800; background: linear-gradient(90deg, #2fd67a, #7cc7ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top-tag { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; }

/* ---------- карточка ---------- */
.wrap { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 8px 16px 24px; }
.card {
  width: 100%; max-width: 480px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px 16px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  backdrop-filter: blur(10px);
}

/* «обменник»: отдаёшь / получаешь */
.swap { display: flex; flex-direction: column; position: relative; transition: opacity .3s, filter .3s; }
.swap.dim { opacity: .55; filter: saturate(.7); }
/* шаг выбора суммы: поле «Отдаёшь» подсвечено и пульсирует, пока не сдвинут ползунок */
.swap.pick .swap-row:first-child { border-color: rgba(47, 214, 122, .7); animation: pick-glow 1.4s ease-in-out infinite; }
@keyframes pick-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(47, 214, 122, .0); } 50% { box-shadow: 0 0 0 6px rgba(47, 214, 122, .22); } }
.swap-row { display: grid; grid-template-columns: 1fr auto; align-items: center; background: var(--card-2); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px 12px; }
.swap-label { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.swap-val { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.swap-gems { color: var(--gem); display: inline-block; transform-origin: left center; }
.swap-gems.bump { animation: bump .25s ease-out; }
@keyframes bump { 40% { transform: scale(1.06); } }
.swap-rate { margin: 8px 2px 0; font-size: 13px; color: var(--muted); text-align: center; }

/* шкала суммы: заливка до ползунка (--p ставит app.js) */
.range { grid-column: 1 / -1; margin-top: 10px; }
.range input {
  -webkit-appearance: none; appearance: none; width: 100%; height: 26px; margin: 0; background: transparent; cursor: pointer;
  --p: 0%;
}
.range input:focus { outline: none; }
.range input::-webkit-slider-runnable-track {
  height: 8px; border-radius: 8px;
  background: linear-gradient(90deg, var(--yes) 0%, var(--gem) var(--p), rgba(255, 255, 255, .1) var(--p));
}
.range input::-moz-range-track { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .1); }
.range input::-moz-range-progress { height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--yes), var(--gem)); }
.range input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; margin-top: -8px; border-radius: 50%;
  background: #fff; border: 4px solid var(--yes); box-shadow: 0 0 0 4px rgba(47, 214, 122, .2), 0 4px 10px rgba(0, 0, 0, .4);
}
.range input::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 4px solid var(--yes); box-shadow: 0 0 0 4px rgba(47, 214, 122, .2), 0 4px 10px rgba(0, 0, 0, .4);
}
.range input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(124, 199, 255, .45); }
.range-ends { display: flex; justify-content: space-between; font-size: 12px; color: #6f6c84; margin-top: 2px; }
.swap-coin { display: inline-flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px 5px 5px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.coin { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 14px; }
.coin-usd { background: #2fd67a; color: #07130c; }
.coin-gem { background: #1b2a3e; font-size: 14px; }
.swap-arrow { position: relative; z-index: 1; align-self: center; margin: -13px 0; width: 36px; height: 36px; border-radius: 12px; background: #24233a; border: 3px solid #161522; display: grid; place-items: center; color: var(--text); font-size: 17px; }

/* шаги */
.progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 16px 2px 4px; }
.progress i { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .1); transition: background .3s; }
.progress i.on { background: linear-gradient(90deg, var(--yes), var(--gem)); }

.stage { min-height: 230px; }
.step { padding: 14px 4px 0; text-align: center; }
.step.in { animation: rise .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.step-n { font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.q { margin: 8px 0 22px; font-size: clamp(24px, 6.4vw, 30px); line-height: 1.22; font-weight: 750; letter-spacing: -.015em; }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn {
  appearance: none; border: 0; cursor: pointer;
  min-height: 58px; border-radius: 16px;
  font: inherit; font-size: 19px; font-weight: 700;
  transition: transform .12s ease, box-shadow .2s, filter .2s;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid rgba(124, 199, 255, .7); outline-offset: 3px; }
.btn-yes { background: linear-gradient(135deg, var(--yes), var(--yes-2)); color: #06140d; box-shadow: 0 10px 26px rgba(47, 214, 122, .28); }
.btn-yes:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; filter: grayscale(.4); }
.btn:disabled:active { transform: none; }
.pick-hint { margin: -10px 0 16px; font-size: 15px; color: #8ff0b8; font-weight: 600; }
.pick-hint.done { color: var(--gem); }
.btn-no { background: rgba(255, 90, 103, .1); color: #ff9aa2; border: 1px solid rgba(255, 90, 103, .4); }
.btn-no:hover { background: rgba(255, 90, 103, .16); }

/* финальные ответы */
.step-end { padding-top: 22px; }
.end-emoji { font-size: 56px; line-height: 1; margin-bottom: 10px; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.end-text { margin: 0 0 22px; font-size: clamp(25px, 7vw, 32px); line-height: 1.2; font-weight: 800; letter-spacing: -.015em; }
.btn-again { width: 100%; background: rgba(255, 255, 255, .06); color: var(--text); border: 1px solid var(--line); font-size: 17px; min-height: 52px; }
.btn-again:hover { background: rgba(255, 255, 255, .1); }

/* кнопка Twitch */
.twitch {
  display: flex; align-items: center; gap: 14px; text-align: left;
  margin: 0 0 14px; padding: 14px 16px; border-radius: 16px;
  background: var(--twitch); color: #fff; text-decoration: none;
  box-shadow: 0 12px 30px rgba(145, 70, 255, .4);
  transition: transform .12s, filter .2s;
}
.twitch:hover { filter: brightness(1.08); }
.twitch:active { transform: scale(.98); }
.twitch-ico { width: 30px; height: 34px; fill: #fff; flex: none; }
.twitch-txt { flex: 1; display: grid; line-height: 1.25; }
.twitch-txt b { font-size: 19px; }
.twitch-txt small { font-size: 14px; opacity: .85; }
.twitch-go { font-size: 22px; opacity: .9; }

/* видео-«кружок» */
.step-video { padding-top: 18px; }
.vnote { position: relative; width: min(78vw, 300px); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 4px rgba(124, 92, 255, .5), 0 18px 50px rgba(0, 0, 0, .5); background: #000; }
.vnote video { width: 100%; height: 100%; object-fit: cover; transform: scale(1.07); display: block; cursor: pointer; }
.vnote-play { position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 30px; cursor: pointer; }
.vnote-play[hidden] { display: none; }
.vbar { width: min(78vw, 300px); height: 4px; margin: 16px auto 0; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.vbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--twitch), var(--gem)); transition: width .2s linear; }

.foot { text-align: center; color: #5f5c72; font-size: 12px; padding: 0 16px 18px; }

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