:root {
  --bg: #fafaf9;
  --fg: #111111;
  --muted: #8a8a85;
  --line: #e7e5e4;
  --accent: #f7931a;
  --card: #ffffff;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0c;
    --fg: #f5f5f4;
    --muted: #78716c;
    --line: #262626;
    --card: #161616;
    --danger: #fca5a5;
    --danger-bg: #2a1212;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }   /* the safety check relies on this to hide the QR/address */
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  /* system fonts only: nothing loaded from third-party servers */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  -webkit-font-smoothing: antialiased;
}
main {
  width: 100%;
  max-width: 480px;
  text-align: center;
}
h1 {
  font-size: clamp(2rem, 8vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}
h1 span { color: var(--accent); }
.tagline {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}
.qr {
  margin: 40px auto 0;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1;
  padding: 8px;
  background: #fff;               /* QR always dark-on-light for reliable scanning */
  border: 1px solid var(--line);
  border-radius: 20px;
  display: block;
}
.qr svg { width: 100%; height: 100%; display: block; }
.address {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.address code {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, "Roboto Mono", monospace;
  /* shrink with the screen so the full (grouped) address fits on one line */
  font-size: clamp(8.5px, calc((100vw - 130px) / 28.5), 13px);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  color: var(--fg);
}
/* groups of 4 characters make look-alike address swaps easier to spot;
   the gap is visual only, so copied text has no spaces */
.address code .g { margin-right: 0.28em; }
.address code .g:last-child { margin-right: 0; }
/* highlight the chars donors should compare: first group after the "bc1q" prefix, and the last group */
.address code .g.key { color: var(--accent); font-weight: 600; }
button {
  flex-shrink: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: var(--fg);
  color: var(--bg);
  cursor: pointer;
  transition: opacity .15s;
}
button:hover { opacity: .85; }
.alert {
  margin-top: 24px;
  padding: 14px;
  border-radius: 12px;
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 600;
  font-size: 0.9rem;
}
.notice {
  margin-top: 16px;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--muted);
}
.notice strong { color: var(--fg); font-weight: 600; }
.proof {
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: left;
}
.proof summary { cursor: pointer; text-align: center; }
.proof p { margin: 10px 0; line-height: 1.5; }
.proof dt { font-weight: 600; color: var(--fg); margin-top: 8px; }
.proof dd code {
  display: block;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  word-break: break-all;
  user-select: all;
}
footer {
  margin-top: 40px;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}
footer span { white-space: nowrap; }

/* live thank-you at the bottom of the page */
.thanks {
  width: 100%;
  max-width: 480px;
  margin-top: 24px;
  text-align: center;
}
.watching {
  font-size: 0.75rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: .25; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.thanks-card {
  margin-top: 12px;
  padding: 20px;
  border: 1px solid var(--accent);
  border-radius: 16px;
  background: var(--card);
  animation: pop .4s ease-out;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.thanks-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.thanks-amount { margin-top: 6px; font-size: 0.95rem; font-weight: 600; color: var(--accent); }
.thanks-status { margin-top: 6px; font-size: 0.75rem; color: var(--muted); }
.thanks-card.confirmed .thanks-status { color: #16a34a; }
.thanks-card a { display: inline-block; margin-top: 10px; font-size: 0.75rem; color: var(--fg); }
