@font-face { font-family: 'Ubuntu'; font-style: normal; font-weight: 400; font-display: swap; src: url('assets/fonts/ubuntu-regular.ttf') format('truetype'); }
@font-face { font-family: 'Ubuntu'; font-style: normal; font-weight: 500; font-display: swap; src: url('assets/fonts/ubuntu-medium.ttf') format('truetype'); }
@font-face { font-family: 'Ubuntu'; font-style: normal; font-weight: 700; font-display: swap; src: url('assets/fonts/ubuntu-bold.ttf') format('truetype'); }
:root {
  color-scheme: light;
  font-family: 'Ubuntu', sans-serif;
  color: #fff;
  background: #7c003f;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --intro-duration: 600ms;
  --intro-scale: 1.2;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-width: 280px; min-height: 100%; }
body {
  min-height: 100svh;
  background: linear-gradient(180deg, #7c003f 0%, #e20073 50%, #7c003f 100%);
  -webkit-tap-highlight-color: transparent;
}
.welcome {
  --page-height: max(560px, 100svh);
  position: relative;
  width: min(100%, 560px);
  height: var(--page-height);
  margin-inline: auto;
}
body:not(.ready) { overflow: hidden; }
.welcome-screen {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, #7c003f 0%, #e20073 50%, #7c003f 100%);
  transition: transform 800ms cubic-bezier(.65, 0, .2, 1);
}
.opening-preview { overflow: hidden; }
.opening-preview .welcome-screen { transform: translateY(-100%); }
html:has(body.preview-active) { height: 100%; overflow: hidden; overscroll-behavior: none; }
.preview-active { height: 100dvh; overflow: hidden; overscroll-behavior: none; touch-action: pinch-zoom; }
.brand {
  position: absolute;
  top: max(calc(7.55 * var(--page-height) / 100), env(safe-area-inset-top));
  left: 50%;
  width: 41.282%;
  transform: translate(-50%, calc(var(--page-height) * .5 - var(--page-height) * .0755 - 50%)) scale(var(--intro-scale));
  transition: transform var(--intro-duration) var(--ease-out);
  transform-origin: center;
}
.brand img, .title img { display: block; width: 100%; height: auto; }
.title {
  position: absolute;
  width: 86.667%;
  top: calc(36.77 * var(--page-height) / 100);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  line-height: 1;
}
.reveal { opacity: 0; transition: opacity 1000ms cubic-bezier(.4, 0, .2, 1); }
.name-field {
  position: absolute;
  width: 69.231%;
  left: 50%;
  top: calc(61.92 * var(--page-height) / 100);
  transform: translateX(-50%);
}
input, button { font: inherit; font-size: clamp(16px, 4.1vw, 20px); }
input {
  width: 100%;
  min-height: clamp(55px, 14.1vw, 68px);
  border: 2px solid transparent;
  border-radius: 17px;
  padding: 14px 20px;
  background: #fff;
  color: #640134;
  text-align: center;
  outline: none;
  transition: box-shadow 160ms ease;
}
input::placeholder { color: #8d6378; opacity: 1; }
input:focus-visible { box-shadow: 0 0 0 4px #ffffff45; }
input[aria-invalid="true"] { border-color: #6c0137; }
.submit-area {
  position: absolute;
  top: min(calc(86.71 * var(--page-height) / 100), calc(var(--page-height) - 100px - env(safe-area-inset-bottom)));
  left: 50%;
  width: 69.231%;
  opacity: 0;
  transform: translate(-50%, 110px);
  transition: transform var(--intro-duration) var(--ease-out), opacity 350ms ease-out;
}
button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: clamp(55px, 14.1vw, 68px);
  padding: 14px 20px;
  border: 0;
  border-radius: 17px;
  background: #6c0137;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
button:active { transform: scale(.97); }
button:focus-visible { outline: 2px solid #fff; outline-offset: 5px; }
.check { display: none; }
.submitted .check { display: block; }
.status { min-height: 1.3em; margin: 10px -20px 0; font-size: 14px; line-height: 1.35; text-align: center; }
.ready .brand { transform: translate(-50%, 0) scale(1); }
.ready .reveal { opacity: 1; }
.ready .submit-area { opacity: 1; transform: translate(-50%, 0); }
.orientation-message { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.preview-screen {
  /* A document layer can paint behind translucent mobile browser controls;
     a fixed, viewport-clipped layer may leave a solid strip there in Safari. */
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  min-height: max(560px, calc(100lvh + env(safe-area-inset-bottom)));
  overflow: clip;
  background: linear-gradient(180deg, #7c003f 0%, #e20073 50%, #7c003f 100%);
}
.preview-active .preview-screen { position: relative; }
.preview-canvas {
  --preview-height: max(560px, 100svh);
  --preview-width: min(100vw, 560px);
  --book-angle: -10.0554deg;
  --heading-top: max(calc(max(23px, env(safe-area-inset-top)) + 203px), calc(var(--preview-height) * .28));
  position: relative;
  width: min(100%, 560px);
  height: var(--preview-height);
  margin-inline: auto;
  overflow: visible;
  isolation: isolate;
}
.preview-summary {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 5.64%;
  right: 5.64%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3;
}
.passenger-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.passenger-identity { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.passenger-name {
  max-width: 100%;
  margin: 0 0 8px;
  font-size: clamp(24px, 7.69vw, 36px);
  line-height: 1.15;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: margin-bottom 400ms var(--ease-out) 200ms;
}
.member-label {
  display: inline-block;
  margin: 0;
  padding: 6px 10px;
  border-radius: 5px;
  background: #b8ffff;
  color: #246f73;
  font-size: clamp(9px, 2.31vw, 10.5px);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  max-height: 40px;
  overflow: hidden;
  transition: transform 500ms cubic-bezier(.65, 0, .2, 1), opacity 350ms ease, max-height 400ms var(--ease-out) 200ms, padding 400ms var(--ease-out) 200ms;
}
.book-opening .member-label, .book-open .member-label { transform: translateX(-120vw); opacity: 0; max-height: 0; padding-block: 0; pointer-events: none; }
.book-opening .passenger-name, .book-open .passenger-name { margin-bottom: 0; }
.header-logo { width: clamp(65px, 18vw, 88px); height: auto; flex: 0 0 auto; }
.preview-title {
  position: absolute;
  top: calc(var(--heading-top) - 75px);
  left: 50%;
  width: 86.667%;
  margin: 0;
  transform: translateX(-50%) rotate(var(--book-angle));
  outline: none;
  transition: opacity 300ms ease;
}
.preview-title img { display: block; width: 100%; height: auto; }
.preview-title-art { display: block; width: 100%; height: auto; overflow: visible; }
.title-letter { animation: title-letter-wave 6s ease-in-out infinite; animation-delay: var(--letter-delay); animation-play-state: paused; }
.preview-active:not(.book-opening):not(.book-open) .title-letter { animation-play-state: running; }
@keyframes title-letter-wave { 0%,16%,100% { transform: translateY(0); } 6% { transform: translateY(-4px); } 11% { transform: translateY(1px); } }
.capture-progress {
  width: 100%;
}
.progress-track {
  position: relative;
  height: 18px;
  border-radius: 20px;
  background: #e3a900;
  overflow: hidden;
}
.progress-fill { position: absolute; inset: 0 auto 0 0; width: 10%; border-radius: inherit; background: #ffbe00; }
.progress-shine { position: absolute; right: 5px; top: 3px; height: 5px; width: min(35px, 60%); border-radius: 5px; background: #ffde7d; }
.progress-value { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; line-height: 1; color: #fff; }
.book-position {
  position: absolute;
  top: calc(max(calc(var(--preview-height) * .5457), calc(var(--heading-top) + var(--preview-width) * .44 + 35px)) - 99px);
  left: -69.71%;
  width: 166.78%;
  transform-origin: top left;
  transform: rotate(var(--book-angle));
  transition: transform 950ms cubic-bezier(.22, 1, .36, 1);
  z-index: 2;
}
.book-float { position: relative; animation: book-float 7s ease-in-out infinite; animation-play-state: paused; }
.preview-active .book-float { animation-play-state: running; }
.book-preview { position: relative; filter: drop-shadow(-4px -4px 4px #00000040); outline: none; }
.book-open-trigger { position: absolute; inset: 0; min-height: 0; padding: 0; border-radius: 25px; background: transparent; }
.book-open-trigger:hover { background: transparent; }
.book-open-trigger:active { transform: none; }
.book-instructions {
  position: absolute;
  top: var(--instructions-top, 145px);
  left: 5.64%;
  right: 5.64%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  z-index: 4;
  margin: 0;
  font-size: clamp(14px, 3.59vw, 17px);
  line-height: 1.25;
  opacity: 0;
  visibility: hidden;
  transform: translateY(48px);
  transition: opacity 400ms ease 200ms, transform 700ms cubic-bezier(.22, 1, .36, 1) 200ms, visibility 0s 200ms;
}
.book-instructions p { margin: 0; flex: 0 1 auto; }
.information-button { position: relative; font-size: inherit; width: 1.25em; height: 1.25em; min-height: 0; flex: 0 0 1.25em; padding: 0; border-radius: 50%; background: transparent; }
.information-button svg { width: 100%; height: 100%; }
.information-button::after { content: ''; position: absolute; inset: -11px; }
.instructions-modal { width: min(86vw, 420px); max-height: 80dvh; padding: 32px 28px; border: 0; border-radius: 22px; color: #640134; background: #f5f2e9; box-shadow: 0 20px 70px #30001866; }
.instructions-modal::backdrop { background: #30001888; backdrop-filter: blur(5px); }
.instructions-modal[open] { animation: modal-enter 320ms var(--ease-out); }
.instructions-modal.closing { animation: modal-exit 200ms ease-in forwards; }
.instructions-modal[open]::backdrop { animation: backdrop-enter 240ms ease-out; }
.instructions-modal.closing::backdrop { animation: backdrop-enter 200ms ease-in reverse forwards; }
.instructions-modal h2 { margin: 12px 24px 16px 0; font-size: 23px; line-height: 1.15; }
.instructions-modal p { margin: 0; font-size: 17px; line-height: 1.55; }
.modal-close { position: absolute; right: 16px; top: 16px; width: 14px; height: 14px; min-height: 0; padding: 0; border-radius: 50%; color: #640134; background: transparent; }
.modal-close svg { width: 12px; height: 12px; }
.modal-close::after { content: ''; position: absolute; inset: -15px; }
.modal-close:focus-visible { outline-color: #640134; outline-offset: 0; }
@keyframes modal-enter { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: scale(1); } }
@keyframes modal-exit { to { opacity: 0; transform: scale(.9); } }
@keyframes backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
.camera-control {
  --safe-inset: env(safe-area-inset-bottom, 0px);
  position: absolute;
  top: var(--camera-top);
  z-index: 4;
  left: 50%;
  transform: translate(-50%, 8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 350ms ease 550ms, transform 350ms var(--ease-out) 550ms, visibility 0s 550ms;
}
.camera-button { width: 51px; height: 45.75px; min-height: 45.75px; padding: 6px; border: 1px solid #fff; background: #af0058; border-radius: 6.75px; }
.camera-button img { width: 21.9375px; height: 16.3125px; }
.camera-button:disabled { cursor: default; }
.book-opening .book-position, .book-open .book-position { transform: var(--open-book-transform); }
.book-opening .preview-title, .book-open .preview-title { opacity: 0; pointer-events: none; }
.book-opening .book-instructions, .book-open .book-instructions { opacity: 1; visibility: visible; transform: translateY(0); }
.book-opening .camera-control, .book-open .camera-control { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.book-opening .book-open-trigger, .book-open .book-open-trigger { pointer-events: none; }
.book-art { display: block; width: 100%; height: auto; }
.paper-texture { position: absolute; top: 3.254%; height: 93.275%; width: 46.544%; border-radius: 10px; background: url('assets/paper-grain.png') repeat; background-size: 96px 96px; mix-blend-mode: multiply; opacity: .45; pointer-events: none; }
.paper-left { left: 2.15%; }
.paper-right { left: 50.998%; }
.collected-stamp { position: absolute; width: 25.5%; height: auto; left: 62%; top: 16%; pointer-events: none; }
.book-ink { position: absolute; inset: 0; clip-path: url(#paper-ink-clip); pointer-events: none; }
.earned-stamp { position: absolute; width: 25.5%; height: auto; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; pointer-events: auto; transform: translate(-50%,-50%) rotate(90deg); animation: stamp-press 300ms var(--ease-out); }
.earned-stamp img { display: block; width: 100%; height: auto; pointer-events: none; }
.earned-stamp.detail-selected { z-index: 1; }
.earned-stamp,.collected-stamp { transition: opacity 250ms ease; }
.badge-detail-active .earned-stamp:not(.detail-selected),.badge-detail-active .collected-stamp { opacity: 0; }
.earned-stamp:hover,.earned-stamp:active { background: transparent; transform: translate(-50%,-50%) rotate(90deg); }
.earned-stamp:focus { outline: none; }
.keyboard-navigation .earned-stamp:focus-visible { outline: 2px solid #7c003f; outline-offset: 5px; }
@keyframes stamp-press { from { opacity: 0; transform: translate(-50%,-50%) rotate(90deg) scale(1.2); } to { opacity: 1; transform: translate(-50%,-50%) rotate(90deg) scale(1); } }
.clip-definitions { position: absolute; pointer-events: none; }
/* Paint a full document layer behind translucent mobile browser bars, as on welcome. */
html:has(body.success-active), body.success-active { background: #7c003f; }
.success-active:not(.placing-stamp) .preview-screen { visibility: hidden; }
.scan-success { position: absolute; z-index: 20; top: 0; left: 0; width: 100%; height: max(100svh,calc(100lvh + env(safe-area-inset-bottom))); overflow: hidden; background: linear-gradient(180deg,#7c003f 0%,#e20073 50%,#7c003f 100%); transition: transform 650ms cubic-bezier(.65,0,.2,1); }
.scan-success.leaving { transform: translateY(-100%); pointer-events: none; }
.success-canvas { position: relative; width: min(100%,560px); height: 100svh; margin-inline: auto; }
.success-logo { position: absolute; top: max(22px,2.61svh,env(safe-area-inset-top)); left: 50%; width: clamp(40px,10.77vw,56px); height: auto; transform: translateX(-50%); }
.signature-content { position: absolute; top: 90px; left: 50%; transform: translateX(-50%); width: min(88.72vw,440px); text-align: center; }
.signature-photo { display: block; width: 100%; margin-inline: auto; aspect-ratio: 1; object-fit: cover; border-radius: clamp(18px,5.13vw,28px); background: #d9d9d9; }
.signature-name { margin: clamp(16px,2.85svh,28px) 0 0; font-size: clamp(20px,5.13vw,28px); font-weight: 700; line-height: 1.2; text-wrap: balance; }
.signature-description { margin: 12px 0 0; font-size: 16px; line-height: 1.4; text-wrap: pretty; }
.stamp-tool { position: fixed; z-index: 22; left: 50%; top: 79.55svh; width: min(53.85vw,300px,29svh); height: auto; aspect-ratio: 1; min-height: 0; padding: 0; border-radius: 0; transform: translate(-50%,-50%); background: transparent; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: none; cursor: grab; }
.stamp-tool:hover { background: transparent; }
.stamp-tool:focus-visible { outline: none; }
.stamp-tool:focus-visible img { filter: drop-shadow(0 0 6px #ffbe0080); }
.stamp-tool:active { transform: translate(-50%,-50%); }
.stamp-tool img { display: block; width: 100%; height: 100%; pointer-events: none; transition: transform 160ms var(--ease-out),filter 160ms ease; }
.stamp-tool.holding img { transform: scale(.96); }
.stamp-tool.needs-pickup img { animation: pickup-hint 1800ms ease-in-out infinite; }
@keyframes pickup-hint { 0%,32%,100% { transform: rotate(0); } 5%,15%,25% { transform: translateX(-2px) rotate(-3deg); } 10%,20%,30% { transform: translateX(2px) rotate(3deg); } }
.stamp-tool.picked-up img { filter: drop-shadow(0 10px 8px #20001055); }
.stamp-tool.dragging { cursor: grabbing; }
.stamp-tool.over-paper img { filter: drop-shadow(0 6px 5px #20001044); }
.stamp-guidance { position: fixed; z-index: 23; left: 50%; top: calc(79.55svh + min(16vw,89px,8.6svh)); transform: translateX(-50%); width: min(86%,480px); margin: 0; font-size: 14px; line-height: 1.4; text-align: center; pointer-events: none; }
.placing-stamp .stamp-guidance { bottom: auto; width: max-content; max-width: calc(100vw - 24px); padding: 11px 18px; border: 1px solid #ffffff66; border-radius: 999px; color: #fff; background: linear-gradient(160deg,#ffffff30,#ffffff08),#3d0b2c99; backdrop-filter: blur(18px) saturate(1.65); -webkit-backdrop-filter: blur(18px) saturate(1.65); box-shadow: inset 0 1px 0 #ffffff4d,inset 0 -1px 0 #ffffff14,0 6px 22px #25001426; text-shadow: 0 1px 2px #25001440; }
.placing-stamp .camera-control { visibility: hidden; opacity: 0; transition: none; }
.stamp-feedback { position: absolute; z-index: 6; bottom: max(86px, calc(env(safe-area-inset-bottom) + 77px)); left: 50%; transform: translateX(-50%); width: max-content; max-width: 90%; margin: 0; padding: 10px 16px; border-radius: 14px; background: #640134; box-shadow: 0 4px 20px #30001833; font-size: 14px; line-height: 1.3; text-align: center; }
.stamp-celebration { position: fixed; z-index: 40; top: 50%; left: 50%; width: max-content; max-width: min(88.72vw,420px); height: auto; padding: 16px; border-radius: 24px; transform: translate(-50%,-50%); opacity: 0; background: #640134ed; color: white; box-shadow: 0 16px 50px #30001833; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); pointer-events: none; transition: opacity 380ms ease; }
.stamp-celebration.visible { opacity: 1; animation: celebration-bounce 500ms cubic-bezier(.22,1,.36,1); }
@keyframes celebration-bounce { 0% { transform: translate(-50%,-50%) scale(.9); } 65% { transform: translate(-50%,-50%) scale(1.035); } 100% { transform: translate(-50%,-50%) scale(1); } }
.celebration-dismiss,.celebration-dismiss:hover,.celebration-dismiss:active { position: fixed; inset: 0; z-index: 39; width: 100%; height: 100dvh; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; transform: none; transition: none; cursor: pointer; }
.celebration-dismiss:focus-visible { outline: none; }
.collection-notice { position: fixed; z-index: 40; bottom: 0; left: 0; width: 100%; padding: 18px 5.64% max(18px,env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: #58002d; color: #fff; transform: translateY(100%); transition: transform 400ms cubic-bezier(.22,1,.36,1); pointer-events: none; }
.collection-notice.visible { transform: translateY(0); }
.collection-notice p { margin: 0; font-size: 16px; line-height: 1.35; font-weight: 400; text-align: left; }
.collection-count { font-weight: 700; }
.celebration-copy { margin: 0; text-align: center; }
.celebration-heading { margin: 0; font-size: clamp(24px,7.69vw,36px); font-weight: 700; line-height: 1.15; text-wrap: balance; }
.celebration-detail { margin: 8px 0 0; font-size: clamp(17px,4.6vw,21px); line-height: 1.45; text-wrap: pretty; }
.celebration-heading:empty,.celebration-detail:empty { display: none; }
.progress-stars { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.progress-star { position: absolute; color: #ffde7d; text-shadow: 0 1px 4px #a9720070; opacity: 0; animation: progress-star-fall 1600ms cubic-bezier(.25,.5,.55,1) both; }
@keyframes progress-star-fall { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.3); } 12% { opacity: 1; } 28% { opacity: 1; transform: translate(var(--star-mid-x),-42px) rotate(50deg) scale(1.1); } 65% { opacity: .9; } 100% { opacity: 0; transform: translate(var(--star-x),var(--star-fall)) rotate(210deg) scale(.5); } }
.scanner { position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; color: white; background: #1a1016; overflow: hidden; }
.scanner::backdrop { background: #1a1016; }
.scanner-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-reticle { position: absolute; top: 46%; left: 50%; width: min(78vw, 350px, 46dvh); aspect-ratio: 1; transform: translate(-50%, -50%); border: 2px solid #ffffffcc; border-radius: 24px; box-shadow: 0 0 0 150vmax #17061080; transition: border-color 200ms ease; }
.scan-reticle.recognising { border-color: #ffde7d; }
.scan-centre { position: absolute; width: 18px; height: 18px; left: 50%; top: 50%; transform: translate(-50%,-50%); }
.scan-centre::before,.scan-centre::after { content: ''; position: absolute; background: #fff; border-radius: 2px; box-shadow: 0 0 2px #000; }
.scan-centre::before { left: 8px; top: 0; width: 2px; height: 18px; }
.scan-centre::after { left: 0; top: 8px; width: 18px; height: 2px; }
.scanner-header { position: absolute; z-index: 1; top: max(22px,env(safe-area-inset-top)); left: 6%; right: 6%; min-height: 28px; display: grid; grid-template-columns: 26px 1fr 26px; align-items: center; gap: 8px; }
.scanner-header h2 { grid-column: 2; font-size: 22px; font-weight: 500; margin: 0; text-align: center; }
.scanner-close { position: relative; grid-column: 3; width: 22px; height: 22px; min-height: 22px; padding: 5px; border-radius: 50%; background: #640134cc; }
.scanner-close svg { width: 12px; height: 12px; }
.scanner-close::after { content: ''; position: absolute; inset: -11px; }
.scanner-copy { position: absolute; left: 8%; right: 8%; top: calc(46% + min(39vw, 175px, 23dvh) + 24px); text-align: center; }
.scanner-copy p { margin: 0; font-size: 16px; line-height: 1.4; }
.scanner-copy .scanner-status { margin-top: 12px; color: #ffde7d; font-size: 14px; min-height: 40px; }
.scanner-retry { width: min(220px,100%); min-height: 44px; margin: 12px auto 0; padding: 10px; font-size: 16px; }
.scanner.has-error .scan-reticle { visibility: hidden; }
.scanner.has-error .scanner-copy { top: 28%; }
@keyframes book-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (max-height: 700px) {
  .preview-title { width: 78%; }
}
@media (hover: hover) and (pointer: fine) { button:hover { background: #59012e; } .information-button:hover { background: #ffffff18; } .modal-close:hover { background: #64013412; } }
@media (min-width: 600px) and (orientation: portrait) {
  .brand { width: 38%; }
  .title { width: 83%; }
}
@media (orientation: landscape) and (pointer: coarse) {
  .scan-success,.stamp-tool,.stamp-guidance { visibility: hidden; }
  .scanner::after { content: 'Please turn your device to portrait.'; position: absolute; inset: 0; display: grid; place-items: center; background: #7c003f; font-size: 20px; padding: 24px; text-align: center; }
  body:not(:has(input:focus)) .welcome, body:not(:has(input:focus)) .preview-screen { visibility: hidden; }
  body:not(:has(input:focus)) .orientation-message { position: fixed; z-index: 5; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; background: linear-gradient(#7c003f, #bc0060, #7c003f); text-align: center; font-size: 20px; line-height: 1.5; }
}
@media (prefers-reduced-motion: reduce) {
  .title-letter { animation: none; }
  .brand, .submit-area, button { transition: opacity 180ms ease; }
  .reveal { transition-duration: 180ms; }
  button:active { transform: none; }
  .welcome-screen { transition: opacity 180ms ease; }
  .opening-preview .welcome-screen { transform: none; opacity: 0; }
  .book-float { animation: none; }
  .progress-fill { transition: none; }
  .book-position { transition: none; }
  .book-instructions, .camera-control { transition: opacity 180ms ease; }
  .instructions-modal[open], .instructions-modal[open]::backdrop { animation: none; }
  .stamp-tool.needs-pickup img { animation: none; }
  .stamp-celebration { transition-duration: 180ms; }
  .stamp-celebration.visible { animation: none; }
  .collection-notice { transition: none; }
  .earned-stamp { animation: none; }
  .member-label, .passenger-name { transition: none; }
  .scan-success { transition: opacity 180ms ease; }
  .scan-success.leaving { transform: none; opacity: 0; }
  .stamp-tool img { transition: none; }
}
/* Badge detail: a shared book transform above a sliding half-height sheet. */
/* Keep a decoding surface for camera inference without displaying a preview. */
.hand-video { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.hand-cursor { position: fixed; z-index: 24; width: 22px; height: 22px; border: 2px solid white; border-radius: 50%; background: #7c003f70; transform: translate(-50%,-50%); box-shadow: 0 0 0 3px #7c003f50; pointer-events: none; }
.hand-cursor.pinched { background: #ffde7d; border-color: #7c003f; }
@media (orientation: landscape) and (pointer: coarse) { .hand-cursor { visibility: hidden; } }
.book-focus { position: absolute; inset: 0; z-index: 2; transform-origin: 0 0; transition: transform 700ms cubic-bezier(.22,1,.36,1); pointer-events: none; }
.book-focus .book-open-trigger { pointer-events: auto; }
.book-open .book-focus .book-open-trigger { pointer-events: none; }
.preview-summary { transition: transform 600ms cubic-bezier(.22,1,.36,1),opacity 350ms ease; }
.badge-detail-active .preview-summary { transform: translateY(-240px); opacity: 0; pointer-events: none; transition: transform 600ms cubic-bezier(.22,1,.36,1),opacity 250ms ease; }
.book-open .book-instructions { transition: none; }
.badge-detail-active .book-instructions { visibility: hidden; pointer-events: none; }
.badge-detail-active .camera-control { transform: translate(-50%,120px); opacity: 0; pointer-events: none; transition: transform 500ms cubic-bezier(.22,1,.36,1),opacity 250ms ease; }
.badge-detail-active .book-position { transition: none; }
.badge-details { position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #171717; overflow: clip; }
.badge-details::backdrop { background: transparent; }
.badge-sheet { position: absolute; bottom: 0; left: 50%; display: flex; flex-direction: column; width: min(100%,560px); height: 50%; border-radius: 24px 24px 0 0; background: white; overflow: clip; transform: translate(-50%,100%); transition: transform 700ms cubic-bezier(.22,1,.36,1); }
.badge-details.visible .badge-sheet { transform: translate(-50%,0); }
.badge-sheet-handle { height: 28px; flex: 0 0 28px; width: 100%; display: flex; justify-content: center; padding-top: 10px; touch-action: none; cursor: grab; }
.badge-sheet-handle span { width: 60px; height: 3px; border-radius: 4px; background: #d9d9d9; }
.badge-detail-close { position: absolute; top: 29px; right: 5.64%; z-index: 1; display: grid; place-items: center; width: 18px; height: 18px; min-height: 0; padding: 3px; border-radius: 50%; background: #e5e5e5; color: #626262; }
.badge-detail-close::after { content: ''; position: absolute; inset: -13px; }
.badge-detail-close:hover { background: #d5d5d5; }
.badge-detail-content { overflow-y: auto; overscroll-behavior: contain; padding: 0 5.64% max(24px,env(safe-area-inset-bottom)); touch-action: pan-y; }
.badge-detail-content h2 { margin: 0 34px 4px 0; font-size: clamp(20px,5.13vw,26px); line-height: 1.18; font-weight: 700; text-transform: uppercase; }
.badge-detail-airport { color: #898989; margin: 0; font-size: 14px; line-height: 1.4; }
.badge-detail-date { display: flex; align-items: center; gap: 6px; width: fit-content; margin-top: 8px; padding: 5px 7px; border-radius: 4px; background: #99004d; color: white; font-size: 14px; line-height: 1; }
.badge-detail-description { margin-top: 14px; font-size: 16px; line-height: 1.35; }
.badge-detail-description p { margin: 0 0 12px; }
.badge-detail-description p:last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) {
  .book-focus,.preview-summary,.badge-sheet,.badge-detail-active .preview-summary,.badge-detail-active .camera-control { transition-duration: 160ms; }
  .earned-stamp:active { transform: translate(-50%,-50%) rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) {
  .book-focus,.badge-sheet,.badge-detail-active .preview-summary,.badge-detail-active .camera-control { transition: none; }
}
@media (orientation: landscape) and (pointer: coarse) {
  .badge-details::after { content: 'Please turn your device to portrait.'; position: fixed; inset: 0; display: grid; place-items: center; background: #7c003f; color: white; text-align: center; font-size: 20px; padding: 24px; }
}
