/* Grok Lottery spectator page: "Security Print".
   The season is one printed ticket. An engraved navy face carries the jackpot and a perforated cream stub
   holds the clock and terms. Numbering-machine red marks time, foil marks money.
   Everything is local: system faces, inline SVG and CSS gradients, no remote assets. */

:root {
  color-scheme: light;
  --ground: #ece5d4;
  --ground-2: #e2d9c4;
  --stock: #fbf8ef;
  --stock-2: #f3eddd;
  --ink: #18213a;
  --ink-2: #4c5368;
  --ink-3: #6c7180;
  --rule: #d6ccb5;
  --navy: #142347;
  --navy-2: #1b2e5d;
  --navy-3: #0c1733;
  --gold: #dcbc68;
  --gold-ink: #7d5a12;
  --on-navy: #f3ebd5;
  --on-navy-2: #c9c6be;
  --red: #c13a24;
  --red-2: #8f2715;
  --green: #2d6a43;
  --amber: #a8640c;
  --foil: linear-gradient(100deg, #a67c2c 0%, #f5e2a2 18%, #c79a3e 36%, #fff1c4 52%, #b6872f 70%, #ebd08b 86%, #a67c2c 100%);
  --display: "Didot", "Bodoni 72", "Bodoni MT", "Playfair Display", Georgia, "Times New Roman", serif;
  --engraved: "Copperplate", "Copperplate Gothic Light", "Optima", "Avenir Next", system-ui, sans-serif;
  --numbering: "DIN Condensed", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --text: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --stub-width: 360px;
  --notch: 15px;
  --radius: 22px;
  color: var(--ink);
  background: var(--ground);
  font-family: var(--text);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
summary { cursor: pointer; }
a { color: inherit; text-decoration-color: rgb(24 33 58 / .35); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
code { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: 3px solid #d07a12; outline-offset: 3px; border-radius: 6px; }

body {
  min-height: 100vh;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .25 0 0 0 0 .12 0 0 0 .55 -.22'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(120% 60% at 50% -12%, #f7f2e6 0%, rgb(247 242 230 / 0) 62%),
    var(--ground);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.wrap { width: min(100% - 64px, 1140px); margin-inline: auto; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10; padding: 10px 14px; border-radius: 10px;
  background: var(--navy); color: var(--on-navy); font-weight: 650; text-decoration: none;
}
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 12px); }

/* ---------- Masthead ---------- */

.masthead { padding-top: env(safe-area-inset-top, 0px); }
.masthead-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  min-height: 76px; padding-block: 10px; border-bottom: 1px solid var(--rule);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--navy); padding: 3px; box-shadow: inset 0 0 0 1px rgb(220 188 104 / .5); }
.brand-mark path { fill: none; stroke: var(--gold); stroke-width: .6; opacity: .95; }
.brand-name { font-family: var(--display); font-size: 27px; letter-spacing: -.01em; line-height: 1; white-space: nowrap; }

.feed {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 6px 13px 5px 11px;
  border: 1px solid var(--rule); border-radius: 100px; background: rgb(251 248 239 / .7);
  font-family: var(--engraved); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.feed-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.feed[data-feed="live"] { color: var(--green); border-color: rgb(45 106 67 / .35); }
.feed[data-feed="live"] .feed-dot { background: #3f9a5f; }
.feed[data-feed="live"] .feed-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #3f9a5f; opacity: 0;
  animation: ping 2.4s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.4); opacity: .7; } 70%, 100% { transform: scale(1.3); opacity: 0; } }
.feed[data-feed="stale"] { color: var(--amber); border-color: rgb(168 100 12 / .4); }
.feed[data-feed="stale"] .feed-dot { background: #d08a1c; }
.feed[data-feed="syncing"] .feed-dot, .feed[data-feed="loading"] .feed-dot {
  background: transparent; border: 2px solid var(--navy-2); border-right-color: transparent; animation: spin .9s linear infinite;
}
.feed[data-feed="offline"], .feed[data-feed="unavailable"] { color: var(--red-2); border-color: rgb(143 39 21 / .35); }
.feed[data-feed="offline"] .feed-dot, .feed[data-feed="unavailable"] .feed-dot { background: var(--red); }
.feed[data-feed="test"] { color: var(--gold-ink); border-color: rgb(125 90 18 / .4); }
.feed[data-feed="test"] .feed-dot { background: var(--gold); }
@keyframes spin { to { transform: rotate(360deg); } }

main { padding-block: 22px 18px; }

/* ---------- Notice ---------- */

.notice {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  margin-bottom: 16px; padding: 12px 16px 12px 44px; border-radius: 14px; position: relative;
  background: var(--stock); box-shadow: 0 0 0 1px var(--rule); font-size: 14px; line-height: 1.45; color: var(--ink-2);
}
.notice::before {
  content: "i"; position: absolute; left: 14px; top: 13px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 13px; font-style: italic;
  color: var(--stock); background: var(--navy);
}
.notice[data-tone="warn"] { background: #fbf1dc; box-shadow: 0 0 0 1px #e3c98f; color: #5b3d08; }
.notice[data-tone="warn"]::before { content: "!"; font-style: normal; background: var(--amber); }
.notice[data-tone="error"] { background: #fbebe6; box-shadow: 0 0 0 1px #e8b4a7; color: var(--red-2); }
.notice[data-tone="error"]::before { content: "!"; font-style: normal; background: var(--red); }
.notice-retry {
  border: 1px solid currentColor; background: transparent; border-radius: 100px; padding: 5px 14px;
  font-size: 13px; font-weight: 650;
}
.notice-retry:hover { background: rgb(255 255 255 / .5); }

/* ---------- The ticket ---------- */

.ticket-wrap { filter: drop-shadow(0 1px 1px rgb(24 33 58 / .16)) drop-shadow(0 22px 30px rgb(24 33 58 / .17)); }
.ticket { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 0 var(--stub-width); }

.face {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; min-height: 430px; padding: 34px 44px 40px;
  color: var(--on-navy); border-radius: var(--radius) 0 0 var(--radius);
  background:
    repeating-linear-gradient(135deg, rgb(255 255 255 / .022) 0 1px, transparent 1px 6px),
    radial-gradient(90% 120% at 82% 50%, var(--navy-2) 0%, var(--navy) 55%, var(--navy-3) 100%);
  -webkit-mask:
    linear-gradient(#000 0 0) left / calc(100% - var(--notch)) 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% 0, #0000 98%, #000) right top / var(--notch) 51% no-repeat,
    radial-gradient(circle var(--notch) at 100% 100%, #0000 98%, #000) right bottom / var(--notch) 51% no-repeat;
  mask:
    linear-gradient(#000 0 0) left / calc(100% - var(--notch)) 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% 0, #0000 98%, #000) right top / var(--notch) 51% no-repeat,
    radial-gradient(circle var(--notch) at 100% 100%, #0000 98%, #000) right bottom / var(--notch) 51% no-repeat;
}
.face::before {
  content: ""; position: absolute; inset: 12px; border-radius: 14px; pointer-events: none; z-index: -1;
  border: 1px solid rgb(220 188 104 / .38); box-shadow: inset 0 0 0 5px rgb(220 188 104 / .1);
}
.plate {
  position: absolute; z-index: -1; width: 620px; height: 620px; right: -150px; top: 50%;
  transform: translateY(-50%); opacity: .62; pointer-events: none;
}
.plate path { fill: none; stroke: var(--gold); stroke-width: .5; vector-effect: non-scaling-stroke; }
.plate .spiro { opacity: .55; }
.plate .band { opacity: .35; }
[data-view="stale"] .plate, [data-view="kept"] .plate { opacity: .4; }

.face-top { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.face h1 { font-family: var(--engraved); font-weight: 400; font-size: 17px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.phase {
  font-family: var(--engraved); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
  padding: 5px 10px 4px; border-radius: 100px; border: 1px solid rgb(220 188 104 / .5); color: var(--on-navy);
}
.phase::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--on-navy-2); margin-right: 7px; vertical-align: 1px; }
[data-phase="open"] .phase::before { background: #7fd39a; }
[data-phase="awaiting-beacon"] .phase::before, [data-phase="awaiting-proof"] .phase::before { background: var(--gold); }
[data-phase="refundable"] .phase::before { background: #ff8a70; }
.serial {
  margin-left: auto; font-family: var(--numbering); font-weight: 700; font-size: 20px; line-height: 1;
  letter-spacing: .06em; color: #ff8a70; font-variant-numeric: tabular-nums; padding-top: 3px;
}
.serial:empty { display: none; }

.pot-label {
  margin-top: auto; padding-top: 34px; font-family: var(--engraved); font-size: 13px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--on-navy-2);
}
.jackpot {
  margin: 6px 0 14px; font-family: var(--display); font-weight: 400; font-size: clamp(54px, 8.2vw, 112px);
  line-height: .98; letter-spacing: -.015em; overflow-wrap: anywhere; font-variant-numeric: lining-nums;
  background: var(--foil); background-size: 220% 100%; background-position: 0% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgb(5 10 25 / .45));
}
.jackpot .unit { font-family: var(--engraved); font-size: .24em; letter-spacing: .16em; }
.jackpot.is-words { font-size: clamp(40px, 5.6vw, 72px); line-height: 1.04; }
.jackpot.is-long { font-size: clamp(40px, 5.8vw, 80px); }
.jackpot.bump { animation: shine 1.6s ease both; }
@keyframes shine { from { background-position: 100% 0; } to { background-position: 0% 0; } }
.pot-line { max-width: 40ch; font-size: 17px; line-height: 1.45; color: var(--on-navy); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin-top: 16px; }
.badges:empty { display: none; }
.badge {
  padding: 6px 12px 5px; border-radius: 6px; background: rgb(220 188 104 / .13); border: 1px solid rgb(220 188 104 / .38);
  font-family: var(--engraved); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.microtext {
  position: absolute; left: 24px; right: 24px; bottom: 18px; overflow: hidden; white-space: nowrap;
  font-family: var(--engraved); font-size: 6.5px; letter-spacing: .3em; color: rgb(220 188 104 / .42);
}

.stamp {
  display: inline-block; padding: 5px 12px 4px; border: 2.5px solid currentColor; border-radius: 7px;
  font-family: var(--engraved); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  color: #e5583f; background: rgb(229 88 63 / .06);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.6 1.9'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23s)'/%3E%3C/svg%3E");
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.6 1.9'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23s)'/%3E%3C/svg%3E");
}
.face-stamp { position: absolute; right: 48px; top: 84px; transform: rotate(-8deg); font-size: 14px; animation: thud .38s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes thud { from { opacity: 0; transform: rotate(-8deg) scale(1.9); } }

.perf { position: relative; z-index: 2; pointer-events: none; }
.perf::before {
  content: ""; position: absolute; top: calc(var(--notch) + 8px); bottom: calc(var(--notch) + 8px); left: -3px; width: 6px;
  background: radial-gradient(circle, var(--ground) 2.3px, transparent 2.8px) center top / 6px 13px repeat-y;
}

.stub {
  position: relative; display: flex; flex-direction: column; gap: 18px; padding: 28px 30px 26px 32px;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: linear-gradient(180deg, var(--stock), var(--stock-2));
  -webkit-mask:
    linear-gradient(#000 0 0) right / calc(100% - var(--notch)) 100% no-repeat,
    radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) left top / var(--notch) 51% no-repeat,
    radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) left bottom / var(--notch) 51% no-repeat;
  mask:
    linear-gradient(#000 0 0) right / calc(100% - var(--notch)) 100% no-repeat,
    radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) left top / var(--notch) 51% no-repeat,
    radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) left bottom / var(--notch) 51% no-repeat;
}

.clock { padding-bottom: 16px; border-bottom: 1px dashed var(--rule); }
.clock-label { font-family: var(--engraved); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.clock-value {
  margin-top: 8px; font-family: var(--numbering); font-weight: 700; font-size: 46px; line-height: .95;
  letter-spacing: .01em; color: var(--red); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-height: .95em;
}
.clock-value.is-words { font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1.1; color: var(--ink); letter-spacing: 0; }
[data-view="stale"] .clock-value, [data-view="kept"] .clock-value { color: var(--ink-2); }
.clock-at { margin-top: 8px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.clock-at:empty { display: none; }

.facts { display: grid; gap: 8px; font-size: 14px; }
.facts div { display: flex; align-items: baseline; gap: 8px; }
.facts dt { color: var(--ink-2); white-space: nowrap; }
.facts div::after { content: ""; order: 1; flex: 1; min-width: 12px; border-bottom: 1px dotted var(--ink-3); opacity: .55; transform: translateY(-4px); }
.facts dd { order: 2; text-align: right; font-variant-numeric: tabular-nums; font-weight: 620; }
.facts dd small { display: block; font-size: 11.5px; font-weight: 450; color: var(--ink-3); }

.stub-note { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.stub-note:empty { display: none; }
.stub-note a { font-family: var(--mono); font-size: 12.5px; }

.cta {
  margin-top: auto; min-height: 50px; padding: 10px 18px; border: 0; border-radius: 12px;
  background: var(--navy); color: var(--on-navy); font-size: 15px; font-weight: 680; text-align: center;
  box-shadow: 0 3px 0 var(--navy-3), inset 0 1px 0 rgb(255 255 255 / .12), inset 0 0 0 1px rgb(220 188 104 / .35);
  transition: transform .08s ease, box-shadow .08s ease, background .15s ease;
}
.cta:hover { background: var(--navy-2); }
.cta:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--navy-3), inset 0 0 0 1px rgb(220 188 104 / .35); }

/* ---------- Loading skeleton ---------- */

.sk {
  display: inline-block; min-width: 6ch; height: .8em; border-radius: 6px; vertical-align: middle;
  background: linear-gradient(90deg, rgb(24 33 58 / .07) 0%, rgb(24 33 58 / .14) 50%, rgb(24 33 58 / .07) 100%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.face .sk { background-image: linear-gradient(90deg, rgb(220 188 104 / .14) 0%, rgb(220 188 104 / .32) 50%, rgb(220 188 104 / .14) 100%); }
.jackpot .sk { width: 4.2em; height: .7em; filter: none; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Draw timeline ---------- */

.section-title { font-family: var(--display); font-weight: 400; font-size: 36px; line-height: 1.05; letter-spacing: -.01em; }
.timeline { margin-top: 44px; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; margin-top: 18px; counter-reset: step; }
.step { position: relative; display: grid; align-content: start; gap: 4px; padding: 30px 14px 0 0; min-width: 0; }
.step::before {
  content: ""; position: absolute; left: 22px; right: 0; top: 10px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--ink-3) 0 4px, transparent 4px 9px); opacity: .5;
}
.step:last-child::before { display: none; }
.step-mark {
  position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--stock); box-shadow: inset 0 0 0 2px var(--ink-3);
}
.step-name { font-family: var(--engraved); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
.step-when { font-size: 14px; line-height: 1.4; color: var(--ink-2); overflow-wrap: anywhere; }
.step-when a { font-weight: 600; }
.step[data-mark="done"]::before { background: var(--navy); opacity: 1; }
.step[data-mark="done"] .step-mark {
  background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6.5 11.3l3 3 6-6.4' fill='none' stroke='%23dcbc68' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 22px no-repeat;
  box-shadow: none;
}
.step[data-mark="now"] .step-mark { background: var(--stock); box-shadow: inset 0 0 0 2px var(--red), 0 0 0 4px rgb(193 58 36 / .16); }
.step[data-mark="now"] .step-mark::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--red); animation: beat 1.6s ease-in-out infinite;
}
@keyframes beat { 50% { transform: scale(.6); opacity: .6; } }
[data-view="stale"] .step[data-mark="now"] .step-mark::after, [data-view="kept"] .step[data-mark="now"] .step-mark::after { animation: none; }
.step[data-mark="now"] .step-name { color: var(--red-2); }
.step[data-mark="missed"] .step-mark {
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M7.5 7.5l7 7M14.5 7.5l-7 7' stroke='%23fff8ec' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 22px no-repeat;
  box-shadow: none;
}
.step[data-mark="skipped"] { opacity: .55; }
.step[data-mark="skipped"] .step-mark { box-shadow: inset 0 0 0 1.5px var(--ink-3); background: transparent; }

/* ---------- Guides ---------- */

.guides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 44px; align-items: start; }
.drawer { border-radius: 16px; background: var(--stock); box-shadow: 0 0 0 1px var(--rule); }
.drawer summary { list-style: none; position: relative; display: grid; gap: 3px; padding: 18px 56px 18px 22px; border-radius: 16px; }
.drawer summary::-webkit-details-marker { display: none; }
.drawer summary::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%;
  background:
    linear-gradient(var(--ink) 0 0) center / 10px 1.6px no-repeat,
    linear-gradient(var(--ink) 0 0) center / 1.6px 10px no-repeat;
  box-shadow: inset 0 0 0 1px var(--rule); transition: transform .2s ease;
}
.drawer[open] summary::after { transform: rotate(45deg); }
.drawer summary:hover { background: rgb(24 33 58 / .025); }
.drawer-title { font-family: var(--display); font-size: 22px; line-height: 1.1; }
.drawer-hint { font-size: 13px; color: var(--ink-3); }
.drawer-body { padding: 4px 22px 22px; }
.drawer-lead { font-size: 14px; line-height: 1.5; color: var(--ink-2); margin-bottom: 8px; }
.drawer-note { margin-top: 14px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.drawer-note a { font-weight: 650; white-space: nowrap; }
.drawer.flash { animation: flash 1.4s ease; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 2px var(--gold), 0 0 0 7px rgb(220 188 104 / .25); } 100% { box-shadow: 0 0 0 1px var(--rule); } }
#play { background: linear-gradient(180deg, #fffaf0, var(--stock)); box-shadow: 0 0 0 1px #d9c48f; }

.how { display: grid; gap: 9px; margin: 2px 0 16px; list-style: none; counter-reset: how; }
.how li { position: relative; padding-left: 30px; font-size: 14px; line-height: 1.5; color: var(--ink-2); counter-increment: how; }
.how li::before {
  content: counter(how); position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--numbering); font-weight: 700; font-size: 13px; padding-top: 2px;
  color: var(--stock); background: var(--navy);
}

.prompt {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: end;
  padding: 14px 14px 14px 16px; border-radius: 12px; border: 1.5px dashed rgb(24 33 58 / .3); background: #fff;
}
.prompt-label { grid-column: 1 / -1; font-family: var(--engraved); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.prompt-text { font-size: 14px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; user-select: all; }

.copy {
  flex: none; border: 1px solid var(--rule); background: var(--stock); border-radius: 8px; padding: 5px 10px;
  font-size: 12px; font-weight: 650; color: var(--ink-2); white-space: nowrap;
}
.copy:hover { border-color: var(--ink-3); color: var(--ink); }
.copy[data-done] { color: var(--green); border-color: rgb(45 106 67 / .4); }

.terms { display: grid; gap: 0; list-style: none; }
.terms li { padding: 10px 0; border-top: 1px solid var(--rule); font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.terms li:first-child { border-top: 0; padding-top: 2px; }
.terms strong { color: var(--ink); font-weight: 650; }

.hashes { display: grid; gap: 0; }
.hashes div { padding: 10px 0; border-top: 1px solid var(--rule); min-width: 0; }
.hashes dt { font-size: 12px; color: var(--ink-3); }
.hashes dd { display: flex; align-items: flex-start; gap: 10px; margin-top: 3px; }
.hashes .value { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; color: var(--ink); }
.hashes .value.plain { font-family: var(--text); font-size: 14px; }

/* ---------- Receipts archive ---------- */

.archive { margin-top: 52px; }
.archive-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 28px; }
.totals { display: flex; flex-wrap: wrap; gap: 10px; }
.totals div { padding: 10px 16px 9px; border-radius: 12px; background: var(--navy); color: var(--on-navy); min-width: 0; }
.totals dt { font-family: var(--engraved); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--on-navy-2); }
.totals dd { margin-top: 3px; font-family: var(--display); font-size: 22px; line-height: 1.1; color: var(--gold); font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
.totals dd .unit, .amount .unit { font-family: var(--engraved); font-size: .6em; letter-spacing: .12em; }

.ledgers { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; margin-top: 20px; align-items: start; }
.ledger h3 { font-family: var(--engraved); font-weight: 400; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 10px; }
.history, .payments { display: grid; gap: 10px; list-style: none; }

.empty {
  padding: 22px 20px; border-radius: 14px; border: 1.5px dashed rgb(24 33 58 / .22);
  font-size: 14px; line-height: 1.5; color: var(--ink-2); text-align: center;
}
.empty strong { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--ink); margin-bottom: 2px; }

.record {
  position: relative; padding: 14px 18px 14px 22px; border-radius: 6px 14px 14px 6px; background: var(--stock);
  box-shadow: 0 0 0 1px var(--rule), 0 2px 0 rgb(24 33 58 / .05);
}
.record::before {
  content: ""; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 4px;
  background: radial-gradient(circle, var(--ground) 1.6px, transparent 2px) center top / 4px 9px repeat-y;
}
.record-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.record-title { font-family: var(--display); font-size: 21px; line-height: 1.1; }
.tag {
  font-family: var(--engraved); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  padding: 4px 9px 3px; border-radius: 100px; background: var(--ground); color: var(--ink-2);
}
.tag-drawn, .tag-prize { background: rgb(220 188 104 / .28); color: var(--gold-ink); }
.tag-expired, .tag-refund { background: rgb(193 58 36 / .1); color: var(--red-2); }
.record-link { margin-left: auto; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px 16px; margin-top: 10px; }
.figs div { min-width: 0; }
.figs dt { font-size: 11.5px; color: var(--ink-3); }
.figs dd { margin-top: 1px; font-size: 14.5px; font-weight: 620; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.record-note { margin-top: 8px; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.record-note.pending { color: var(--amber); }

.pay { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding-block: 12px; }
.pay .tag { grid-row: 1 / span 2; align-self: center; min-width: 64px; text-align: center; }
.amount { font-family: var(--display); font-size: 21px; line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
.pay-meta { grid-column: 2 / -1; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }
.pay-meta a { font-family: var(--mono); font-size: 12px; }
.pay .record-link { grid-column: 3; grid-row: 1; }

.skeleton-row { height: 78px; border-radius: 6px 14px 14px 6px; }
.skeleton-row.sk { display: block; width: 100%; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.pager button {
  min-height: 40px; padding: 7px 14px; border: 1px solid var(--rule); border-radius: 10px; background: var(--stock);
  font-size: 13.5px; font-weight: 650; color: var(--ink);
}
.pager button:not(:disabled):hover { border-color: var(--ink-3); }
.pager button:disabled { opacity: .45; }
.pager button[data-move="-1"]::before { content: "← "; }
.pager button[data-move="1"]::after { content: " →"; }
.pager-range { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: center; }

.colophon { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding: 30px 0 40px; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.colophon a { font-weight: 600; color: var(--ink-2); }

/* ---------- Narrower screens ---------- */

@media (max-width: 940px) {
  :root { --stub-width: 330px; }
  .face { padding: 30px 32px 38px; }
  .stub { padding: 24px 24px 22px 28px; }
  .plate { right: -220px; }
  .ledgers { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .ticket { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 0 auto; }
  .face {
    min-height: 0; border-radius: var(--radius) var(--radius) 0 0;
    -webkit-mask:
      linear-gradient(#000 0 0) top / 100% calc(100% - var(--notch)) no-repeat,
      radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) left bottom / 51% var(--notch) no-repeat,
      radial-gradient(circle var(--notch) at 100% 100%, #0000 98%, #000) right bottom / 51% var(--notch) no-repeat;
    mask:
      linear-gradient(#000 0 0) top / 100% calc(100% - var(--notch)) no-repeat,
      radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) left bottom / 51% var(--notch) no-repeat,
      radial-gradient(circle var(--notch) at 100% 100%, #0000 98%, #000) right bottom / 51% var(--notch) no-repeat;
  }
  .stub {
    border-radius: 0 0 var(--radius) var(--radius);
    -webkit-mask:
      linear-gradient(#000 0 0) bottom / 100% calc(100% - var(--notch)) no-repeat,
      radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) left top / 51% var(--notch) no-repeat,
      radial-gradient(circle var(--notch) at 100% 0, #0000 98%, #000) right top / 51% var(--notch) no-repeat;
    mask:
      linear-gradient(#000 0 0) bottom / 100% calc(100% - var(--notch)) no-repeat,
      radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) left top / 51% var(--notch) no-repeat,
      radial-gradient(circle var(--notch) at 100% 0, #0000 98%, #000) right top / 51% var(--notch) no-repeat;
  }
  .perf::before { top: -3px; bottom: auto; left: calc(var(--notch) + 8px); right: calc(var(--notch) + 8px); width: auto; height: 6px; background-size: 13px 6px; background-repeat: repeat-x; background-position: left center; }
  .plate { width: 520px; height: 520px; right: -200px; top: 46%; }
  .face-stamp { top: auto; bottom: 40px; right: 28px; }
  .stub { padding: 28px 26px 24px; }
  .guides { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .step { padding: 0 0 18px 36px; }
  .step::before { left: 10px; right: auto; top: 26px; bottom: 2px; width: 2px; height: auto; background: repeating-linear-gradient(180deg, var(--ink-3) 0 4px, transparent 4px 9px); }
  .step[data-mark="done"]::before { background: var(--navy); }
  .step:last-child { padding-bottom: 0; }
}

@media (max-width: 560px) {
  :root { --notch: 13px; --radius: 18px; }
  .wrap { width: min(100% - 32px, 520px); }
  .masthead-inner { min-height: 62px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .brand { gap: 9px; }
  .brand-name { font-size: 22px; }
  .feed { font-size: 9.5px; letter-spacing: .08em; padding: 5px 10px 4px 9px; }
  main { padding-top: 16px; }
  .face { padding: 24px 22px 34px; }
  .face::before { inset: 8px; border-radius: 12px; }
  .face h1 { font-size: 15px; }
  .serial { font-size: 17px; }
  .pot-label { padding-top: 26px; font-size: 12px; }
  .jackpot { font-size: clamp(42px, 13.5vw, 64px); margin-bottom: 12px; }
  .jackpot.is-long { font-size: clamp(34px, 10.5vw, 52px); }
  .jackpot.is-words { font-size: clamp(34px, 10vw, 46px); }
  .pot-line { font-size: 15.5px; }
  .face-stamp { position: static; align-self: flex-start; margin-top: 16px; font-size: 12px; transform: rotate(-3deg); }
  .plate { width: 440px; height: 440px; right: -210px; top: 40%; opacity: .5; }
  .microtext { left: 18px; right: 18px; bottom: 13px; }
  .stub { padding: 24px 20px 20px; gap: 16px; }
  .clock-value { font-size: 40px; }
  .clock-value.is-words { font-size: 28px; }
  .section-title { font-size: 30px; }
  .timeline { margin-top: 36px; }
  .guides { margin-top: 32px; }
  .drawer summary { padding: 16px 52px 16px 18px; }
  .drawer-body { padding: 2px 18px 18px; }
  .prompt { grid-template-columns: minmax(0, 1fr); }
  .prompt .copy { justify-self: start; }
  .archive { margin-top: 40px; }
  .totals { width: 100%; }
  .totals div { flex: 1 1 140px; }
  .record { padding: 13px 14px 13px 20px; }
  .pay { grid-template-columns: auto minmax(0, 1fr); }
  .pay .record-link { grid-column: 2; grid-row: auto; margin-left: 0; }
  .pay .tag { grid-row: 1 / span 3; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
