/* GAGA Games x IGX Stage 03 registration.
   Shape rule: cards and panels 20-24px, inputs 14px, ticket 24px, buttons and chips are pills.
   Z scale: content 2, topbar 10, sparks 15 (they may drift over the top bar), grain 20. */

@font-face {
  font-family: 'IGX Sans';
  src: url('/assets/fonts/igx-sans.woff2') format('woff2-variations'), url('/assets/fonts/igx-sans.woff2') format('woff2');
  font-weight: 400 850;
  font-stretch: 100% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'IGX Mono';
  src: url('/assets/fonts/igx-mono.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@property --holo {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

:root {
  color-scheme: dark;
  --bg: #08090b;
  --panel: #111317;
  --panel-2: #171a1f;
  --line: rgb(232 236 234 / 0.1);
  --line-2: rgb(232 236 234 / 0.18);
  --text: #eaedeb;
  --muted: #a3aba7;
  --faint: #8a928e;
  --accent: #00a97f;
  --accent-hi: #17c496;
  --accent-ink: #03130e;
  --accent-soft: rgb(0 169 127 / 0.16);
  --accent-glow: rgb(0 169 127 / 0.38);
  --mu-glow: rgb(255 72 24 / 0.32);
  --exc-glow: rgb(98 146 255 / 0.3);
  --danger: #ff7d73;
  --warn: #f6bc52;
  --r-card: 20px;
  --r-panel: 24px;
  --r-input: 14px;
  --r-ticket: 24px;
  --r-pill: 999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --topbar-h: 60px;
  --pad: 20px;
  --sans: 'IGX Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IGX Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(75% 55% at -10% 108%, rgb(255 72 24 / 0.14), transparent 62%),
    radial-gradient(60% 48% at 110% -6%, rgb(98 146 255 / 0.1), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* viewport-fit=cover: keep content clear of the notch in landscape and the home indicator. */
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: url('/assets/img/grain.webp') repeat;
  background-size: 128px;
  opacity: 0.055;
  mix-blend-mode: overlay;
}
.sparks { position: fixed; inset: 0; z-index: 15; pointer-events: none; }
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}
.icon { width: 1.15em; height: 1.15em; flex: none; fill: currentColor; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Headings receive focus only so screen readers announce the new step. */
[tabindex='-1']:focus { outline: none; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: var(--r-pill); font-weight: 700; text-decoration: none;
  transition: top 0.2s;
}
.skip:focus { top: 12px; }

/* ---------- top bar ---------- */
.topbar {
  position: relative;
  z-index: 10;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 var(--pad);
}
.brand { display: block; width: 92px; flex: none; }
.brand img { width: 100%; height: auto; }
.topbar__event {
  margin: 0 auto 0 0;
  padding-left: 16px;
  border-left: 1px solid var(--line-2);
  font-size: 11.5px;
  line-height: 1.25;
  font-weight: 620;
  font-stretch: 112%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.topbar__event strong { display: block; color: var(--text); font-weight: 760; }
.topbar__venue { display: none; }
@media (min-width: 480px) { .topbar__venue { display: inline; } }
.lang {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: rgb(8 9 11 / 0.5);
  backdrop-filter: blur(8px);
}
.lang button {
  border: 0;
  background: none;
  padding: 6px 11px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 760;
  font-stretch: 112%;
  letter-spacing: 0.06em;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.lang button[aria-pressed='true'] { background: var(--text); color: var(--bg); }
/* Small phones: keep "IGX Stage 03" on one line inside the 60px bar instead of five clipped lines. */
@media (max-width: 419.98px) {
  .topbar { gap: 12px; }
  .brand { width: 74px; }
  .topbar__event { padding-left: 12px; font-size: 10.5px; letter-spacing: 0.04em; }
  .topbar__event strong { white-space: nowrap; }
  .lang button { padding-inline: 9px; }
}
/* Touch: grow hit areas to 44px without moving anything. */
.brand, .lang button, .link { position: relative; }
@media (pointer: coarse) {
  .brand::after, .lang button::after, .link::after { content: ''; position: absolute; inset: -9px -2px; }
  .lang button::after { inset: -7px -1px; }
  .link::after { inset: -12px -6px; }
}

/* ---------- stage (mobile first) ---------- */
.stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 0 var(--pad) 36px;
  /* Characters may rise above their cards but must never widen the page (iOS lets body overflow-x: hidden pan sideways). */
  overflow-x: clip;
}
.intro { padding-top: 14px; }
.intro--ticket { display: none; }
.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.title {
  margin: 0;
  font-size: clamp(2.45rem, 1.7rem + 3.2vw, 3.25rem);
  line-height: 0.93;
  font-weight: 830;
  font-stretch: 125%;
  letter-spacing: -0.012em;
  text-transform: uppercase;
}
.title .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.title .line > span { display: block; }
.lede {
  margin: 16px 0 0;
  max-width: 38ch;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.55;
  text-wrap: pretty;
}
.note {
  display: flex;
  gap: 10px;
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: var(--r-input);
  background: var(--accent-soft);
  font-size: 13.5px;
  line-height: 1.45;
  max-width: 44ch;
}
.note .icon { color: var(--accent); margin-top: 1px; }

/* ---------- realms (game cards) ---------- */
.realms {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 46px;
}
.realm { position: relative; min-width: 0; }
.realm__input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.realm__card {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4.3;
  border-radius: var(--r-card);
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  /* Characters may rise above the card, never spill sideways. */
  clip-path: inset(-30% 0 -40px 0);
  transition: transform 0.5s var(--ease-out), filter 0.5s var(--ease-out);
}
.realm__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  border-radius: inherit;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}
.realm__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.62) saturate(0.95);
  transform: scale(1.04);
  transition: filter 0.6s var(--ease-out), transform 1.2s var(--ease-out);
}
.realm__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgb(8 9 11 / 0.96) 6%, rgb(8 9 11 / 0.55) 38%, rgb(8 9 11 / 0) 70%);
}
.realm__bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.5;
  transition: opacity 0.6s var(--ease-out);
}
.realm--mu .realm__bg::before { background: radial-gradient(70% 45% at 50% 62%, var(--mu-glow), transparent 70%); }
.realm--exc .realm__bg::before { background: radial-gradient(70% 45% at 50% 62%, var(--exc-glow), transparent 70%); }

.realm__char {
  position: absolute;
  left: 50%;
  bottom: 30%;
  width: 118%;
  translate: -50% 0;
  pointer-events: none;
  transition: transform 0.6s var(--ease-out), filter 0.6s var(--ease-out);
  -webkit-mask-image: linear-gradient(0deg, transparent 0%, #000 22%);
  mask-image: linear-gradient(0deg, transparent 0%, #000 22%);
}
.realm--mu .realm__char { width: 104%; bottom: 24%; }
/* Sized so Lancelot's sword hand and pauldron stay inside the card (the card clips sideways). */
.realm--exc .realm__char { width: 112%; bottom: 42%; translate: -46% 0; }
.realm__char img { width: 100%; height: auto; }

.realm__foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 0 10px 14px;
  text-align: center;
}
.realm__logo { width: 78%; height: auto; filter: drop-shadow(0 6px 14px rgb(0 0 0 / 0.6)); }
.realm--exc .realm__logo { width: 92%; }
.realm__meta {
  font-size: 10.5px;
  font-weight: 650;
  font-stretch: 104%;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.realm__pick {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.4s var(--ease-out), border-color 0.3s, background 0.3s;
}
.realm__pick-text { display: none; }
.realm__pick .picked { display: none; }
.tick {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgb(234 237 235 / 0.55);
  background: rgb(8 9 11 / 0.55);
  backdrop-filter: blur(6px);
  color: transparent;
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.4s var(--ease-out);
}
.tick .icon { width: 15px; height: 15px; }

.realm__card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1.5px var(--accent);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .realm__card:hover .realm__bg img { filter: brightness(0.78) saturate(1.05); transform: scale(1.07); }
  .realm__card:hover .realm__char { transform: translateY(-6px) scale(1.015); }
  .realm__card:hover .tick { border-color: var(--accent); }
}

.realm__input:checked + .realm__card::after { opacity: 1; }
.realm__input:checked + .realm__card .realm__bg img { filter: brightness(0.86) saturate(1.1); }
.realm__input:checked + .realm__card .realm__bg::before { opacity: 1; }
.realm__input:checked + .realm__card .realm__char { transform: translateY(-4px) scale(1.03); }
.realm__input:checked + .realm__card .tick {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: scale(1.06);
}
.realm__input:checked + .realm__card .pick { display: none; }
.realm__input:checked + .realm__card .picked { display: inline; }
.realms:has(.realm__input:checked) .realm__input:not(:checked) + .realm__card { filter: saturate(0.45) brightness(0.72); }
.realm__input:focus-visible + .realm__card { outline: 2px solid var(--text); outline-offset: -5px; }
.realms.is-invalid .realm__card::after { opacity: 1; box-shadow: inset 0 0 0 1.5px var(--danger); }

.realms__seam {
  position: absolute;
  left: 50%;
  top: -18px;
  bottom: 34px;
  width: 1px;
  translate: -0.5px 0;
  background: linear-gradient(180deg, transparent, rgb(0 169 127 / 0.85) 40%, rgb(0 169 127 / 0.85) 60%, transparent);
  box-shadow: 0 0 14px 1px rgb(0 169 127 / 0.45);
  pointer-events: none;
}
.realms__hint {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.realms__error { grid-column: 1 / -1; justify-content: center; }

/* ---------- gate: form, ticket and locked panes ---------- */
.gate { position: relative; z-index: 2; margin-top: 30px; }
.picker { display: none; }
.panel__title {
  margin: 0;
  font-size: 19px;
  font-weight: 780;
  font-stretch: 112%;
  letter-spacing: 0.01em;
}
.panel__title--big {
  font-size: clamp(2rem, 1.5rem + 2.4vw, 2.5rem);
  line-height: 0.95;
  font-weight: 820;
  font-stretch: 125%;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}
.panel__text { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.pane--form .form, .pane--locked .form { margin-top: 22px; }
.form { display: grid; gap: 16px; }
.form__row { display: grid; gap: 16px; }

.field { display: grid; gap: 7px; }
.field__label { font-size: 13px; font-weight: 640; letter-spacing: 0.01em; }
.input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: var(--r-input);
  border: 1px solid var(--line-2);
  background: rgb(255 255 255 / 0.035);
  font-size: 16px;
  font-weight: 520;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input::placeholder { color: var(--faint); font-weight: 450; }
.input:hover { border-color: rgb(232 236 234 / 0.3); }
.input:focus { outline: none; border-color: var(--accent); background: rgb(255 255 255 / 0.05); box-shadow: 0 0 0 4px rgb(0 169 127 / 0.18); }
.field.is-invalid .input { border-color: var(--danger); }
.field.is-invalid .input:focus { box-shadow: 0 0 0 4px rgb(255 125 115 / 0.16); }
.error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--danger);
}
.error .icon { margin-top: 1px; }
.error:empty { display: none; }

.check {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  cursor: pointer;
}
.check input {
  appearance: none;
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 7px;
  border: 1.5px solid var(--line-2);
  background: rgb(255 255 255 / 0.03);
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.check input::before {
  content: '';
  width: 13px;
  height: 13px;
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20256%20256%22%20fill%3D%22%2303130e%22%3E%3Cpath%20d%3D%22M232.49%2C80.49l-128%2C128a12%2C12%2C0%2C0%2C1-17%2C0l-56-56a12%2C12%2C0%2C1%2C1%2C17-17L96%2C183%2C215.51%2C63.51a12%2C12%2C0%2C0%2C1%2C17%2C17Z%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
  transform: scale(0);
  transition: transform 0.25s var(--ease-out);
}
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::before { transform: scale(1); }
.check a { color: var(--text); text-underline-offset: 3px; white-space: nowrap; }
.field.is-invalid .check input { border-color: var(--danger); }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: var(--r-pill);
  font-size: 14.5px;
  font-weight: 780;
  font-stretch: 120%;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s var(--ease-out), background 0.2s, box-shadow 0.3s, color 0.2s, border-color 0.2s;
}
.btn .icon { transition: transform 0.3s var(--ease-out); }
.btn:active { transform: scale(0.98); }
.btn--primary {
  width: 100%;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 14px 34px -14px var(--accent-glow), inset 0 1px 0 rgb(255 255 255 / 0.28);
}
.btn--primary:hover { background: var(--accent-hi); }
.btn--primary:hover .icon { transform: translateX(3px); }
.btn--ghost {
  height: 48px;
  padding: 0 20px;
  font-size: 12.5px;
  background: rgb(255 255 255 / 0.02);
  color: var(--text);
  border: 1px solid var(--line-2);
}
.btn--ghost:hover { border-color: var(--text); }
.btn[aria-busy='true'] { pointer-events: none; }
.btn[aria-busy='true']::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 0.35) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: sweep 1.1s var(--ease-io) infinite;
}
@keyframes sweep { to { transform: translateX(100%); } }

.link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13.5px;
  font-weight: 620;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgb(234 237 235 / 0.35);
  text-underline-offset: 4px;
  cursor: pointer;
}
.link:hover { text-decoration-color: var(--accent); }

/* ---------- ticket ---------- */
.pane--ticket { display: grid; justify-items: center; }
.ticket {
  --tear-y: 70%;
  --mx: 50%;
  --my: 30%;
  position: relative;
  width: min(100%, 380px);
  border-radius: var(--r-ticket);
  border: 1.5px solid transparent;
  background:
    linear-gradient(165deg, #171a1f, #0c0e11 70%) padding-box,
    conic-gradient(from var(--holo), #00a97f, #5ed3ff, #b48cff, #ff7a45, #ffd36b, #00a97f) border-box;
  isolation: isolate;
  animation: holo 9s linear infinite;
  -webkit-mask: radial-gradient(circle 13px at 0 var(--tear-y), transparent 97%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle 13px at 100% var(--tear-y), transparent 97%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 13px at 0 var(--tear-y), transparent 97%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle 13px at 100% var(--tear-y), transparent 97%, #000) right / 51% 100% no-repeat;
}
@keyframes holo { to { --holo: 360deg; } }
.ticket__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}
.ticket__glow::before,
.ticket__glow::after {
  content: '';
  position: absolute;
  inset: 0;
}
.ticket[data-games~='mu'] .ticket__glow::before { background: radial-gradient(80% 50% at 0% 0%, rgb(255 72 24 / 0.24), transparent 70%); }
.ticket[data-games~='excalibur'] .ticket__glow::after { background: radial-gradient(80% 50% at 100% 0%, rgb(98 146 255 / 0.24), transparent 70%); }
.ticket__sheen {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--mx) var(--my), rgb(255 255 255 / 0.09), transparent 45%);
  mix-blend-mode: screen;
  overflow: hidden;
}
.ticket__sheen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgb(255 255 255 / 0.1) 48%, rgb(255 255 255 / 0.02) 54%, transparent 62%);
  transform: translateX(-120%);
  animation: sheen 7s var(--ease-io) 1.8s infinite;
}
@keyframes sheen { 0% { transform: translateX(-120%); } 35%, 100% { transform: translateX(120%); } }

.ticket__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 0;
}
.ticket__brand { width: 74px; height: auto; }
.ticket__event,
.ticket__label {
  font-size: 10.5px;
  font-weight: 720;
  font-stretch: 112%;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.ticket__label { display: block; }
.ticket__code { padding: 20px 22px 0; }
.ticket__id {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: clamp(26px, 7.6vw, 30px);
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: #fff;
}
.ticket__id .dim { color: var(--muted); }
.ticket__body {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 18px 22px 22px;
}
/* The QR is a button: a tap opens the full-screen QR (#qr-zoom) for the booth scanner. */
.ticket__qrbtn {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: none;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}
.ticket__qr {
  display: block;
  padding: 11px;
  border-radius: 14px;
  background: #eef1ef;
  box-shadow: 0 10px 30px -14px rgb(0 0 0 / 0.8);
}
.ticket__qr svg { display: block; width: 100%; height: auto; }
.ticket__zoom {
  position: absolute;
  right: -7px;
  bottom: -7px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 0 0 3px #111317;
  transition: transform 0.3s var(--ease-out);
}
.ticket__zoom .icon { width: 15px; height: 15px; }
.ticket__qrbtn:hover .ticket__zoom { transform: scale(1.12); }

.qr-zoom {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
  color: #0a0b0d;
  color-scheme: light;
}
.qr-zoom::backdrop { background: #fff; }
.qr-zoom__inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
/* As large as the screen allows, leaving room for the ID and the close button. The padding plus the page
   padding keep a white quiet zone of about 3 modules (the code is 21 modules wide) next to the screen edge. */
.qr-zoom__code {
  --qz: max(180px, min(100%, 100dvh - 190px, 680px));
  width: var(--qz);
  padding: calc(var(--qz) / 14);
}
/* Landscape phones: QR on the left at full height, ID and button beside it. */
@media (orientation: landscape) and (max-height: 560px) {
  .qr-zoom__inner { flex-direction: row; gap: 24px; }
  .qr-zoom__code { --qz: min(100dvh - 32px, 56vw); }
}
.qr-zoom__side { display: grid; justify-items: center; gap: 14px; }
.qr-zoom__code svg { display: block; width: 100%; height: auto; }
.qr-zoom__id { margin: 0; font-family: var(--mono); font-size: clamp(20px, min(6vw, 4.5dvh), 30px); font-weight: 600; letter-spacing: 0.05em; white-space: nowrap; }
.qr-zoom__hint { margin: -6px 0 0; font-size: 14px; color: #3d4441; text-align: center; }
.qr-zoom__close { min-width: 200px; background: #0a0b0d; color: #fff; }
.qr-zoom__close:hover { background: #2a2f2c; }
.qr-zoom :focus-visible { outline: 3px solid #0a0b0d; outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .qr-zoom[open] { animation: qr-in 0.22s var(--ease-out); }
}
@keyframes qr-in { from { opacity: 0; } to { opacity: 1; } }
.ticket__meta { display: grid; gap: 10px; margin: 0; }
.ticket__meta div { display: grid; gap: 2px; min-width: 0; }
.ticket__meta dt { font-size: 10px; font-weight: 700; font-stretch: 112%; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.ticket__meta dd { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.ticket__meta .mono { font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; }
.gchips { display: flex; flex-wrap: wrap; gap: 6px; }
.gchip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  font-stretch: 108%;
  white-space: nowrap;
}
.gchip--mu { background: rgb(255 90 36 / 0.16); color: #ffb08f; box-shadow: inset 0 0 0 1px rgb(255 90 36 / 0.35); }
.gchip--excalibur { background: rgb(122 168 255 / 0.14); color: #b9d0ff; box-shadow: inset 0 0 0 1px rgb(122 168 255 / 0.35); }
.ticket__tear { position: absolute; left: 18px; right: 18px; top: var(--tear-y); border-top: 1.5px dashed var(--line-2); }
.ticket__live { display: flex; align-items: center; gap: 10px; padding: 26px 22px 6px; }
.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: rgb(0 169 127 / 0.14);
  color: var(--accent-hi);
  font-size: 11px;
  font-weight: 760;
  font-stretch: 112%;
  letter-spacing: 0.14em;
}
.live__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-hi); animation: pulse 1.6s var(--ease-out) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(23 196 150 / 0.7); } 100% { box-shadow: 0 0 0 9px rgb(23 196 150 / 0); } }
.ticket__clock { font-family: var(--mono); font-size: 17px; font-weight: 600; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.ticket__tz { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.1em; }
.ticket__note { margin: 0; padding: 4px 22px 22px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.ticket__redeemed {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 22px 18px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgb(246 188 82 / 0.12);
  color: var(--warn);
  font-size: 13px;
  font-weight: 650;
}

.mu-cta {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 4px 14px;
  align-items: center;
  width: min(100%, 380px);
  margin-top: 14px;
  padding: 14px 14px 12px;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgb(255 72 24 / 0.12), rgb(14 16 19 / 0.9));
}
.mu-cta img { width: 52px; height: auto; grid-row: span 2; }
.mu-cta strong { display: block; font-size: 13.5px; font-weight: 720; }
.mu-cta p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.mu-cta .btn { grid-column: 2; justify-self: start; height: 34px; padding: 0 14px; margin-top: 6px; font-size: 11px; }
@media (pointer: coarse) { .mu-cta .btn { height: 44px; } }
.pane--ticket .link { margin-top: 22px; }
/* Narrow phones: keep the masked phone number and the MU button inside the ticket and card. */
@media (max-width: 399.98px) {
  .ticket__body { grid-template-columns: 136px minmax(0, 1fr); gap: 14px; padding-inline: 18px; }
  .ticket__meta .mono { font-size: 12.5px; letter-spacing: 0; }
  .mu-cta .btn { grid-column: 1 / -1; justify-self: stretch; }
}
@media (max-width: 349.98px) {
  .ticket__body { grid-template-columns: minmax(0, 1fr); }
  .ticket__qrbtn { justify-self: center; width: 176px; }
}
.offline-note { margin: 12px 0 0; font-size: 12.5px; color: var(--warn); }

/* ---------- locked ---------- */
.badge-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgb(0 169 127 / 0.35);
}
.badge-icon .icon { width: 26px; height: 26px; }
.pane--locked .link { margin-top: 20px; }

/* ---------- footer ---------- */
.foot {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 18px;
  padding: 28px var(--pad) 40px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.foot__facts { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 0; padding: 0; list-style: none; color: var(--text); font-weight: 600; }
.foot__facts li { display: inline-flex; align-items: center; gap: 8px; }
.foot__facts .icon { color: var(--accent); }
.foot__legal { display: grid; gap: 6px; margin: 0; font-size: 11px; line-height: 1.5; color: var(--faint); }
.foot__legal p { margin: 0; }
.foot a { color: var(--text); text-underline-offset: 3px; }
.foot__facts a { padding-block: 13px; margin-block: -13px; }

/* ---------- view state ---------- */
/* data-boot (set by boot.js): app.js is still asking whether this device holds a ticket. */
:root[data-boot] .gate, :root[data-boot] .intro { visibility: hidden; animation: unboot 0s 4s forwards; }
@keyframes unboot { to { visibility: visible; } }
/* Layout switch: the three-panel desktop needs min-width 1024px AND a landscape window (min-aspect-ratio 1/1,
   same query as isDesktop in app.js and fx.js). Portrait iPad Pro and tall windows get the tablet layout. */
@media (max-width: 1023.98px), (max-aspect-ratio: 999/1000) {
  :root[data-boot] .realms { display: none; }
  :root[data-boot] .gate { margin-top: 24px; }
}
.stage:not([data-view='form']) .realm__card { pointer-events: none; }
.stage:not([data-view='form']) .realm__pick,
.stage:not([data-view='form']) .realms__hint { opacity: 0; }
.stage:not([data-view='form']) .intro--form { display: none; }
.stage[data-view='ticket'] .intro--ticket { display: block; }
.stage[data-view='ticket'] .realms:has(.realm__input:checked) .realm__input:not(:checked) + .realm__card { filter: saturate(0.2) brightness(0.4); }
@media (max-width: 1023.98px), (max-aspect-ratio: 999/1000) {
  .stage[data-view='ticket'] .realms,
  .stage[data-view='locked'] .realms { display: none; }
  .stage[data-view='ticket'] .gate { margin-top: 24px; }
  .stage[data-view='locked'] .gate { margin-top: 10px; }
}

/* ---------- tablet ---------- */
@media (min-width: 640px) and (max-width: 1023.98px), (min-width: 640px) and (max-aspect-ratio: 999/1000) {
  :root { --pad: 32px; }
  .stage { max-width: 640px; margin-inline: auto; width: 100%; }
  .realms { gap: 20px; }
  .realm__meta { font-size: 11.5px; }
}
/* Landscape phones: a card taller than the screen can never be seen whole, so size the pair by height. */
@media (max-width: 1023.98px) and (orientation: landscape) and (max-height: 520px) {
  .realms { width: min(100%, 118dvh); margin-inline: auto; }
}

/* ---------- desktop: two realms with the gate between them ---------- */
@media (min-width: 1024px) and (min-aspect-ratio: 1/1) {
  :root { --topbar-h: 72px; --pad: 40px; --gate-w: clamp(520px, 42vw, 640px); }
  .topbar {
    position: absolute;
    inset: 0 0 auto;
    background: linear-gradient(180deg, rgb(8 9 11 / 0.82), rgb(8 9 11 / 0));
  }
  .brand { width: 108px; }
  .topbar__event { font-size: 12px; }

  .stage {
    max-width: none;
    min-height: max(100dvh, 680px);
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--gate-w) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: start;
  }
  .stage::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    z-index: 1;
    width: var(--gate-w);
    translate: -50% 0;
    background: linear-gradient(180deg, rgb(8 9 11 / 0.9), rgb(8 9 11 / 0.97) 30%);
    border-inline: 1px solid;
    border-image: linear-gradient(180deg, transparent 4%, rgb(0 169 127 / 0.7) 42%, rgb(0 169 127 / 0.7) 58%, transparent 96%) 1;
    box-shadow: 0 0 140px 50px rgb(8 9 11 / 0.92);
  }
  .intro, .gate { grid-column: 2; position: relative; z-index: 2; padding-inline: 46px; }
  .intro { grid-row: 1; padding-top: calc(var(--topbar-h) + 18px); }
  .eyebrow { margin-bottom: 12px; }
  .title { font-size: clamp(2.5rem, 1.1rem + 2.1vw, 3.1rem); }
  .lede { font-size: 15px; margin-top: 12px; max-width: 50ch; }
  .gate { grid-row: 2; margin: 0; padding-top: 24px; padding-bottom: 40px; }

  .stage:not([data-view='form']) { align-content: center; padding-top: var(--topbar-h); }
  .stage:not([data-view='form']) .intro { padding-top: 16px; }
  .intro--ticket { text-align: center; }
  .intro--ticket .lede { margin-inline: auto; max-width: 40ch; }
  .intro--ticket .note { margin-inline: auto; text-align: left; }

  .realms {
    position: absolute;
    inset: 0;
    z-index: 0;
    margin: 0;
    gap: 0;
    grid-template-columns: minmax(0, 1fr) var(--gate-w) minmax(0, 1fr);
  }
  .realms__seam, .realms__hint, .realms__error { display: none; }
  .realm--mu { grid-column: 1; }
  .realm--exc { grid-column: 3; }
  .realm__card { height: 100%; aspect-ratio: auto; border-radius: 0; clip-path: none; }
  .realm__bg { border-radius: 0; box-shadow: none; }
  .realm__bg img { filter: brightness(0.58) saturate(0.95); }
  .realm--mu .realm__bg img { object-position: 60% 50%; }
  .realm--exc .realm__bg img { object-position: 40% 50%; }
  .realm--mu .realm__bg::after { background: linear-gradient(90deg, rgb(8 9 11 / 0.35), rgb(8 9 11 / 0.15) 40%, rgb(8 9 11 / 0.85) 92%), linear-gradient(0deg, var(--bg) 2%, rgb(8 9 11 / 0) 42%); }
  .realm--exc .realm__bg::after { background: linear-gradient(270deg, rgb(8 9 11 / 0.35), rgb(8 9 11 / 0.15) 40%, rgb(8 9 11 / 0.85) 92%), linear-gradient(0deg, var(--bg) 2%, rgb(8 9 11 / 0) 42%); }
  .realm--mu .realm__bg::before { background: radial-gradient(60% 40% at 55% 70%, var(--mu-glow), transparent 70%); }
  .realm--exc .realm__bg::before { background: radial-gradient(60% 40% at 45% 70%, var(--exc-glow), transparent 70%); }

  .realm__char { bottom: 0; translate: none; left: auto; width: auto; }
  .realm--mu .realm__char {
    right: -6%;
    bottom: 6%;
    width: min(122%, 72vh);
    -webkit-mask-image: linear-gradient(0deg, transparent 0%, #000 16%), linear-gradient(270deg, transparent 0%, #000 22%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(0deg, transparent 0%, #000 16%), linear-gradient(270deg, transparent 0%, #000 22%);
    mask-composite: intersect;
  }
  /* Anchored to the outer edge so the sword hand is never cut by the window edge; the shoulder may slip under the gate. */
  .realm--exc .realm__char {
    left: auto;
    right: 0;
    bottom: 22%;
    translate: 6% 0;
    width: min(140%, 88vh);
    -webkit-mask-image: linear-gradient(0deg, transparent 0%, #000 18%), linear-gradient(90deg, transparent 0%, #000 20%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(0deg, transparent 0%, #000 18%), linear-gradient(90deg, transparent 0%, #000 20%);
    mask-composite: intersect;
  }
  .realm__char img { transform: translate3d(calc(var(--px, 0) * 10px), calc(var(--py, 0) * 6px), 0); transition: transform 0.9s var(--ease-out); }
  .realm__bg img { translate: calc(var(--px, 0) * -8px) calc(var(--py, 0) * -5px); }

  .realm__foot {
    left: 40px;
    right: auto;
    bottom: 104px;
    justify-items: start;
    gap: 10px;
    padding: 0;
    text-align: left;
    max-width: 62%;
    transition: opacity 0.4s var(--ease-out);
  }
  .realm--exc .realm__foot { left: auto; right: 40px; justify-items: end; text-align: right; }
  .realm__logo { width: clamp(140px, 11vw, 200px); }
  .realm--exc .realm__logo { width: clamp(170px, 14vw, 240px); }
  /* Stays legible where it crosses the knight's flaming swords on narrow side panels. */
  .realm__meta { font-size: 11.5px; text-shadow: 0 1px 2px rgb(0 0 0 / 0.9), 0 0 12px rgb(0 0 0 / 0.85); }
  .realm__pick {
    top: auto;
    right: auto;
    left: 40px;
    bottom: 44px;
    padding: 6px 16px 6px 6px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line-2);
    background: rgb(8 9 11 / 0.55);
    backdrop-filter: blur(8px);
  }
  .realm--exc .realm__pick { left: auto; right: 40px; }
  .realm__pick-text { display: inline; font-size: 12.5px; font-weight: 720; font-stretch: 112%; letter-spacing: 0.06em; text-transform: uppercase; }
  .realm__input:checked + .realm__card .realm__pick { border-color: var(--accent); background: rgb(0 169 127 / 0.16); }
  .realm__card::after { box-shadow: none; }
  .realm--mu .realm__card::after { background: linear-gradient(90deg, transparent 96%, rgb(0 169 127 / 0.55)); }
  .realm--exc .realm__card::after { background: linear-gradient(270deg, transparent 96%, rgb(0 169 127 / 0.55)); }
  .realms.is-invalid .realm__card::after { box-shadow: none; }
  .realms.is-invalid .realm--mu .realm__card::after { background: linear-gradient(90deg, transparent 96%, rgb(255 125 115 / 0.55)); }
  .realms.is-invalid .realm--exc .realm__card::after { background: linear-gradient(270deg, transparent 96%, rgb(255 125 115 / 0.55)); }
  /* On desktop keyboard focus shows on the tile in the gate, not on the whole side panel. */
  .realm__input:focus-visible + .realm__card { outline: none; }
  .stage:has(#g-mu:focus-visible) .tile--mu,
  .stage:has(#g-exc:focus-visible) .tile--exc { outline: 2px solid var(--text); outline-offset: 3px; }

  .stage[data-view='ticket'] .realm__card { transition: transform 1.4s var(--ease-io), filter 0.6s var(--ease-out); }
  .stage[data-view='ticket'] .realm--mu .realm__card { transform: translateX(-9%); }
  .stage[data-view='ticket'] .realm--exc .realm__card { transform: translateX(9%); }
  .stage:not([data-view='form']) .realm__foot { opacity: 0; }

  /* Game tiles inside the gate mirror the two realms. */
  .picker { display: grid; gap: 9px; }
  .picker__label { margin: 0; font-size: 13px; font-weight: 640; letter-spacing: 0.01em; }
  .picker__tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .tile {
    position: relative;
    display: block;
    height: 132px;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--line-2);
    background: var(--panel);
    cursor: pointer;
    isolation: isolate;
    transition: transform 0.4s var(--ease-out), border-color 0.3s, box-shadow 0.3s, filter 0.4s var(--ease-out);
  }
  .tile__bg { position: absolute; inset: 0; z-index: -3; }
  .tile__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.5) saturate(0.9);
    transform: scale(1.06);
    transition: filter 0.5s var(--ease-out), transform 1s var(--ease-out);
  }
  .tile--mu .tile__bg img { object-position: 50% 62%; }
  .tile--exc .tile__bg img { object-position: 50% 30%; }
  .tile__char { position: absolute; z-index: -2; pointer-events: none; transition: transform 0.6s var(--ease-out); }
  .tile__char img { width: 100%; height: auto; }
  .tile--mu .tile__char { right: -10%; bottom: -76%; width: 70%; }
  .tile--exc .tile__char { right: -26%; bottom: -46%; width: 96%; }
  .tile::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgb(8 9 11 / 0.92) 10%, rgb(8 9 11 / 0.55) 50%, rgb(8 9 11 / 0.05) 100%);
  }
  .tile--mu::before,
  .tile--exc::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.55;
    transition: opacity 0.5s var(--ease-out);
  }
  .tile--mu::before { background: radial-gradient(60% 70% at 78% 85%, var(--mu-glow), transparent 70%); }
  .tile--exc::before { background: radial-gradient(60% 70% at 78% 85%, var(--exc-glow), transparent 70%); }
  .tile__body { position: absolute; left: 16px; bottom: 14px; display: grid; justify-items: start; gap: 6px; }
  .tile__logo { width: 92px; height: auto; filter: drop-shadow(0 4px 10px rgb(0 0 0 / 0.7)); }
  .tile--exc .tile__logo { width: 124px; }
  .tile__meta {
    font-size: 10px;
    font-weight: 680;
    font-stretch: 106%;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .tile .tick { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; }
  .tile .tick .icon { width: 13px; height: 13px; }
  .tile:hover { border-color: rgb(232 236 234 / 0.36); transform: translateY(-2px); }
  .tile:hover .tile__bg img { filter: brightness(0.66) saturate(1); transform: scale(1.1); }
  .tile:hover .tile__char { transform: translateX(-5px); }
  .tile.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 16px 40px -18px var(--accent-glow); }
  .tile.is-on .tile__bg img { filter: brightness(0.78) saturate(1.1); }
  .tile.is-on::before { opacity: 1; }
  .tile.is-on .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .picker__tiles:has(.is-on) .tile:not(.is-on) { filter: saturate(0.5) brightness(0.8); }
  .picker.is-invalid .tile { border-color: var(--danger); }

  .pane--form .panel__title, .pane--form .panel__text { display: none; }
  .pane--form .form { margin-top: 18px; }
  .form { gap: 14px; }
  .form__row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; }
  .field { gap: 6px; }
  .input { height: 50px; }

  .foot {
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 40px;
    padding: 30px 44px 44px;
  }
  .foot__legal { max-width: 760px; justify-self: end; text-align: right; }
}
@media (min-width: 1024px) and (max-height: 820px) {
  .intro { padding-top: calc(var(--topbar-h) + 6px); }
  .title { font-size: 2.6rem; }
  .gate { padding-top: 18px; }
  .tile { height: 116px; }
  .input { height: 46px; }
  .btn { height: 50px; }
}
@media (min-width: 1024px) and (max-height: 760px) {
  .intro { padding-top: var(--topbar-h); }
  .eyebrow { margin-bottom: 8px; }
  .title { font-size: 2.3rem; }
  .lede { font-size: 14px; margin-top: 8px; }
  .gate { padding-top: 14px; padding-bottom: 20px; }
  .tile { height: 96px; }
  .tile__logo { width: 76px; }
  .tile--exc .tile__logo { width: 100px; }
  .pane--form .form { margin-top: 14px; }
  .form { gap: 12px; }
  .field { gap: 5px; }
  .input { height: 44px; }
  .btn { height: 48px; }
  .check { font-size: 12.5px; line-height: 1.45; }
}

/* ---------- motion ---------- */
/* Pure CSS so the page still reveals itself if the script fails. */
@media (prefers-reduced-motion: no-preference) {
  .intro .eyebrow { animation: rise 0.8s var(--ease-out) 0.15s both; }
  .intro .title .line > span { animation: lineup 1s var(--ease-out) both; }
  .intro .title .line:nth-child(1) > span { animation-delay: 0.22s; }
  .intro .title .line:nth-child(2) > span { animation-delay: 0.32s; }
  .intro .lede, .intro .note { animation: rise 0.9s var(--ease-out) 0.45s both; }
  .realms__seam { animation: seam 1.1s var(--ease-out) 0.2s both; }
  .realm--mu { animation: realm-in 1.2s var(--ease-out) 0.3s both; }
  .realm--exc { animation: realm-in 1.2s var(--ease-out) 0.42s both; }
  .pane--form { animation: rise 1s var(--ease-out) 0.5s both; }

  @media (min-width: 1024px) and (min-aspect-ratio: 1/1) {
    .stage::before { animation: gate-open 1.3s var(--ease-io) 0.05s both; }
    .realm--mu { animation-name: realm-in-left; }
    .realm--exc { animation-name: realm-in-right; }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes gate-open { from { clip-path: inset(50% -320px); } to { clip-path: inset(0 -320px); } }
@keyframes realm-in-left { from { opacity: 0; transform: translateX(-6%); } to { opacity: 1; transform: none; } }
@keyframes realm-in-right { from { opacity: 0; transform: translateX(6%); } to { opacity: 1; transform: none; } }
@keyframes lineup { from { opacity: 1; transform: translateY(108%); } to { opacity: 1; transform: none; } }
@keyframes seam { from { opacity: 0; transform: scaleY(0); } to { opacity: 1; transform: none; } }
@keyframes realm-in { from { opacity: 0; transform: translateY(28px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.shake { animation: shake 0.38s var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .ticket { animation: none; }
  .ticket__sheen::after { display: none; }
}

/* ---------- document pages (privacy, 404) ---------- */
.doc { position: relative; z-index: 2; padding: 12px var(--pad) 56px; }
.doc__body { width: min(100%, 720px); margin: 0 auto; color: var(--muted); font-size: 15.5px; line-height: 1.7; }
.doc__back { margin: 8px 0 26px; }
.doc__title {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.1rem);
  line-height: 0.95;
  font-weight: 830;
  font-stretch: 125%;
  letter-spacing: -0.012em;
  text-transform: uppercase;
}
.doc__meta { margin: 14px 0 0; font-size: 13px; color: var(--faint); }
.doc__body h2 { margin: 38px 0 10px; color: var(--text); font-size: 18px; line-height: 1.3; font-weight: 760; font-stretch: 112%; }
.doc__body p { margin: 0 0 12px; }
.doc__body ul { margin: 0 0 12px; padding-left: 1.2em; }
.doc__body li { margin-bottom: 6px; }
.doc__body li::marker { color: var(--accent); }
.doc__body a:not(.btn):not(.link) { color: var(--text); text-underline-offset: 3px; }
.doc--center { min-height: calc(100dvh - var(--topbar-h)); display: grid; place-items: center; text-align: center; }
.doc--center .doc__body { width: min(100%, 520px); }
.doc__cta { width: auto; margin-top: 26px; }
.doc--center .doc__title + p { margin-top: 18px; }
@media (min-width: 1024px) {
  .doc-page .topbar { position: relative; background: none; }
  .doc { padding-top: 20px; }
}

/* ---------- staff ---------- */
.staff-page .topbar { position: relative; background: none; border-bottom: 1px solid var(--line); }
.staff-main { position: relative; z-index: 2; width: min(100%, 640px); margin: 0 auto; padding: 28px var(--pad) 48px; }
.staff-main .pane__title, .staff-main .title { font-size: clamp(2rem, 1.5rem + 2.4vw, 2.5rem); line-height: 0.95; font-weight: 820; font-stretch: 125%; text-transform: uppercase; margin: 0; }
.staff-main .pane__text { margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.staff-who { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.staff-who strong { color: var(--text); }
.staff-card { margin-top: 22px; padding: 22px; border-radius: var(--r-panel); background: var(--panel); border: 1px solid var(--line); }
.staff-card .pane__title { font-size: 1.5rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0 0; }
.stat { padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.stat dt { font-size: 10.5px; font-weight: 700; font-stretch: 112%; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stat dd { margin: 4px 0 0; font-family: var(--mono); font-size: 22px; font-weight: 600; }
.lookup { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 14px; }
.lookup .input { height: 60px; font-size: 19px; }
.results__count { margin: 18px 0 0; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.results__count + .result { margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.chip b { font-family: var(--mono); font-weight: 600; color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #04110d; }
.chip[aria-pressed="true"] b { color: #04110d; }
.chip:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.roster { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.roster__row { display: grid; gap: 4px; width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color 0.2s; }
.roster__row:hover { border-color: var(--line-2); }
.roster__row:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.roster__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.roster__name { font-weight: 760; font-size: 15.5px; overflow-wrap: anywhere; }
.roster__pill { flex: none; padding: 3px 10px; border-radius: var(--r-pill); font-size: 11px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid var(--warn); color: var(--warn); }
.roster__pill--done { border-color: var(--accent); color: var(--accent-hi); }
.roster__line { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.roster__line--phone { font-family: var(--mono); color: var(--text); }
.roster__empty { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.roster__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.roster__actions .btn { width: auto; }
.result__rows dd { overflow-wrap: anywhere; }
.lookup .btn { width: auto; height: 60px; }
.lookup__alt { display: flex; gap: 16px; margin-top: 14px; }
.result { margin-top: 18px; padding: 20px; border-radius: var(--r-card); border: 1.5px solid var(--line-2); background: var(--panel-2); }
.result__status { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; font-weight: 780; font-stretch: 115%; letter-spacing: 0.12em; text-transform: uppercase; }
.result__status .icon { width: 26px; height: 26px; }
.result--valid { border-color: var(--accent); background: linear-gradient(160deg, rgb(0 169 127 / 0.14), var(--panel-2) 60%); }
.result--valid .result__status { color: var(--accent-hi); }
.result--redeemed { border-color: var(--warn); background: linear-gradient(160deg, rgb(246 188 82 / 0.12), var(--panel-2) 60%); }
.result--redeemed .result__status { color: var(--warn); }
.result--invalid { border-color: var(--danger); background: linear-gradient(160deg, rgb(255 125 115 / 0.12), var(--panel-2) 60%); }
.result--invalid .result__status { color: var(--danger); }
.result__name { margin: 14px 0 0; font-size: 26px; font-weight: 800; font-stretch: 115%; line-height: 1.1; overflow-wrap: anywhere; }
.result__rows { display: grid; gap: 8px; margin: 14px 0 0; }
.result__rows div { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.result__rows dt { color: var(--muted); }
.result__rows dd { margin: 0; font-weight: 650; text-align: right; }
.result__hint { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); }
.result .btn { margin-top: 18px; }
.scan { position: relative; margin-top: 14px; border-radius: var(--r-card); overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scan video { width: 100%; height: 100%; object-fit: cover; }
.scan__frame { position: absolute; inset: 18%; border: 2px solid var(--accent); border-radius: 18px; box-shadow: 0 0 0 999px rgb(0 0 0 / 0.35); }
.pin { display: grid; gap: 14px; margin-top: 20px; }
.pin .input { height: 64px; font-family: var(--mono); font-size: 28px; letter-spacing: 0.4em; text-align: center; }
#staff-logout { margin-top: 22px; }
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .lookup { grid-template-columns: 1fr; }
  .lookup .btn { width: 100%; }
}
/* "Hand over merch" must fit a 320px phone. */
@media (max-width: 419.98px) {
  .staff-card { padding: 18px; }
  .result { padding: 16px; }
  .result .btn { padding-inline: 14px; letter-spacing: 0.04em; font-size: 13.5px; }
}
