/* Steven Bremel, version 03: a till roll printing over a dark counter. */

:root {
  --counter: #121315;
  --paper: #f7f6f1;
  --ink: #1c1b19;
  --pw80: min(460px, calc(100vw - 36px));
  --pw58: min(332px, calc(100vw - 60px));
  --pwstub: min(480px, calc(100vw - 32px));
  --pwcarbon: min(500px, calc(100vw - 28px));
  --thermal: 'Share Tech Mono', ui-monospace, 'Courier New', monospace;
  --dots: 'Doto', 'Share Tech Mono', monospace;
  --hand: 'Kalam', 'Comic Sans MS', cursive;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .28 0 0 0 0 .25 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --speck: 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='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html { background: var(--counter); }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--counter);
  background-image:
    var(--speck),
    radial-gradient(60% 50% at 50% 12%, rgba(255, 240, 215, 0.09), transparent 70%),
    linear-gradient(180deg, #17181b 0%, #101113 60%, #0c0d0e 100%);
  color: #d9d6cf;
  font-family: var(--thermal);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.counter { padding: 0 0 120px; }

/* ---------- Top of the counter ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 16px 22px;
}

.shop {
  min-width: 0;
  color: #c4c6cb;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
}

.shop:hover,
.shop:focus-visible { color: #fff; outline: none; text-decoration: underline; text-underline-offset: 5px; }

/* Customer display. */
.vfd {
  flex: 0 0 auto;
  padding: 8px 12px 7px;
  border-radius: 4px;
  background: #07120f;
  box-shadow: inset 0 0 0 1px #1b2f29, inset 0 0 18px rgba(0, 0, 0, 0.8), 0 4px 12px rgba(0, 0, 0, 0.5);
  color: #7dffd8;
  font-family: var(--dots);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgba(125, 255, 216, 0.8), 0 0 16px rgba(125, 255, 216, 0.35);
  white-space: nowrap;
}

.vfd.blink { animation: vfd 0.6s steps(2, end) 2; }
@keyframes vfd { 50% { opacity: 0.2; } }

/* ---------- The printer ---------- */

.printer {
  position: relative;
  z-index: 5;
  width: min(560px, calc(100vw - 20px));
  margin: 0 auto;
}

.pr-body {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 62px;
  padding: 0 22px;
  border-radius: 18px 18px 6px 6px;
  background: linear-gradient(#3d3e43, #28292c 58%, #1e1f22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13), inset 0 -2px 0 rgba(0, 0, 0, 0.4), 0 12px 30px rgba(0, 0, 0, 0.55);
}

.pr-led {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #39ff88;
  box-shadow: 0 0 8px #39ff88;
}

.printing .pr-led { background: #ffb13b; box-shadow: 0 0 10px #ffb13b; animation: led 0.24s steps(1, end) infinite; }
@keyframes led { 50% { opacity: 0.25; } }

.pr-name {
  font-size: 11px;
  letter-spacing: 0.32em;
  color: #8c8e93;
  text-transform: uppercase;
}

.pr-vent {
  margin-left: auto;
  width: 96px;
  height: 18px;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, #141517 0, #141517 3px, transparent 3px, transparent 8px);
  opacity: 0.8;
}

.pr-mouth {
  position: relative;
  height: 16px;
  margin: 0 14px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(#0b0b0c, #2b2c2f);
}

/* Serrated cutter: a row of small teeth. */
.pr-mouth::after {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: -6px;
  height: 6px;
  background:
    linear-gradient(135deg, #9aa0a7 25%, transparent 25%) 0 0 / 8px 6px repeat-x,
    linear-gradient(225deg, #9aa0a7 25%, transparent 25%) 0 0 / 8px 6px repeat-x;
}

.printing .pr-mouth::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 2px;
  height: 2px;
  background: #ffcf8a;
  box-shadow: 0 0 10px 2px rgba(255, 190, 110, 0.6);
  animation: head 0.12s steps(2, end) infinite;
}

@keyframes head { 50% { opacity: 0.3; } }

/* ---------- Paper ---------- */

.roll { position: relative; z-index: 1; }

.feed {
  position: relative;
  margin: -8px auto 0;
  width: max-content;
  max-width: 100%;
  transform-origin: 50% 0;
  transition: height 0.06s linear;
}

.feed.feeding { overflow: hidden; }

.paper {
  position: relative;
  width: var(--pw80);
  margin: 0 auto;
  padding: 34px 22px 26px;
  background-color: var(--paper);
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 26px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.06), transparent 7%, transparent 93%, rgba(0, 0, 0, 0.06)),
    var(--grain);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12), 0 30px 60px rgba(0, 0, 0, 0.55);
}

.paper.w58 { width: var(--pw58); font-size: 14px; color: #262a30; padding-left: 16px; padding-right: 16px; }
.paper.stub { width: var(--pwstub); }
.paper.carbon { width: var(--pwcarbon); }

/* The end of the roll curls toward you. */
.paper::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70px;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.07) 70%, rgba(0, 0, 0, 0.12));
  pointer-events: none;
}

.edge {
  position: absolute;
  left: 0;
  top: 100%;
  width: 100%;
  height: 12px;
  fill: var(--paper);
  filter: drop-shadow(0 6px 4px rgba(0, 0, 0, 0.3));
}

.w58 .edge { fill: var(--paper); }
.stub .edge { fill: #f2d7b4; }
.carbon.pink .edge { fill: #f6cfd8; }
.carbon.yellow .edge { fill: #f5e6a3; }

.ln { position: relative; }
.center { text-align: center; }
.small { font-size: 12.5px; }
.bold { text-shadow: 0.45px 0 0 currentColor; }
.caps { text-transform: uppercase; letter-spacing: 0.14em; }

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
}

.row .l { min-width: 0; overflow-wrap: anywhere; }
.row .r { flex: 0 0 auto; text-align: right; }

.logo-ln { padding-bottom: 4px; }

.logo {
  font-family: var(--dots);
  font-weight: 900;
  font-size: clamp(25px, 7vw, 32px);
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stars {
  margin: 8px 0 6px;
  overflow: hidden;
  white-space: nowrap;
  color: #6c6a64;
  letter-spacing: 0.08em;
}

.stars .fill { display: block; }

.dots {
  height: 16px;
  margin: 6px 0;
  background: radial-gradient(circle, currentColor 1.15px, transparent 1.7px) 0 50% / 7px 7px repeat-x;
  opacity: 0.5;
}

.gap { height: 12px; }

.head { text-transform: uppercase; letter-spacing: 0.1em; font-size: 12.5px; color: #55534d; padding: 2px 0 6px; }

/* Double width, as thermal printers do it: the glyphs stretch, not the font. */
.dw { margin: 12px 0 6px; }

.dw-in {
  display: block;
  width: 50%;
  font-size: 23px;
  line-height: 1.15;
  text-transform: uppercase;
  transform: scaleX(2);
  transform-origin: 0 50%;
  overflow-wrap: anywhere;
}

.w58 .dw-in { font-size: 21px; }

.tagline { margin: 4px 0 2px; }

.inverse {
  margin: 14px 0 4px;
  padding: 12px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  line-height: 1.45;
}

.shead {
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-shadow: 0.45px 0 0 currentColor;
}

.sn { opacity: 0.5; margin-right: 4px; }

.para { margin-top: 4px; }

.detail { justify-content: flex-start; }
.dn { display: inline-block; width: 2.6em; opacity: 0.55; }

.total {
  padding-top: 24px;
  font-size: 22px;
  line-height: 1.1;
}

.total .l,
.total .r {
  display: inline-block;
  transform: scaleY(2);
  transform-origin: 0 100%;
  text-shadow: 0.5px 0 0 currentColor;
}

.buy {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-height: 52px;
  margin: 16px 0 6px;
  padding: 12px 16px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--thermal);
  font-size: 15px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.buy:hover,
.buy:focus-visible { background: #45433e; outline: none; }
.buy:active { transform: translateY(1px); }
.buy.done { background: transparent; color: var(--ink); }
.buy.small { display: inline-block; width: auto; min-height: 42px; margin: 8px 0 0; padding: 8px 18px; font-size: 13px; }

.basket-ln { min-height: 1.5em; color: #55534d; }

.code { margin: 8px 0 2px; }
.bc { display: block; width: 100%; height: 66px; fill: var(--ink); }
.idline { letter-spacing: 0.12em; overflow-wrap: anywhere; }

.navs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.nav {
  display: grid;
  align-content: start;
  gap: 2px;
  min-width: 0;
  padding: 10px 8px;
  color: inherit;
  text-decoration: none;
}

.nav span { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.6; }
.nav b { font-weight: 400; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.nav.next { text-align: right; }
.nav.home { text-align: center; }
.nav:hover,
.nav:active,
.nav:focus-visible { background: var(--ink); color: var(--paper); outline: none; }

/* Perforation and the tab to tear by. */
.tearoff { margin: 22px -22px 0; }
.w58 .tearoff { margin-left: -16px; margin-right: -16px; }

.perf {
  height: 12px;
  background: radial-gradient(circle, var(--counter) 2.6px, transparent 3.1px) 6px 50% / 12px 12px repeat-x;
}

.tab {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--thermal);
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.tab:active { cursor: grabbing; }
.tab:focus-visible { outline: 2px solid var(--ink); outline-offset: -6px; }
.tab-arrow { font-size: 20px; letter-spacing: 0; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(8px); } }

.feed.torn .paper { box-shadow: 0 50px 90px rgba(0, 0, 0, 0.6); }

/* ---------- Home receipt ---------- */

.item {
  display: grid;
  grid-template-columns: 3.1em minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: baseline;
  margin: 0 -8px;
  padding: 8px 8px;
  color: rgb(calc(28 + 85 * var(--age, 0)), calc(27 + 83 * var(--age, 0)), calc(25 + 79 * var(--age, 0)));
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.item .t { font-size: 16px; overflow-wrap: anywhere; }
.item .p { text-align: right; }
.item .sub { grid-column: 2 / 4; font-size: 12px; opacity: 0.75; }
.item .no { opacity: 0.8; }

.item:not(.open):hover,
.item:not(.open):active,
.item:focus-visible {
  background: var(--ink);
  color: var(--paper);
  outline: none;
}

.item.in .no::after { content: "*"; margin-left: 2px; }

.item.open { color: #8a877f; }

.caret {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  vertical-align: text-bottom;
  background: currentColor;
  animation: blink 1s steps(1, end) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.cont { letter-spacing: 0.3em; text-transform: uppercase; color: #6c6a64; padding-bottom: 6px; }

/* ---------- Thermal photograph ---------- */

.thermal {
  position: relative;
  margin: 16px 0 4px;
  cursor: pointer;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  outline: none;
}

.thermal canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  image-rendering: pixelated;
}

.thermal .colour {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.thermal.show .colour { opacity: 1; }
.thermal:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
.thermal.nocanvas canvas { visibility: hidden; }
.thermal.nocanvas .colour { opacity: 1; filter: grayscale(1) contrast(1.7) brightness(1.08); mix-blend-mode: multiply; }
.thermal.nocanvas.show .colour { filter: none; mix-blend-mode: normal; }

.hold {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-align: center;
  text-transform: uppercase;
  opacity: 0.6;
}

/* ---------- Stapled Polaroid ---------- */

.pola {
  position: relative;
  width: 84%;
  margin: 22px auto 14px;
  padding: 12px 12px 0;
  background: #fff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  transform: rotate(-2.5deg);
}

.pola img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }

.pola figcaption {
  padding: 10px 4px 16px;
  font-family: var(--hand);
  font-size: 21px;
  line-height: 1.1;
  color: #2b2b2b;
}

.tape {
  position: absolute;
  top: -12px;
  width: 92px;
  height: 28px;
  background: rgba(238, 230, 196, 0.78);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.tape.t1 { left: -18px; transform: rotate(-32deg); }
.tape.t2 { right: -18px; transform: rotate(30deg); }

/* ---------- Ticket stub ---------- */

.paper.stub {
  background-color: #f2d7b4;
  box-shadow: inset 0 0 0 6px #f2d7b4, inset 0 0 0 8px #b3262f, inset 0 0 0 11px #f2d7b4, inset 0 0 0 12px #b3262f, 0 30px 60px rgba(0, 0, 0, 0.55);
  padding-left: 28px;
  padding-right: 28px;
  color: #2a1a12;
}

.stub .tearoff { margin-left: -28px; margin-right: -28px; }

.admit {
  margin: 4px 0 6px;
  font-family: var(--dots);
  font-weight: 900;
  font-size: clamp(26px, 8vw, 36px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b3262f;
}

.screening {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  margin: 10px 0;
  padding: 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.45);
}

.screening img { display: block; width: 74px; aspect-ratio: 9 / 16; object-fit: cover; }
.screening.s0 { background: rgba(255, 196, 214, 0.55); }
.screening.s1 { background: rgba(196, 228, 255, 0.55); }
.screening.s2 { background: rgba(255, 233, 168, 0.65); }
.screening.s3 { background: rgba(204, 245, 214, 0.6); }
.screening.s4 { background: rgba(226, 210, 255, 0.6); }

.sc-info { display: grid; align-content: start; gap: 2px; min-width: 0; }
.sc-info b { font-weight: 400; font-size: 18px; text-transform: uppercase; letter-spacing: 0.08em; }
.sc-n { font-family: var(--dots); font-weight: 900; font-size: 20px; color: #b3262f; }
.sc-p { font-size: 20px; }

.stubline {
  height: 16px;
  margin: 18px -28px 8px;
  background: radial-gradient(circle, var(--counter) 3.2px, transparent 3.7px) 7px 50% / 14px 16px repeat-x;
}

.stub .buy { background: #b3262f; border-color: #b3262f; color: #fff4e6; }
.stub .buy.done { background: transparent; color: #b3262f; }
.stub .nav:hover,
.stub .nav:focus-visible { background: #2a1a12; color: #f2d7b4; }

/* ---------- Void ---------- */

.void-stamp {
  position: absolute;
  left: 50%;
  top: 360px;
  z-index: 3;
  padding: 0 0.16em;
  border: 0.06em solid currentColor;
  color: rgba(204, 30, 40, 0.78);
  font-family: var(--dots);
  font-weight: 900;
  font-size: clamp(88px, 28vw, 160px);
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: translate(-50%, 0) rotate(-24deg);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.sticker-ln { font-size: 17px; }

/* ---------- No sale ---------- */

.nosale-ln {
  padding: 16px 0 10px;
  font-family: var(--dots);
  font-weight: 900;
  font-size: clamp(36px, 11vw, 48px);
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Carbon copy ---------- */

.paper.carbon {
  padding: 26px 22px 26px 46px;
  color: #2e3a8c;
  font-family: var(--hand);
  font-size: 19px;
  line-height: 1.5;
}

.paper.carbon.pink { background-color: #f6cfd8; }
.paper.carbon.yellow { background-color: #f5e6a3; }

/* Binding holes down the left edge. */
.paper.carbon::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 16px;
  bottom: 16px;
  width: 16px;
  background: radial-gradient(circle, var(--counter) 5px, transparent 5.6px) 50% 0 / 16px 46px repeat-y;
}

.cb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: var(--thermal);
  color: #b3262f;
}

.cb-dup {
  padding: 3px 10px;
  border: 2px solid currentColor;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.cb-no { font-family: var(--dots); font-weight: 900; font-size: 26px; letter-spacing: 0.06em; }

.cb-shop {
  display: grid;
  margin: 14px 0 8px;
  font-family: var(--thermal);
  color: #7c3940;
}

.cb-shop b { font-weight: 400; font-size: 18px; letter-spacing: 0.24em; text-transform: uppercase; }
.cb-shop span { font-size: 12px; letter-spacing: 0.08em; }

.cb-field {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid rgba(179, 38, 47, 0.35);
}

.cb-k {
  font-family: var(--thermal);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9b3a44;
}

.cb-v,
.cb-hand,
.cb-total .cb-v {
  text-shadow: 0.6px 0.5px 0 rgba(46, 58, 140, 0.28), -0.4px 0 1px rgba(46, 58, 140, 0.32);
  overflow-wrap: anywhere;
}

.cb-v.big { font-size: 26px; line-height: 1.2; font-weight: 700; }

.cb-rule { height: 0; margin: 10px 0; border-top: 2px solid rgba(179, 38, 47, 0.55); }

.cb-hand {
  line-height: 32px;
  background-image: linear-gradient(to bottom, transparent 31px, rgba(179, 38, 47, 0.28) 31px);
  background-size: 100% 32px;
}

.cb-hand.head { margin-top: 14px; font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.cb-hand.lede { font-size: 22px; }

.cb-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 0 8px;
  border-top: 2px solid #9b3a44;
  border-bottom: 4px double #9b3a44;
  font-size: 32px;
  font-weight: 700;
}

.cb-total .cb-k { font-size: 12px; }
.carbon .thermal { margin: 14px 0 10px; }
.carbon .thermal canvas { filter: none; }
.carbon .buy { background: #2e3a8c; border-color: #2e3a8c; color: #f6f1ff; font-size: 14px; }
.carbon .buy.done { background: transparent; color: #2e3a8c; }
.carbon .dots { color: #9b3a44; }
.carbon .bc { fill: #3a2b30; }
.carbon .idline,
.carbon .navs { font-family: var(--thermal); font-size: 14px; }
.carbon .basket-ln { font-family: var(--thermal); font-size: 12.5px; color: #7c3940; }
.carbon .nav:hover,
.carbon .nav:focus-visible { background: #2e3a8c; color: #fff; }
.carbon .tearoff { margin-left: -46px; margin-right: -22px; }

/* ---------- Mirror ---------- */

.stage {
  --lx: 50%;
  --ly: 300px;
  --lr: clamp(80px, 21vw, 124px);
  position: relative;
  width: var(--pw80);
  margin: 0 auto;
}

.paper.mirrored { transform: scaleX(-1); }

.paper.true {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  background-color: #fffef9;
  box-shadow: none;
  -webkit-clip-path: circle(var(--lr) at var(--lx) var(--ly));
  clip-path: circle(var(--lr) at var(--lx) var(--ly));
}

.stage.flipped .paper.true { -webkit-clip-path: none; clip-path: none; }
.stage.flipped .lens { display: none; }

.lens {
  position: absolute;
  left: var(--lx);
  top: var(--ly);
  z-index: 6;
  width: calc(var(--lr) * 2);
  height: calc(var(--lr) * 2);
  margin: calc(var(--lr) * -1) 0 0 calc(var(--lr) * -1);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 7px #cfd3d8, 0 0 0 9px #8b9097, 0 16px 30px rgba(0, 0, 0, 0.45), inset 0 0 26px rgba(255, 255, 255, 0.4);
}

.lens-glass {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.4), transparent 38%);
}

.lens-handle {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 26px;
  height: 112px;
  margin: 8px 0 0 -13px;
  border-radius: 12px;
  background: linear-gradient(90deg, #686d74, #d1d4d9 45%, #686d74);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}

.mirror-tools {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 24px);
  padding: 6px 8px 6px 6px;
  border-radius: 30px;
  background: rgba(10, 10, 12, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 0 0 1px #2c2d31;
  transform: translateX(-50%);
}

.flip {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #4a4c52;
  border-radius: 24px;
  background: #1d1e21;
  color: #e5e3dc;
  font-family: var(--thermal);
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
}

.flip[aria-pressed="true"] { background: #e5e3dc; color: #121315; }
.flip:focus-visible { outline: 2px solid #7dffd8; outline-offset: 2px; }

.cue {
  padding-right: 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #9d9a92;
  white-space: nowrap;
}

/* ---------- Wide screens: the counter and receipt at a readable size ---------- */

@media (min-width: 1100px) {
  .counter { zoom: 1.35; }
}

/* ---------- Phones ---------- */

@media (max-width: 520px) {
  .top { padding: 14px 12px 18px; }
  .shop { font-size: 11px; letter-spacing: 0.22em; }
  .vfd { font-size: 15px; padding: 7px 10px 6px; }
  .pr-body { height: 52px; padding: 0 16px; }
  .pr-vent { width: 60px; }
  .paper { padding: 30px 16px 22px; font-size: 14.5px; }
  .tearoff { margin-left: -16px; margin-right: -16px; }
  .dw-in { font-size: 20px; }
  .w58 .dw-in { font-size: 18px; }
  .navs { grid-template-columns: minmax(0, 1fr); }
  .nav.next,
  .nav.home { text-align: left; }
  .paper.stub { padding-left: 22px; padding-right: 22px; }
  .stub .tearoff,
  .stubline { margin-left: -22px; margin-right: -22px; }
  .paper.carbon { padding-left: 40px; padding-right: 16px; }
  .carbon .tearoff { margin-left: -40px; margin-right: -16px; }
  .cb-field { grid-template-columns: 60px minmax(0, 1fr); gap: 8px; }
  .screening { grid-template-columns: 60px minmax(0, 1fr); }
  .screening img { width: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .caret,
  .tab-arrow,
  .vfd.blink,
  .printing .pr-led,
  .printing .pr-mouth::before { animation: none !important; }
  .feed,
  .thermal .colour,
  .buy,
  .item { transition: none !important; }
}
