:root {
  --bg: #07070a;
  --card: #131316;
  --card-line: #26262b;
  --input: #1b1b20;
  --text: #f5f5f7;
  --text-dim: #9a9aa3;
  --text-faint: #5a5a63;
  --red: #e10600;
  --red-soft: rgba(225, 6, 0, 0.16);
  --green: #16a34a;
  --green-bright: #22c55e;
  --ok: #4ade80;
  --err: #ff4d4d;

  --font: 'Hanken Grotesk', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 700px 500px at 50% 0%, rgba(225, 6, 0, 0.10), transparent 65%);
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  animation: rise 480ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 16px;
  padding: 24px 24px 22px;
  box-shadow:
    0 24px 48px -18px rgba(0, 0, 0, 0.6),
    0 6px 20px -10px rgba(225, 6, 0, 0.16);
}

.brand {
  text-align: center;
  margin-bottom: 22px;
}
.logo {
  width: 44px;
  height: 44px;
  display: block;
  margin: 0 auto 10px;
  filter: drop-shadow(0 5px 14px rgba(225, 6, 0, 0.4));
}
.brand h1 {
  font-family: var(--font);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 0;
}
.tagline {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.subtitle {
  margin: 10px auto 0;
  max-width: 320px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
  font-weight: 400;
}

.form { display: flex; flex-direction: column; }
.field { margin-bottom: 16px; }
.field:last-of-type { margin-bottom: 0; }

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.field-head label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
}

.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; }

input[type="text"] {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--card-line);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  font-variant-numeric: tabular-nums;
}
input[type="text"]:focus { border-color: var(--red); background: #1f1f25; }
input[type="text"]::placeholder { color: var(--text-faint); font-weight: 400; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--card-line);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 0 16px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--red);
  color: var(--red);
}
.btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }

.status {
  margin: 7px 0 0;
  font-size: 13px;
  min-height: 18px;
  color: var(--text-dim);
  font-weight: 500;
}
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--card-line);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  margin: 4px 0 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--red);
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: grab;
  transition: transform 0.1s;
  box-shadow: 0 2px 10px rgba(225, 6, 0, 0.5);
}
input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.12); cursor: grabbing; }
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--red);
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: grab;
}

.amount-display {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.amount-unit {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-dim);
}

.bonus-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  min-height: 18px;
  transition: color 0.3s;
}
.bonus-hint.active { color: var(--green-bright); }
.bonus-hint.flash {
  animation: hint-flash 700ms ease;
}

.amount-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--input);
  border: 1px solid var(--card-line);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.3s, background 0.3s;
}
.amount-meta.tier-up {
  animation: meta-glow 900ms ease;
}
.amount-meta .meta-coins {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.amount-meta #price-label {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bonus-badge {
  display: inline-block;
  padding: 2px 9px;
  background: rgba(22, 163, 74, 0.15);
  border: 1px solid rgba(22, 163, 74, 0.4);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green-bright);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.bonus-badge.bump {
  animation: badge-pop 600ms cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

@keyframes badge-pop {
  0%   { transform: scale(0.6); }
  35%  { transform: scale(1.25); background: rgba(34, 197, 94, 0.35); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}
@keyframes meta-glow {
  0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55); border-color: var(--green-bright); }
  60%  { box-shadow: 0 0 0 12px rgba(22, 163, 74, 0); border-color: var(--green-bright); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); border-color: var(--card-line); }
}
@keyframes hint-flash {
  0%   { transform: translateY(-3px); opacity: 0.4; }
  40%  { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes thumb-flash {
  0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7), 0 2px 10px rgba(225, 6, 0, 0.5); }
  60%  { box-shadow: 0 0 0 14px rgba(22, 163, 74, 0), 0 2px 10px rgba(225, 6, 0, 0.5); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0), 0 2px 10px rgba(225, 6, 0, 0.5); }
}
input[type="range"].thumb-pulse::-webkit-slider-thumb {
  animation: thumb-flash 700ms ease;
}
input[type="range"].thumb-pulse::-moz-range-thumb {
  animation: thumb-flash 700ms ease;
}

.turnstile-wrap {
  display: flex;
  justify-content: center;
  margin: 18px 0 14px;
  min-height: 65px;
}

.btn-primary {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--green);
  color: #fff;
  border: 1px solid var(--green);
  border-radius: 10px;
  padding: 14px 18px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.05s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
  box-shadow: 0 8px 22px -10px rgba(22, 163, 74, 0.55);
}
.btn-primary:hover:not(:disabled) {
  background: var(--green-bright);
  border-color: var(--green-bright);
  box-shadow: 0 10px 26px -8px rgba(34, 197, 94, 0.7);
}
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled {
  background: var(--input);
  border-color: var(--card-line);
  color: var(--text-faint);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-icon { flex-shrink: 0; }

.error {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: rgba(255, 77, 77, 0.08);
  border: 1px solid rgba(255, 77, 77, 0.25);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--err);
  text-align: center;
}

.trust {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--card-line);
  text-align: center;
}
.trust-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 9px;
}
.trust-line strong { color: var(--text); font-weight: 700; }
.cards {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.card-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  background: var(--input);
  border: 1px solid var(--card-line);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.footnote {
  margin: 14px 12px 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-faint);
  font-weight: 500;
  line-height: 1.5;
}

/* success / cancel */
.center { text-align: center; padding: 8px 4px 0; }
.center .icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  margin: 0 auto 14px;
  background: var(--red-soft);
  color: var(--red);
}
.center.ok .icon { background: rgba(74, 222, 128, 0.14); color: var(--ok); }
.center h2 {
  font-family: var(--font);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.center p {
  margin: 0 0 6px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.55;
}
.center a {
  display: inline-block;
  margin-top: 18px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--card-line);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.center a:hover { border-color: var(--green); color: var(--green); }

/* phone */
@media (max-width: 480px) {
  body { padding: 14px 12px; }
  .card {
    padding: 20px 18px 18px;
    border-radius: 14px;
  }
  .brand { margin-bottom: 18px; }
  .logo { width: 40px; height: 40px; margin-bottom: 10px; }
  .brand h1 { font-size: 19px; }
  .subtitle { font-size: 12.5px; line-height: 1.4; }
  .field { margin-bottom: 14px; }
  .field-head { margin-bottom: 7px; }
  .amount { font-size: 20px; }
  .amount-meta { padding: 9px 11px; font-size: 13.5px; }
  .turnstile-wrap { margin: 14px 0 12px; }
  .btn-primary { padding: 13px 16px; font-size: 14.5px; }
  .trust { margin-top: 14px; padding-top: 12px; }
  .trust-line { font-size: 11.5px; }
  .footnote { font-size: 11px; margin-top: 12px; }
}

@media (max-width: 360px) {
  .input-row { flex-direction: column; }
  .btn-ghost { padding: 10px 14px; }
  .cards { gap: 4px; }
  .card-tag { font-size: 9.5px; padding: 0 6px; }
}
