/* Checkpoint: original pixel-art border-office theme for the wallet gate. */
@font-face { font-family: "Silkscreen"; src: url("/static/fonts/silkscreen-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("/static/fonts/silkscreen-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "VT323"; src: url("/static/fonts/vt323-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --night: #0d1624;
  --slate: #1d2b3e;
  --slate-2: #172334;
  --frame: #0a0f18;
  --paper: #f4e9cc;
  --paper-2: #e3d4ae;
  --paper-3: #c9b78c;
  --ink: #253150;
  --ink-2: #56607e;
  --ink-3: #8b90a5;
  --amber: #ffb43b;
  --teal: #5fd4d0;
  --cleared: #2fa86b;
  --cleared-ink: #1d8a55;
  --refused: #e0434a;
  --refused-ink: #c12f3a;
  --light: #f4ecd6;
  --muted: #8fa0b8;

  --f-pixel: "Silkscreen", ui-monospace, monospace;
  --f-text: "VT323", ui-monospace, "SF Mono", Menlo, monospace;

  --u: 4px; /* one "pixel" of the art */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--light);
  background-color: var(--night);
  /* 2x2 dither */
  background-image: conic-gradient(#ffffff05 25%, transparent 0 50%, #ffffff05 0 75%, transparent 0);
  background-size: 8px 8px;
  font: 22px/1.25 var(--f-text);
  -webkit-font-smoothing: none;
  font-smooth: never;
}
button { font: inherit; color: inherit; }
canvas, img, svg.px { image-rendering: pixelated; }
:focus-visible { outline: var(--u) solid var(--amber); outline-offset: var(--u); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Notched pixel frame: border drawn with hard box-shadows, corners left open. */
.px-frame {
  --fc: var(--frame);
  box-shadow: 0 calc(-1 * var(--u)) 0 0 var(--fc), 0 var(--u) 0 0 var(--fc), calc(-1 * var(--u)) 0 0 0 var(--fc), var(--u) 0 0 0 var(--fc);
  filter: drop-shadow(var(--u) var(--u) 0 #00000070);
}
.px-frame--dark { --fc: #04070c; }

.booth { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }

/* ------------------------------------------------------------ window: skyline, plates, barrier */
.window { position: relative; overflow: hidden; min-height: 196px; background: var(--night); border-bottom: var(--u) solid var(--frame); }
.skyline { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.window__bar {
  position: relative;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 20px clamp(16px, 3vw, 28px) 44px;
}
.plate {
  --fc: #04070c;
  background: #0b111bdd;
  padding: 10px 14px;
  box-shadow: 0 calc(-1 * var(--u)) 0 0 var(--fc), 0 var(--u) 0 0 var(--fc), calc(-1 * var(--u)) 0 0 0 var(--fc), var(--u) 0 0 0 var(--fc),
              inset 0 var(--u) 0 0 #ffffff12;
}
.window__id { display: flex; gap: 14px; align-items: center; }
.window__id p { margin: 0; }
.authority { font: 400 16px/1.1 var(--f-pixel); text-transform: uppercase; letter-spacing: 1px; color: var(--light); }
.booth-no { margin-top: 4px !important; font-size: 20px; color: var(--muted); text-transform: uppercase; }

.lamp { --lamp: var(--amber); display: block; width: 32px; height: 32px; color: var(--lamp); filter: drop-shadow(0 0 6px var(--lamp)); }
.lamp svg { width: 100%; height: 100%; display: block; }
.booth[data-lamp="wait"] .lamp { animation: blink-lamp 1.2s steps(1) infinite; }
.booth[data-lamp="ok"] .lamp { --lamp: #49e08f; }
.booth[data-lamp="no"] .lamp { --lamp: #ff4d55; }

.board { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.board__label { font: 400 16px var(--f-pixel); text-transform: uppercase; color: var(--amber); }
.flaps { display: flex; flex-wrap: wrap; gap: 4px; }
.flap {
  display: inline-grid; place-items: center;
  width: 26px; height: 36px;
  font: 400 24px/1 var(--f-pixel);
  color: var(--light);
  background: linear-gradient(#1c2636 0 50%, #04070c 50% calc(50% + 4px), #141c29 calc(50% + 4px));
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
}
.flap.is-flip { animation: flip 60ms steps(2); }

.road {
  position: absolute; left: 0; right: 0; bottom: 0; height: 28px;
  background: repeating-linear-gradient(90deg, #2a3446 0 24px, #232c3c 24px 48px);
  border-top: var(--u) solid #04070c;
}
.road::after { /* lane paint */
  content: ""; position: absolute; left: 0; right: 0; top: 12px; height: var(--u);
  background: repeating-linear-gradient(90deg, #d9c38a 0 28px, transparent 28px 56px);
  opacity: .5;
}
.barrier__post {
  position: absolute; z-index: 2; left: clamp(16px, 3vw, 28px); bottom: 0;
  width: 20px; height: 44px;
  background: linear-gradient(90deg, #5b6b82 0 4px, #3d4b60 4px 16px, #2b3647 16px);
  box-shadow: 0 -4px 0 0 #04070c, 4px 0 0 0 #04070c, -4px 0 0 0 #04070c;
}
.barrier__arm {
  position: absolute; z-index: 1;
  left: calc(clamp(16px, 3vw, 28px) + 12px); bottom: 30px;
  width: min(62%, 760px); height: 12px;
  background: repeating-linear-gradient(90deg, var(--refused) 0 32px, var(--paper) 32px 64px);
  box-shadow: 0 -4px 0 0 #04070c, 0 4px 0 0 #04070c, 4px 0 0 0 #04070c;
  transform-origin: 4px 50%;
  transition: transform .9s steps(8);
}
.booth[data-gate="up"] .barrier__arm { transform: rotate(-80deg); }
.barrier__arm.is-rattle { animation: rattle .36s steps(6); }

/* ------------------------------------------------------------ hall */
.hall {
  display: grid;
  grid-template-columns: minmax(250px, 330px) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 44px);
  padding: clamp(20px, 3vw, 40px);
  align-items: start;
  width: 100%; max-width: 1300px; margin: 0 auto;
}

.notice { position: relative; padding: 32px 22px 20px; color: var(--ink); background: var(--paper); }
.pin { position: absolute; top: 8px; left: calc(50% - 12px); width: 24px; height: 24px; }
.pin svg { width: 100%; height: 100%; display: block; }
.notice__kicker { margin: 0; text-align: center; font-size: 18px; text-transform: uppercase; color: var(--ink-3); }
.notice__title {
  margin: 8px 0 6px; padding: 8px 0;
  font: 400 24px/1.1 var(--f-pixel); text-transform: uppercase; text-align: center;
  border-top: var(--u) solid var(--ink); border-bottom: var(--u) solid var(--ink);
  box-shadow: 0 -8px 0 -4px var(--paper), 0 -12px 0 -4px var(--ink-3);
}
.notice__for { margin: 0 0 4px; text-align: center; font-size: 20px; color: var(--ink-2); }
.notice__for strong { font-weight: 400; color: var(--ink); overflow-wrap: anywhere; }
.articles { list-style: none; margin: 0; padding: 0; }
.article { margin: 10px 0; font-size: 20px; line-height: 1.15; }
.article b { font: 400 16px var(--f-pixel); margin-right: 4px; color: var(--ink); }
.article--closed { color: var(--refused-ink); }
.notice__foot { margin: 14px 0 0; padding-top: 10px; border-top: var(--u) dotted var(--ink-3); font-size: 18px; line-height: 1.1; color: var(--ink-2); }

.ticket {
  width: 156px; margin: 32px 12px 0 auto; padding: 10px 16px 12px;
  text-align: center; color: var(--ink); background: #d7e6cf;
  clip-path: polygon(0 0, 100% 0, 100% 38%, calc(100% - 8px) 38%, calc(100% - 8px) 62%, 100% 62%, 100% 100%, 0 100%, 0 62%, 8px 62%, 8px 38%, 0 38%);
  filter: drop-shadow(4px 4px 0 #00000070);
}
.ticket__label { display: block; font: 400 8px var(--f-pixel); text-transform: uppercase; letter-spacing: 2px; color: var(--ink-2); }
.ticket__no { display: block; margin-top: 4px; font: 400 24px/1 var(--f-pixel); color: var(--refused-ink); }

/* ------------------------------------------------------------ desk */
.desk { overflow: clip; background-color: var(--slate); background-image: conic-gradient(#00000022 25%, transparent 0 50%, #00000022 0 75%, transparent 0); background-size: 8px 8px; }
.desk__surface { min-height: 560px; display: grid; place-items: center; padding: clamp(16px, 3vw, 36px); container-type: inline-size; }
.desk__surface.is-shake { animation: shake .24s steps(4); }

.slot {
  position: relative;
  width: min(100%, 540px);
  padding: 36px 26px 28px;
  text-align: center;
  background: #0f1828;
  box-shadow: 0 -4px 0 0 #5c7290, 0 4px 0 0 #04070c, -4px 0 0 0 #5c7290, 4px 0 0 0 #04070c, inset 4px 4px 0 0 #ffffff10;
  animation: rise .3s steps(4) both;
}
.slot::before { /* glass glare, two hard bands */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, #ffffff0d 30% 34%, transparent 34% 37%, #ffffff08 37% 39%, transparent 39%);
}
.slot__hint { margin: 0; font: 400 16px/1.4 var(--f-pixel); text-transform: uppercase; color: var(--light); }
.slot__gap { width: 84%; height: 16px; margin: 22px auto 28px; background: #000; box-shadow: 0 4px 0 0 #2b3a52; }
.slot__fine { margin: 20px 0 0; font-size: 20px; line-height: 1.15; color: var(--muted); }
.slot__note { margin: 0 0 18px; font-size: 20px; color: #ff9aa0; }

/* buttons */
.btn {
  --b: var(--ink);
  --bg: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  margin: var(--u);
  padding: 12px 20px 10px;
  font: 400 16px/1 var(--f-pixel); text-transform: uppercase; text-decoration: none;
  color: var(--ink); background: var(--bg);
  border: 0;
  box-shadow: inset calc(-1 * var(--u)) calc(-1 * var(--u)) 0 0 #00000030, inset var(--u) var(--u) 0 0 #ffffff80,
              0 calc(-1 * var(--u)) 0 0 var(--b), 0 var(--u) 0 0 var(--b), calc(-1 * var(--u)) 0 0 0 var(--b), var(--u) 0 0 0 var(--b),
              0 calc(2 * var(--u)) 0 0 #00000060;
  cursor: pointer;
}
.btn:hover { --bg: #fff6dc; }
.btn:active { transform: translateY(var(--u)); box-shadow: inset var(--u) var(--u) 0 0 #00000030, 0 calc(-1 * var(--u)) 0 0 var(--b), 0 var(--u) 0 0 var(--b), calc(-1 * var(--u)) 0 0 0 var(--b), var(--u) 0 0 0 var(--b); }
.btn:disabled { opacity: .7; cursor: progress; transform: none; }
.btn--big { font-size: 16px; padding: 16px 26px 14px; }
.btn--go { --bg: var(--cleared); --b: #0b3a24; color: #f0fff6; }
.btn--go:hover { --bg: #38bd79; }
.link {
  padding: 4px 6px; border: 0; background: none; cursor: pointer;
  font: 20px var(--f-text); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.link:hover { color: var(--amber); }

/* wallet chooser: each wallet is a pixel passport */
.chooser { width: 100%; text-align: center; animation: rise .3s steps(4) both; }
.chooser__q { margin: 0; font: 400 16px var(--f-pixel); text-transform: uppercase; }
.passports { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; margin: 28px 0 18px; }
.passport {
  --cover: #2b2e33;
  width: 152px; height: 204px; padding: 18px 12px 16px 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  color: #f0c868; background: var(--cover);
  border: 0;
  box-shadow: inset 8px 0 0 0 #00000040, inset 12px 0 0 0 #ffffff14, inset 0 -4px 0 0 #00000030,
              0 -4px 0 0 #04070c, 0 4px 0 0 #04070c, -4px 0 0 0 #04070c, 4px 0 0 0 #04070c, 8px 8px 0 0 #00000060;
  cursor: pointer;
  transition: transform .12s steps(2);
}
.passport:hover, .passport:focus-visible { transform: translateY(-8px); }
.passport[data-cover="0"] { --cover: #7a2230; }
.passport[data-cover="1"] { --cover: #22407a; }
.passport[data-cover="2"] { --cover: #1f5c43; }
.passport[data-cover="3"] { --cover: #553077; }
.passport[data-cover="4"] { --cover: #3a3f48; }
.passport__crest { width: 64px; height: 64px; display: grid; place-items: center; box-shadow: 0 -4px 0 0 currentColor, 0 4px 0 0 currentColor, -4px 0 0 0 currentColor, 4px 0 0 0 currentColor; }
.passport__crest img { width: 40px; height: 40px; }
.passport__crest svg { width: 44px; height: 44px; }
.passport__kind { font-size: 16px; text-transform: uppercase; opacity: .8; }
.passport__name { font: 400 16px/1.2 var(--f-pixel); text-transform: uppercase; overflow-wrap: anywhere; }
.passport__chain { padding: 2px 8px; font: 400 12px/1.2 var(--f-pixel); text-transform: uppercase; box-shadow: 0 0 0 2px currentColor; }

/* stage: document + inspection slip */
.stage { width: 100%; display: grid; grid-template-columns: minmax(0, 580px); justify-content: center; align-items: start; gap: 36px; }
.stage.has-slip { grid-template-columns: minmax(0, 580px) minmax(210px, 260px); }
/* The slip sits beside the document only when the desk is wide enough for both. */
@container (max-width: 720px) {
  .stage.has-slip { grid-template-columns: minmax(0, 580px); }
}
.stage__doc { display: flex; flex-direction: column; align-items: center; gap: 28px; min-width: 0; }
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 18px; }
.countdown { font-size: 20px; color: var(--muted); }

.paper {
  position: relative;
  width: 100%;
  padding: 22px 26px 20px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 -4px 0 0 var(--frame), 0 4px 0 0 var(--frame), -4px 0 0 0 var(--frame), 4px 0 0 0 var(--frame),
              inset 0 -4px 0 0 var(--paper-2);
  filter: drop-shadow(8px 8px 0 #00000070);
  animation: slide-up .32s steps(5) both;
}
.paper.is-thud { animation: thud .2s steps(2); }
.paper--narrow { max-width: 480px; }
.form__head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: var(--u) solid var(--paper-3); font-size: 18px; text-transform: uppercase; color: var(--ink-2); }
.form__no { padding: 0 6px; box-shadow: 0 0 0 2px currentColor; white-space: nowrap; }
.form__title { margin: 14px 0 12px; font: 400 24px/1.15 var(--f-pixel); text-transform: uppercase; }
.form__body { margin: 0 0 12px; font-size: 22px; line-height: 1.15; }
.fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); margin: 0; border-top: var(--u) solid var(--ink); }
.fields dt, .fields dd { border-bottom: 2px solid #25315024; }
.fields dt { padding: 7px 16px 5px 0; font-size: 18px; text-transform: uppercase; color: var(--ink-2); }
.fields dd { margin: 0; padding: 5px 0 3px; font-size: 22px; overflow-wrap: anywhere; }
.form__statement { margin: 14px 0 12px; font-size: 20px; line-height: 1.15; color: var(--ink-2); }
.form__warn { margin: 0 0 12px; padding: 6px 10px; font-size: 19px; color: var(--refused-ink); box-shadow: 0 0 0 2px currentColor; }
.seal-row { display: flex; align-items: flex-end; gap: 14px; }
.seal-row__label { font-size: 18px; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; padding-bottom: 6px; }
.seal-row__line { flex: 1; min-width: 0; min-height: 52px; display: flex; align-items: center; gap: 12px; padding-bottom: 4px; border-bottom: var(--u) solid var(--ink); }
.wax { flex: none; width: 44px; height: 44px; animation: pop .24s steps(3) both; }
.wax svg { width: 100%; height: 100%; display: block; }
.sig { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 26px; color: #2b3d7a; font-style: italic; }
.fine { margin-top: 14px; font-size: 19px; color: var(--ink-2); }
.fine summary { cursor: pointer; }
.fine pre { margin: 8px 0 0; padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; font: 18px/1.1 var(--f-text); background: #2531500f; box-shadow: inset 4px 0 0 0 var(--ink-3); }

.slip { position: relative; padding: 24px 18px 18px; color: var(--ink); background: #f8f2e2; animation: slide-in .3s steps(5) both; }
.slip__clip { position: absolute; top: -18px; left: 18px; width: 20px; height: 40px; }
.slip__clip svg { width: 100%; height: 100%; display: block; }
.slip__title { margin: 0 0 12px; padding-bottom: 6px; border-bottom: var(--u) solid var(--ink); font: 400 16px var(--f-pixel); text-transform: uppercase; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.check { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 20px; line-height: 1.05; animation: fade .2s steps(2) both; }
.check__box { position: relative; width: 20px; height: 20px; margin-top: 1px; box-shadow: inset 0 0 0 3px var(--ink); }
.check__box svg { position: absolute; left: -4px; top: -8px; width: 32px; height: 32px; animation: pop .18s steps(3) both; }
.check.is-no .check__text { color: var(--ink-2); }
.slip__verdict { margin: 16px 0 0; padding-top: 10px; border-top: var(--u) dotted var(--ink-3); font-size: 19px; line-height: 1.1; }

/* rubber stamp (drawn on a tiny canvas, scaled up) */
.stamp {
  --rot: -5deg;
  position: absolute; left: 50%; top: 50%;
  width: min(88%, 416px);
  opacity: .92;
  mix-blend-mode: multiply;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(var(--rot));
  animation: slam .22s steps(4) both;
}
.stamp.is-static { animation: none; }
.paper.is-stamped > :not(.stamp) { opacity: .45; transition: opacity .3s steps(3); }

/* ------------------------------------------------------------ dialog */
.speaker { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px 20px; padding: 18px clamp(16px, 3vw, 28px) 18px; background: var(--frame); }
.dialog { display: flex; gap: 16px; align-items: center; padding: 10px 14px; background: #101a2b; max-width: 980px; }
.portrait { flex: none; width: 64px; height: 64px; background: #24344f; box-shadow: inset 0 0 0 4px #04070c, inset 0 0 0 8px #3b5277; }
.portrait svg { width: 100%; height: 100%; display: block; padding: 8px; }
.dialog__body { min-width: 0; }
.dialog__name { display: inline-block; margin-bottom: 2px; font: 400 16px var(--f-pixel); text-transform: uppercase; color: var(--amber); }
.dialog__line { margin: 0; min-height: 1.25em; font-size: 24px; line-height: 1.1; color: var(--light); }
.caret { display: inline-block; width: 12px; height: 16px; margin-left: 6px; vertical-align: -1px; background: var(--amber); animation: blink 1s steps(1) infinite; }
.speaker__tools { display: flex; gap: 10px; color: var(--muted); white-space: nowrap; }

/* ------------------------------------------------------------ motion (stepped, like sprites) */
@keyframes blink-lamp { 50% { opacity: .35; } }
@keyframes flip { 50% { transform: scaleY(.25); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes fade { from { opacity: 0; transform: translateX(-8px); } }
@keyframes slide-up { from { opacity: 0; transform: translateY(48px); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(48px); } }
@keyframes pop { from { transform: scale(0); } }
@keyframes thud { 50% { transform: translateY(var(--u)); } }
@keyframes shake { 25% { transform: translate(4px, 0); } 50% { transform: translate(-4px, 4px); } 75% { transform: translate(4px, -4px); } }
@keyframes rattle { 33% { transform: translateY(-4px); } 66% { transform: translateY(4px); } }
@keyframes slam {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--rot)) scale(2.2); }
  70% { opacity: .95; transform: translate(-50%, -50%) rotate(var(--rot)) scale(.96); }
  100% { opacity: .92; transform: translate(-50%, -50%) rotate(var(--rot)) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ------------------------------------------------------------ small screens */
@media (max-width: 900px) {
  .hall { grid-template-columns: minmax(0, 1fr); }
  .desk { order: -1; }
  .desk__surface { min-height: 0; }
  .ticket { display: none; }
  .stage.has-slip { grid-template-columns: minmax(0, 580px); }
  .speaker { grid-template-columns: minmax(0, 1fr); }
  .speaker__tools { justify-content: flex-end; }
}
@media (max-width: 560px) {
  .window__bar { padding-bottom: 48px; }
  .flap { width: 18px; height: 26px; font-size: 16px; }
  .paper { padding: 18px 16px 16px; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .fields dt { padding: 6px 0 0; border-bottom: 0; }
  .passport { width: 130px; height: 176px; }
  .btn--big { width: calc(100% - 8px); }
  .dialog__line { font-size: 21px; }
  .portrait { width: 48px; height: 48px; }
  .portrait svg { padding: 6px; }
}
