/* ---------------------------------------------------------------------------
   Coin-Operator (coin-operator.html). Everything here is scoped under .coinop,
   because style.css owns a vocabulary of short class names (.row, .in, .k, .v)
   that collided silently before.

   One screen, the way every incremental is laid out: a slim bar, the storefront
   with its till under it on the left, the store in tabs on the right. On a
   desktop window the page itself never scrolls; a store tab that outgrows the
   window scrolls inside its own column. Below 900px wide or 560px tall it falls
   back to one column that scrolls, since phones are not a priority here.

   The storefront borrows the arcade thumbnails' drawing rules (.thumb in
   arcade.css): ink lines at one weight that don't scale, .a for the one red
   mark. The cabinet screens inside it are those same thumbnails.
   --------------------------------------------------------------------------- */

body.coinop-app { padding-block: 10px 14px; }
.coinop .topnav { padding-block: 8px; margin-bottom: 10px; }

/* ---- the frame: one screen -------------------------------------------------- */

.coinop .app { display: grid; gap: 14px 32px; grid-template-columns: minmax(0, 1fr); }
.coinop .bar { grid-column: 1 / -1; }

@media (min-width: 900px) and (min-height: 560px) {
  body.coinop-app { height: 100dvh; overflow: hidden; box-sizing: border-box; }
  .coinop.wrap { height: 100%; }
  .coinop .app {
    flex: 1; min-height: 0;
    /* Shares of the page's own width, not the window's: the page stops widening, and a
       store sized in vw took most of it on a wide monitor, squeezing the shop to 280px. */
    grid-template-columns: minmax(0, 1.65fr) minmax(340px, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .coinop .shop { display: flex; flex-direction: column; min-height: 0; }
  /* The drawing takes its own height, as large as the column allows; the notice
     board fills what's left and hides the oldest notes that don't fit. */
  .coinop .front { flex: 0 1 auto; aspect-ratio: 902 / 392; min-height: 120px; }
  .coinop .notices { flex: 1 1 0; }
  /* Before the shop opens there's no till to share the column with, so the drawing
     is only as tall as itself and the opening line sits right under it. */
  body.coinop-app:not(.open) .coinop .front { flex: 0 0 auto; aspect-ratio: 902 / 392; max-height: 60vh; }
  .coinop .store { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--rule); padding-left: 24px; }
  .coinop .pane { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; padding-right: 4px; }
}

/* ---- the coin: what every quarter amount wears ------------------------------------ */
/* A matte silver quarter with a cent sign (Robert, 2026-10-09). Lettering of any kind was
   unreadable at text size, so the coin is known by its shape and its silver first; the
   cent sign is drawn bold enough to survive. It keeps its own colors in both themes. The
   currency sign it replaces stays inside, unseen, so a copy of the text keeps it. */
.coinop .qamt { white-space: nowrap; }
.coinop .till .v.big .coin { width: 0.86em; height: 0.86em; vertical-align: -0.1em; }
.coinop .coin {
  display: inline-block; width: 1.05em; height: 1.05em; margin: 0 0.16em 0 0.02em; vertical-align: -0.17em;
  overflow: hidden; text-indent: 2em; white-space: nowrap; color: transparent;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='9.3' fill='%23C4C7CD' stroke='%23878B93' stroke-width='1.2'/%3E%3Cpath d='M12.9 7.3A3.6 3.6 0 1 0 12.9 12.7M10.4 4.6V15.4' fill='none' stroke='%2350545B' stroke-width='1.9' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---- the bar ---------------------------------------------------------------- */

.coinop .bar {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px;
  padding-bottom: 10px; border-bottom: 1px solid var(--rule);
}
.coinop .bar h1 { font-size: 1.55rem; line-height: 1.1; }
.coinop .today { margin: 0; flex: 1 1 320px; color: var(--muted); font-size: 0.92rem; }
.coinop .today a { color: var(--ink); font-weight: 600; }
.coinop .bar-btns { display: flex; gap: 8px 16px; align-items: center; }
.coinop .bar-btns .notes-link { font-size: 0.86rem; color: var(--muted); }
.coinop .bar-btns .notes-link:hover { color: var(--ink); }
.coinop .btn.small { padding: 5px 12px; font-size: 0.84rem; }

/* ---- the storefront ----------------------------------------------------------- */

.coinop .front { position: relative; display: block; color: var(--ink); margin-top: 12px; }
.coinop .front svg { display: block; width: 100%; height: 100%; overflow: visible; }
.coinop .front svg * {
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke;
}
.coinop .front svg .f { fill: currentColor; stroke: none; }
.coinop .front svg .a { fill: var(--accent); stroke: none; }
.coinop .front svg .a-line { stroke: var(--accent); }
.coinop .front svg .thick { stroke-width: 4; }
.coinop .front svg .dash { stroke-dasharray: 4 5; }
.coinop .front svg .hole { fill: var(--ground); }
.coinop .front svg .t { fill: currentColor; stroke: none; font-family: var(--mono); font-weight: 500;
                        text-anchor: middle; dominant-baseline: central; }
.coinop .front svg .t.tp { fill: var(--paper); }
.coinop .front .screen { overflow: hidden; }

/* A cabinet is a button: a customer's credit. Its shell takes the ground fill so
   the whole silhouette catches the click, and thickens under the pointer. */
.coinop .front [data-cab] { cursor: pointer; }
.coinop .front [data-cab] .shell { fill: var(--ground); }
.coinop .front [data-cab]:hover .shell { stroke-width: 2.6; }
.coinop .front [data-cab]:active { transform: translateY(1.5px); }

/* Lettering. The sign is the shop's name in the site's display face. */
.coinop .front svg text { stroke: none; fill: currentColor; }
.coinop .front svg .sign {
  font-family: var(--display); font-weight: 700; font-size: 34px;
  letter-spacing: 0.16em; text-anchor: middle;
}
.coinop .front svg .label {
  font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: 0.08em;
  fill: var(--muted);
}
.coinop .front svg .label.end { text-anchor: end; }
.coinop .front svg .label.mid { text-anchor: middle; }
.coinop .front svg .lease {
  font-family: var(--mono); font-weight: 500; font-size: 22px; letter-spacing: 0.22em;
  text-anchor: middle; fill: var(--muted);
}
.coinop .front svg .doorsign {
  font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: 0.1em; text-anchor: middle;
}
.coinop .front svg .doorsign.a { fill: var(--accent); }
/* Today's promotion, taped inside the door glass. */
.coinop .front svg .poster .paper { fill: var(--paper); }
.coinop .front svg .poster .promo { font-family: var(--display); font-weight: 700; font-size: 17px; text-anchor: middle; }
.coinop .front svg .poster .tape { stroke: var(--muted); stroke-width: 4; opacity: 0.5; }
.coinop .front svg .poster:hover .paper { fill: var(--code-bg); }
.coinop .front svg .poster:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.coinop .front svg .count {
  font-family: var(--mono); font-weight: 500; font-size: 12px; text-anchor: middle;
  font-variant-numeric: tabular-nums;
}
/* Regulars and the snack counter: filled with the ground color so the lines
   behind them don't show through. */
.coinop .front .person .body, .coinop .front .counter .body { fill: var(--ground); }
/* A regular walking between cabinets: arm down, legs swinging, a slight bob. */
.coinop .front .person.walking { pointer-events: none; }
.coinop .front .person.walking .arm { display: none; }
.coinop .front .person .leg { transform-box: fill-box; transform-origin: 50% 0; }
.coinop .front .person.walking .leg { animation: coinop-step 420ms ease-in-out infinite alternate; }
.coinop .front .person.walking .leg.two { animation-delay: -420ms; }
.coinop .front .person.walking .body { animation: coinop-bob 210ms ease-in-out infinite alternate; }
@keyframes coinop-step { from { transform: rotate(-18deg); } to { transform: rotate(18deg); } }
@keyframes coinop-bob { to { transform: translateY(-3px); } }

/* The next cabinet's place on the floor: a dashed outline, quieter than ink. */
.coinop .front .ghost { color: var(--muted); }
.coinop .front .level {
  transform-box: fill-box; transform-origin: 50% 100%;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* A new cabinet steps down into its place in the window. */
.coinop .front .arrive { animation: coinop-arrive 220ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes coinop-arrive {
  from { opacity: 0; transform: translateY(-18px); }
}

/* What a click paid, rising from where it landed. */
.coinop .rise {
  position: absolute; pointer-events: none; transform: translate(-50%, -50%);
  font-family: var(--mono); font-weight: 500; font-size: 0.95rem; color: var(--ink);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  animation: coinop-rise 760ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes coinop-rise {
  to { opacity: 0; transform: translate(-50%, -190%); }
}
@media (prefers-reduced-motion: reduce) {
  .coinop .front .arrive { animation: none; }
  .coinop .front .level { transition: none; }
  .coinop .front [data-cab]:active { transform: none; }
  .coinop .rise { animation: coinop-fade 760ms linear forwards; }
}
@keyframes coinop-fade { to { opacity: 0; } }

/* ---- visitors and the notice board --------------------------------------------------- */

/* Someone on the sidewalk, crossing the front of the shop. */
.coinop .front .walker { cursor: pointer; animation: coinop-walk var(--walk, 14s) linear forwards; }
.coinop .front .walker .body { fill: var(--ground); }
.coinop .front .walker.waiting { animation: none; }
.coinop .front .walker .leg { transform-box: fill-box; transform-origin: 50% 0; animation: coinop-step 420ms ease-in-out infinite alternate; }
.coinop .front .walker .leg.two { animation-delay: -420ms; }
.coinop .front .walker.waiting .leg { animation: none; }
@keyframes coinop-walk { from { transform: translateX(10px); } to { transform: translateX(900px); } }
.coinop .front .curb { stroke: var(--muted); }
/* The street's passersby: scenery, never in the way of a click. */
.coinop .front .amb { pointer-events: none; animation: coinop-pass var(--dur, 12s) linear forwards; }
.coinop .front .amb.loiter { animation-name: coinop-loiter; }
.coinop .front .amb .solid { fill: var(--ground); }
.coinop .front .amb .leg { transform-box: fill-box; transform-origin: 50% 0; animation: coinop-step 420ms ease-in-out infinite alternate; }
.coinop .front .amb .leg.two { animation-delay: -420ms; }
.coinop .front .amb .fast .leg { animation-duration: 190ms; }
.coinop .front .amb .fast .leg.two { animation-delay: -190ms; }
.coinop .front .amb .board .leg { animation: none; }
.coinop .front .amb .hop { animation: coinop-hop 2.4s ease-out infinite; }
/* A pigeon mostly walks; now and then it hops. */
@keyframes coinop-hop { 0%, 80%, 100% { transform: none; } 88% { transform: translateY(-3px); } }
@keyframes coinop-pass { from { transform: translate(var(--x0), 0); } to { transform: translate(var(--x1), var(--y1, 0px)); } }
/* A cat stops to look in the window, then goes on. */
@keyframes coinop-loiter {
  from { transform: translateX(var(--x0)); } 40% { transform: translateX(var(--xm)); }
  70% { transform: translateX(var(--xm)); } to { transform: translateX(var(--x1)); }
}
@media (prefers-reduced-motion: reduce) { .coinop .front .amb { display: none; } }
/* A party on: every marquee lit. */
.coinop .front.party .cab > rect:first-of-type { fill: currentColor; }
.coinop .visit { margin: 8px 0 0; font-size: 0.88rem; display: flex; align-items: center; gap: 10px; }

.coinop .notices { margin-top: 10px; min-height: 0; overflow: hidden; }
.coinop .notices-h { margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.coinop .notices-h .k {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.coinop .notices-h .sub { color: var(--muted); font-size: 0.82rem; }
.coinop .notices ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 14px; }
.coinop .note {
  display: grid; grid-template-columns: auto 1fr; gap: 0 10px; align-items: baseline;
  padding: 8px 10px; border: 1px solid var(--rule); background: var(--paper); font-size: 0.82rem; line-height: 1.35;
}
.coinop .note .when { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.coinop .note.fresh { border-color: var(--ink); }
.coinop .note[hidden] { display: none; }
.coinop .notices.cramped > * { visibility: hidden; }

/* ---- the opening, before there is a shop ---------------------------------------- */

.coinop .opening { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 14px; }
.coinop .opening p { max-width: 62ch; margin: 0; }

/* ---- the till ------------------------------------------------------------------- */

.coinop .till {
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px 24px; align-items: start;
  padding-bottom: 12px; border-bottom: 1px solid var(--rule);
}
.coinop .till .cell { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.coinop .till .k, .coinop .tabs-row [role="tab"], .coinop .saveio label, .coinop .stats dt {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.coinop .till .v { font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.coinop .till .v.big { font-family: var(--display); font-size: 2.1rem; line-height: 1.05; }
.coinop .till .sub { color: var(--muted); font-size: 0.82rem; }
.coinop .till-btns { display: flex; flex-direction: column; gap: 6px; align-self: center; }
.coinop .till-btns .btn { white-space: nowrap; font-variant-numeric: tabular-nums; }
.coinop .away { margin: 8px 0 4px; color: var(--muted); font-size: 0.88rem; }
.coinop .away:empty { display: none; }

/* ---- the store: tabs ------------------------------------------------------------- */

/* Seven tabs fit on one line from about 1280px wide; narrower, they wrap rather than run
   off the edge. The gap still clears the ready dot. */
.coinop .tabs-row { display: flex; flex-wrap: wrap; gap: 4px 11px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.coinop .tabs-row [role="tab"] {
  position: relative; background: none; border: 0; cursor: pointer; letter-spacing: 0.02em; font-size: 0.6875rem;
  padding: 2px 0 9px; margin-bottom: -1px; border-bottom: 2px solid transparent;
}
.coinop .tabs-row [role="tab"]:hover { color: var(--ink); }
.coinop .tabs-row [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.coinop .tabs-row [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Something in the Upgrades tab is affordable: a dot, in ink. */
.coinop .tabs-row [role="tab"].ready::after {
  content: ""; position: absolute; top: 1px; right: -9px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--ink);
}

/* ---- buying in bulk ---------------------------------------------------------------- */

.coinop .bulk { display: flex; align-items: center; gap: 0; margin: 8px 0 2px; }
.coinop .bulk .k {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-right: 10px;
}
.coinop .bulk button {
  font: 600 0.8rem var(--body); padding: 3px 10px; cursor: pointer;
  background: transparent; color: var(--ink); border: 1px solid var(--ink); margin-left: -1px;
}
.coinop .bulk button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.coinop .bulk button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; position: relative; }

/* ---- the math setting: the readout, the column heads, each row's figures ---------------- */

/* The buy switch, the readout and the column heads stay put while the list scrolls under
   them, so the preview of a row far down the list is still in view. */
.coinop .cabs-head { position: sticky; top: 0; z-index: 1; background: var(--ground); }
/* A fixed height, so a preview never moves the list out from under the pointer: one line
   naming the buy, then label-over-value cells, the till's own idiom. */
.coinop .plan {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center;
  height: 92px; overflow: hidden; margin: 8px 0 0; padding: 8px 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.coinop .plan-what {
  margin: 0; font-weight: 600; font-size: 0.9rem; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.coinop .plan .k, .coinop .plan-cells dt {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.coinop .plan .k { color: var(--accent); margin-right: 6px; }
.coinop .plan-cells { grid-column: 1 / -1; display: flex; gap: 0 13px; margin: 0; }
.coinop .plan-cells .cell { display: flex; flex-direction: column; gap: 1px; white-space: nowrap; }
.coinop .plan-cells dd { margin: 0; font-weight: 600; font-size: 0.9rem; font-variant-numeric: tabular-nums; }

/* The ledger's figures sit where they mean something, with no column heads (Robert,
   2026-10-09): the count under the picture, the hour at the end of the name line, the share
   as a bar with its percent, and with the math on, what a buy adds inside its button.
   Regular weight throughout: only the fastest payback stands out, in red. */
.coinop .stat {
  display: grid; grid-template-columns: 3.9rem 3.9rem minmax(0, 1fr); column-gap: 8px;
  font-size: 0.84rem; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.coinop .cab-row > .stat { grid-column: 2 / -1; }
.coinop .cab-row .stat { margin-top: 1px; font-weight: 500; }
.coinop .cab-row.up .stat { grid-template-columns: auto auto; column-gap: 14px; font-weight: 500; justify-content: start; }
.coinop .stat .best { color: var(--accent); font-weight: 600; }
.coinop .cab-row { position: relative; }   /* keeps each screen-reader sentence inside the scrolling pane */
.coinop .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* The buttons share one width, the widest label's, so their edges line up. */
/* --buyw: the widest buy label showing, set by fitBuys() in coin-operator.js. */
.coinop #ledger .cab-row { grid-template-columns: 36px minmax(0, 1fr) var(--buyw, 7.4rem); }
.coinop #ledger .pic { grid-row: 1 / 3; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.coinop #ledger .pic .thumb-sm { width: 36px; }
.coinop #ledger .pic .own { font-size: 0.74rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.coinop #ledger .pic { grid-column: 1; }
.coinop #ledger .info { grid-column: 2; grid-row: 1; }
.coinop #ledger .acts { grid-column: 3; grid-row: 1 / 3; }
.coinop #ledger .name .hr { margin-left: auto; font-weight: 500; font-size: 0.86rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.coinop #ledger .name .hr .u { color: var(--muted); font-size: 0.74rem; font-weight: 400; margin-left: 1px; }
.coinop #ledger .share { grid-column: 2; display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.coinop #ledger .share .bar { position: relative; flex: 1; height: 3px; background: var(--rule); overflow: hidden; }
.coinop #ledger .share .fill { position: absolute; inset: 0; background: var(--ink); transform-origin: 0 50%;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1); }
@media (prefers-reduced-motion: reduce) { .coinop #ledger .share .fill { transition: none; } }
.coinop #ledger .share .pct { min-width: 2.8em; text-align: right; color: var(--muted); font-size: 0.74rem; font-variant-numeric: tabular-nums; }
/* A buy button's label is centered, the price beside the action, and with the math on,
   what the buy adds and its payback on a small line under them. */
.coinop .btn.ledger { display: flex; flex-direction: column; align-items: center; width: 100%; white-space: nowrap; line-height: 1.25; }
.coinop .btn.ledger .top { display: flex; gap: 6px; }
.coinop .btn.ledger .lbl { font-weight: 500; }
.coinop .btn.ledger .price { font-variant-numeric: tabular-nums; }
.coinop .btn.ledger .w { font-size: 0.7rem; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.coinop .btn.ledger .w.best { color: var(--accent); font-weight: 600; }
.coinop .cab-row .name .yr { color: var(--muted); font-weight: 500; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.coinop .mathset { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; align-items: center; margin: 8px 0 4px; }
.coinop .mathset input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.coinop .mathset input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.coinop .mathset label { font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.coinop .mathset .later { grid-column: 2; margin: 0; }

/* ---- store rows ------------------------------------------------------------------ */

.coinop .cabs { list-style: none; margin: 0; padding: 0; }
.coinop .cab-row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 2px 12px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--rule);
}
.coinop .cab-row.up { grid-template-columns: minmax(0, 1fr) auto; }
.coinop .cab-row .thumb-sm { width: 36px; }
.coinop .cab-row .name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-weight: 600; line-height: 1.3; }
.coinop .cab-row .name a { color: var(--ink); }
.coinop .cab-row .meta { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; line-height: 1.35; }
.coinop .cab-row .acts { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.coinop .tag {
  font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--rule); border-radius: 4px; padding: 0 5px; white-space: nowrap;
}
.coinop .btn.buy { padding: 5px 10px; font-size: 0.82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.coinop .btn:disabled { opacity: 0.42; cursor: not-allowed; }
.coinop .btn:disabled:hover { background: transparent; }
.coinop .btn.primary:disabled:hover { background: var(--ink); opacity: 0.42; }
.coinop .later { color: var(--muted); font-size: 0.82rem; margin: 10px 0 0; }

/* ---- snacks: shelves as meters -------------------------------------------------------- */

.coinop .decade { padding: 8px 0 12px; border-bottom: 1px solid var(--rule); }
.coinop .decade .name { font-weight: 600; }
.coinop .decade .meta { color: var(--muted); font-size: 0.8rem; line-height: 1.35; }
.coinop .decade .warn { font-size: 0.82rem; margin: 6px 0; }
.coinop .decade .row-btns { margin-top: 8px; }
.coinop .lead { font-size: 0.84rem; color: var(--muted); margin: 8px 0; }
.coinop #restockall-row { margin-bottom: 4px; }
.coinop .meter { position: relative; height: 8px; margin: 5px 0 3px; border: 1px solid var(--ink); overflow: hidden; }
.coinop .meter .fill {
  position: absolute; inset: 0; background: var(--ink); transform-origin: 0 50%;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-reduced-motion: reduce) { .coinop .meter .fill { transition: none; } }
/* Under each meter, one line of two ends: profit an hour and share at the left, the time
   left at the right. Red, saying what it misses, when the shelf is empty. */
.coinop .snk { display: flex; justify-content: space-between; gap: 2px 12px; flex-wrap: wrap; margin-top: 2px;
  font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.coinop .snk .u { color: var(--muted); }
.coinop .stockwarn { margin-top: 3px; }
.coinop .snk.lost, .coinop .snk.lost .u, .coinop .snk .lost { color: var(--accent); }
.coinop #pane-snacks .snack.sum { padding: 6px 0 9px; }
.coinop #pane-snacks .snack.sum .name { font-size: 0.84rem; color: var(--muted); }

/* ---- locked rows: what's still to come ------------------------------------------- */

.coinop .cab-row.locked .name, .coinop .cab-row.locked .meta { color: var(--muted); }
.coinop .cab-row.locked .name { font-weight: 500; }
.coinop .cab-row.locked .pic .thumb, .coinop .cab-row.locked .strip .thumb { opacity: 0.38; }
.coinop .cab-row.locked .need { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; white-space: nowrap; }
.coinop .cab-row.locked .need .k { font-family: var(--mono); font-size: 0.64rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.coinop .cab-row.locked .need .v { color: var(--muted); font-size: 0.84rem; font-variant-numeric: tabular-nums; }
.coinop .cab-row.locked.era .strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.coinop .cab-row.locked.era .strip .thumb-sm { width: 28px; }
.coinop #ledger .cab-row.locked .pic { grid-row: 1; }

/* ---- prizes: how many cabinets toward each ----------------------------------------- */

.coinop #prizes .need { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; white-space: nowrap; }
.coinop #prizes .cab-row:not(.locked) .need .v { color: var(--ink); }
.coinop #prizes .need .k { font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.coinop #prizes .need .v { font-weight: 600; font-size: 0.9rem; font-variant-numeric: tabular-nums; }

/* ---- regulars: the capsule machine and the cast ------------------------------------- */

.coinop .machine { display: flex; align-items: center; gap: 18px; padding: 10px 0 4px; }
.coinop .capsule { width: 72px; flex-shrink: 0; color: var(--ink); }
.coinop .capsule svg { display: block; width: 100%; height: auto; overflow: visible; }
.coinop .capsule svg * {
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke;
}
.coinop .capsule svg .f { fill: currentColor; stroke: none; }
.coinop .capsule svg .a { fill: var(--accent); stroke: none; }
.coinop .capsule svg .thick { stroke-width: 3; }
/* The capsule that just came out drops into the chute. */
.coinop .capsule .drop { animation: coinop-drop 240ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes coinop-drop { from { transform: translateY(-22px); opacity: 0; } }
.coinop .pulls { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.coinop .tickets { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.coinop .ticketwhy { margin: 0 0 2px; color: var(--muted); font-size: 0.8rem; line-height: 1.35; }
.coinop .odds { margin: 4px 0 0; color: var(--muted); font-size: 0.78rem; }
.coinop .pulled { margin: 6px 0 0; font-size: 0.86rem; }
.coinop .pulled:empty { display: none; }

.coinop .regs { list-style: none; margin: 6px 0 0; padding: 0; }
.coinop .reg {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 2px 12px; align-items: start;
  padding: 10px 0; border-bottom: 1px solid var(--rule);
}
.coinop .reg .badge {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--ink); font-family: var(--mono); font-size: 0.78rem; font-weight: 500;
}
.coinop .reg.full .badge { background: var(--ink); color: var(--ground); }
.coinop .reg.unmet .badge { border-style: dashed; color: var(--muted); border-color: var(--muted); }
.coinop .reg .name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-weight: 600; line-height: 1.3; }
.coinop .reg.unmet .name { color: var(--muted); font-weight: 500; }
/* Rarity climbs the same ladder as the capsule reveal: plain, ink, red, red all over. */
.coinop .tag.rar1 { color: var(--ink); border-color: var(--ink); }
.coinop .tag.rar2 { color: var(--accent); border-color: var(--accent); }
.coinop .tag.rar3 { color: var(--ground); background: var(--accent); border-color: var(--accent); }
.coinop .reg .line { font-size: 0.82rem; line-height: 1.35; }
.coinop .reg .meta { color: var(--muted); font-size: 0.78rem; line-height: 1.35; }
.coinop .punches { display: flex; gap: 4px; margin: 4px 0 2px; }
.coinop .punches .hole { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink); }
.coinop .punches .hole.on { background: var(--ink); }
/* The regular who just came out of the capsule. */
.coinop .reg.just { animation: coinop-just 900ms ease-out; }
@keyframes coinop-just { from { background: var(--code-bg); } }
@media (prefers-reduced-motion: reduce) {
  .coinop .capsule .drop, .coinop .reg.just { animation: none; }
}

/* ---- stats ------------------------------------------------------------------------ */

.coinop .stats { display: grid; grid-template-columns: 1fr auto; margin: 6px 0 0; }
.coinop .stats dt, .coinop .stats dd {
  display: flex; align-items: center; min-height: 38px; margin: 0; border-bottom: 1px solid var(--rule);
}
.coinop .stats dd { justify-content: flex-end; }
.coinop .stats dd { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- the floor ---------------------------------------------------------------------- */

.coinop .floor { list-style: none; margin: 4px 0 0; padding: 0; counter-reset: spot; }
.coinop .spot {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 0 6px; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 0.82rem; line-height: 1.35;
  counter-increment: spot;
}
.coinop .spot::before { content: counter(spot); font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.coinop .spot .info { display: flex; flex-direction: column; min-width: 0; }
.coinop .spot .name { font-weight: 600; }
.coinop .spot .meta { color: var(--muted); }
.coinop .spot.paired .name::after { content: " \2713"; }
.coinop .spot .mv {
  font: 600 0.85rem var(--body); width: 30px; height: 26px; padding: 0; cursor: pointer;
  background: transparent; color: var(--ink); border: 1px solid var(--ink);
}
.coinop .spot .mv:disabled { opacity: 0.3; cursor: default; }
.coinop .spot .mv:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.coinop .front svg .tie { stroke-width: 3; }

/* ---- milestones ------------------------------------------------------------------- */

.coinop .goals { list-style: none; margin: 4px 0 0; padding: 0; }
.coinop .goal {
  display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 0 8px; padding: 6px 0;
  border-bottom: 1px solid var(--rule); font-size: 0.82rem; line-height: 1.35;
}
.coinop .goal .mark { grid-row: 1 / span 2; font-weight: 600; }
.coinop .goal .gname { font-weight: 600; color: var(--muted); }
.coinop .goal.got .gname { color: var(--ink); }
.coinop .goal .gwhat { color: var(--muted); }

/* ---- the capsule reveal ------------------------------------------------------------ */
/* A pull plays in the store's column, over the Regulars tab, not over the whole page
   (Robert and Andy, 2026-10-09: "it shouldn't be fullscreen"): the crank turns, the globe
   tumbles, a capsule rolls out, wobbles (more for rarer), changes color, and bursts open.
   placeReveal() sets its box to the store's; on a narrow screen it keeps the whole screen.
   Everything inside sizes to the box (container units). */

.coinop .gacha {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: var(--ground); color: var(--ink); overflow: hidden;
  container-type: size;
}
.coinop .gacha.local { position: fixed; inset: auto; }
.coinop .gacha[open] { display: grid; place-items: center; }
.coinop .gacha::backdrop { background: transparent; }   /* the dialog itself covers the screen */
.coinop .gacha > * { grid-area: 1 / 1; }
.coinop .g-stage { width: min(620px, 94cqw, 92cqh); aspect-ratio: 1; }
.coinop .g-stage svg { display: block; width: 100%; height: 100%; overflow: visible; }
.coinop .g-stage svg * { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.coinop .g-stage .f { fill: var(--ink); stroke: none; }
.coinop .g-stage .a { fill: var(--accent); stroke: none; }
.coinop .g-stage .p { fill: var(--ground); }
.coinop .g-stage .thick { stroke-width: 4; }
.coinop .g-stage .ray { stroke: none; fill: var(--muted); }
.coinop .g-stage .rays { opacity: 0; }
.coinop .g-stage .r1 .ray { fill: var(--ink); }
.coinop .g-stage .r2 .ray, .coinop .g-stage .r3 .ray { fill: var(--accent); }
.coinop .g-stage .cap, .coinop .g-stage .flash, .coinop .g-stage .bits { opacity: 0; }
.coinop .g-stage .half { fill: var(--ground); }
.coinop .g-stage .c1 .half.top { fill: var(--ink); }
.coinop .g-stage .c2 .half.top, .coinop .g-stage .c3 .half.top { fill: var(--accent); }
.coinop .g-stage .c3 .half.bot { fill: var(--accent); }
.coinop .g-stage .flash { fill: var(--paper); stroke: none; }
.coinop .g-stage .flash.hot { fill: var(--accent); }
.coinop .g-stage .bit { stroke: none; fill: var(--ink); }
.coinop .g-stage .bit.hot { fill: var(--accent); }

.coinop .g-card {
  width: min(380px, 88cqw); max-height: 96cqh; overflow-y: auto; padding: 22px 24px 20px; background: var(--paper);
  border: 2px solid var(--ink); text-align: center; visibility: hidden;
  box-shadow: 0 18px 50px rgb(0 0 0 / 0.18);
}
.coinop .g-card.r2, .coinop .g-card.r3 { border-color: var(--accent); }
.coinop .g-name { font-family: var(--display); font-size: 2.3rem; line-height: 1.05; margin: 0 0 6px; text-wrap: balance; }
.coinop .g-what { margin: 0 0 10px; font-weight: 600; font-size: 0.9rem; }
.coinop .g-card.r2 .g-what, .coinop .g-card.r3 .g-what { color: var(--accent); }
.coinop .g-punches { justify-content: center; margin: 0 0 12px; }
.coinop .g-punches .hole { width: 14px; height: 14px; }
.coinop .g-line { margin: 0 0 8px; font-style: italic; color: var(--muted); }
.coinop .g-perk { margin: 0 0 16px; font-size: 0.88rem; }
.coinop .g-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.coinop .g-skip {
  align-self: end; margin: 0 0 24px; font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}

/* ---- save ------------------------------------------------------------------------- */

.coinop .saveh { font-size: 1rem; margin: 20px 0 4px; }
.coinop .saveh + p { font-size: 0.84rem; margin: 0 0 6px; color: var(--muted); }
.coinop .saveio { display: grid; gap: 8px; }
.coinop .saveio label { margin-top: 6px; }
.coinop .saveio textarea {
  /* No bottom padding: text scrolls into padding, so a padded box always ended
     mid-line. Four whole lines plus the top padding and the border, then the edge. */
  width: 100%; resize: vertical; padding: 8px 10px 0; height: calc(4lh + 10px);
  font: 0.76rem/1.45 var(--mono); color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 6px; word-break: break-all;
}
.coinop .saveio textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.coinop .row-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.coinop .row-btns .said { font-size: 0.84rem; }

/* ---- the help panel ------------------------------------------------------------------ */

/* A dialog with a tab per part of the shop, in the store's own tab style. Every pane gets
   the same height, so switching tabs never makes the box jump. */
.coinop .helpbox {
  width: min(640px, calc(100vw - 40px)); max-height: calc(100vh - 40px); padding: 18px 24px 20px; margin: auto;
  color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 10px;
}
.coinop .helpbox[open] { display: flex; flex-direction: column; }
.coinop .helpbox::backdrop { background: rgb(0 0 0 / 0.32); }
.coinop .help-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.coinop .help-head h2 { font-size: 1.3rem; margin: 0; }
.coinop .help-head form { margin: 0; }
.coinop .help-panes { height: 25rem; max-height: calc(100vh - 170px); overflow-y: auto; padding-top: 6px; }
.coinop .help-pane:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.coinop .help-pane h3 {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 12px 0 6px;
}
.coinop .help-pane h3:first-child { margin-top: 6px; }
.coinop .help-pane ul { margin: 0; padding-left: 1.1em; }
.coinop .help-pane li { font-size: 0.92rem; line-height: 1.45; margin: 0 0 6px; }
.coinop .help-pane li::marker { color: var(--muted); }
.coinop .help-pane b { font-weight: 600; }
.coinop .help-key { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 0.92rem; line-height: 1.45; }
.coinop .help-key dt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.coinop .help-key dd { margin: 0; }
.coinop .helpbox .aside { color: var(--muted); font-size: 0.85rem; margin-top: 12px; }

@media (max-width: 640px) {
  .coinop .till { grid-template-columns: 1fr 1fr; }
  .coinop .till-btns { grid-column: 1 / -1; flex-direction: row; }
  /* The drawing's small lettering shrinks with it to about 5px here. The store
     carries the counts and the bar the name, so only the sign stays. */
  .coinop .front svg .label, .coinop .front svg .count { display: none; }
}

/* ---- today's pattern ------------------------------------------------------------- */

/* The help dialog's frame, wider: the board and the hand on the left, the book on the right. */
.coinop .patbox { width: min(800px, calc(100vw - 40px)); }
.coinop .pat-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px; }
.coinop .pat-have { margin: 0 0 8px; font-size: 0.84rem; line-height: 1.35; color: var(--muted); }
.coinop .pat-board { width: 100%; aspect-ratio: 1; cursor: pointer; touch-action: none; }
.coinop .pat-board:focus { outline: none; }
.coinop .pat-board:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.coinop .pat-board svg { display: block; width: 100%; height: 100%; }
.coinop .pat-board .grid { fill: none; stroke: var(--rule); stroke-width: 1; }
.coinop .pat-board .piece rect { fill: var(--ink); }
.coinop .pat-board .piece.lit rect { fill: var(--accent); }
/* Faded as a group, so the squares' overlaps don't show as seams. */
.coinop .pat-board .ghost { opacity: 0.22; }
.coinop .pat-board .ghost rect { fill: var(--ink); }
.coinop .pat-board .ghost.bad { opacity: 0.16; }
.coinop .pat-board .ghost.bad rect { fill: var(--accent); }
.coinop .pat-board .ghost-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: square; }
.coinop .pat-board .ghost-line.bad { stroke: var(--accent); stroke-dasharray: 5 4; }
.coinop .pat-board .cursor { fill: none; stroke: var(--accent); stroke-width: 2; display: none; }
.coinop .pat-board:focus-visible .cursor { display: inline; }
.coinop .pat-result { display: flex; align-items: center; gap: 12px; min-height: 2.5rem; margin: 6px 0; }
.coinop .pat-result p { margin: 0; flex: 1; font-size: 0.9rem; line-height: 1.35; }
.coinop .pat-result .btn { flex: none; }
.coinop .pat-hand { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.coinop .pat-piece, .coinop .pat-slot {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px;
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink); font: inherit;
}
.coinop .pat-piece { cursor: pointer; }
.coinop .pat-piece svg { width: 34px; height: 34px; }
.coinop .pat-piece .piece rect { fill: currentColor; }
.coinop .pat-piece:hover { background: var(--code-bg); }
.coinop .pat-piece:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.coinop .pat-piece.placed { color: var(--muted); }
.coinop .pat-piece.placed svg { opacity: 0.4; }
.coinop .pat-piece.held { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.coinop .pat-slot { border-style: dashed; color: var(--muted); }
.coinop .pat-q { display: grid; place-items: center; width: 34px; height: 34px; font-family: var(--mono); }
.coinop .pat-n { font-family: var(--mono); font-size: 0.66rem; white-space: nowrap; }
.coinop .pat-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.coinop .pat-tools kbd {
  font-family: var(--mono); font-size: 0.7rem; padding: 0 4px; margin-left: 4px;
  border: 1px solid var(--rule); color: var(--muted);
}
.coinop .pat-tools .btn:disabled { opacity: 0.45; cursor: default; }
.coinop .pat-tools .btn:disabled:hover { background: transparent; }
.coinop .pat-keys { margin: 8px 0 0; font-size: 0.78rem; line-height: 1.4; color: var(--muted); }
.coinop .pat-book-h, .coinop .pat-size .k {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 0;
}
.coinop .pat-legend { margin: 4px 0 0; font-size: 0.76rem; line-height: 1.35; color: var(--muted); }
.coinop .pat-size { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 12px 0 6px; padding-top: 8px; border-top: 1px solid var(--rule); }
.coinop .pat-size .k { color: var(--ink); }
.coinop .pat-size .sub { font-size: 0.8rem; color: var(--muted); }
.coinop .pat-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
.coinop .pat-list li { display: flex; align-items: center; gap: 10px; }
.coinop .pat-list svg { flex: none; width: 35px; height: 30px; }
.coinop .pat-list .fill { fill: var(--ink); }
.coinop .pat-list .line { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 2; }
.coinop .pat-list li.lit .fill { fill: var(--accent); }
.coinop .pat-list li.lit .pat-name { color: var(--accent); }
.coinop .pat-words { min-width: 0; }
.coinop .pat-words { font-size: 0.86rem; line-height: 1.3; }
.coinop .pat-name { font-weight: 600; }
.coinop .pat-sub { margin-left: 6px; font-size: 0.76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.coinop .pat-list li.unmade .pat-name { font-weight: 400; color: var(--muted); }

/* The signs of patterns you've made, over the window. */
.coinop .front svg .neon { stroke-linecap: square; }

@media (max-width: 720px) {
  .coinop .pat-body { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
