/* The Rock self-pour kiosk — dark, touch-first.

   Reads its colour palette from /assets/tokens.css (loaded first in
   index.html). The local vars below are SHIMS that translate
   kiosk-specific names to the shared tokens, so we can keep the
   existing class names and code without rewriting everything.

   Kiosk-specific design choices left in place:
     - Slightly larger body font (18px vs admin's 14px) — touch device
       at arm's length needs bigger text
     - Heavier disabled-overlay handling (no hover affordances)
     - Bigger radius (14px vs 8px) — softer feel for the customer-
       facing surface */
:root {
  /* Map kiosk-local names to design-token equivalents */
  --bg-elev:     var(--surface);
  --bg-elev-2:   var(--surface2);
  --accent-press: var(--accent-hover);
  --ok:          var(--tip-green);
  --line:        var(--border);
  --radius:      14px;        /* kiosk-specific override of tokens.css --radius */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overflow: hidden;
  overscroll-behavior: none;
}

input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

#app {
  height: 100vh;
  width: 100vw;
  position: relative;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: 0;
}
.screen.active { display: flex; }

/* ---------- bar (top header on most screens) ---------- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-elev);
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  min-height: 64px;
}
.bar-title {
  font-family: var(--display, 'Handel Gothic'), 'Helvetica Neue', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
/* Two-line header variant — used on the top-up amount picker so the
 * customer sees both the question (large) and their current balance
 * (small, dimmed) without either competing for attention. The stack
 * sits in the same flex slot as a single .bar-title would, so the
 * cancel button still right-aligns naturally. */
.bar-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Compensate for the extra vertical content vs a one-liner —
   * the .bar still has min-height: 64px so this just adds breathing
   * room when both lines are present. */
}
.bar-eyebrow {
  font-size: 16px;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
}
.bar-eyebrow span {
  /* The actual balance number gets the warmer accent so it pops out
   * from "Current balance " label text. */
  color: var(--accent);
  font-weight: 600;
  margin-left: 4px;
}
.bar-actions { display: flex; gap: 10px; }
.cancel {
  width: 56px; height: 56px;
  font-size: 28px;
  background: transparent;
  color: var(--fg-dim);
  border: none;
  border-radius: 50%;
}
.cancel:active { background: var(--bg-elev-2); }

/* ---------- buttons ---------- */
button {
  font: inherit;
  border: none;
  border-radius: var(--radius);
  padding: 14px 22px;
  font-weight: 600;
  font-size: 18px;
  background: var(--bg-elev-2);
  color: var(--fg);
  cursor: pointer;
  transition: transform 60ms ease;
  touch-action: manipulation;
}
button.primary { background: var(--accent); color: #1a1a1a; }
button.primary:active { background: var(--accent-press); }
button.ghost   { background: transparent; color: var(--fg-dim); border: 1px solid var(--line); }
button.danger  { background: var(--danger); color: #fff; }
button.big     { padding: 22px 28px; font-size: 22px; min-height: 64px; }
button:active  { transform: scale(0.98); }
button:disabled { opacity: 0.4; }

/* ---------- IDLE ---------- */
[data-screen="idle"] {
  /* The base .screen rule sets position: absolute + inset: 0 to fill
     #app — DON'T override that here. The attract-slide children are
     position: absolute and would otherwise resolve against a zero-
     sized relative parent and render invisibly (looks like a black
     screen). align-items/justify-content stay on as a safety net for
     any future flow content. */
  align-items: stretch;
  justify-content: stretch;
  text-align: center;
  background: linear-gradient(135deg, #0d0d10 0%, #1a1a20 100%);
  overflow: hidden;
}

/* ----- Attract loop ------------------------------------------------
   Each slide is absolutely positioned over the others. Only one
   carries .active at a time. Cross-fade between slides via opacity
   transition — easy on the eye, no layout reflow per swap.
   Pointer-events: none on inactive slides means a card-scan on a
   passively-shown brand slide doesn't feel different from one on
   the prompt slide (the card scan is captured globally by the NFC
   service, not by clicks on the screen). */
.attract-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  padding: 4vh 4vw;
}
.attract-slide.active {
  opacity: 1;
  pointer-events: auto;
}

/* Slide 1: wordmark + tap-card prompt.
   Fluid type via clamp() so the screen looks proportional on every
   iPad (10.2" through 13" Pro) without a stack of media queries.
   Lower bound = readable on the smallest target; upper bound caps
   on the biggest so it doesn't go absurd. */
.attract-prompt .logo {
  font-family: var(--display, 'Handel Gothic'), 'Helvetica Neue', sans-serif;
  font-size: clamp(80px, 14vw, 220px);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent);
  line-height: 1;
  margin-bottom: clamp(24px, 4vh, 60px);
}
.attract-prompt .prompt {
  font-size: clamp(28px, 4.5vw, 64px);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: clamp(14px, 2vh, 28px);
  max-width: 90%;
}
.attract-prompt .hint {
  color: var(--fg-dim);
  font-size: clamp(16px, 2vw, 28px);
}

/* Slide 2: branding image with a "tap to begin" caption beneath.
 *
 * Layout: image takes the upper portion, caption sits below with a
 * bit of breathing room. The image is `contain`-fitted so it never
 * overlaps the caption regardless of how tall the artwork happens
 * to be. The caption mirrors the prompt slide's wording exactly so
 * the call-to-action is consistent whichever slide is on screen
 * when a customer walks up.
 *
 * .attract-slide is flex-column (set above) — we just shrink the
 * image's max-height so the caption gets vertical room, and add
 * a margin-top to the caption to separate them visually.
 */
.attract-image {
  background: var(--bg);
}
.attract-image img {
  max-width: 100%;
  /* Cap the image at ~70% of slide height so the caption below has
   * unambiguous room. Without this the image would consume all the
   * vertical space and crush the caption against the bottom edge. */
  max-height: 70%;
  object-fit: contain;
}
.attract-image-caption {
  font-size: clamp(28px, 4.5vw, 64px);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--fg);
  margin-top: clamp(20px, 3vh, 48px);
  max-width: 90%;
  text-align: center;
}

.dev-tools { position: absolute; bottom: 18px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; z-index: 5; }
.dev-tools button { font-size: 14px; padding: 10px 14px; }

/* ---------- forms (register) ---------- */
.form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 30px;
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 16px;
  color: var(--fg-dim);
}
input {
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 22px;
  font-family: inherit;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.form-error {
  background: rgba(213, 69, 69, 0.15);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: #ffb9b9;
}

/* ---------- REGISTER WIZARD (new member) ----------
 * Four-step wizard: name → email → dob → confirm. Each step is a
 * pane that's shown when the parent <section> has the matching
 * data-reg-step attribute. The custom virtual keyboard means iOS
 * never tries to pop its native keyboard — field displays are
 * <div>s with a synthetic blinking caret. */
section[data-screen="register"] { padding: 0; }
.reg-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 24px 22px;
  gap: 14px;
  min-height: 0;
}

/* Progress dots — current step is full accent, completed are dim,
   upcoming are outline. data-reg-step on the section drives this
   via attribute selectors so it's CSS-only. */
.reg-progress {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex: 0 0 auto;
}
.reg-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  transition: background 120ms;
}
section[data-reg-step="name"]    .reg-dot[data-step="name"],
section[data-reg-step="email"]   .reg-dot[data-step="email"],
section[data-reg-step="dob"]     .reg-dot[data-step="dob"],
section[data-reg-step="confirm"] .reg-dot[data-step="confirm"] {
  background: var(--accent);
  border-color: var(--accent);
}
/* Visited (steps before the current one) get a softer dim filled */
section[data-reg-step="email"]   .reg-dot[data-step="name"],
section[data-reg-step="dob"]     .reg-dot[data-step="name"],
section[data-reg-step="dob"]     .reg-dot[data-step="email"],
section[data-reg-step="confirm"] .reg-dot[data-step="name"],
section[data-reg-step="confirm"] .reg-dot[data-step="email"],
section[data-reg-step="confirm"] .reg-dot[data-step="dob"] {
  background: var(--accent);
  opacity: 0.4;
  border-color: transparent;
}

/* Show only the active pane */
.reg-step { display: none; }
section[data-reg-step="name"]    .reg-step[data-reg-step-pane="name"],
section[data-reg-step="email"]   .reg-step[data-reg-step-pane="email"],
section[data-reg-step="dob"]     .reg-step[data-reg-step-pane="dob"],
section[data-reg-step="confirm"] .reg-step[data-reg-step-pane="confirm"] {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 14px;
}

.reg-prompt {
  font-size: 32px;
  font-weight: 700;
  color: var(--fg);
  text-align: center;
  letter-spacing: 0.01em;
  flex: 0 0 auto;
}

/* Field display — replaces <input> entirely. Big caps text with a
   blinking caret. tabular-nums keeps width steady on the email
   step where digits and letters mix. */
.reg-display {
  background: var(--bg-elev);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 24px;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-variant-numeric: tabular-nums;
  word-break: break-all;       /* very long emails wrap rather than overflow */
  flex: 0 0 auto;
}
.reg-display .reg-text {
  white-space: pre-wrap;        /* preserve user's spaces in names */
}
.reg-display .caret {
  display: inline-block;
  width: 4px;
  height: 1em;
  background: var(--accent);
  vertical-align: middle;
  margin-left: 2px;
  animation: caret-blink 1s steps(2, start) infinite;
}
@keyframes caret-blink {
  to { background: transparent; }
}

/* Virtual keyboard. Rows of equal-width keys; specific keys (back,
   space, next) override flex to claim more width. Keys deliberately
   chunky for use at arm's length without precision. */
.vk {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  justify-content: flex-end;
}
.vk-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.vk-row-indent { padding: 0 30px; }    /* A-row indent like a real qwerty */
.vk-row-numbers .vk-key { font-size: 22px; font-weight: 600; }

.vk-key {
  flex: 1 1 0;
  min-width: 0;
  height: 64px;
  font-size: 26px;
  font-weight: 700;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--fg);
  letter-spacing: 0.02em;
}
.vk-key:active { background: var(--bg-elev-2); }
.vk-key[disabled] { opacity: 0.35; }

.vk-back {
  flex: 1.6 1 0;
  font-size: 24px;
}
.vk-space {
  flex: 6 1 0;
  font-size: 18px;
  color: var(--fg-dim);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.vk-next {
  flex: 2.5 1 0;
  font-size: 22px;
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.vk-next[disabled] {
  background: var(--bg-elev);
  color: var(--fg-dim);
  border-color: var(--line);
}
.vk-next:not([disabled]):active { background: var(--accent-press); }
.vk-symbol {
  flex: 1 1 0;
  font-size: 26px;
}
.vk-quick-suffix {
  flex: 1.6 1 0;
  font-size: 18px;
  color: var(--fg-dim);
}

/* Email step — quick-domain pills above the keyboard. One row,
   horizontally scrollable on narrow screens (5 buttons fit at full
   iPad width). */
.vk-quick-domains {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  overflow-x: auto;
}
.vk-quick {
  flex: 1 1 auto;
  white-space: nowrap;
  height: 50px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--fg);
  font-size: 18px;
  font-weight: 600;
  padding: 0 14px;
}
.vk-quick:active { background: var(--accent); color: var(--accent-fg); }

/* DOB step reuses .dob-display and .dob-keypad (defined in
   AGE VERIFY block below). Just sized down a bit so the Next button
   has room without hitting the keyboard. */
.reg-step[data-reg-step-pane="dob"] .dob-display {
  font-size: 80px;
  min-width: 520px;
  align-self: center;
  flex: 0 0 auto;
}
.reg-step[data-reg-step-pane="dob"] .dob-keypad {
  max-width: 460px;
}
.reg-step[data-reg-step-pane="dob"] .dob-keypad .kp-key {
  min-height: 84px;
  font-size: 36px;
  padding: 20px 0;
}

/* Confirm step — three rows of name/email/dob with Edit links per
   row, plus the big primary submit button. */
.reg-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}
.reg-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  align-items: center;
  gap: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.reg-row-label {
  color: var(--fg-dim);
  font-size: 20px;
  letter-spacing: 0.02em;
}
.reg-row-value {
  color: var(--accent);
  font-size: 28px;
  font-weight: 700;
  word-break: break-all;
}
.reg-edit {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 16px;
  font-weight: 600;
}
.reg-edit:active { background: var(--bg-elev-2); }

.reg-next-button {
  flex: 0 0 auto;
}

/* Challenge 25 warning. Inline panel on the confirm step, hidden by
   default; revealed when the customer's DOB makes them 18-24. The
   amber-on-dark scheme matches the rest of the kiosk; the icon is
   a circled exclamation rendered as a CSS pseudo-element. */
.reg-warning {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: rgba(212, 160, 23, 0.10);    /* tint of --accent */
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 22px;
  flex: 0 0 auto;
}
.reg-warning-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 800;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reg-warning-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 18px;
  color: var(--fg-dim);
  line-height: 1.4;
}
.reg-warning-text strong {
  color: var(--fg);
  font-size: 20px;
  font-weight: 700;
}

/* ---------- AGE VERIFY (welcome back, date of birth) ----------
 * (v1.5.268: this comment had lost its opening, which made the browser
 * drop the .verify-stage rule below — the screen sat at the top
 * instead of centred.)
 * No header, no Confirm button — full-bleed stage that fits an
 * iPad landscape viewport (~768px tall, minus ~50px for the iOS
 * system bar / home indicator = ~720px usable). Sizes tuned so the
 * full vertical stack lands comfortably inside ~580px, leaving a
 * generous safety buffer so nothing clips at the top or bottom even
 * with browser chrome or odd viewport quirks. */
.verify-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Generous gap between the four blocks (name, prompt, DOB
   * display, keypad) so the screen fills out properly on a 4:3
   * iPad. Old 14px made everything cluster in the upper-middle
   * and left a big dead zone at the bottom — see WhatsApp shot
   * 2026-05-02 22:18. */
  gap: 28px;
  padding: 28px 32px 44px;
  width: 100%;
  margin: 0;
  min-height: 0;
}
.verify-stage .verify-name {
  font-family: var(--display, 'Handel Gothic'), 'Helvetica Neue', sans-serif;
  font-size: 56px;
  font-weight: 800;
  color: var(--accent);
  /* line-height 1.05 not 1.0 — Handel Gothic has tall ascenders;
     a flat 1.0 line-height clips the very top of capital letters. */
  line-height: 1.05;
  text-align: center;
  letter-spacing: 0.02em;
  margin: 0;
}
/* Prompt text — reads as the active instruction on a screen the
 * customer is actively interacting with, so it needs presence.
 * Old 22px in muted-grey faded into the wallpaper at arm's length
 * on a tablet behind glass. Bumped to 34px and brought up to full
 * foreground colour with a slight weight. */
.verify-stage .verify-prompt {
  font-size: 34px;
  font-weight: 600;
  color: var(--fg);
  text-align: center;
  margin: 0;
}
/* Masked DOB display. Big enough to read at arm's length but
 * restrained enough to leave room for the keypad. */
.dob-display {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 36px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 76px;
  line-height: 1;
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  min-width: 540px;
}
.dob-display .dob-d.filled {
  color: var(--accent);
  min-width: 0.7em;
  text-align: center;
}
.dob-display .dob-d.empty {
  color: var(--fg-dim);
  opacity: 0.4;
  min-width: 0.7em;
  text-align: center;
}
.dob-display .dob-sep {
  color: var(--fg-dim);
  margin: 0 8px;
}
.dob-keypad-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  /* Extra breathing room above the keypad. The verify-stage gap
   * already gives 28px between every pair of children; this adds
   * another 16px so the keypad sits visually lower on the iPad
   * (per operator request — keypad was crowding the DOB display
   * and there was a dead zone below it). */
  margin-top: 16px;
}
.dob-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 580px;
}
.dob-keypad .kp-key {
  font-size: 44px;
  font-weight: 700;
  padding: 30px 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--fg);
  min-height: 96px;
}
.dob-keypad .kp-key:active { background: var(--bg-elev-2); }
.dob-keypad .kp-key.kp-clear,
.dob-keypad .kp-key.kp-back {
  font-size: 24px;
  color: var(--fg-dim);
  font-weight: 600;
}
.dob-keypad .kp-key.kp-back { font-size: 38px; }

/* ---------- DASHBOARD ---------- */
.dashbar {
  padding: 18px 26px;
  align-items: stretch;
  min-height: 110px;
}
.balance { display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.balance-name {
  font-family: var(--display, 'Handel Gothic'), 'Helvetica Neue', sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.03em;
}
.balance-amt {
  font-family: var(--display, 'Handel Gothic'), 'Helvetica Neue', sans-serif;
  font-size: 48px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  letter-spacing: 0.02em;
}
.balance-spend { font-size: 16px; color: var(--fg-dim); }

/* Top up button in the dashbar — the only header CTA now that
   Exit has been retired (card removal ends the session instead).
   Sized big and accent-coloured so it's the obvious primary action. */
.dashbar .bar-actions { gap: 14px; align-items: stretch; }
.dashbar .bar-actions button {
  padding: 0 30px;
  font-size: 22px;
  font-weight: 700;
  min-width: 130px;
  border-radius: 14px;
}
.dashbar .bar-actions button.primary {
  font-size: 26px;
  min-width: 170px;
}

/* Footer hint sitting under the pump grid. Reminds the customer
   that lifting the card from the slot is how they leave — there's
   no longer an Exit button. Subtle on purpose: dim colour, modest
   size, centred. Visible without stealing focus from the pump tiles
   or the Top up button. */
.dash-footer {
  flex: 0 0 auto;
  text-align: center;
  padding: 8px 24px 14px;
  font-size: 18px;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
}

.pump-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 12px;
  padding: 14px;
}
.pump-tile {
  position: relative;
  background-color: var(--bg-elev);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px 10px;
  overflow: hidden;
  min-height: 0;
}
.pump-tile.unavailable { opacity: 0.45; }

/* Circular pump clip — Untappd-on-the-TV style. The image is
   background-cover so it fills the circle, with the corners of the
   original rectangular pump clip cropped off. Most pump-clip designs
   centre their brand artwork so this works visually. White fallback
   means transparent or smaller PNGs don't show through to the dark
   tile background. aspect-ratio: 1 forces a perfect circle regardless
   of width. 85% of tile width gives the clip strong visual presence
   without crowding the name underneath. */
.pump-tile .clip {
  width: 85%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: #fff center / cover no-repeat;
  flex: 0 0 auto;
  box-shadow: 0 2px 10px rgba(0,0,0,0.45);
}
/* Beer assigned but no pump clip uploaded yet — show a dim dashed
   ring so the layout doesn't collapse. Manager can upload later via
   the admin Beers panel. */
.pump-tile .clip.clip-empty {
  background: var(--bg-elev-2, #1c1c20);
  border: 2px dashed var(--line);
  box-shadow: none;
}

.pump-tile .num {
  position: absolute;
  top: 8px; left: 10px;
  background: rgba(0,0,0,0.7);
  color: var(--fg);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 700;
  z-index: 2;
}
.pump-tile .label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
  width: 100%;
  flex: 0 0 auto;
}
/* Name font scales by length so longer names still fit on one line.
   Three buckets set in JS by adding .name-short / .name-medium /
   .name-long; defaults fall through to .name. Bumped up so the
   label has visual weight to match the circle. */
.pump-tile .name {
  font-family: var(--display, 'Handel Gothic'), 'Helvetica Neue', sans-serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--fg);
}
.pump-tile .name.name-short  { font-size: 30px; }    /* ≤ 10 chars */
.pump-tile .name.name-medium { font-size: 24px; }    /* 11–15 */
.pump-tile .name.name-long   { font-size: 19px; }    /* ≥ 16 */
.pump-tile .meta {
  font-size: 18px;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
  font-weight: 600;
}
/* Dietary badge pills — deliberately small so the ABV stays the
 * dominant detail. Colours are muted tints, readable on the dark
 * tile without shouting: AF amber-ish, GF/VG green-ish. */
.diet-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: 2px;
  border: 1px solid transparent;
}
.diet-af { color: #e9b341; border-color: rgba(233, 179, 65, 0.45); background: rgba(233, 179, 65, 0.10); }
.diet-gf { color: #5dc769; border-color: rgba(93, 199, 105, 0.45); background: rgba(93, 199, 105, 0.10); }
.diet-vg { color: #5dc769; border-color: rgba(93, 199, 105, 0.45); background: rgba(93, 199, 105, 0.10); }
.pump-tile .blocked {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--fg-dim);
  background: rgba(13,13,16,0.55);
  text-align: center;
  padding: 6px;
}
.pump-tile.empty {
  background: var(--bg-elev);
}
.pump-tile.empty .name {
  color: var(--fg-dim);
  font-weight: 600;
}

/* ---------- PUMP DETAIL ----------
   Layout designed for iPad in landscape (the wall kiosk's primary
   orientation). The pumpclip is the visual anchor — customers
   recognise the artwork before they read the name — so it gets
   roughly half the screen width and the full body height. The right
   column carries meta + tasting notes (notes below meta). Measure
   buttons live in a fixed strip at the bottom of the screen, OUTSIDE
   the body grid, so customers always know where to tap.

   Portrait orientation stacks them vertically with the clip on top;
   the same content reflows.

   Critical: background-size MUST be 'contain' not 'cover' — pumpclips
   are portrait artwork (typically 2:3) and 'cover' crops the sides
   off, which mangles the brewery branding. 'contain' shows the whole
   clip and letterboxes any unused space inside the box. The bg colour
   matches the surface so the letterbox is invisible. */
/* Circular pump clip on the pump-detail screen — Untappd-style, same
   treatment as the dashboard tiles. The clip column (45% of body
   width) determines the diameter; aspect-ratio: 1/1 forces a square
   that becomes a circle once border-radius: 50% rounds it. White
   background fallback prevents transparent or smaller PNGs showing
   through to the dark surface. align-self: center keeps the circle
   vertically centred when the description column is taller; max-
   width/height stop the circle ballooning if the row is unusually
   tall. background-size: cover crops the rectangular pump-clip art
   to fill the circle — most clips centre their brand artwork so
   this works visually, matching the dashboard tile crop exactly. */
.pump-detail {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 45%) 1fr;
  gap: 24px;
  padding: 20px;
  min-height: 0;       /* let the grid actually shrink to its container */
}
.pd-clip {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff center / cover no-repeat;
  border-radius: 50%;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5);
  align-self: center;
  justify-self: center;
  max-width: 560px;
  max-height: 560px;
  min-height: 0;
}
/* No pump clip uploaded for this beer yet — dim dashed ring so the
   layout still holds. Manager uploads via the admin Beers panel. */
.pd-clip.pd-clip-empty {
  background: var(--bg-elev-2, #1c1c20);
  border: 2px dashed var(--line);
  box-shadow: none;
}
.pd-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}
.pd-meta { color: var(--fg-dim); font-size: 22px; flex: none; letter-spacing: 0.01em; }
.pd-notes {
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 22px 26px;
  font-size: 24px;
  line-height: 1.5;
  flex: 1;             /* fills remaining vertical space in info column */
  min-height: 0;
  overflow: auto;
}
/* Bottom strip of measure buttons. flex: none so it stays its natural
   height regardless of how much vertical space is in the body. */
.pd-prices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px 20px 20px;
  flex: none;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.measure-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 110px;
}
.measure-btn .frac  { font-size: 32px; font-weight: 700; letter-spacing: 0.01em; }
.measure-btn .price { font-size: 26px; font-weight: 600; color: var(--accent); }
.measure-btn:disabled { opacity: 0.35; }

/* ---------- POURING ---------- */
[data-screen="pouring"] {
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(ellipse at center, #1a1a20 0%, #0d0d10 80%);
}
.pour-stage { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.pour-big { font-size: 160px; font-weight: 800; color: var(--accent); line-height: 1; }
.pour-msg { font-size: 26px; }
.pour-pump { font-size: 22px; color: var(--fg-dim); }
/* Cancel button shown during the 5..1 countdown only (kiosk JS hides
   it once the pour starts). Sized for thumb-tap on a wall-mounted
   tablet — not subtle. Customers want to be sure they can back out. */
#pour-abort {
  margin-top: 18px;
  padding: 16px 38px;
  font-size: 22px;
  border-radius: 14px;
  min-width: 200px;
}

/* ---------- IDLE-WARNING / CARD-LEFT / REG-REJECTED / ID-PENDING ----- */
/* All four share the same centred-content layout: a big primary
 * line, a smaller dim subline, and (for the warning) a countdown
 * and a primary button. The .done class survives because both
 * screens reuse it as the inner wrapper — naming inertia, but
 * harmless. */
[data-screen="idle-warning"],
[data-screen="card-left"],
[data-screen="reg-rejected"],
[data-screen="id-pending"],
[data-screen="card-suspended"] {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.done { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.done-big { font-size: 80px; font-weight: 800; color: var(--accent); }
.done-msg { font-size: 24px; color: var(--fg-dim); max-width: 28em; }

/* Under-18 rejection. Bigger gap and emphatic countdown styling so
 * it reads as serious without being doom-y. The amber tone is the
 * accent we already use everywhere else, not red — they didn't do
 * anything wrong, they're just too young. */
/* Under-18 refusal screen.
 *
 * Voice and layout work together to send the customer off smiling
 * rather than embarrassed. The countdown number is the visual hero
 * — the message is "look how exciting your wait is" rather than
 * "you're not allowed in." Eyebrow line up top is the
 * pseudo-conspiratorial open ("Hold your horses, gorgeous"); the
 * days number dominates the middle; closing label sits below in
 * accent type to underline that this is a *future* event, not a
 * refusal.
 */
.rejected {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  max-width: 36em;
  padding: 30px;
  text-align: center;
}
.rejected-eyebrow {
  font-family: var(--display, 'Handel Gothic'), 'Helvetica Neue', sans-serif;
  font-size: 44px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.rejected-msg {
  font-size: 22px;
  color: var(--fg-dim);
  line-height: 1.4;
}
/* Rule line — the formal compliance statement under the sassy
 * description. Visually distinct from the lighthearted .rejected-msg
 * so it reads as a fact, not part of the joke. Slightly smaller,
 * uppercase letter-spaced, accent border underneath to underline
 * (literally) that it's the official rule. */
.rejected-rule {
  font-size: 16px;
  color: var(--fg);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(212, 160, 23, 0.4);
}
.rejected-tip {
  font-size: 18px;
  opacity: 0.6;
  margin-top: 8px;
}
/* Countdown block — the big number plus its rough conversion plus
 * the celebratory label, stacked tight. The block has no border or
 * background so the number reads as raw type rather than a "card";
 * makes it feel impactful rather than fenced-off. */
.rejected-countdown-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 12px 0;
}
.rejected-days-big {
  font-family: var(--display, 'Handel Gothic'), 'Helvetica Neue', sans-serif;
  font-size: 140px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  letter-spacing: 0.01em;
  /* Slight text shadow to give the gold a touch of depth on the
   * dark background — not a glow, just a subtle drop so the giant
   * number reads as embossed rather than stuck on. */
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}
.rejected-days-rough {
  font-size: 22px;
  color: var(--fg-dim);
  font-style: italic;
  letter-spacing: 0.02em;
}
.rejected-days-label {
  font-family: var(--display, 'Handel Gothic'), 'Helvetica Neue', sans-serif;
  font-size: 28px;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* ID check pending — similar layout, calmer tone since they DID
 * register successfully, they just need staff to do the legal bit. */
.idpending {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  max-width: 32em;
  padding: 30px;
}
.idpending-name {
  font-family: var(--display, 'Handel Gothic'), 'Helvetica Neue', sans-serif;
  font-size: 56px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.idpending-big {
  font-size: 42px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.15;
}
.idpending-msg {
  font-size: 22px;
  color: var(--fg-dim);
  line-height: 1.5;
}
.idpending-tip { font-size: 20px; opacity: 0.7; }

/* Acceptable-ID list. Sits between the requirement statement and
 * the "pop over to the bar" line, treated as a poster-style list
 * (clean, indented, gold bullets) rather than running prose so the
 * customer can scan it at a glance.
 *
 * The list is centred but its own contents are left-aligned, giving
 * the visual block a poster-on-the-wall feel without making each
 * line drift away from the same starting x.
 */
.idpending-list {
  list-style: none;
  margin: 0;
  padding: 12px 24px;
  text-align: left;
  font-size: 22px;
  color: var(--fg);
  line-height: 1.5;
}
.idpending-list li {
  position: relative;
  padding-left: 22px;
}
.idpending-list li + li {
  margin-top: 6px;
}
.idpending-list li::before {
  content: "•";
  position: absolute;
  left: 4px;
  top: 0;
  color: var(--accent);
  font-size: 22px;
  line-height: 1.5;
}

/* Challenge 25 policy line — set apart from the conversational tone
 * of everything else as a small italic notice. Reads like a sign on
 * a pub door: a stated policy, not a chat. */
.idpending-policy {
  font-size: 18px;
  color: var(--fg-dim);
  font-style: italic;
  letter-spacing: 0.04em;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  width: 100%;
  text-align: center;
}

/* Suspended — firmer tone than id-pending. We don't accuse, we don't
 * explain why; we just say what staff need them to do. The danger
 * colour (muted red) signals "this is a hard stop" without being
 * shouty. No name display because suspension can apply to anyone
 * tapping the card, not necessarily the registered owner. */
.suspended {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 30em;
  padding: 30px;
}
.suspended-big {
  font-size: 52px;
  font-weight: 800;
  color: var(--danger);
  line-height: 1.1;
}
.suspended-msg {
  font-size: 26px;
  color: var(--fg);
  line-height: 1.4;
}
.suspended-tip {
  font-size: 20px;
  color: var(--fg-dim);
  opacity: 0.7;
}

/* Warning countdown: big bold number, dim label underneath. The
 * number ticks every second from 10 → 0 driven by JS. */
.warning-countdown-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.warning-countdown {
  font-size: 96px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;     /* digits don't reflow as count drops */
  min-width: 1.4em;
  text-align: center;
}
.warning-countdown-label {
  font-size: 16px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- TOPUP ---------- */
.topup-amounts {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  /* Three equal-height rows that fill the remaining vertical space.
   * Without this, align-content packed everything to the top and
   * left ~225px of dead zone at the bottom on iPad landscape. */
  grid-auto-rows: 1fr;
  gap: 14px;
  padding: 22px;
}
/* Amount tiles. Six in a 2x3 grid (5/10/20/50/100/Other).
 *
 * Visual treatment is more substantial than a plain dark tile:
 *   - subtle gold gradient body so they read as "premium" rather
 *     than admin-form
 *   - a soft inner highlight on the top edge for material feel
 *   - a slow sheen sweep — a faint diagonal highlight that drifts
 *     across each tile every ~6s, staggered per tile so the grid
 *     has gentle visual life without synchronised pulsing (which
 *     would feel like a casino)
 *   - press state darkens the gradient briefly so it feels tactile
 *
 * Rejected alternatives: scale/opacity pulse (reads as an alert),
 * box-shadow throb (cheap), faster timing (anxious). The whole
 * effect is meant to hint "alive, premium, stable" and disappear
 * into the background within seconds of the customer focusing on
 * the choice in front of them.
 */
.amt-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  /* Centre the £ amount in whatever height the row track gives us
   * (rows now share the available space via grid-auto-rows: 1fr).
   * On the real kiosk — iPad landscape 1024x768 — each tile renders
   * roughly 488w x 200h, so the min-height floor is just a safety
   * net for narrow/odd viewports rather than the dominant sizing
   * factor. */
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  font-family: var(--display, 'Handel Gothic'), 'Helvetica Neue', sans-serif;
  font-size: 56px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent);
  background:
    linear-gradient(180deg, rgba(212,160,23,0.10) 0%, rgba(212,160,23,0.02) 100%),
    var(--bg-elev);
  border: 1px solid rgba(212,160,23,0.45);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}
.amt-btn:active {
  transform: scale(0.98);
  background:
    linear-gradient(180deg, rgba(212,160,23,0.18) 0%, rgba(212,160,23,0.04) 100%),
    var(--bg-elev-2);
}
/* Top-edge highlight — a 1px line that catches like reflective metal
 * along the upper border. Adds material weight without competing
 * with the sheen below. */
.amt-btn::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(212,160,23,0.55) 50%, transparent 100%);
  pointer-events: none;
}
/* Sheen — a wide diagonal gradient stripe that drifts left-to-right
 * across the tile. Held mostly off-screen by the negative left
 * offset; the keyframes shift it across and back off the right
 * side over 6s. Gradient itself is mostly transparent with a
 * narrow gold band that tapers softly. */
.amt-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(212,160,23,0.18) 50%,
    transparent 65%
  );
  transform: translateX(-100%);
  pointer-events: none;
  animation: amt-sheen 6s ease-in-out infinite;
}
/* Stagger each tile's sheen so the grid never lights up uniformly.
 * nth-child indices align with the JS-rendered order: presets in
 * value order then Other, so the eye sees a soft ripple sweeping
 * across the whole grid rather than every button shimmering at
 * once. */
.amt-btn:nth-child(1)::after { animation-delay: 0s; }
.amt-btn:nth-child(2)::after { animation-delay: 1.0s; }
.amt-btn:nth-child(3)::after { animation-delay: 2.0s; }
.amt-btn:nth-child(4)::after { animation-delay: 3.0s; }
.amt-btn:nth-child(5)::after { animation-delay: 4.0s; }
.amt-btn:nth-child(6)::after { animation-delay: 5.0s; }

@keyframes amt-sheen {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(180%);  }
  100% { transform: translateX(180%);  }
}

/* Accessibility: customers with vestibular sensitivity can switch
 * off motion at the OS level. Honour that by killing the sheen and
 * holding everything still. The static gold gradient is plenty
 * appealing on its own. */
@media (prefers-reduced-motion: reduce) {
  .amt-btn::after { animation: none; display: none; }
}

.topup-pay {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  text-align: center;
}
.pay-amt { font-size: 72px; font-weight: 800; color: var(--accent); }
.pay-msg { font-size: 22px; color: var(--fg-dim); }
.pay-spinner {
  width: 60px; height: 60px;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- KEYPAD (Other amount entry) ----------
   Compact and centred — it's a tool, not the headline. The stage
   centres vertically; max-width keeps keys finger-sized but never
   sprawling on a wide monitor. */
.keypad-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  align-items: stretch;
  justify-content: center;     /* centre vertically */
  max-width: 360px;
  width: 100%;
  margin: 0 auto;
  min-height: 0;
}
.kp-display {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-align: right;
  font-size: 40px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  line-height: 1;
}
.kp-display .kp-currency { color: var(--fg-dim); margin-right: 4px; font-weight: 600; font-size: 30px; }
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.kp-key {
  font-size: 22px;
  font-weight: 700;
  padding: 16px 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--fg);
  min-height: 56px;
}
.kp-key:active { background: var(--bg-elev-2); }
.kp-key.kp-clear,
.kp-key.kp-back { font-size: 15px; color: var(--fg-dim); }
.kp-key.kp-dot { font-size: 28px; }

/* ---------- ERROR ---------- */
[data-screen="error"] {
  align-items: center; justify-content: center; text-align: center;
}
.errbox { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 30px; }
.err-big { font-size: 40px; font-weight: 700; color: var(--danger); }
.err-msg { font-size: 18px; color: var(--fg-dim); max-width: 600px; }

/* ---------- responsive ---------------------------------------------
   Targets:
     1180×820  iPad landscape (kiosk wall — most pubs)         default
      820×1180 iPad portrait                                   stacked
     1024×600  small landscape touch panel                     compact
      <900     unknown narrow displays                         compact

   Approach: design the default for landscape iPad and add narrow
   variants. The pump-detail screen is the most layout-sensitive
   because it must show a full pumpclip without cropping AND a
   tasting-notes block AND four measure buttons.

   In portrait we stack vertically: clip on top (filling most of the
   body), notes below it, buttons at the bottom. That matches how
   you'd hold an iPad in portrait against a wall. */

@media (max-width: 900px) {
  .pump-grid { grid-template-columns: repeat(5, 1fr); }
  .pump-tile .name { font-size: 14px; }
  .pour-big { font-size: 120px; }
  /* On a narrow landscape touch panel keep the side-by-side layout
     but tighten the clip column. */
  .pump-detail {
    grid-template-columns: minmax(200px, 40%) 1fr;
    gap: 14px;
    padding: 14px;
  }
}

@media (orientation: portrait) {
  /* Pump-detail stacks: clip on top filling roughly 2/3 of body,
     info below taking the rest. The clip's background-size: contain
     keeps the whole pumpclip visible regardless of the box shape it
     ends up in. */
  .pump-detail {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 2fr) minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
  }
  .pump-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(5, 1fr); }
}

/* ---------- DEV PANEL (long-press bottom-right or press F2) ---------- */
#dev-trigger {
  position: fixed;
  right: 0; bottom: 0;
  width: 64px; height: 64px;
  z-index: 50;
  /* Invisible to the eye but takes pointer events. Touch-action none so
     the long-press gesture isn't intercepted by browser scrolling. */
  background: transparent;
  touch-action: none;
}
#dev-panel {
  position: fixed; inset: 0;
  z-index: 60;
  background: rgba(0,0,0,0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
#dev-panel[hidden] { display: none; }
.dev-card {
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
}
.dev-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.dev-section { margin-top: 14px; }
.dev-label { font-size: 12px; color: var(--fg-dim); text-transform: uppercase; margin-bottom: 6px; letter-spacing: 0.5px; }
.dev-cards {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.dev-cards .empty { color: var(--fg-dim); font-style: italic; padding: 8px 0; }
.dev-cards button {
  font-size: 13px;
  padding: 8px 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  text-align: left;
}
.dev-cards button code { font-size: 11px; color: var(--fg-dim); margin-left: 6px; }
.dev-row { display: flex; gap: 8px; margin-top: 6px; }
.dev-row input { flex: 1; font-size: 16px; padding: 10px 12px; }
.dev-row button { padding: 10px 14px; font-size: 14px; }
.dev-card .hint { color: var(--fg-dim); font-size: 13px; margin: 4px 0 0; }
.dev-card .hint code { background: var(--bg-elev-2); padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* =====================================================================
 * Unclaimed-balance banner (registration screen).
 * Appears at the top of the register flow when the inserted card has
 * a known balance (legacy or gift). Muted gold panel — celebratory
 * without competing with the form fields below.
 * ===================================================================== */
.unclaimed-banner {
  background: linear-gradient(135deg, rgba(212,160,23,0.12), rgba(212,160,23,0.04));
  border: 1px solid rgba(212,160,23,0.4);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin: 0 auto 18px;
  max-width: 520px;
  text-align: center;
}
.unclaimed-banner-title {
  font-family: var(--display, 'Handel Gothic'), 'Helvetica Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.unclaimed-banner-msg {
  font-size: 18px;
  color: var(--fg);
  line-height: 1.4;
}

/* =====================================================================
 * Path buttons (registration name step).
 * Two-column row that appears below the alpha keyboard. The customer
 * types their name, then commits with one of these:
 *   - "This card is for me" (primary, filled gold, beer icon)
 *   - "This card is a gift" (secondary, outlined gold, gift icon)
 * Both disabled until the name is at least 2 characters.
 * The gift button hides on cards with an existing balance — the
 * "for me" button then stretches across both columns so it doesn't
 * sit alone in a half-width column.
 * ===================================================================== */
.path-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px auto 0;
  max-width: 720px;
}
.path-buttons.gift-hidden {
  grid-template-columns: 1fr;
}
.path-btn-primary,
.path-btn-gift {
  /* Flex layout so the emoji icon sits inline with the label and
   * both centre as a unit. Inline-flex (rather than just flex) keeps
   * the disabled-state opacity behaving naturally. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--display, 'Handel Gothic'), 'Helvetica Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 0.04em;
  padding: 18px 16px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
}
.path-btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border: 2px solid var(--accent);
}
.path-btn-primary:active { background: var(--accent-hover); border-color: var(--accent-hover); }
.path-btn-primary:disabled { opacity: 0.4; cursor: default; }
.path-btn-gift {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.path-btn-gift:active { background: var(--accent); color: var(--accent-fg); }
.path-btn-gift:disabled { opacity: 0.4; cursor: default; }

/* Shared icon size for both path buttons. The emoji glyph sits a
 * touch larger than the text so it reads as a graphical anchor
 * rather than punctuation. */
.path-btn-icon { font-size: 24px; line-height: 1; }

/* =====================================================================
 * Celebrate screen — used by both gift-success (buyer) and
 * claim-celebrate (recipient). Shared so the visual language between
 * "you bought a gift" and "you received a gift" is the same — the
 * only difference is the wording, injected by JS.
 * ===================================================================== */
.celebrate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  max-width: 32em;
  padding: 30px;
  text-align: center;
}
.celebrate-eyebrow {
  font-family: var(--display, 'Handel Gothic'), 'Helvetica Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
}
.celebrate-big {
  font-family: var(--display, 'Handel Gothic'), 'Helvetica Neue', sans-serif;
  font-size: 56px;
  letter-spacing: 0.02em;
  color: var(--fg);
  line-height: 1.1;
}
.celebrate-amt {
  font-family: var(--display, 'Handel Gothic'), 'Helvetica Neue', sans-serif;
  font-size: 72px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.celebrate-msg {
  font-size: 22px;
  color: var(--fg-dim);
  line-height: 1.5;
  max-width: 24em;
}

/* =====================================================================
   LICENSING-HOURS CLOSED OVERLAY
   ===================================================================== */
#kiosk-closed-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(ellipse at center, #1a1410 0%, #050505 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f0e3c8;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

#kiosk-closed-overlay[hidden] { display: none; }

#kiosk-closed-overlay .kco-card {
  text-align: center;
  max-width: 600px;
  padding: 0 32px;
}

#kiosk-closed-overlay .kco-icon {
  font-size: 96px;
  margin-bottom: 24px;
  opacity: 0.6;
}

#kiosk-closed-overlay .kco-title {
  font-family: 'Handel Gothic', serif;
  font-size: 64px;
  font-weight: 700;
  letter-spacing: 6px;
  margin: 0 0 32px;
  color: #d4a017;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

#kiosk-closed-overlay .kco-message {
  font-size: 32px;
  font-weight: 600;
  margin: 0 0 16px;
  color: #f5e8d0;
}

#kiosk-closed-overlay .kco-sub {
  font-size: 18px;
  line-height: 1.5;
  color: #a89880;
  margin: 0;
}

/* Belt-and-braces: ensure NOTHING under the overlay can be tapped. The
   overlay itself catches pointer events; this class on body suppresses
   the rest of the kiosk visually as well as functionally. */
body.kiosk-closed > #app { pointer-events: none; filter: blur(4px); }

/* Wall screen: no mouse pointer (kiosk.js, ?nocursor=1). */
html.nocursor, html.nocursor * { cursor: none !important; }

/* Beer page (v1.5.266): the dashboard header on top, the beer's name
   below it, no ×. */
.pd-beerbar { padding-top: 10px; padding-bottom: 10px; }
.pd-beerbar #pd-allbeers { font-size: 20px; font-weight: 600; padding: 10px 18px; border-radius: 12px; }

/* =====================================================================
   TABLET POLISH (v1.5.268)
   The kiosk runs on iPads / similar tablets in landscape, 1024×768 up
   to 1366×1024. Everything below sizes from the viewport height so a
   screen fits the shortest of them without scrolling or overlapping,
   and grows on the bigger ones. Rules here deliberately come last and
   override the older fixed pixel sizes above.
   ===================================================================== */

/* ---------- header: name, balance, Top up ---------- */
.dashbar {
  padding: clamp(10px, 1.8vh, 18px) clamp(18px, 2.4vw, 32px);
  min-height: 0;
  align-items: center;
  gap: 24px;
}
.dashbar .balance { gap: 2px; }
.balance-name { font-size: clamp(20px, 3.2vh, 30px); }
.balance-amt  { font-size: clamp(34px, 6vh, 52px); }
.balance-spend { font-size: clamp(13px, 1.8vh, 16px); }
.dashbar .bar-actions button,
.dashbar .bar-actions button.primary {
  min-height: clamp(64px, 10vh, 92px);
  min-width: clamp(150px, 16vw, 200px);
  font-size: clamp(22px, 3.2vh, 28px);
  border-radius: 16px;
}

/* ---------- beer page ---------- */
.pd-beerbar { display: none; }        /* name now sits beside the clip */
.pump-detail {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(20px, 3vw, 44px);
  padding: clamp(16px, 2.6vh, 28px) clamp(20px, 3vw, 40px);
  align-items: center;
}
.pd-clip {
  height: 100%;
  width: auto;
  max-height: min(100%, 46vw);
  max-width: 46vw;
  aspect-ratio: 1 / 1;
  align-self: center;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.6), 0 0 0 4px rgba(212, 160, 23, 0.25);
}
.pd-info {
  gap: clamp(8px, 1.6vh, 16px);
  justify-content: center;
  height: 100%;
  min-width: 0;
}
.pd-top { display: flex; align-items: flex-start; gap: 16px; }
.pd-name {
  flex: 1;
  font-family: var(--display, 'Handel Gothic'), 'Helvetica Neue', sans-serif;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: var(--fg);
  overflow-wrap: anywhere;
}
.pd-name.name-l { font-size: clamp(44px, 8.4vh, 84px); }
.pd-name.name-m { font-size: clamp(36px, 6.6vh, 64px); }
.pd-name.name-s { font-size: clamp(28px, 5vh, 48px); }
.pd-allbeers { flex: none; font-size: 20px; padding: 12px 18px; border-radius: 12px; }
.pd-meta { font-size: clamp(18px, 2.8vh, 26px); color: var(--fg-dim); line-height: 1.3; }
.pd-pills, .ab-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  display: inline-flex; align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: clamp(14px, 2vh, 18px);
  font-weight: 600;
  color: var(--fg);
  background: var(--bg-elev);
}
.pill-abv { background: var(--accent); border-color: var(--accent); color: var(--accent-fg, #1a1a1a); }
.pd-notes {
  flex: 0 1 auto;
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: clamp(17px, 2.6vh, 24px);
  line-height: 1.45;
  color: var(--fg);
  opacity: 0.9;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}
.pd-prices { gap: clamp(10px, 1.4vw, 16px); padding: clamp(12px, 2vh, 20px) clamp(20px, 3vw, 40px); }
.measure-btn {
  min-height: clamp(84px, 14vh, 128px);
  padding: 10px;
  gap: 4px;
  border-radius: 18px;
}
.measure-btn .frac  { font-size: clamp(24px, 4vh, 36px); }
.measure-btn .price { font-size: clamp(20px, 3.2vh, 30px); }
.measure-btn:active { background: var(--bg-elev-2); border-color: var(--accent); }

/* ---------- welcome back: date of birth ---------- */
.verify-stage { gap: clamp(10px, 2vh, 24px); padding: clamp(14px, 3vh, 36px) 32px; }
.verify-stage .verify-name { font-size: clamp(34px, 6.2vh, 60px); line-height: 1.12; }
.verify-stage .verify-prompt { font-size: clamp(20px, 3.4vh, 32px); }
.dob-display { font-size: clamp(44px, 8vh, 76px); padding: clamp(8px, 1.6vh, 18px) 36px; min-width: min(540px, 80vw); }
.dob-keypad-wrap { margin-top: 0; }
.dob-keypad { gap: clamp(8px, 1.4vh, 14px); max-width: min(560px, 60vw); }
.dob-keypad .kp-key {
  min-height: clamp(62px, 11vh, 104px);
  padding: 0;
  font-size: clamp(30px, 5vh, 44px);
}
.dob-keypad .kp-key.kp-clear { font-size: clamp(18px, 2.8vh, 24px); }
.dob-keypad .kp-key.kp-back  { font-size: clamp(26px, 4.4vh, 38px); }

/* ---------- pouring: the glass ---------- */
[data-screen="pouring"] { background: radial-gradient(ellipse at 30% 50%, #22201a 0%, #0d0d10 75%); }
.pour-stage {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(32px, 6vw, 96px);
  padding: 4vh 5vw;
  width: 100%;
  height: 100%;
}
.pour-glass { position: relative; height: min(72vh, 620px); aspect-ratio: 200 / 300; flex: none; }
.glass-svg { width: 100%; height: 100%; overflow: visible; }
.glass-outline { fill: none; stroke: rgba(245, 240, 232, 0.75); stroke-width: 4; stroke-linejoin: round; }
.pour-liquid { transition: transform 0.7s ease-out, opacity 0.3s; }
.target-line { stroke: rgba(245, 240, 232, 0.35); stroke-width: 2; stroke-dasharray: 8 6; }
.bub { fill: rgba(255, 244, 214, 0.55); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .flowing .bub { animation: bubble 2.4s linear infinite; }
  .flowing .b2 { animation-delay: 0.5s; animation-duration: 2s; }
  .flowing .b3 { animation-delay: 1.1s; animation-duration: 2.8s; }
  .flowing .b4 { animation-delay: 1.6s; animation-duration: 2.2s; }
  .flowing .b5 { animation-delay: 0.8s; animation-duration: 2.6s; }
  .waiting .pour-big { animation: pulse 1.8s ease-in-out infinite; }
  .waiting .pour-glass { animation: nudge 1.8s ease-in-out infinite; }
  .done .pour-big { animation: pop 0.5s ease-out; }
}
@keyframes bubble {
  0%   { transform: translateY(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-280px); opacity: 0; }
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pop { 0% { transform: scale(0.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.pour-count {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display, 'Handel Gothic'), sans-serif;
  font-size: min(28vh, 240px); font-weight: 800;
  color: var(--accent);
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
}
.pour-count[hidden] { display: none; }
.pour-words { display: flex; flex-direction: column; gap: clamp(10px, 2vh, 20px); max-width: 48vw; text-align: left; }
.pour-big {
  font-family: var(--display, 'Handel Gothic'), sans-serif;
  font-size: clamp(44px, 8.6vh, 92px);
  line-height: 1.05;
  color: var(--accent);
}
.pour-msg { font-size: clamp(20px, 3.4vh, 32px); color: var(--fg); line-height: 1.3; }
.pour-pump { font-size: clamp(17px, 2.6vh, 24px); color: var(--fg-dim); }
.pour-pct {
  font-family: var(--display, 'Handel Gothic'), sans-serif;
  font-size: clamp(30px, 5.4vh, 56px);
  color: var(--fg);
  min-height: 1.1em;
}
.pour-actions { display: flex; gap: 16px; margin-top: clamp(4px, 1.4vh, 16px); }
.pour-actions button[hidden] { display: none; }
#pour-abort, #pour-finish {
  margin: 0;
  min-height: clamp(64px, 10vh, 92px);
  min-width: 240px;
  padding: 0 40px;
  font-size: clamp(22px, 3.4vh, 30px);
  border-radius: 16px;
}

/* ---------- idle: the beers on the bar ---------- */
.attract-beer {
  flex-direction: row;
  gap: clamp(32px, 5vw, 80px);
  padding: 6vh 6vw 22vh;
  text-align: left;
  transform: translateX(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.attract-beer.active { transform: none; }
.ab-clip {
  flex: none;
  width: min(58vh, 40vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: #fff center / cover no-repeat;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65), 0 0 0 6px rgba(212, 160, 23, 0.3);
}
.ab-clip-empty { background: var(--bg-elev-2); border: 3px dashed var(--line); box-shadow: none; }
@media (prefers-reduced-motion: no-preference) {
  .attract-beer.active .ab-clip { animation: drift 10s ease-in-out infinite; }
}
@keyframes drift { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-10px) rotate(1.5deg); } }
.ab-info { display: flex; flex-direction: column; gap: clamp(8px, 1.8vh, 18px); max-width: 48vw; min-width: 0; }
.ab-eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 700;
  font-size: clamp(14px, 2vh, 20px);
}
.ab-name {
  font-family: var(--display, 'Handel Gothic'), sans-serif;
  line-height: 1.04;
  letter-spacing: 0.02em;
  color: var(--fg);
  overflow-wrap: anywhere;
}
.ab-name.name-l { font-size: clamp(52px, 10vh, 112px); }
.ab-name.name-m { font-size: clamp(40px, 7.6vh, 84px); }
.ab-name.name-s { font-size: clamp(30px, 5.6vh, 60px); }
.ab-meta { font-size: clamp(18px, 3vh, 30px); color: var(--fg-dim); }
.ab-notes {
  font-size: clamp(16px, 2.6vh, 24px);
  line-height: 1.45;
  color: var(--fg);
  opacity: 0.85;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ab-prices { display: flex; flex-wrap: wrap; gap: clamp(8px, 1.2vw, 14px); margin-top: 4px; }
.ab-price {
  display: flex; flex-direction: column; align-items: center;
  min-width: clamp(84px, 9vw, 120px);
  padding: 10px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.ab-price .frac { font-size: clamp(16px, 2.4vh, 22px); font-weight: 700; color: var(--fg); }
.ab-price .amt  { font-size: clamp(18px, 2.8vh, 26px); font-weight: 700; color: var(--accent); }

/* The band along the bottom of every slide once beers are on. */
.attract-cta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 18vh;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3vw, 40px);
  background: linear-gradient(180deg, rgba(13, 13, 16, 0) 0%, rgba(13, 13, 16, 0.92) 35%);
  pointer-events: none;
}
.attract-cta[hidden] { display: none; }
.cta-words { text-align: left; }
.cta-main {
  font-family: var(--display, 'Handel Gothic'), sans-serif;
  font-size: clamp(26px, 4.6vh, 48px);
  color: var(--fg);
}
.cta-sub { font-size: clamp(14px, 2vh, 20px); color: var(--fg-dim); margin-top: 4px; }
.cta-card { position: relative; width: clamp(64px, 9vh, 92px); height: clamp(64px, 9vh, 92px); flex: none; }
.cta-slot {
  position: absolute; left: 6%; right: 6%; top: 8%; height: 14%;
  border-radius: 6px; background: var(--bg-elev-2); border: 2px solid var(--line);
}
.cta-chip {
  position: absolute; left: 18%; right: 18%; top: 22%; height: 70%;
  border-radius: 8px; background: var(--accent);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}
@media (prefers-reduced-motion: no-preference) {
  .cta-chip { animation: insert 2.6s ease-in-out infinite; }
}
@keyframes insert {
  0%, 15%  { transform: translateY(30%); opacity: 0; }
  35%      { transform: translateY(0); opacity: 1; }
  70%      { transform: translateY(-12%); opacity: 1; }
  100%     { transform: translateY(-12%); opacity: 0; }
}
/* Brand artwork slide: the band carries the call to action. */
.has-beers .attract-image { padding-bottom: 20vh; }
.has-beers .attract-image-caption { display: none; }
.has-beers .attract-image img { max-height: 100%; }
/* The plain prompt slide's text was too dim on the dark background. */
.attract-prompt .prompt { color: var(--fg); }
.attract-prompt .hint { color: var(--fg-dim); }
.attract-off { display: none !important; }

/* The beer page is the home screen with one pump: say how to leave. */
.hdr-hint { flex: 1; text-align: center; color: var(--fg-dim); font-size: clamp(14px, 2vh, 18px); align-self: center; }

/* Pump grid (v1.5.268): only the slots in use; empty ones are quiet. */
.pump-grid { gap: clamp(10px, 1.6vh, 16px); padding: clamp(12px, 2vh, 20px); }
.pump-tile { border-radius: 18px; }
.pump-tile .clip { width: min(85%, calc((100vh - 230px) / var(--rows, 2) * 0.62)); height: auto; aspect-ratio: 1 / 1; }
.pump-tile.empty { opacity: 0.35; }
.pump-tile.empty .name { font-size: 18px; font-family: inherit; }
.pump-tile .blocked {
  inset: auto 0 0 0;
  padding: 10px;
  font-size: clamp(14px, 2vh, 18px);
  font-weight: 600;
  color: var(--fg);
  background: rgba(13, 13, 16, 0.85);
}
.pump-grid[data-slots="1"] .pump-tile .name,
.pump-grid[data-slots="2"] .pump-tile .name,
.pump-grid[data-slots="3"] .pump-tile .name { font-size: clamp(26px, 4.4vh, 40px); }
.pump-grid[data-slots="1"] .pump-tile .meta,
.pump-grid[data-slots="2"] .pump-tile .meta,
.pump-grid[data-slots="3"] .pump-tile .meta { font-size: clamp(18px, 2.8vh, 24px); }
.dash-footer { padding-bottom: clamp(8px, 1.6vh, 16px); }

/* Top-up keypad, error, register path buttons: tablet sizes. */
.kp-display { font-size: clamp(40px, 7vh, 64px); }
.keypad { max-width: min(520px, 50vw); gap: clamp(8px, 1.4vh, 14px); }
.keypad .kp-key { min-height: clamp(60px, 10vh, 92px); font-size: clamp(26px, 4.4vh, 38px); }
[data-screen="error"] h2, [data-screen="error"] .err-title { font-size: clamp(32px, 5.6vh, 52px); }
#err-msg { font-size: clamp(20px, 3.2vh, 28px); max-width: 70vw; text-align: center; line-height: 1.4; }
#err-back { min-height: clamp(60px, 9vh, 84px); min-width: 220px; font-size: clamp(22px, 3.2vh, 28px); border-radius: 16px; margin-top: 12px; }
.path-buttons button { white-space: nowrap; }
.err-big { font-size: clamp(32px, 5.6vh, 52px); }
.keypad-stage { gap: clamp(10px, 1.8vh, 18px); }
#kp-confirm, #gift-kp-confirm { width: min(520px, 50vw); min-height: clamp(60px, 9vh, 84px); font-size: clamp(22px, 3.2vh, 28px); border-radius: 16px; }
.keypad-stage .keypad, .keypad-stage .kp-display { width: min(520px, 50vw); max-width: none; }
.path-buttons { width: min(720px, 92%); }

/* Finished pour (v1.5.270): balance left, then the take-your-card
   reminder with the insert animation running backwards. */
.pour-left { display: flex; align-items: baseline; gap: 14px; font-size: clamp(18px, 2.8vh, 26px); color: var(--fg-dim); }
.pour-left[hidden] { display: none; }
.pour-left strong { font-family: var(--display, 'Handel Gothic'), sans-serif; font-size: clamp(32px, 5.6vh, 54px); color: var(--fg); font-weight: 400; }
.pour-card {
  display: flex; align-items: center; gap: clamp(16px, 2vw, 26px);
  margin-top: clamp(8px, 2vh, 20px);
  padding: clamp(14px, 2.4vh, 22px) clamp(18px, 2.2vw, 28px);
  border: 2px solid var(--accent);
  border-radius: 18px;
  background: rgba(212, 160, 23, 0.08);
  font-size: clamp(20px, 3.2vh, 30px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--fg);
}
.pour-card .cta-card { width: clamp(70px, 11vh, 104px); height: clamp(70px, 11vh, 104px); }
@media (prefers-reduced-motion: no-preference) {
  .cta-card.out .cta-chip { animation: takeout 2.4s ease-in-out infinite; }
}
@keyframes takeout {
  0%, 10% { transform: translateY(0); opacity: 1; }
  55%     { transform: translateY(-75%); opacity: 1; }
  80%     { transform: translateY(-75%); opacity: 0; }
  100%    { transform: translateY(0); opacity: 0; }
}
.pour-card[hidden] { display: none; }
.done .pour-pct:empty { display: none; }

/* ---------- LOW BALANCE (v1.5.270) ---------- */
[data-screen="low-balance"] { background: radial-gradient(ellipse at 30% 50%, #22201a 0%, #0d0d10 75%); }
.lowbal { display: flex; align-items: center; justify-content: center; gap: clamp(32px, 6vw, 96px); width: 100%; height: 100%; padding: 5vh 6vw; }
.lowbal-glass { height: min(58vh, 500px); aspect-ratio: 200 / 300; flex: none; }
.lowbal-glass svg { width: 100%; height: 100%; overflow: visible; }
@media (prefers-reduced-motion: no-preference) {
  .lowbal-glass { animation: wobble 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
}
@keyframes wobble { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.lowbal-words { display: flex; flex-direction: column; gap: clamp(10px, 2vh, 18px); max-width: 52vw; }
.lowbal-eyebrow { color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.2em; font-weight: 700; font-size: clamp(14px, 2vh, 18px); }
.lowbal-amt { font-family: var(--display, 'Handel Gothic'), sans-serif; font-size: clamp(56px, 11vh, 110px); line-height: 1; color: var(--accent); }
.lowbal-title { font-family: var(--display, 'Handel Gothic'), sans-serif; font-size: clamp(32px, 6vh, 60px); line-height: 1.08; color: var(--fg); }
.lowbal-msg { font-size: clamp(19px, 3vh, 28px); line-height: 1.4; color: var(--fg); opacity: 0.9; }
.lowbal-actions { display: flex; gap: 16px; margin-top: clamp(6px, 2vh, 20px); flex-wrap: wrap; }
.lowbal-actions button { min-height: clamp(64px, 10vh, 92px); min-width: 220px; padding: 0 36px; font-size: clamp(22px, 3.4vh, 30px); border-radius: 16px; }

/* =====================================================================
   READABILITY (v1.5.270): nothing a customer reads is under ~18px on
   the smallest tablet; the secondary lines step up with it.
   ===================================================================== */
.balance-name  { font-size: clamp(24px, 3.8vh, 34px); }
.balance-spend { font-size: clamp(17px, 2.4vh, 22px); }
.hdr-hint      { font-size: clamp(18px, 2.6vh, 24px); }
.pd-meta       { font-size: clamp(21px, 3.2vh, 30px); }
.pill          { font-size: clamp(17px, 2.5vh, 22px); padding: 7px 16px; }
.pd-notes      { font-size: clamp(20px, 3vh, 28px); }
.measure-btn .frac  { font-size: clamp(28px, 4.6vh, 40px); }
.measure-btn .price { font-size: clamp(24px, 3.8vh, 34px); }
.dash-footer   { font-size: clamp(18px, 2.6vh, 24px); }
.pump-tile .meta { font-size: clamp(18px, 2.6vh, 24px); }
.ab-eyebrow    { font-size: clamp(17px, 2.4vh, 24px); }
.ab-meta       { font-size: clamp(21px, 3.4vh, 34px); }
.ab-notes      { font-size: clamp(19px, 3vh, 28px); }
.ab-price .frac { font-size: clamp(19px, 2.8vh, 26px); }
.ab-price .amt  { font-size: clamp(22px, 3.4vh, 32px); }
.cta-main      { font-size: clamp(30px, 5.2vh, 54px); }
.cta-sub       { font-size: clamp(18px, 2.6vh, 24px); }
.pour-msg      { font-size: clamp(23px, 3.8vh, 36px); }
.pour-pump     { font-size: clamp(20px, 3vh, 28px); }
.pour-left     { font-size: clamp(20px, 3vh, 28px); }
.lowbal-eyebrow { font-size: clamp(17px, 2.4vh, 22px); }
.lowbal-msg    { font-size: clamp(21px, 3.4vh, 32px); }
.verify-stage .verify-prompt { font-size: clamp(24px, 3.8vh, 36px); }
.bar-eyebrow   { font-size: clamp(18px, 2.6vh, 22px); }
.attract-prompt .hint { font-size: clamp(20px, 2.8vh, 30px); }
.warning-countdown-label, .rejected-tip, .idpending-policy, .suspended-tip { font-size: clamp(18px, 2.6vh, 24px); }

/* Take-your-card animation (v1.5.270): the member card rising out of
   the reader's slot, an arrow pointing the way — the insert animation
   on the attract screen, run backwards. */
.takecard { position: relative; flex: none; width: clamp(120px, 17vh, 160px); height: clamp(120px, 17vh, 160px); }
.tc-window { position: absolute; left: 8%; right: 8%; top: 20%; bottom: 22%; overflow: hidden; }
.tc-card {
  position: absolute; left: 10%; right: 10%; bottom: 0; height: 78%;
  border-radius: 10px;
  background: var(--accent);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  transform: translateY(85%);
}
.tc-chip { position: absolute; left: 14%; top: 18%; width: 26%; height: 24%; border-radius: 4px; background: rgba(0, 0, 0, 0.35); }
.tc-stripe { position: absolute; left: 14%; right: 14%; bottom: 18%; height: 8%; border-radius: 3px; background: rgba(0, 0, 0, 0.25); }
.tc-slot {
  position: absolute; left: 4%; right: 4%; bottom: 14%; height: 10%;
  border-radius: 8px; background: #050505; border: 2px solid var(--line);
}
.tc-arrow {
  position: absolute; left: 50%; top: 2%; width: 20%; aspect-ratio: 1;
  border-left: 5px solid var(--accent); border-top: 5px solid var(--accent);
  border-radius: 3px; opacity: 0;
  transform: translateX(-50%) rotate(45deg);
}
@media (prefers-reduced-motion: no-preference) {
  .tc-card { animation: tcOut 2.6s cubic-bezier(.4, 0, .2, 1) infinite; }
  .tc-arrow { animation: tcArrow 2.6s ease-in-out infinite; }
}
@media (prefers-reduced-motion: reduce) { .tc-card { transform: translateY(10%); } .tc-arrow { opacity: 1; } }
@keyframes tcOut {
  0%, 12%  { transform: translateY(85%); }
  55%, 82% { transform: translateY(0); }
  100%     { transform: translateY(85%); }
}
@keyframes tcArrow {
  0%, 30%  { opacity: 0; translate: 0 10px; }
  55%, 80% { opacity: 1; translate: 0 -6px; }
  100%     { opacity: 0; translate: 0 -6px; }
}
.pour-card { font-size: clamp(22px, 3.6vh, 34px); }

/* v1.5.272: the card comes OUT TOWARDS the customer — it slides out of
   the slot and grows as it comes off the screen at them, arrow pointing
   down/out. Overrides the upward version above. */
.takecard { perspective: 420px; }
.tc-window { top: 0; bottom: 22%; overflow: visible; }
.tc-card {
  bottom: 8%; height: 70%;
  transform-origin: 50% 100%;
  transform: translateY(40%) scale(0.55) rotateX(55deg);
  opacity: 0;
}
.tc-arrow {
  left: 50%; top: auto; bottom: -14%;
  transform: translateX(-50%) rotate(225deg);
}
@media (prefers-reduced-motion: no-preference) {
  .tc-card { animation: tcToward 2.6s cubic-bezier(.3, 0, .2, 1) infinite; }
  .tc-arrow { animation: tcArrowDown 2.6s ease-in-out infinite; }
}
@media (prefers-reduced-motion: reduce) { .tc-card { transform: none; opacity: 1; } }
@keyframes tcToward {
  0%, 10%  { transform: translateY(40%) scale(0.55) rotateX(55deg); opacity: 0; }
  20%      { opacity: 1; }
  60%, 80% { transform: translateY(18%) scale(1.25) rotateX(0deg); opacity: 1; }
  100%     { transform: translateY(24%) scale(1.35) rotateX(0deg); opacity: 0; }
}
@keyframes tcArrowDown {
  0%, 35%  { opacity: 0; translate: 0 -8px; }
  60%, 85% { opacity: 1; translate: 0 6px; }
  100%     { opacity: 0; translate: 0 6px; }
}
.pour-card { padding-bottom: clamp(22px, 3.6vh, 34px); }

/* ---------- EASTER EGG (v1.5.274) ---------- */
#egg { position: fixed; inset: 0; z-index: 9000; background: #000; }
#egg[hidden], #credits[hidden] { display: none; }
#egg iframe { width: 100%; height: 100%; border: 0; display: block; }
#credits {
  position: fixed; inset: 0; z-index: 9001; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #241d10 0%, #050505 75%);
  display: flex; justify-content: center;
}
.credits-roll { position: absolute; top: 100%; text-align: center; display: flex; flex-direction: column; gap: 1.4vh; }
#credits.rolling .credits-roll { animation: roll 8.5s linear forwards; }
@keyframes roll { 0% { transform: translateY(0); } 70% { transform: translateY(calc(-50vh - 50%)); } 100% { transform: translateY(calc(-50vh - 50%)); } }
@media (prefers-reduced-motion: reduce) { #credits.rolling .credits-roll { animation: none; top: 50%; transform: translateY(-50%); } }
.cr-small { color: var(--fg-dim); font-size: clamp(20px, 3vh, 28px); text-transform: uppercase; letter-spacing: 0.25em; }
.cr-title { font-family: var(--display, 'Handel Gothic'), sans-serif; font-size: clamp(48px, 9vh, 96px); color: var(--accent); line-height: 1.05; margin-bottom: 3vh; }
.cr-name { font-family: var(--display, 'Handel Gothic'), sans-serif; font-size: clamp(34px, 6vh, 64px); color: var(--fg); }
.cr-url { font-size: clamp(26px, 4.4vh, 44px); color: var(--accent); font-weight: 700; letter-spacing: 0.04em; margin-top: 1vh; }
.cr-gap { height: 5vh; }

/* v1.5.275 — fit the real iPad. In a home-screen web app with a solid
   status bar the page is shorter than the screen, but 100vh is still
   the whole screen, so the bottom row fell off. Size to the visible
   area instead (dvh, with the old value as the fallback). */
#app { height: 100vh; height: 100dvh; }
.pump-detail { padding-top: clamp(10px, 2dvh, 24px); padding-bottom: clamp(10px, 2dvh, 24px); }
.measure-btn { min-height: clamp(76px, 12dvh, 120px); }
.pd-clip { max-height: min(100%, 44vw); }
/* Attract: all the prices on one row, and clear of the bottom band. */
.attract-beer { padding: 5dvh 5vw 21dvh; }
.ab-clip { width: min(52dvh, 38vw); }
.ab-info { max-width: 52vw; }
.ab-prices { flex-wrap: nowrap; }
.ab-price { flex: 1 1 0; min-width: 0; padding: 8px 10px; }
.attract-cta { height: 17dvh; }
/* Cancel sits quietly beside the pour, not shouting for a tap. */
#pour-finish { border-color: var(--line); color: var(--fg); }

/* v1.5.275: take-your-card = the attract screen's insert animation,
   exactly, played backwards — the card slides back out of the slot. */
.pour-card .cta-card { width: clamp(80px, 12vh, 112px); height: clamp(80px, 12vh, 112px); }
@media (prefers-reduced-motion: no-preference) {
  .cta-card.out .cta-chip { animation: insert 2.6s ease-in-out infinite reverse; }
}

/* Tap handle on the pour screen (v1.5.276): pulled forward and back
   while they pour; gone once it's finished. */
.pour-tap { width: clamp(90px, 15vh, 140px); height: auto; overflow: visible; }
.done .pour-tap { display: none; }
.tap-body { fill: #3a3a3e; stroke: rgba(245, 240, 232, 0.6); stroke-width: 2; }
.tap-handle { fill: var(--accent); }
.tap-pivot { fill: #222; stroke: rgba(245, 240, 232, 0.6); stroke-width: 2; }
.tap-lever { transform-origin: 80px 76px; transform-box: view-box; }
.tap-drip { fill: #e0a02a; }
@media (prefers-reduced-motion: no-preference) {
  .waiting .tap-lever, .flowing .tap-lever { animation: pull 1.6s ease-in-out infinite; }
  .flowing .tap-drip { animation: drip 0.8s linear infinite; }
}
@keyframes pull { 0%, 100% { transform: rotate(0deg); } 45%, 60% { transform: rotate(-38deg); } }
@keyframes drip { 0% { height: 0; opacity: 1; } 70% { height: 22px; opacity: 1; } 100% { height: 22px; opacity: 0; } }
.pour-tap { width: clamp(130px, 22vh, 190px); }

/* v1.5.277: arrows, so it can't be misread — UP on the card going in
   (attract screen), DOWN on the card coming out (finished pour). */
.cta-card::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 26%;
  aspect-ratio: 1;
  border-left: 5px solid var(--accent);
  border-top: 5px solid var(--accent);
  border-radius: 3px;
  bottom: -30%;
  transform: translateX(-50%) rotate(45deg);           /* points up */
}
.cta-card.out::after { transform: translateX(-50%) rotate(225deg); bottom: -34%; }   /* points down */
.attract-cta .cta-card { margin-bottom: 3vh; }
.pour-card .cta-card { margin-bottom: clamp(18px, 3vh, 30px); }
@media (prefers-reduced-motion: no-preference) {
  .cta-card::after { animation: arrowUp 1.3s ease-in-out infinite; }
  .cta-card.out::after { animation: arrowDown 1.3s ease-in-out infinite; }
}
@keyframes arrowUp   { 0%, 100% { translate: 0 6px; opacity: 0.45; } 50% { translate: 0 -6px; opacity: 1; } }
@keyframes arrowDown { 0%, 100% { translate: 0 -6px; opacity: 0.45; } 50% { translate: 0 6px; opacity: 1; } }

/* v1.5.278: the two taps, side on. Keg tap: lever comes 90° forward
   (clockwise, towards the customer). Hand pull: swings from upright to
   60° clockwise and back. Only the one for this pump is shown. */
.pour-tap { width: clamp(140px, 24vh, 200px); }
.tap-hp { display: none; }
.handpull .tap-hp { display: block; }
.handpull .tap-keg { display: none; }
.done .pour-tap { display: none !important; }
.tap-shaft { fill: #b9b2a6; }
.tap-clipline { fill: rgba(0, 0, 0, 0.3); }
.tap-swan { stroke: #b9b2a6; stroke-width: 8; stroke-linecap: round; }
.lever-keg { transform-origin: 119px 80px; }
.lever-hp  { transform-origin: 100px 174px; }
.tap-lever { transform-box: view-box; animation: none; }
@media (prefers-reduced-motion: no-preference) {
  .waiting .lever-keg, .flowing .lever-keg { animation: kegPull 2s ease-in-out infinite; }
  .waiting .lever-hp,  .flowing .lever-hp  { animation: hpPull 1.8s ease-in-out infinite; }
}
@keyframes kegPull { 0%, 12% { transform: rotate(0deg); } 40%, 72% { transform: rotate(90deg); } 100% { transform: rotate(0deg); } }
@keyframes hpPull  { 0%, 8% { transform: rotate(0deg); } 50% { transform: rotate(60deg); } 92%, 100% { transform: rotate(0deg); } }

/* v1.5.279: drawn from the real things — a Nukatap and a classic hand
   pull — side on. */
.nk-black  { fill: #151515; stroke: rgba(245, 240, 232, 0.55); stroke-width: 2; }
.nk-chrome { fill: #c9c6c0; stroke: #f5f0e8; stroke-width: 1.5; }
.nk-knurl  { fill: #a9a59e; stroke: #f5f0e8; stroke-width: 1.5; stroke-dasharray: 2 2; }
.hp-wood   { fill: #6b3b17; stroke: rgba(245, 240, 232, 0.55); stroke-width: 2; }
.hp-brass  { fill: var(--accent); }
.hp-chrome { fill: #c9c6c0; stroke: #f5f0e8; stroke-width: 1.5; }
.hp-box    { fill: #232326; stroke: rgba(245, 240, 232, 0.3); stroke-width: 1.5; }
.hp-swan   { stroke: #c9c6c0; stroke-width: 9; stroke-linecap: round; }
.lever-keg { transform-origin: 143px 82px; }
.lever-hp  { transform-origin: 96px 202px; }
.tap-keg { width: clamp(150px, 25vh, 210px); }
.tap-hp  { width: clamp(130px, 22vh, 180px); }
/* v1.5.279: how they really move. Keg tap: pulled forward, held, then
   the spring snaps it shut (with a little bounce). Hand pull: pulled
   forward, then pushed back upright by hand — both strokes deliberate. */
@keyframes kegPull {
  0%, 8%   { transform: rotate(0deg); }
  38%, 70% { transform: rotate(90deg); }
  76%      { transform: rotate(-8deg); }
  80%      { transform: rotate(3deg); }
  84%, 100% { transform: rotate(0deg); }
}
@keyframes hpPull {
  0%, 6%   { transform: rotate(0deg); }
  42%, 52% { transform: rotate(60deg); }
  90%, 100% { transform: rotate(0deg); }
}
@media (prefers-reduced-motion: no-preference) {
  .waiting .lever-keg, .flowing .lever-keg { animation: kegPull 2.4s cubic-bezier(.4, 0, .3, 1) infinite; }
  .waiting .lever-hp,  .flowing .lever-hp  { animation: hpPull 2.2s ease-in-out infinite; }
}
