/* Cash Worms — прогревающий лендинг. Современный тёмный вайб, mobile-first. */

:root {
  --bg: #080B0A;
  --ink: #F1F5F2;
  --muted: #93A29B;
  --coral: #FB4C2F;
  --coral-2: #FF8A3D;
  --green: #2CB642;
  --green-2: #55E27A;
  --surface: rgba(255, 255, 255, .05);
  --surface-2: rgba(255, 255, 255, .08);
  --stroke: rgba(255, 255, 255, .10);
  --stroke-2: rgba(255, 255, 255, .16);
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 20px 50px rgba(0, 0, 0, .55);
  --font-display: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background:
    radial-gradient(90% 60% at 78% -5%, rgba(251, 76, 47, .16), transparent 60%),
    radial-gradient(80% 55% at 12% 105%, rgba(44, 182, 66, .14), transparent 60%),
    var(--bg);
}

/* ---------- Topbar ---------- */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand__mark {
  width: 22px; height: 22px; border-radius: 8px;
  background: linear-gradient(135deg, var(--coral), var(--coral-2));
  box-shadow: 0 0 16px rgba(251, 76, 47, .55);
  position: relative;
}
.brand__mark::after {
  content: ""; position: absolute; right: -3px; bottom: -3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green-2); box-shadow: 0 0 8px rgba(85, 226, 122, .8); border: 2px solid var(--bg);
}

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--stroke);
  font-size: 13px; font-weight: 600; color: var(--ink);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pill--age { color: var(--muted); font-size: 12px; letter-spacing: .04em; }

/* ---------- Stage / scenes ---------- */
.stage { position: relative; flex: 1 1 auto; overflow: hidden; }
.scene { position: absolute; inset: 0; }

/* ---------- Стартовый экран (герой) ---------- */
.start { display: flex; align-items: center; justify-content: center; text-align: center; z-index: 10; }
.start__inner { position: relative; z-index: 2; padding: 24px; max-width: 480px; }

/* мягкие светящиеся орбы на фоне */
.orbs { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.orbs i {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5;
  animation: float 14s ease-in-out infinite;
}
.orbs i:nth-child(1) { width: 300px; height: 300px; left: -60px; top: 8%; background: rgba(251, 76, 47, .45); }
.orbs i:nth-child(2) { width: 320px; height: 320px; right: -80px; top: 30%; background: rgba(44, 182, 66, .38); animation-delay: -5s; }
.orbs i:nth-child(3) { width: 240px; height: 240px; left: 30%; bottom: -40px; background: rgba(255, 138, 61, .30); animation-delay: -9s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -24px) scale(1.08); }
}

.eyebrow {
  display: inline-block; margin-bottom: 18px; padding: 6px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--stroke);
  font-size: 12.5px; font-weight: 600; letter-spacing: .01em; color: var(--muted);
  animation: rise .6s ease both;
}
.hero__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(34px, 10vw, 56px); line-height: 1.02; letter-spacing: -.02em;
  margin: 0 0 16px; animation: rise .6s ease .06s both;
}
.hero__title .grad {
  background: linear-gradient(100deg, var(--coral), var(--coral-2) 60%, var(--green-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub {
  font-size: clamp(15px, 4vw, 17px); line-height: 1.5; color: var(--muted);
  max-width: 30ch; margin: 0 auto 28px; animation: rise .6s ease .12s both;
}
.ticks {
  list-style: none; margin: 22px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px 10px; justify-content: center;
  animation: rise .6s ease .24s both;
}
.ticks li {
  font-size: 12.5px; color: var(--muted); padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--stroke);
}
.ticks li::before { content: "✓ "; color: var(--green-2); font-weight: 700; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Кнопки ---------- */
.btn {
  --glow: rgba(44, 182, 66, .45);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.01em;
  color: #05230d; text-decoration: none; cursor: pointer; border: 0;
  padding: 16px 30px; border-radius: 16px;
  background: linear-gradient(135deg, var(--green-2), var(--green));
  box-shadow: 0 10px 30px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible { outline: 3px solid var(--green-2); outline-offset: 3px; }
.btn__arrow { transition: transform .18s ease; }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn--play { animation: rise .6s ease .18s both, glow 2.6s ease-in-out infinite; }
.btn--block { width: 100%; }
@keyframes glow {
  0%, 100% { box-shadow: 0 10px 30px rgba(44, 182, 66, .35), inset 0 1px 0 rgba(255, 255, 255, .35); }
  50% { box-shadow: 0 14px 44px rgba(44, 182, 66, .6), inset 0 1px 0 rgba(255, 255, 255, .35); }
}

/* ---------- Игровой экран ---------- */
.game { z-index: 5; }
#arena { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* HUD */
.hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 14px; pointer-events: none;
}
.hud .pill { pointer-events: none; }
.pill--cash { padding: 10px 15px; font-size: 15px; background: var(--surface-2); border-color: var(--stroke-2); }
.pill--cash .coin {
  width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-2), var(--green));
  box-shadow: 0 0 10px rgba(85, 226, 122, .6); flex: 0 0 auto;
}
.pill__label { color: var(--muted); font-weight: 600; }
.pill__value { color: var(--green-2); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.hud__right { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.pill--combo { background: linear-gradient(135deg, var(--coral), var(--coral-2)); color: #fff; border: 0; font-weight: 700; box-shadow: 0 6px 18px rgba(251, 76, 47, .4); }
.pill--combo.bump { animation: bump .3s ease; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
.pill--zone { color: var(--green-2); border-color: rgba(85, 226, 122, .4); background: rgba(44, 182, 66, .12); }

/* тосты */
.toasts {
  position: absolute; top: 24%; left: 0; right: 0; z-index: 25;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  pointer-events: none;
}
.toast {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em;
  padding: 9px 18px; border-radius: 999px;
  background: rgba(10, 14, 12, .7); border: 1px solid var(--stroke-2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: opacity .5s ease, transform .5s ease; animation: toastIn .25s ease;
}
.toast--l1 { color: var(--ink); font-size: 15px; }
.toast--l2 { color: var(--coral-2); font-size: 17px; }
.toast--l3 { color: var(--green-2); font-size: 19px; }
.toast--l4 { color: #fff; font-size: 22px; background: linear-gradient(135deg, rgba(251,76,47,.9), rgba(44,182,66,.9)); border: 0; }
.toast--out { opacity: 0; transform: translateY(-14px) scale(.96); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }

.combo-stamp {
  position: absolute; top: 36%; left: 50%; transform: translate(-50%, -50%);
  font-family: var(--font-display); font-size: clamp(38px, 13vw, 66px); font-weight: 700; letter-spacing: -.02em;
  background: linear-gradient(120deg, var(--coral), var(--coral-2), var(--green-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: stamp .9s ease forwards;
}
@keyframes stamp {
  0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; }
  30% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.06); opacity: 0; }
}

/* подсказка управления */
.swipe-hint {
  position: absolute; bottom: 13%; left: 50%; transform: translateX(-50%);
  z-index: 25; display: flex; align-items: center; gap: 12px;
  color: var(--ink); font-size: 14px; width: 84%; max-width: 360px;
  padding: 12px 16px; border-radius: 16px;
  background: rgba(10, 14, 12, .68); border: 1px solid var(--stroke-2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: hintPulse 1.8s ease-in-out infinite; pointer-events: none;
}
.swipe-hint__dot {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  background: radial-gradient(circle at 50% 50%, var(--coral-2), var(--coral));
  box-shadow: 0 0 0 0 rgba(251, 76, 47, .5); animation: ping 1.8s ease-out infinite;
}
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(251, 76, 47, .5); } 70% { box-shadow: 0 0 0 16px rgba(251, 76, 47, 0); } 100% { box-shadow: 0 0 0 0 rgba(251, 76, 47, 0); } }
@keyframes hintPulse { 0%, 100% { opacity: .8; } 50% { opacity: 1; } }

/* кнопка пропуска */
#skip-btn {
  position: absolute; bottom: 16px; right: 16px; z-index: 26;
  background: var(--surface); color: var(--muted); border: 1px solid var(--stroke);
  font-family: var(--font); font-size: 13px; padding: 8px 14px; border-radius: 999px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transition: opacity .4s ease; cursor: pointer;
}
#skip-btn.show { opacity: 1; pointer-events: auto; }
#skip-btn:hover { color: var(--ink); border-color: var(--stroke-2); }

/* ---------- Финальный pop-up ---------- */
.popup { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 18px; }
.popup__backdrop { position: absolute; inset: 0; background: rgba(4, 7, 6, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.popup__card {
  position: relative; z-index: 1; width: 100%; max-width: 400px;
  background: linear-gradient(180deg, rgba(23, 28, 25, .96), rgba(11, 14, 12, .96));
  border: 1px solid var(--stroke-2); border-radius: 24px;
  padding: 30px 24px 22px; text-align: center; box-shadow: var(--shadow);
  animation: popIn .42s cubic-bezier(.2, 1.25, .4, 1);
}
@keyframes popIn { from { transform: translateY(22px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.popup__close {
  position: absolute; top: 14px; right: 14px; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--stroke); color: var(--muted); cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.popup__close:hover { color: var(--ink); background: var(--surface-2); }
.popup__spark {
  width: 60px; height: 60px; margin: 4px auto 16px; border-radius: 20px;
  background: linear-gradient(135deg, var(--coral), var(--coral-2));
  box-shadow: 0 12px 30px rgba(251, 76, 47, .45), inset 0 1px 0 rgba(255,255,255,.4);
  position: relative;
}
.popup__spark::after {
  content: ""; position: absolute; right: -6px; bottom: -6px; width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-2), var(--green));
  border: 3px solid #16201b; box-shadow: 0 0 14px rgba(85, 226, 122, .7);
}
.popup__title { font-family: var(--font-display); margin: 0 0 10px; font-size: clamp(22px, 6vw, 27px); font-weight: 700; letter-spacing: -.02em; }
.popup__sub { margin: 0 0 18px; font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.popup__score {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; margin-bottom: 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--stroke); font-size: 13.5px; color: var(--muted);
}
.popup__score b { font-family: var(--font-display); color: var(--ink); font-size: 17px; }

.popup__bonus {
  display: flex; flex-direction: column; gap: 3px; align-items: center;
  background: linear-gradient(180deg, rgba(44, 182, 66, .14), rgba(44, 182, 66, .05));
  border: 1px solid rgba(85, 226, 122, .35); border-radius: var(--radius-sm);
  padding: 16px; margin-bottom: 20px;
}
.popup__bonus-label { font-size: 11.5px; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.popup__bonus-value {
  font-family: var(--font-display); font-size: clamp(24px, 7vw, 30px); font-weight: 700; letter-spacing: -.01em; line-height: 1.1;
  background: linear-gradient(120deg, var(--green-2), var(--green));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.popup__bonus-note { margin-top: 5px; font-size: 13px; color: var(--muted); }
.popup__micro { margin: 11px 0 0; font-size: 12.5px; color: var(--muted); }
.popup__replay {
  margin-top: 14px; background: none; border: 0; color: var(--muted);
  font-family: var(--font); font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.popup__replay:hover { color: var(--ink); }
.popup__disclaimer { margin: 18px 0 0; font-size: 10.5px; line-height: 1.55; color: #5f6b64; }

/* ---------- Футер ---------- */
.footer { flex: 0 0 auto; text-align: center; font-size: 11.5px; color: #5f6b64; padding: 10px; }

/* ---------- Крупные экраны: центрируем «телефонный» кадр ---------- */
@media (min-width: 760px) {
  #app { max-width: 520px; margin: 0 auto; border-left: 1px solid rgba(255,255,255,.05); border-right: 1px solid rgba(255,255,255,.05); }
}

/* ---------- Доступность ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
