:root {
  --night: #0b1914;
  --pine: #1d3a2f;
  --gold: #e9c46a;
  --gold-soft: #f3dca0;
  --text: #f4ecdc;
  --text-soft: #c4bba9;
  --paper: #fbf5e8;
  --paper-edge: #efe2c8;
  --ink: #2a211c;
  --ink-soft: #6b5a4e;
  --red: #a3212b;
  --red-deep: #6e1219;
  --kraft: #e9d9b8;
  --kraft-dark: #d9c39a;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }

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

body {
  min-height: 100svh;
  background: radial-gradient(130% 70% at 50% 0%, var(--pine) 0%, var(--night) 65%) fixed, var(--night);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 34rem;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top)) 1rem calc(3rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ---------- Wreath ---------- */

.wreath { width: min(100%, 21rem); margin-top: .5rem; }
.wreath svg { display: block; width: 100%; height: auto; overflow: visible; }

.flame { opacity: 0; transition: opacity .9s ease; }
.flame .fl {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: scale(.1);
  transition: transform .8s cubic-bezier(.3, 1.6, .5, 1);
}
.lit .flame { opacity: 1; }
.lit .fl { transform: scale(1); }

.flicker {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: flicker 2.6s ease-in-out infinite;
}
.glow { animation: glow 3.2s ease-in-out infinite; }

@keyframes flicker {
  0%, 100% { transform: scale(1, 1) skewX(0deg); }
  25% { transform: scale(.95, 1.06) skewX(2.5deg); }
  50% { transform: scale(1.04, .95) skewX(-2deg); }
  75% { transform: scale(.97, 1.03) skewX(1deg); }
}
@keyframes glow {
  0%, 100% { opacity: .8; }
  50% { opacity: 1; }
}

/* ---------- Heading ---------- */

.head { margin-top: 1rem; }

.eyebrow {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
}

h1 {
  margin-top: .5rem;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: clamp(1.9rem, 8.5vw, 2.6rem);
  line-height: 1.1;
  text-wrap: balance;
}

.sub {
  margin: .85rem auto 0;
  max-width: 24rem;
  color: var(--text-soft);
  text-wrap: pretty;
}
.sub:empty { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1.75rem;
  padding: .65rem 1.1rem;
  border: 1px solid rgba(233, 196, 106, .35);
  border-radius: 999px;
  background: rgba(233, 196, 106, .07);
  color: var(--gold-soft);
  font-size: .92rem;
}

.stage { width: 100%; margin-top: 2rem; }

.loading {
  color: var(--text-soft);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .4; } }

/* ---------- Envelope ---------- */

.env-wrap { display: flex; flex-direction: column; align-items: center; transition: opacity .5s ease, transform .5s ease; }
.env-wrap.gone { opacity: 0; transform: translateY(12px) scale(.96); }

.envelope {
  position: relative;
  width: min(100%, 19rem);
  aspect-ratio: 3 / 2;
  margin-top: 4.5rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 900px;
  -webkit-tap-highlight-color: transparent;
  animation: bob 3.2s ease-in-out infinite;
}
.envelope:focus-visible { outline: 2px solid var(--gold); outline-offset: 8px; border-radius: 6px; }
.envelope.open { animation: none; cursor: default; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}

.envelope > span { position: absolute; inset: 0; border-radius: 6px; }

.env-back {
  z-index: 0;
  background: var(--kraft-dark);
  box-shadow: 0 24px 40px -16px rgba(0, 0, 0, .7);
}

.env-letter {
  z-index: 1;
  inset: 8% 7% 6% !important;
  border-radius: 3px !important;
  background:
    repeating-linear-gradient(to bottom, transparent 0 13px, rgba(107, 90, 78, .14) 13px 14px) 18px 28px / calc(100% - 36px) 55% no-repeat,
    var(--paper);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
  transition: transform .7s cubic-bezier(.2, .8, .3, 1) .45s;
}

.env-front {
  z-index: 2;
  background: var(--kraft);
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .08);
}

.env-flap {
  z-index: 3;
  background: linear-gradient(to bottom, #f1e4c6, var(--kraft-dark));
  clip-path: polygon(0 0, 100% 0, 50% 58%);
  transform-origin: 50% 0;
  transition: transform .55s ease-in, z-index 0s linear .28s;
}

.seal {
  z-index: 4;
  inset: 58% auto auto 50% !important;
  width: 3.4rem;
  height: 3.4rem;
  margin: -1.7rem 0 0 -1.7rem;
  border-radius: 50% !important;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #c43a44, var(--red) 45%, var(--red-deep));
  box-shadow: 0 3px 8px rgba(0, 0, 0, .35), inset 0 0 0 4px rgba(0, 0, 0, .12);
  color: var(--gold-soft);
  font: 500 1.5rem/1 "Fraunces", Georgia, serif;
  transition: opacity .25s ease, transform .3s ease;
}

.envelope.open .seal { opacity: 0; transform: scale(.6); }
.envelope.open .env-flap { transform: rotateX(180deg); z-index: 0; }
.envelope.open .env-letter { transform: translateY(-58%); }

.hint {
  margin-top: 1.5rem;
  color: var(--text-soft);
  font-size: .9rem;
  letter-spacing: .04em;
}

/* ---------- Letter ---------- */

.letter {
  position: relative;
  padding: 2.25rem 1.5rem 2.5rem;
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  font-family: "Lora", Georgia, serif;
  font-size: 1.07rem;
  line-height: 1.75;
  box-shadow: 0 1px 0 var(--paper-edge), 0 30px 60px -24px rgba(0, 0, 0, .75);
  animation: rise .8s cubic-bezier(.2, .8, .3, 1) both;
}

.letter::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--red) 0 14px, transparent 14px 20px, #2b5e3e 20px 34px, transparent 34px 40px);
  opacity: .8;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}

.letter p { white-space: pre-line; overflow-wrap: anywhere; }
.letter p + p { margin-top: 1.1em; }

.photo {
  margin: 2rem 0;
  padding: .55rem .55rem 1.6rem;
  background: #fff;
  box-shadow: 0 8px 22px -10px rgba(42, 33, 28, .5);
  transform: rotate(-1.2deg);
}
.photo:nth-of-type(even) { transform: rotate(1.4deg); }
.photo:last-child { margin-bottom: 0; }
.photo img { display: block; width: 100%; height: auto; background: #eee; }

/* ---------- Weekly task ---------- */

.task {
  margin-top: 1.5rem;
  padding: 1.75rem 1.25rem;
  border: 1px solid rgba(233, 196, 106, .35);
  border-radius: 16px;
  background: rgba(233, 196, 106, .06);
  text-align: center;
  animation: rise .8s cubic-bezier(.2, .8, .3, 1) .25s both;
}

.task-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 1.45rem;
  line-height: 1.2;
}

.task-text { margin-top: .5rem; color: var(--text-soft); text-wrap: pretty; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 3.25rem;
  margin-top: 1.4rem;
  padding: .9rem 1.7rem;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: #1b140a;
  font: 600 1.05rem/1 system-ui, -apple-system, sans-serif;
  cursor: pointer;
  box-shadow: 0 10px 24px -10px rgba(233, 196, 106, .6);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; }
.btn-small { min-height: 3rem; margin-top: 0; padding: .75rem 1.2rem; font-size: 1rem; }

.link-btn {
  display: block;
  margin: 1rem auto 0;
  padding: .5rem;
  border: 0;
  background: none;
  color: var(--text-soft);
  font: inherit;
  font-size: .85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.manual {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.25rem;
}
.manual input {
  flex: 1 1 10rem;
  min-width: 0;
  min-height: 3rem;
  padding: .6rem 1rem;
  border: 1px solid rgba(233, 196, 106, .4);
  border-radius: 999px;
  background: rgba(0, 0, 0, .25);
  color: var(--text);
  font: 500 1.05rem/1 system-ui, -apple-system, sans-serif;
  letter-spacing: .06em;
}
.manual input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.manual-msg { flex-basis: 100%; color: #ffb4b4; font-size: .9rem; }
.manual-msg:empty { display: none; }

.shake { animation: shake .4s ease; }
@keyframes shake {
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.unlocked { border-color: rgba(233, 196, 106, .7); background: rgba(233, 196, 106, .1); }
.unlocked.pop { animation: pop .7s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes pop {
  from { opacity: 0; transform: scale(.85); }
  to { opacity: 1; transform: none; }
}

.task-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
}

.task-number {
  margin-top: .25rem;
  font: 500 clamp(4.5rem, 24vw, 6.5rem)/1 "Fraunces", Georgia, serif;
  color: var(--gold-soft);
  text-shadow: 0 0 28px rgba(255, 200, 90, .55);
}

/* ---------- Hint video ---------- */

[hidden] { display: none !important; }

.hint-video { animation: rise .7s cubic-bezier(.2, .8, .3, 1) both; }
.hint-video video {
  display: block;
  width: 100%;
  max-height: 72svh;
  margin-top: .75rem;
  border-radius: 16px;
  background: #000;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .75);
}

.btn-ghost {
  background: transparent;
  color: var(--gold-soft);
  border: 1px solid rgba(233, 196, 106, .5);
  box-shadow: none;
}
.task-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
  margin-top: 1.25rem;
}
.task-actions .btn { margin-top: 0; }

/* Hold-to-reveal hint button: --p (0..1) fills it from the left. */
.hold-btn {
  --p: 0;
  position: relative;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform .15s ease;
}
.hold-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(233, 196, 106, .4);
  transform: scaleX(var(--p));
  transform-origin: left;
}
.hold-btn > span { position: relative; }
.hold-btn.holding { transform: scale(.95); }

.hint-bubble {
  margin-top: 1rem;
  padding: .85rem 1.1rem;
  border-radius: 14px;
  background: rgba(233, 196, 106, .12);
  color: var(--gold-soft);
  text-wrap: pretty;
  animation: rise .5s cubic-bezier(.2, .8, .3, 1) both;
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- Inline camera scanner ---------- */

.scan-view {
  position: relative;
  margin-top: 1.25rem;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 14px;
  background: #000;
}

.scan-view video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-frame {
  position: absolute;
  inset: 20% 8%;
  border: 3px solid rgba(255, 255, 255, .95);
  border-radius: 12px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45);
  transition: border-color .2s ease;
}
.scan-view:not(.live) .scan-laser { display: none; }
.scan-frame.ok { border-color: #5be38a; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45), 0 0 30px #5be38a; }
.scan-frame.ok .scan-laser { display: none; }
.scan-frame.nope { animation: nope .4s ease; }
@keyframes nope {
  0%, 100% { border-color: rgba(255, 255, 255, .95); }
  30%, 70% { border-color: #ff6b6b; }
}

.scan-laser {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 50%;
  height: 2px;
  border-radius: 2px;
  background: #ff3b3b;
  box-shadow: 0 0 12px 3px rgba(255, 59, 59, .75);
  animation: laser 1.6s ease-in-out infinite alternate;
}
@keyframes laser {
  from { top: 15%; }
  to { top: 85%; }
}

.scan-start {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  margin: 0;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}
.scan-start:active { transform: translate(-50%, -50%) scale(.97); }

.scan-msg { margin-top: .9rem; color: var(--text-soft); text-wrap: pretty; }
.scan-msg.wrong { color: #ffb4b4; }
.scan-msg:empty { display: none; }

/* Face variant: portrait view with an oval frame. */
.scan-face { aspect-ratio: 3 / 4; max-height: 62svh; margin-inline: auto; }
.scan-face .scan-frame { inset: 12% 18%; border-radius: 50%; border-style: dashed; }
.scan-face .scan-frame.ok { border-style: solid; }

/* ---------- Faces: who has been found ---------- */

.face-slots {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: .25rem;
}
.face-slot { width: 5rem; text-align: center; }
.face-ring {
  display: grid;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  margin: 0 auto;
  overflow: hidden;
  border: 2px dashed rgba(233, 196, 106, .45);
  border-radius: 50%;
  color: rgba(233, 196, 106, .6);
  font: 500 1.6rem/1 "Fraunces", Georgia, serif;
}
.face-ring img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.face-slot.found .face-ring {
  border: 2px solid var(--gold);
  box-shadow: 0 0 18px rgba(233, 196, 106, .45);
  animation: pop .6s cubic-bezier(.3, 1.6, .5, 1) both;
}
/* ---------- Agent overlay (face lock-on) ---------- */

.agent {
  --agent: #3dff9a;
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--agent);
}
.agent.show { opacity: 1; }
.agent.unknown { --agent: #ff4d5e; }
.agent.known { --agent: #7fd4ff; }
.agent.locked { --agent: #3dff9a; }
.scan-view:has(.agent.show) .scan-frame { opacity: 0; }

.agent-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  transition: transform .16s linear, width .16s linear, height .16s linear;
}

.agent-c {
  position: absolute;
  width: 22%;
  height: 22%;
  border: 0 solid var(--agent);
  filter: drop-shadow(0 0 6px var(--agent));
  transition: inset .3s ease;
}
.agent-c.tl { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; }
.agent-c.tr { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; }
.agent-c.bl { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; }
.agent-c.br { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; }
/* Brackets close in on the face while scanning. */
.agent.scan .agent-c { animation: agent-tighten 1.5s ease-in-out infinite alternate; }
@keyframes agent-tighten {
  from { margin: -6px; }
  to { margin: 4px; }
}

.agent-grid {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 13px, color-mix(in srgb, var(--agent) 18%, transparent) 13px 14px),
    repeating-linear-gradient(90deg, transparent 0 13px, color-mix(in srgb, var(--agent) 18%, transparent) 13px 14px);
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

.agent-scan {
  position: absolute;
  left: 4%;
  right: 4%;
  height: 2px;
  background: var(--agent);
  box-shadow: 0 0 10px 2px var(--agent);
  animation: agent-sweep 1.1s ease-in-out infinite alternate;
}
.agent.locked .agent-scan, .agent.known .agent-scan { display: none; }
@keyframes agent-sweep {
  from { top: 6%; }
  to { top: 94%; }
}

.agent-cross {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  background:
    linear-gradient(var(--agent), var(--agent)) center / 100% 2px no-repeat,
    linear-gradient(var(--agent), var(--agent)) center / 2px 100% no-repeat;
  opacity: .8;
}

.agent-top, .agent-bottom {
  position: absolute;
  left: 50%;
  width: max(100%, 13rem);
  transform: translateX(-50%);
  text-align: center;
  text-shadow: 0 0 6px var(--agent), 0 1px 2px #000;
}
.agent-top { bottom: calc(100% + 6px); }
.agent-bottom { top: calc(100% + 8px); display: flex; align-items: center; gap: .4rem; justify-content: center; }

.agent-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  animation: agent-blink .9s steps(2, start) infinite;
}
.agent.locked .agent-label, .agent.known .agent-label { animation: none; }
@keyframes agent-blink { to { opacity: .35; } }

.agent-sub {
  margin-top: .15rem;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .12em;
  white-space: nowrap;
}

.agent-bar {
  width: 55%;
  height: 6px;
  overflow: hidden;
  border: 1px solid var(--agent);
  background: rgba(0, 0, 0, .45);
}
.agent-fill {
  height: 100%;
  background: var(--agent);
  box-shadow: 0 0 8px var(--agent);
  transform: scaleX(0);
  transform-origin: left;
}
.agent-pct, .agent-hex { font-size: .65rem; font-weight: 700; }
.agent-hex { opacity: .7; }
.agent.unknown .agent-bar, .agent.unknown .agent-pct { display: none; }

/* IDENTIFIED: the whole reticle flashes and snaps tight. */
.agent.locked .agent-box { animation: agent-flash .5s ease-out 2; }
.agent.locked .agent-c { margin: 6px; }
@keyframes agent-flash {
  0% { filter: brightness(2.2); }
  100% { filter: brightness(1); }
}

.face-debug { margin-top: .5rem; color: #9fd3ff; font: .75rem/1.4 ui-monospace, Menlo, monospace; }
.face-name { min-height: 1.3em; margin-top: .35rem; color: var(--gold-soft); font-size: .8rem; line-height: 1.3; }

/* ---------- Crossword ---------- */

.kryds-clue {
  min-height: 3em;
  margin-top: .25rem;
  color: var(--gold-soft);
  font-size: .95rem;
  text-wrap: balance;
}
.kryds-clue::first-letter { text-transform: uppercase; }

.kryds {
  display: grid;
  gap: 3px;
  margin: .75rem auto 0;
}
.kryds-blank { aspect-ratio: 1; }
.kryds-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 5px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
  transition: background .15s ease;
}
.kryds-cell.in-word { background: #f3dca0; }
.kryds-cell.focus { background: var(--gold); box-shadow: inset 0 0 0 2px var(--red-deep); }
.kryds.done .kryds-cell { background: #bfe8c9; box-shadow: inset 0 0 0 1px #3f7a4f; }
.kryds-num {
  position: absolute;
  top: 2px;
  left: 4px;
  color: var(--ink-soft);
  font: 600 .6rem/1 system-ui, sans-serif;
  pointer-events: none;
}
.kryds-cell input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  caret-color: transparent;
  text-align: center;
  text-transform: uppercase;
  font: 600 max(16px, 1.25rem)/1 "Fraunces", Georgia, serif; /* >=16px: no iOS zoom */
  outline: none;
}

.kryds-msg { min-height: 1.5em; margin-top: .75rem; color: var(--gold-soft); }

.kryds-lists {
  display: grid;
  gap: 1rem;
  margin-top: .75rem;
  text-align: left;
}
.kryds-list-title {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}
.kryds-list ol { margin-top: .35rem; padding: 0; list-style: none; }
.kryds-list li {
  padding: .4rem .6rem;
  border-radius: 8px;
  color: var(--text-soft);
  cursor: pointer;
}
.kryds-list li b { display: inline-block; min-width: 1.4em; color: var(--gold-soft); }
.kryds-list li.active { background: rgba(233, 196, 106, .12); color: var(--text); }

/* ---------- Order terminal (receipt + POS keypad) ---------- */

.bon {
  position: relative;
  width: min(100%, 19rem);
  margin: 0 auto;
  padding: 1.1rem 1.1rem 1.4rem;
  background: #fdfcf7;
  color: #2a2622;
  font: 500 .82rem/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  text-align: left;
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .7);
  transform: rotate(-.6deg);
}
/* Torn/serrated bottom edge. */
.bon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 8px;
  background: radial-gradient(circle at 6px 0, #fdfcf7 6px, transparent 6.5px) repeat-x;
  background-size: 12px 8px;
}
.bon-head { text-align: center; font-weight: 700; letter-spacing: .12em; }
.bon-meta { text-align: center; color: #7a7066; font-size: .72rem; }
.bon-rule { height: 0; margin: .55rem 0; border-top: 1.5px dashed #b9b0a3; }
.bon-line { white-space: pre-wrap; }
.bon-line + .bon-line { margin-top: .35rem; }
.bon-ask { text-align: center; font-size: 1.05rem; font-weight: 700; letter-spacing: .1em; }
.bon.printing .bon-ask { text-decoration: line-through; color: #a39a8e; }
.bon-order { font-weight: 700; }
.bon-thanks { text-align: center; font-weight: 700; color: var(--red); }
.bon-print { animation: bon-print .45s steps(4, end) both; overflow: hidden; }
@keyframes bon-print {
  from { max-height: 0; opacity: 0; }
  to { max-height: 4em; opacity: 1; }
}

.pos {
  width: min(100%, 19rem);
  margin: 1.5rem auto 0;
  padding: .9rem;
  border-radius: 18px;
  background: linear-gradient(#2b302d, #1d211f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 18px 34px -16px rgba(0, 0, 0, .8);
}

.pos-display {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 4.6rem;
  padding: .55rem .8rem;
  border-radius: 8px;
  background: #0d1a10;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .8);
  color: #9dff6a;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  text-align: left;
  text-shadow: 0 0 8px rgba(157, 255, 106, .55);
}
.pos-lcd-label { font-size: .62rem; letter-spacing: .16em; opacity: .7; }
.pos-lcd { font-size: 1.7rem; font-weight: 700; letter-spacing: .12em; line-height: 1.2; }
.pos-lcd.small { font-size: .95rem; letter-spacing: .02em; }
.pos-display.bad { color: #ff6b6b; text-shadow: 0 0 8px rgba(255, 107, 107, .55); }
.pos-display.ok { color: #9dff6a; animation: pos-ok .35s ease 3 alternate; }
@keyframes pos-ok { to { background: #1d3a1f; } }

.pos-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .55rem;
  margin-top: .9rem;
}
.pos-key {
  min-height: 3.4rem;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(#efe7d6, #d9cdb5);
  box-shadow: 0 3px 0 #8f846f, 0 5px 8px rgba(0, 0, 0, .35);
  color: #2a2622;
  font: 700 1.35rem/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.pos-key:active { transform: translateY(3px); box-shadow: 0 0 0 #8f846f, 0 2px 4px rgba(0, 0, 0, .35); }
.pos-fn { background: linear-gradient(#c9c0ae, #b1a68f); }
.pos-go {
  background: linear-gradient(#4fc46b, #2f9a4b);
  box-shadow: 0 3px 0 #1d6a31, 0 5px 8px rgba(0, 0, 0, .35);
  color: #fff;
  font-size: .95rem;
  letter-spacing: .08em;
}
.pos-go:active { box-shadow: 0 0 0 #1d6a31, 0 2px 4px rgba(0, 0, 0, .35); }

/* ---------- Answer ---------- */

.task-question {
  margin-top: .25rem;
  font: 400 1.2rem/1.45 "Lora", Georgia, serif;
  text-wrap: pretty;
}
.task-question + .manual { margin-top: 1.25rem; }

.noscript { position: relative; z-index: 1; padding: 2rem 1rem; text-align: center; }

@media (min-width: 40rem) {
  .letter { padding: 3rem 3rem 3.25rem; }
  .letter::before { left: 3rem; right: 3rem; }
}

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