/* ============================================================
   WISCO NIGHTS — design system
   ------------------------------------------------------------
   Sky       A canvas of ~840 stars behind the page (app/starfield.js).
             Cards are solid black on top of it; only the fixed bars are
             glass, so content scrolling under them stays legible.
   Palette   Paper #000000 · Riser #0E0E0F · Riser-2 #17171A
             Ink #F1F1F1 · Carpet #E32309 (the only red in the system)
             Champagne (rewards only — never decorative)
             Black is unconditional; .theme-light is opt-in.
   Type      Gentium Book, self-hosted from /fonts. Real small caps do
             the labelling; a system mono holds the numeric columns,
             because Gentium has no tabular figures.
   Signature The runner: a full-bleed carpet plane. It appears behind
             the hero, as the ticket stub, and under the action bar.
             Nowhere else.
   ============================================================ */

/* Self-hosted, no third-party origin on the critical path. These are Latin
   subsets built by scripts/build-fonts.sh — the upstream files are ~1.5 MB of
   multilingual coverage this app never renders. font-display: swap so text is
   readable immediately and reflows once, rather than hiding behind a blank
   header on bad wifi. */
@font-face {
  font-family: 'Gentium Book';
  src: url('/fonts/GentiumBook-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Gentium Book';
  src: url('/fonts/GentiumBook-Italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Gentium Book';
  src: url('/fonts/GentiumBook-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Gentium Book';
  src: url('/fonts/GentiumBook-BoldItalic.woff2') format('woff2');
  font-weight: 700; font-style: italic; font-display: swap;
}

/* Black is the default and is unconditional — a nightlife app is used in a
   dark room, and a phone set to light mode at 1am should not flash white.
   The light palette from the earlier build is kept below and applied only if
   you add class="theme-light" to <html>. */
:root {
  --paper: #000000;         /* page */
  /* Solid, over the sky behind the page (app/starfield.js). A card is an
     opaque surface laid on the night, not a window into it. */
  --surface: #000000;       /* the fill inside an outlined card */
  --riser: #0e0e0f;         /* cards, sheets, raised surfaces */
  --riser-2: #17171a;       /* nested fills, hover, table zebra */
  --rope: #262629;          /* hairlines */
  --ink: #f1f1f1;           /* text */
  --on-ink: #000000;
  --muted: #8b8b90;
  --carpet: #e32309;        /* The ticket surface. Never overridden. */
  --accent: #e32309;        /* Carpet. The one red. */
  --on-accent: #ffffff;
  --champagne-fill: #d9c089;   /* rewards only — never decorative */
  --on-champagne: #33260a;
  --danger: var(--carpet);   /* the only red in the system */
  --ok: #57d6a0;

  --radius: 4px;
  --radius-lg: 6px;

  /* One family, everywhere. `serif` is the generic fallback a browser uses
     only if the webfont fails to load — not a second typeface. */
  --display: 'Gentium Book', serif;
  --body: 'Gentium Book', serif;
  /* Numbers use the same face. Gentium has no tabular figure set, so numeric
     columns are held by right alignment rather than by a monospace. */
  --mono: 'Gentium Book', serif;

  /* White text that sits inside something clickable: one step down at rest,
     full white under the pointer. Applied to controls and links, not to
     muted or secondary copy, which keeps its own colour. */
  --click: #f5f5f5;
  --click-hover: #ffffff;

  --label-tracking: 0.13em;
  --gutter: 20px;
  --navbar-h: 54px;
}

/* The management and admin dashboards run light. They are used at a desk
   under house lights and are mostly tables, which read better on
   paper-coloured stock. The door console is not one of these: it is a phone
   at the entrance, so it keeps the black default. Toggled on <html> by the
   router. */
.theme-light {
  --paper: #f5f5f5;         /* page */
  --surface: #ffffff;       /* the fill inside a card */
  --riser: #ffffff;
  --riser-2: #f5f5f5;
  --rope: #e2e0e0;
  --ink: #120d0e;
  --on-ink: #ffffff;
  --muted: #6f686a;
  --click: #292929;
  --click-hover: #000000;
  --champagne-fill: #c19a2e;
  --on-champagne: #33260a;
  --ok: #1d7d52;
}

/* Text on the carpet stays light whatever the surrounding theme — the button
   is red in both, so its label can't follow the page's ink. */
.theme-light .btn-primary,
.theme-light .btn-primary:hover { color: #f5f5f5; }

/* No animated edge on a dashboard: it is a working surface, and a dozen
   rotating gradients behind a table is noise plus needless compositing. */
.theme-light .outline {
  background: var(--surface);
  border: 1px solid var(--rope);
  border-radius: 12px;
  animation: none;
  filter: none;
}


/* ---- The outline -------------------------------------------
   Every card and pill is the page colour with a lit edge: a conic gradient
   in the border box, rotating slowly, with a soft bloom around it.

   Two notes on how this is built.

   `@property` is what makes --angle animatable — a plain custom property is a
   string to the animation engine and would jump rather than sweep. Browsers
   without it (Firefox before 128) get a static gradient edge, which still
   looks right; nothing else has to change.

   The `filter` establishes a containing block, so anything position:fixed
   inside an outlined element would anchor to the card instead of the viewport.
   That is why the sheet backdrop and the sticky action bar are never outlined. */
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes rotate-outline {
  to { --angle: 360deg; }
}

.outline {
  position: relative;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(
      from var(--angle),
      var(--accent) 0%, #ffffff 25%,
      var(--accent) 50%, #ffffff 75%,
      var(--accent) 100%
    ) border-box;
  border: 1px solid transparent;
  border-radius: 28px;
  animation: rotate-outline 24s linear infinite;
  filter: drop-shadow(0 0 3px rgba(227, 35, 9, 0.85))
          drop-shadow(0 0 2px rgba(255, 255, 255, 0.9));
}
/* The sweep is decoration; anyone who has asked for less motion keeps the
   edge and loses the rotation. */
@media (prefers-reduced-motion: reduce) {
  .outline { animation: none; }
}

/* One rule for every label in the system. */
.eyebrow, .navlink, .btn, .field span, .tab, .table th,
.stat .l, .ticket-stub span, .badge-reward,
.ticket-extra .hint, .staff-strip .hint {
  font-variant-caps: all-small-caps;
  text-transform: none;
  letter-spacing: var(--label-tracking);
}

/* Prose that happens to sit inside a labelled control — an address under a
   location name, a hint under a field — is not a label. Opt it back out. */
.btn .sub, .field span.hint, .btn .sub * {
  font-variant-caps: normal;
  letter-spacing: 0;
  font-weight: 400;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-family: var(--body); }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* ---- The sky -----------------------------------------------
   A painted canvas pinned behind the app (see app/starfield.js). The page
   colour stays black underneath it, so a browser that can't give us a 2d
   context, or a stylesheet that loads before the script, shows the plain
   night the design was built on rather than a white flash.

   Only the dark theme has a sky. The dashboards are a working surface under
   house lights; stars behind a table of numbers are noise. */
#starfield {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}
.theme-light #starfield { display: none; }

/* Content sits above the sky. Without this the canvas paints over the app,
   since both are in the same stacking context and the canvas comes first. */
#root {
  position: relative; z-index: 1;
  min-height: 100dvh; display: flex; flex-direction: column;
}

a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
/* Inline links in running copy read as clickable, so they take the pair. */
.sub a, .empty a, .row-item a, p a { color: var(--click); transition: color 0.15s; }
.sub a:hover, .empty a:hover, .row-item a:hover, p a:hover { color: var(--click-hover); }
/* ...except on the light prompt slab, where the surface is inverted. */
.prompt a { color: inherit; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

.shell {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 var(--gutter) calc(48px + env(safe-area-inset-bottom));
  flex: 1;
}
/* Customer screens sit under the fixed glass bar. */
.shell.shell-tabs { padding-top: calc(var(--navbar-h) + env(safe-area-inset-top)); }

/* ---- Glass tab bar -----------------------------------------
   Three destinations, one control. Fixed to the top; the pill slides to
   whichever tab is live. */
.glass-nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 8px max(var(--gutter), env(safe-area-inset-left)) 8px
           max(var(--gutter), env(safe-area-inset-right));
  padding-top: max(10px, env(safe-area-inset-top));
  /* Nearly opaque rather than solid: enough sky comes through to read as
     glass, while the wordmark and the pill keep their contrast. Content
     scrolling underneath is blurred out where the browser supports it. */
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
}
/* No sky on the dashboards, so nothing to show through. */
.theme-light .glass-nav { background: var(--paper); backdrop-filter: none; }
.nav-mark {
  background: none; border: 0; padding: 0; display: flex; cursor: pointer;
  text-decoration: none;
}
.nav-mark svg { height: 42px; width: auto; display: block; }

.tabbar {
  position: relative; display: flex; align-items: center;
  gap: 2px; padding: 3px;
  border-radius: 40px; user-select: none;
}

.tabbar-pill {
  position: absolute; top: 3px; bottom: 3px; left: 0; width: 0;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 30px; pointer-events: none;
  transition: left 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              width 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
/* The console runs light, so the pill inverts there. */
.theme-light .tabbar-pill {
  background: rgba(0, 0, 0, 0.08); border-color: rgba(0, 0, 0, 0.12);
}

/* Before the first measurement the pill has no width; don't animate in from
   the left edge on load. */
.tabbar-pill.initial { transition: none; }

.tabbar-btn {
  position: relative; z-index: 1; background: transparent; border: 0;
  color: var(--ink); padding: 4px 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #f5f5f5; background: transparent;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.tabbar-btn svg { width: 22px; height: 22px; fill: currentColor; pointer-events: none; }
/* The supplied magnifier's artwork doesn't fill its 38x40 box, so it runs a
   little larger to match the optical weight of the star and the avatar. */
.tabbar-btn[data-tab='search'] svg { width: 26px; height: 26px; }
.tabbar-btn:hover { color: #ffffff; }
.tabbar-btn[aria-selected='true'] { color: #ffffff; }

/* The bar itself is outlined; the pill inside marks the live tab. */

/* A live ticket puts a mark on the account tab. */
.tabbar-btn .dot {
  position: absolute; top: 6px; right: 10px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); border: 1.5px solid var(--paper);
}

/* ---- Header ------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  /* Same glass as the customer tab bar: the door console is a dark screen
     with a sky behind it, and a solid bar would cut a black strip out of it. */
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border-bottom: 1px solid var(--rope);
  --rope: #2a2a2c;
}
/* The dashboards have no sky and a pale page; their header stays solid. */
.theme-light .topbar {
  background: #000000;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.topbar-inner {
  max-width: 480px; margin: 0 auto; padding: 14px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* Same split as the wordmark: the second word carries the carpet. */
.display em { font-style: normal; color: var(--accent); }

.topnav { display: flex; gap: 2px; align-items: center; }
.navlink {
  text-decoration: none; font-size: 14px; font-weight: 600;
  letter-spacing: 0.09em; color: var(--muted);
  padding: 8px 10px; border-radius: var(--radius);
  border-bottom: 1.5px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
/* The console bar is black whatever the page theme, so its links carry their
   own colours rather than the theme's ink. */
.topbar .navlink { color: #f1f1f1; }
.topbar .navlink:hover { color: #ffffff; }
.topbar .navlink.active,
.topbar .navlink.active:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- Type -------------------------------------------------- */
.display {
  font-family: var(--display);
  font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em; line-height: 1.02; margin: 0;
  font-variant-numeric: lining-nums;
}
h1.display { font-size: clamp(34px, 11vw, 48px); }
h2.display { font-size: 22px; letter-spacing: 0.06em; line-height: 1.1; }
.eyebrow {
  font-family: var(--display);
  font-size: 12px; font-weight: 700; letter-spacing: 0.22em;
 color: var(--accent); margin: 0 0 10px;
}
.sub { color: var(--muted); font-size: 14.5px; margin: 10px 0 0; max-width: 46ch; }
.mono {
  font-family: var(--mono); letter-spacing: 0.01em;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: 'lnum' 1, 'tnum' 1;
}

/* ---- Hero --------------------------------------------------
   The masthead: centred type on the page, no frame and no plane of its own. */
.hero {
  margin: 8px 0 40px;
  padding: 26px 0 0;
  text-align: center;
}
.hero h1.display { font-size: 40px; }
/* The second line is a subtitle, not part of the lockup: small caps at just
   over half the size, so "WISCO NIGHTS" stays the thing you read first. */
.hero .subline {
  display: block;
  margin-top: 6px;
  font-size: 0.55em;
  text-transform: none;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.14em;
}

/* ---- Rope divider ------------------------------------------
   A hairline between two stanchion posts. Separates zones. */
.divider {
  border: 0; height: 1px; background: var(--rope);
  margin: 22px 0; position: relative; overflow: visible;
}
.divider::before, .divider::after {
  content: ''; position: absolute; top: 50%; width: 5px; height: 5px;
  border-radius: 50%; background: var(--rope); transform: translateY(-50%);
}
.divider::before { left: 0; }
.divider::after { right: 0; }

/* ---- Cards & lists ----------------------------------------- */
.card { padding: 22px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row .grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; }

/* ---- Venue ------------------------------------------------
   One venue, one outlined card: name in carpet, address beneath. */
.venue {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 26px 28px;
}
.venue + .venue { margin-top: 16px; }

.venue-name {
  font-family: var(--display);
  font-weight: 700; text-transform: uppercase;
  font-size: 21px; line-height: 1.1; letter-spacing: 0.01em;
  margin: 0; color: var(--click);
  transition: color 0.15s;
}
/* The pill itself stays inert on hover; only its name lifts to full white. */
.venue:hover .venue-name { color: var(--click-hover); }
.venue-addr {
  margin: 7px 0 0; color: var(--click); font-size: 14.5px;
  transition: color 0.15s;
}
.venue:hover .venue-addr { color: var(--click-hover); }

/* A venue's own photograph, on its page. Shown only when there is one —
   nothing stands in for it, because an empty coloured rectangle is worse than
   no image at all. */
.venue-hero {
  display: block; width: 100%; aspect-ratio: 4 / 3;
  object-fit: cover; border-radius: 18px; margin-top: 22px;
}

/* ---- List rows ---------------------------------------------
   Specials, order lines and summaries: hairline-separated rows, never boxes.
   The rule between them is the only chrome. */
.rows { border-top: 1px solid var(--rope); }
.row-item {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 2px;
  border-bottom: 1px solid var(--rope);
}
.row-item .grow { flex: 1; min-width: 0; }
.row-item .title { color: var(--ink); }
a.row-item .title { color: var(--click); transition: color 0.15s; }
a.row-item:hover .title { color: var(--click-hover); }
.row-item .title {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: 16px; letter-spacing: 0.02em; line-height: 1.2; margin: 0;
}
.row-item .desc { color: var(--muted); font-size: 14.5px; margin: 7px 0 0; }
/* The tier's fixed meaning, set apart from the venue's own note below it. */
.row-item .tier-desc { color: var(--ink); }
.row-item .price {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 14px; margin-top: 6px; display: block;
}
.row-item.tight { padding: 12px 2px; align-items: center; }

/* Opening copy on a screen with no heading above it. Left-aligned: two short
   sentences justified across a phone column open up gaps between words. */
.lede {
  color: #ffffff;
  font-size: 16px;
  text-align: left;
  margin: 6px 0 22px;
}

/* ---- Footnote ----------------------------------------------
   The "no account? / already have one?" line under a form. */
.footnote {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  margin: 18px auto 0;
}
.footnote a {
  color: var(--click);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.footnote a:hover { color: var(--click-hover); }

/* ---- Search field ------------------------------------------
   No box: a magnifier and the words, on the page. */
.searchline {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
  margin-bottom: 22px;
}
.searchline svg {
  width: 27px; height: 27px; flex: 0 0 27px; margin-left: -3px;
  pointer-events: none;
  /* White on the black app, ink on the light console — a white glyph on a
     #f5f5f5 console was simply invisible. */
  fill: #ffffff;
}
.theme-light .searchline svg { fill: #292929; }
.searchline.plain { margin-bottom: 18px; }
.searchline input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: none; padding: 6px 0;
  color: var(--ink); font-family: var(--body); font-size: 19px;
}
.searchline input::placeholder { color: var(--muted); }

/* ---- Buttons ----------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius); padding: 15px 20px;
  font-family: var(--display);
  font-weight: 700; font-size: 14.5px;
  letter-spacing: 0.11em;
  border: 1px solid var(--rope); background: transparent; color: var(--click);
  text-decoration: none;
  transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.06s;
}
.btn:hover {
  color: var(--click-hover);
  border-color: color-mix(in srgb, var(--ink) 34%, var(--rope));
  background: var(--riser-2);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent); border-color: var(--accent); color: var(--click);
}
/* The carpet button holds its colour under the pointer. It is already the
   loudest thing on the screen; the generic .btn hover would repaint it with
   the page's raised surface, which on the light console turned it white. */
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--click);
  filter: none;
}
.btn-pulse {
  background: var(--ink); border-color: var(--ink); color: var(--on-ink);
}
.btn-ghost { background: transparent; }
.btn-sm { padding: 9px 13px; font-size: 11px; letter-spacing: 0.13em; }
.btn-block { width: 100%; }
/* Secondary text inside a button is prose, not a label. */
.btn .sub { font-family: var(--body); }

/* ---- Sign-up prompt ----------------------------------------
   A flat light slab, square and unlit: deliberately the opposite of the
   outlined pills around it, so it reads as a message rather than one more
   card in the list. Its interior is a small light theme, so the components
   inside adapt without being restyled. */
.prompt {
  background: #f5f5f5;
  color: #292929;
  border: 0;
  border-radius: 0;
  padding: 24px 26px;
  font-size: 15px;
  text-align: justify;
  hyphens: auto;
  transition: background 0.15s, color 0.15s;
  --ink: #292929;
  --muted: #5f5f63;
}
.prompt:hover { background: #ffffff; color: #000000; }
.prompt p { margin: 0; }
.prompt strong { font-weight: 700; color: inherit; }
/* The call to action keeps the carpet — it is the action, not the surface. */
.prompt .btn-primary {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
  text-align: center;
}

/* ---- Forms ------------------------------------------------- */
.field { display: block; margin-bottom: 14px; }
.field span {
  display: block; font-family: var(--display); font-size: 12.5px;
  font-weight: 700; letter-spacing: 0.14em;
  color: var(--muted); margin-bottom: 7px;
}
.input, select.input, textarea.input {
  width: 100%; background: var(--paper); color: var(--ink);
  border: 1px solid var(--rope); border-radius: var(--radius);
  padding: 13px 14px; transition: border-color 0.15s;
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.input:hover { border-color: color-mix(in srgb, var(--ink) 26%, var(--rope)); }
.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
textarea.input { resize: vertical; min-height: 80px; }

.error {
  background: color-mix(in srgb, var(--danger) 7%, var(--riser));
  border: 1px solid color-mix(in srgb, var(--danger) 26%, var(--rope));
  border-left: 2px solid var(--danger);
  color: var(--ink); border-radius: var(--radius); padding: 12px 14px; font-size: 14px;
}
.notice { padding: 22px 24px; font-size: 15px; }
.notice strong { color: var(--ink); font-weight: 600; }

/* ---- Specials ---------------------------------------------- */
.special { padding: 17px 18px; }
.special .price {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-weight: 500; font-size: 14px; color: var(--ink); white-space: nowrap;
  margin-top: 5px;
}
.special .desc { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; }
.stepper {
  display: flex; align-items: center; border: 1px solid var(--rope);
  border-radius: var(--radius); overflow: hidden;
}
.stepper button {
  width: 40px; height: 40px; background: transparent; color: var(--ink);
  border: 0; font-size: 17px; font-weight: 500; transition: background 0.12s;
}
.stepper button:hover:not(:disabled) { background: var(--riser-2); }
.stepper button:disabled { color: var(--rope); }
.stepper .qty {
  width: 32px; text-align: center; font-family: var(--mono);
  font-variant-numeric: tabular-nums; font-weight: 500; font-size: 14px;
}
.stepper.has-qty { border-color: var(--accent); }
.stepper.has-qty .qty { color: var(--accent); }

/* ---- Sticky action bar ------------------------------------- */
.actionbar {
  position: sticky; bottom: 0; z-index: 30;
  margin: 22px calc(var(--gutter) * -1) 0;
  padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--accent);   /* runner, third appearance */
}

/* ---- Venue header ------------------------------------------ */
.venue-head { padding: 30px 0 10px; }
.venue-badge {
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: var(--radius);
  overflow: hidden; background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-weight: 700; font-size: 24px;
}
.venue-badge img { width: 100%; height: 100%; object-fit: cover; }

/* ---- The ticket --------------------------------------------
   The ticket is an outlined card like everything else, so the perforated stub
   is gone: the notches were holes punched through to the page, and there is no
   longer a fill for them to be punched out of. What carries the ticket idea
   now is a carpet label and a dashed tear line across the card.

   That is a real trade — the perforation was the most distinctive thing in the
   old design — but a single card language matters more than one clever object,
   and the tear line keeps enough of it. */
.ticket { padding: 22px 24px; }
.ticket-main {
  display: block; width: 100%; background: none; border: 0; padding: 0;
  color: inherit; text-align: left; cursor: pointer; font: inherit;
}
.ticket-label {
  display: inline-block;
  background: var(--accent); color: var(--click);
  border-radius: 999px; padding: 4px 13px; margin-bottom: 12px;
  font-family: var(--display); font-variant-caps: all-small-caps;
  font-weight: 700; font-size: 12.5px; letter-spacing: 0.16em;
}
.ticket.reward .ticket-label {
  background: var(--champagne-fill); color: var(--on-champagne);
}
.ticket-name {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: 18px; letter-spacing: 0.02em; line-height: 1.15; margin: 0;
  color: var(--click); transition: color 0.15s;
}
.ticket-main:hover .ticket-name,
.ticket-main:hover .ticket-label { color: var(--click-hover); }
.ticket-where { color: rgba(255, 255, 255, 0.7); font-size: 14px; margin: 6px 0 0; }

/* The tear line: what is left of the perforation. */
.ticket-extra {
  border-top: 1px dashed rgba(255, 255, 255, 0.3);
  margin-top: 20px; padding-top: 20px;
}
.ticket-extra .desc { color: rgba(255, 255, 255, 0.7); font-size: 14.5px; margin: 0 0 16px; }
.ticket-extra .hint {
  text-align: center; font-family: var(--display); font-size: 12px;
  font-variant-caps: all-small-caps; letter-spacing: 0.16em;
  color: var(--muted); margin: 0 0 14px;
}
.ticket .btn-pulse {
  background: var(--accent); border-color: rgba(255, 255, 255, 0.25); color: var(--click);
}
.ticket .btn-pulse:hover { color: var(--click-hover); }
.ticket .btn-pulse:hover { filter: brightness(1.1); }
.ticket.reward .btn-pulse {
  background: var(--champagne-fill); color: var(--on-champagne);
}

/* ---- Ticket detail sheet ----------------------------------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10, 7, 8, 0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 480px; background: var(--riser);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 1px solid var(--rope); border-bottom: 0;
  border-top: 2px solid var(--accent);
  padding: 26px 22px calc(28px + env(safe-area-inset-bottom));
  animation: rise 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  /* The edit forms are taller than a laptop viewport; without this the fields
     past the fold are simply unreachable. */
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
@keyframes rise { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }

/* No padding: the symbol carries its own four-module quiet zone, which is what
   the white margin inside the frame is. Adding CSS padding on top of it just
   shrinks the code for no benefit. */
.qr-frame {
  background: #fff; border: 1px solid var(--rope);
  border-radius: var(--radius); padding: 0; overflow: hidden;
  width: 100%; max-width: 340px; margin: 0 auto;
}
.qr-frame img { display: block; width: 100%; height: auto; }

.staff-strip { border-top: 1px dashed var(--rope); margin-top: 20px; padding-top: 18px; }
.staff-strip .hint {
  text-align: center; font-family: var(--display); font-size: 12px;
  letter-spacing: 0.18em; color: var(--muted); margin: 0 0 12px;
}

/* ---- Tables (management) -----------------------------------
   Leaderboard rigor: hairlines, tabular numerals, no chrome. */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-family: var(--display); font-size: 12px;
  letter-spacing: 0.12em; color: var(--muted);
  padding: 10px 8px; border-bottom: 1px solid var(--rope); font-weight: 600;
}
.table td { padding: 11px 8px; border-bottom: 1px solid var(--rope); vertical-align: top; }
.table tbody tr:hover td { background: var(--riser-2); }
.table td.num, .table th.num {
  text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.table-scroll .table { min-width: 420px; }

.tabs {
  display: flex; gap: 0; overflow-x: auto; padding: 4px 0 0;
  scrollbar-width: none; border-bottom: 1px solid var(--rope);
  margin-bottom: 34px;
}
/* A second tab row nested inside a tab's content sits closer to its own list. */
.tabs .tabs, .stack > .tabs { margin-bottom: 26px; }
.tab {
  border: 0; border-bottom: 2px solid transparent; background: transparent;
  color: var(--muted); padding: 10px 15px;
  font-family: var(--display); font-size: 14px; font-weight: 700;
  letter-spacing: 0.1em; white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--click-hover); }
.tab.active { color: var(--click); border-bottom-color: var(--accent); }
.tab.active:hover { color: var(--click-hover); }

.stat { text-align: left; }
.stat .n {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-weight: 500; font-size: 26px; line-height: 1; letter-spacing: -0.02em;
}
.stat .l {
  font-family: var(--display); font-size: 12px; letter-spacing: 0.14em;
 color: var(--muted); margin-top: 7px;
}
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---- Scanner ----------------------------------------------- */
.scan-frame {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--rope); background: #000; aspect-ratio: 1;
}
.scan-frame video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame .reticle {
  position: absolute; inset: 14%; border: 2px solid var(--accent); border-radius: var(--radius);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0.9; pointer-events: none;
}

.empty { text-align: center; padding: 56px 12px; color: var(--muted); font-size: 14.5px; }
.empty .display { color: var(--ink); margin-bottom: 10px; font-size: 22px; }
.empty .sub { margin-left: auto; margin-right: auto; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ---- Desktop (management dashboard) ------------------------
   Everything else stays phone-shaped on purpose: customers and door
   staff are on their phones. The dashboard is the laptop screen. */
@media (min-width: 900px) {
  .shell-wide, .topbar-inner.wide { max-width: 1120px; }
  .shell-wide { padding-bottom: 72px; }
  .shell-wide .tabs { margin-bottom: 40px; }
  .shell-wide .tab { padding: 11px 20px; font-size: 12.5px; }
  .shell-wide .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .shell-wide .stat .n { font-size: 34px; }
  .shell-wide .stack.grid-2 {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px; align-items: start;
  }
  .shell-wide .stack.grid-2 > * + * { margin-top: 0; }
  .shell-wide .table { font-size: 14px; }
  .shell-wide .table-scroll .table { min-width: 0; }
  .shell-wide .table th, .shell-wide .table td { padding: 12px 11px; }
  .shell-wide ~ * .sheet-backdrop, .sheet-backdrop.centered { align-items: center; }
  .sheet-backdrop.centered .sheet {
    max-width: 560px; border-radius: var(--radius-lg);
    border-bottom: 1px solid var(--rope);
  }
}

/* ---- Printable QR code -------------------------------------
   One page, QR only. Off-screen on screen; the only thing on paper. */
.print-sheet { position: fixed; left: -10000px; top: 0; width: 6.5in; background: #fff; }
.print-sheet img { display: block; width: 100%; height: auto; }

@media print {
  @page { size: portrait; margin: 0; }
  /* Everything except the poster is removed from the flow rather than merely
     hidden. `visibility: hidden` leaves their boxes behind, and a dashboard's
     worth of empty boxes is what spills onto a second sheet. */
  html, body {
    height: 100%; margin: 0; padding: 0; overflow: hidden;
    background: #fff !important;
  }
  body > *:not(.print-sheet) { display: none !important; }
  /* Fixed, not absolute: with every sibling removed the body collapses to no
     height, so an absolutely-positioned sheet has nothing to centre against
     and lands at the top-left. Fixed positions against the page box itself. */
  .print-sheet {
    position: fixed;
    left: 0; top: 0; right: 0; bottom: 0;
    width: 100%; height: 100%; margin: 0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; break-inside: avoid; page-break-inside: avoid;
  }
  .print-sheet img { width: auto; height: auto; max-width: 85%; max-height: 85%; }
}
