/* Shop-receipt look: paper cards on an ink background. System fonts only, so the page makes no
   network requests. */
:root {
  --bg: #ecebe6;
  --ink: #1d1c1a;
  --muted: #6b6860;
  --paper: #fffdf7;
  --paper-ink: #1d1c1a;
  --paper-muted: #77736a;
  --rule: #cfcabd;
  --accent: #d6452f;
  --accent-ink: #ffffff;
  --ok: #2f7d4f;
  --warn: #9a5b00;
  --warn-bg: #fff2d9;
  --focus: #2a6df4;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151514;
    --ink: #efede6;
    --muted: #9d998f;
    --paper: #f6f2e7;
    --rule: #cbc5b6;
    --accent: #ef5a42;
    --focus: #7ea6ff;
  }
}
:root[data-theme="dark"] {
  --bg: #151514;
  --ink: #efede6;
  --muted: #9d998f;
  --paper: #f6f2e7;
  --rule: #cbc5b6;
  --accent: #ef5a42;
  --focus: #7ea6ff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 8px 16px 48px; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

/* header / footer */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 560px; width: 100%; margin: 0 auto; padding: 16px; }
.top-right { display: flex; align-items: center; gap: 8px; }
.restart { font: 600 14px var(--mono); color: var(--ink); background: transparent; border: 1px solid var(--muted); border-radius: 999px; padding: 5px 10px; white-space: nowrap; }
/* Phones: icon only, so the header never pushes the currency menu off screen. */
@media (max-width: 440px) { .restart-label { display: none; } .restart { padding: 5px 11px; } }
.brand { font: 700 15px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.badge { display: inline-block; font-size: 12px; color: var(--muted); border: 1px solid currentColor; border-radius: 999px; padding: 2px 10px; white-space: nowrap; margin-top: 8px; }
.currency select {
  font: 600 14px var(--mono);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--muted);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  max-width: 150px;
}
.currency select option { color: #1d1c1a; background: #fff; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
footer { max-width: 560px; margin: 0 auto; padding: 24px 16px 32px; color: var(--muted); font-size: 12px; text-align: center; }
footer p { margin: 4px 0; }

/* intro */
h1 { font-size: clamp(28px, 7vw, 40px); line-height: 1.1; margin: 16px 0 12px; letter-spacing: -.01em; }
h1 em { font-style: normal; color: var(--accent); }
.lede { color: var(--muted); margin: 0 0 24px; }

/* the receipt card */
.receipt {
  position: relative;
  background: var(--paper);
  color: var(--paper-ink);
  padding: 20px 20px 28px;
  margin: 0 0 20px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 10px 30px rgba(0, 0, 0, .12);
  /* torn zig-zag bottom edge */
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 16px 100%;
          mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 16px 100%;
}
.receipt a { color: var(--accent); font-weight: 600; word-break: break-word; }

.steps { list-style: none; }
.steps li { display: grid; grid-template-columns: 36px 1fr; gap: 4px; padding: 14px 0; border-bottom: 1px dashed var(--rule); }
.steps li:first-child { padding-top: 0; }
.steps li:last-child { border-bottom: 0; padding-bottom: 0; }
.steps .n { font: 700 13px var(--mono); color: var(--paper-muted); padding-top: 2px; }
.steps b { display: block; }
.steps p { margin: 2px 0 0; color: var(--paper-muted); font-size: 15px; }
kbd {
  font: 600 12px var(--mono);
  color: var(--paper-ink);
  background: #fff;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* paste target: a real textarea (so phones offer "Paste") with the hint drawn behind it */
.drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 150px;
  border: 2px dashed var(--muted);
  border-radius: 12px;
  cursor: text;
  transition: border-color .15s, background-color .15s;
}
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.drop textarea {
  position: absolute; inset: 0; width: 100%; height: 100%;
  resize: none; border: 0; border-radius: 12px; background: transparent;
  color: transparent; caret-color: var(--accent); font-size: 16px; padding: 16px;
}
.drop textarea:focus { outline: none; }
.drop-hint { pointer-events: none; text-align: center; padding: 16px; }
.drop-hint b { display: block; font-size: 18px; }
.drop-hint small { color: var(--muted); font-size: 14px; }
.drop.busy .drop-hint b::after { content: " …"; }

.alt { font-size: 14px; color: var(--muted); text-align: center; margin: 16px 0 0; }
.link { text-decoration: underline; cursor: pointer; color: var(--ink); }
.link input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.link:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.mobile-note { display: none; font-size: 14px; color: var(--muted); text-align: center; }
@media (hover: none) and (pointer: coarse) { .mobile-note { display: block; } }

/* check screen */
.stamp {
  display: inline-block;
  font: 800 13px var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 2px solid currentColor;
  border-radius: 4px;
  padding: 2px 8px;
  transform: rotate(-3deg);
  margin: 0 0 12px;
}
.stamp.ok { color: var(--ok); }
.stamp.bad { color: var(--accent); }
.receipt h2 { font-size: 22px; line-height: 1.2; margin: 0 0 8px; }
.receipt p { margin: 8px 0; }
.lines { font: 14px/1.4 var(--mono); margin: 16px 0 0; padding: 12px 0 0; border-top: 1px dashed var(--rule); }
.lines div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.lines dt { color: var(--paper-muted); }
.lines dd { margin: 0; text-align: right; font-weight: 600; }
.lines .total { border-top: 1px dashed var(--rule); margin-top: 8px; padding-top: 10px; font-size: 16px; }

.issue { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 12px; margin: 12px 0 0; font-size: 14px; }
.issue b { display: block; color: var(--paper-ink); }
.fix { margin: 12px 0 0; padding-left: 20px; color: var(--paper-muted); }
.fix li { margin: 4px 0; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
button {
  font: 600 16px var(--sans);
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  border: 2px solid transparent;
}
button.primary { background: var(--accent); color: var(--accent-ink); }
button.ghost { background: transparent; color: var(--ink); border-color: var(--muted); }
button:active { transform: translateY(1px); }
.note { font-size: 13px; color: var(--muted); }

/* Phone warning at the top of the start screen. */
.phone-note { margin: 0 0 20px; padding: 14px 16px; border-radius: 12px; background: var(--warn-bg); color: #3a2a00; }
.phone-note p { margin: 0 0 12px; font-size: 15px; }
.phone-note b { color: #1d1c1a; }
.phone-note button.ghost { color: #3a2a00; border-color: #9a5b00; }

/* cards: one canvas per card, sized to fit the screen at 9:16 */
.deck { width: min(100%, calc((100vh - 240px) * 9 / 16)); width: min(100%, calc((100svh - 240px) * 9 / 16)); min-width: 240px; margin: 0 auto; }
.progress { display: flex; gap: 6px; margin: 0 0 10px; }
.progress span { flex: 1; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 35%, transparent); }
.progress span.on { background: var(--ink); }
.stage { touch-action: pan-y; cursor: pointer; user-select: none; -webkit-user-select: none; }
.stage canvas { display: block; width: 100%; height: auto; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.deck-actions { justify-content: center; margin-top: 16px; }
.deck-actions button[disabled] { opacity: .35; cursor: default; }
.deck-note { text-align: center; }
.text-btn { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; text-decoration: underline; border-radius: 0; }

/* Steam's "Load More Transactions" button, redrawn so people recognise it. Not clickable here. */
/* It copies Steam's look on purpose so people spot the real button; the note says it's only a picture. */
.steam-btn-note { display: block; margin: 0 0 4px; font-size: 12px; color: var(--paper-muted); }
.steam-btn {
  display: block;
  max-width: 320px;
  margin: 10px 0 2px;
  padding: 8px 12px;
  border-radius: 2px;
  background: linear-gradient(to bottom, #31506a, #27435a);
  color: #66c0f4;
  font: 13px/1.4 Arial, Helvetica, sans-serif;
  text-align: center;
  text-transform: uppercase;
  user-select: none;
  -webkit-user-select: none;
}

/* Headings get focus from code so screen readers announce the new screen; no ring needed. */
h2[tabindex="-1"]:focus { outline: none; }

/* Thank-you slide: real page content (so the button is clickable) made to match the card images.
   Sizes use cqw, a share of the slide's width, so it scales the same way the canvas cards do. */
.thanks { container-type: inline-size; aspect-ratio: 9 / 16; background: #1d1c1a; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); display: flex; cursor: default; }
.thanks-paper {
  flex: 1;
  margin: 15.7cqw 9.3cqw;
  padding: 0 6.5cqw;
  background: #fffdf7;
  color: #1d1c1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3.2cqw;
  text-align: center;
  /* the same torn zig-zag as the cards, top and bottom */
  --tooth: 3.7cqw;
  -webkit-mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--tooth) 51% repeat-x, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--tooth) 51% repeat-x;
          mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--tooth) 51% repeat-x, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--tooth) 51% repeat-x;
}
.thanks-paper p { margin: 0; }
.thanks-brand { font: 700 4.1cqw var(--mono); letter-spacing: .18em; text-transform: uppercase; }
.thanks-title { font: 700 3.4cqw var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #d6452f; }
.thanks .kofi-icon { width: 22cqw; height: 22cqw; margin: 2cqw 0; }
.thanks-ask { font: 700 5.6cqw/1.25 var(--sans); }
.thanks-small { font: 400 3.5cqw/1.35 var(--sans); color: #77736a; }
.tip-btn { display: inline-block; margin: 1.5cqw 0; padding: 3cqw 6cqw; border-radius: 999px; background: #d6452f; color: #fff; font: 600 4.2cqw var(--sans); text-decoration: none; }

/* Small Support button: bottom-right corner, final receipt only. */
.tip-pill {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 5px;
  border-radius: 999px;
  border: 1px solid var(--muted);
  background: var(--bg);
  color: var(--ink);
  font: 600 12px var(--sans);
  text-decoration: none;
}
.tip-pill:hover { border-color: var(--accent); }
.tip-pill .kofi-icon { width: 20px; height: 20px; }
#cards { padding-bottom: 40px; } /* room to scroll clear of the Support button */

/* Front page: the safety notes, kept in plain sight above the steps. */
.safe { margin: 0 0 24px; padding: 14px 16px; border: 1px solid var(--muted); border-radius: 12px; font-size: 15px; }
.safe h2 { margin: 0 0 8px; font-size: 17px; }
.safe p { margin: 0 0 10px; }
.safe b { color: var(--ink); }
.safe details { margin-top: 6px; color: var(--muted); }
.safe summary { cursor: pointer; color: var(--ink); text-decoration: underline; }
.safe details p { margin: 8px 0 0; }
.safe kbd { color: #1d1c1a; }

