/* SpawnPK crypto checkout — no external resources */

:root {
  color-scheme: dark;
  --bg: #121314;
  --card: #1a1b1d;
  --surface: #202124;
  --surface-hover: #25272a;
  --border: #2a2c2f;
  --border-strong: #3a3d42;
  --text: #e6e6e6;
  --muted: #8a8f98;
  --accent: #4f8cff;
  --accent-strong: #2f6be0;
  --accent-strong-hover: #3d78ec;
  --ok: #3ccf8e;
  --warn: #f0b429;
  --err: #f06464;
  --radius: 16px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  justify-content: center;
  padding: 48px 16px 32px;
  overflow-x: hidden;
}

h1, h2, h3, p { margin: 0; }

a { color: var(--accent); }

.wrap { width: 100%; max-width: 440px; min-width: 0; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.center { text-align: center; }
.tnum { font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.sr-copy {
  position: fixed; top: 0; left: 0;
  width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Icons ---------- */
.icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset, 0 12px 32px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.head {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.game {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  min-width: 0;
  overflow-wrap: anywhere;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
}
.meta > span { min-width: 0; overflow-wrap: anywhere; }
.meta > span:empty { display: none; }
.meta > span + span::before {
  content: "·";
  margin: 0 8px;
  color: var(--border-strong);
}

/* ---------- Status pill ---------- */
.pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill-muted  { color: var(--muted);  background: rgba(138, 143, 152, 0.08); }
.pill-accent { color: var(--accent); background: rgba(79, 140, 255, 0.10);  border-color: rgba(79, 140, 255, 0.28); }
.pill-warn   { color: var(--warn);   background: rgba(240, 180, 41, 0.08);  border-color: rgba(240, 180, 41, 0.26); }
.pill-ok     { color: var(--ok);     background: rgba(60, 207, 142, 0.08);  border-color: rgba(60, 207, 142, 0.26); }
.pill-err    { color: var(--err);    background: rgba(240, 100, 100, 0.08); border-color: rgba(240, 100, 100, 0.28); }

/* ---------- Cart ---------- */
.cart { border-bottom: 1px solid var(--border); }

.cart-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
}
.cart-summary::-webkit-details-marker { display: none; }
.cart-summary::marker { content: ""; }
.cart-summary:hover .cart-chev { color: var(--text); }
.cart-summary:focus-visible { outline-offset: -2px; border-radius: 0; }

.cart-label { font-weight: 500; }
.cart-label .muted { font-weight: 400; margin-left: 4px; }
.cart-right { display: inline-flex; align-items: center; gap: 8px; }
.cart-total { font-weight: 600; font-variant-numeric: tabular-nums; }
.cart-chev { color: var(--muted); transition: transform 0.18s ease; }
.cart[open] .cart-chev { transform: rotate(180deg); }

.cart-items {
  list-style: none;
  margin: 0;
  padding: 0 20px 14px;
  display: grid;
  gap: 6px;
  font-size: 14px;
}
.cart-items li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}
.ci-name { min-width: 0; overflow-wrap: anywhere; }
.ci-qty { color: var(--muted); font-variant-numeric: tabular-nums; }
.ci-amt { flex-shrink: 0; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- View ---------- */
.view {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:disabled { cursor: default; opacity: 0.6; }

.btn-primary { background: var(--accent-strong); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong-hover); }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--border-strong); }

.btn-link {
  width: auto;
  align-self: center;
  min-height: 36px;
  padding: 6px 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
}
.btn-link:hover:not(:disabled) { color: var(--text); }

.btn .spinner { display: none; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading { opacity: 1; }

.btn-copy {
  appearance: none;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.btn-copy:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-hover); }
.btn-copy .icon { width: 14px; height: 14px; }
.btn-copy .i-check { display: none; }
.btn-copy.is-copied { color: var(--ok); border-color: rgba(60, 207, 142, 0.35); }
.btn-copy.is-copied .i-copy { display: none; }
.btn-copy.is-copied .i-check { display: inline-block; }
.btn-copy.is-failed { color: var(--err); }

/* ---------- Spinner ---------- */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: currentColor;
  animation: spin 0.8s linear infinite;
}
.spinner-lg {
  width: 44px; height: 44px;
  border-width: 3px;
  border-color: var(--border);
  border-top-color: var(--accent);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Coin selector ---------- */
.coin-list { display: grid; gap: 8px; }

.coin-opt {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.coin-opt:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--border-strong); }
.coin-opt:disabled { cursor: default; opacity: 0.55; }
.coin-opt.is-loading { opacity: 1; border-color: var(--accent); }
.coin-opt.is-current { border-color: rgba(79, 140, 255, 0.45); }
.coin-opt .spinner { display: none; color: var(--accent); }
.coin-opt.is-loading .spinner { display: inline-block; }
.coin-opt.is-loading .coin-opt-chev { display: none; }

.coin-icon { width: 32px; height: 32px; flex-shrink: 0; display: block; }

.coin-opt-text { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.coin-opt-name { font-weight: 600; overflow-wrap: anywhere; }
.coin-opt-code { color: var(--muted); font-size: 13px; }
.coin-opt-chev { color: var(--muted); }

/* ---------- Payment ---------- */
.coin-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.coin-head-text { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.coin-head-name { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.coin-head-code { color: var(--muted); font-size: 13px; }

.timer {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.timer .icon { width: 14px; height: 14px; }
.timer.is-low { color: var(--warn); border-color: rgba(240, 180, 41, 0.3); }
.timer.is-out { color: var(--err); border-color: rgba(240, 100, 100, 0.3); }

.qr {
  align-self: center;
  width: 200px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr img { width: 100%; height: 100%; display: block; }
.qr-fallback { color: #555; font-size: 13px; text-align: center; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.field-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  min-width: 0;
}
.field-value {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.field-value.addr { font-family: var(--mono); font-size: 13.5px; line-height: 1.55; }

.amount { font-family: var(--mono); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.amount-code { color: var(--muted); font-size: 14px; font-weight: 500; margin-left: 6px; word-break: normal; }

.field-sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

.note {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 8px; }
.form .btn { margin-top: 8px; }

.input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  transition: border-color 0.15s ease;
}
.input::placeholder { color: #6b7079; }
.input:focus { border-color: var(--accent); outline: none; }
.input:focus-visible { outline: 2px solid rgba(79, 140, 255, 0.35); outline-offset: 1px; }
.input[aria-invalid="true"] { border-color: var(--err); }

.form-error { font-size: 13px; color: var(--err); overflow-wrap: anywhere; }
.form-error:empty { display: none; }

/* ---------- Status states ---------- */
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 12px 0 4px;
  min-width: 0;
}
.state-page { padding: 20px 0 12px; }
.state h2, .state-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.state p { font-size: 14px; overflow-wrap: anywhere; }
.state .spinner-lg { margin-bottom: 4px; }

.state-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  border: 1px solid transparent;
}
.state-icon .icon { width: 28px; height: 28px; stroke-width: 2.2; }
.state-ok    { color: var(--ok);    background: rgba(60, 207, 142, 0.10);  border-color: rgba(60, 207, 142, 0.22); }
.state-err   { color: var(--err);   background: rgba(240, 100, 100, 0.10); border-color: rgba(240, 100, 100, 0.22); }
.state-warn  { color: var(--warn);  background: rgba(240, 180, 41, 0.10);  border-color: rgba(240, 180, 41, 0.22); }
.state-muted { color: var(--muted); background: var(--surface);            border-color: var(--border); }

.progress {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  max-width: 240px;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
  color: var(--accent);
}
.progress::-webkit-progress-bar { background: var(--surface); border-radius: 999px; }
.progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; transition: width 0.3s ease; }
.progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }

.cmd {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 18px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(60, 207, 142, 0.30);
  background: rgba(60, 207, 142, 0.06);
  text-align: center;
}
.cmd-code {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ok);
  overflow-wrap: anywhere;
}
.cmd-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Connection indicator ---------- */
.net {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--warn);
  background: rgba(240, 180, 41, 0.04);
}
.net-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }

/* ---------- Footer ---------- */
.foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.foot .icon { width: 12px; height: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  body { padding: 16px 16px 24px; }
  .head { padding: 16px 16px 14px; }
  .cart-summary { padding: 12px 16px; }
  .cart-items { padding: 0 16px 12px; }
  .view { padding: 16px; }
  .net { padding: 8px 16px; }
  .qr { width: 184px; }
  .amount { font-size: 17px; }
}

@media (max-width: 360px) {
  .field-box { flex-wrap: wrap; }
  .field-box .btn-copy { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .spinner { animation: spin 2.4s linear infinite !important; }
}

@media (forced-colors: active) {
  .pill, .btn, .coin-opt, .field-box, .timer { border: 1px solid CanvasText; }
}
