/* Le Ticket: one phone-sized stage, full screen on a phone, centred on a computer.
   Same DA as the app: pure black, white only for the one action, Funnel Display. */
:root {
  --bg: #000000;
  --ink: #FFFFFF;
  --secondary: rgba(255,255,255,0.56);
  --faint: rgba(255,255,255,0.30);
  --control: #1F1F1F;
  --hairline: rgba(255,255,255,0.12);
  --on-ink: #000000;
  --glass: rgba(0,0,0,0.55);
  --font: "Funnel Display", ui-sans-serif, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { font-family: var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; }

.app {
  position: fixed; top: 0; bottom: 0; left: 50%;
  width: 100%; max-width: 520px; transform: translateX(-50%);
  overflow: hidden; overflow: clip;
  container-type: inline-size;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.language-switch {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; z-index: 30;
  display: flex; gap: 3px; padding: 3px; border-radius: 10px;
  background: rgba(0,0,0,.7); border: 1px solid var(--hairline);
}
.language-switch a { padding: 5px 7px; border-radius: 7px; color: var(--secondary); text-decoration: none; font-size: 11px; font-weight: 800; }
.language-switch a[aria-current="page"] { color: var(--ink); background: var(--control); }
.language-switch a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (min-width: 521px) { .app { border-left: 1px solid var(--hairline); border-right: 1px solid var(--hairline); } }

/* On a computer: the stage on the left, how to play and the app's QR code on its right. */
.side { display: none; }
@media (min-width: 960px) {
  body { display: flex; justify-content: center; align-items: center; gap: 64px; height: 100dvh; }
  .app {
    position: relative; left: auto; transform: none; flex: 0 0 auto;
    width: min(100dvh, calc(100vw - 520px)); max-width: none; height: auto; aspect-ratio: 1;
  }
  .side { display: grid; gap: 22px; width: 420px; max-height: 100dvh; overflow-y: auto; padding-block: 32px; }
  .r-ticket { container-type: inline-size; }
}
.side-logo { display: block; width: 56px; height: auto; }
.side h2 { margin: -12px 0 0; font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: -.03em; }
.side.result-mode { gap: 12px; padding-block: 12px; }
.side.result-mode .side-logo { width: 44px; }
.side.result-mode h2 { margin: 0; font-size: 36px; line-height: .95; }
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; font-size: 15px; line-height: 1.45; color: var(--secondary); }
.steps li::before {
  counter-increment: s; content: counter(s);
  width: 28px; height: 28px; border-radius: 50%; background: var(--control);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--ink);
}
.steps b { color: var(--ink); font-weight: 600; }
kbd { font-family: var(--font); font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--control); border: 1px solid var(--hairline); color: var(--ink); }
.webapp-preview { display: grid; justify-items: center; gap: 12px; }
.phone-preview {
  position: relative; width: 318px; height: 690px; padding: 9px;
  border-radius: 54px; background: #191919; border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 24px 70px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.05); overflow: hidden;
}
.phone-preview iframe {
  position: absolute; left: 9px; top: 9px; width: 375px; height: 840px;
  border: 0; border-radius: 56px; background: #000; display: block;
  transform: scale(.8); transform-origin: top left;
}
.preview-qr { display: grid; justify-items: center; gap: 8px; color: var(--secondary); text-decoration: none; font-size: 12px; font-weight: 600; }
.preview-qr .qr { width: 80px; height: 80px; padding: 6px; border-radius: 11px; background: #fff; display: block; }

/* Light from the poster, like the app's halo. */
.halo {
  position: absolute; inset: -20%;
  background-size: cover; background-position: center;
  filter: blur(42px) saturate(1.3); opacity: .75;
}
.halo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.1) 0%, rgba(0,0,0,.5) 45%, #000 85%); }
.cam { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.with-cam .halo { opacity: 0; }

/* Without the camera: a quiet silhouette that nods or shakes with the answer. */
.person { position: absolute; inset: 0; }
.with-cam .person, .intro-on .person { display: none; }
.head-group { position: absolute; inset: 0; }
.head, .shoulders { position: absolute; left: 50%; transform: translateX(-50%); filter: blur(.5cqw); }
.head { top: 98cqw; width: 34cqw; height: 42cqw; border-radius: 48% 48% 44% 44%; background: radial-gradient(ellipse at 40% 30%, #3a3a3c 0%, #232325 55%, #161617 100%); }
.shoulders { top: 140cqw; bottom: 0; width: 92cqw; border-radius: 46cqw 46cqw 0 0; background: radial-gradient(ellipse at 50% 0%, #2b2b2d 0%, #18181a 60%, #0d0d0e 100%); }
.nod { animation: nod .55s ease-in-out; }
.shake { animation: shake .55s ease-in-out; }
@keyframes nod { 30% { transform: translateY(3cqw); } 65% { transform: translateY(-1cqw); } }
@keyframes shake { 20% { transform: translateX(-3cqw) rotate(-3deg); } 45% { transform: translateX(3cqw) rotate(3deg); } 70% { transform: translateX(-2cqw) rotate(-2deg); } }

/* ---------- The ticket ---------- */
.slot {
  position: absolute; left: var(--x, 50%); top: var(--y, calc(env(safe-area-inset-top, 0px) + 96cqw));
  width: 42cqw;
  transform: translate(-50%, -100%) rotate(var(--roll, 0deg)) scale(var(--s, 1));
  transform-origin: 50% 100%;
  will-change: transform;
}
.with-cam .slot { transition: none; }
.intro-on .slot { --y: calc(env(safe-area-inset-top, 0px) + 112cqw); --s: 1.05; }
.result-on .slot { display: none; }
.ticket { position: relative; transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .35s, filter .35s; }
.ticket.hidden { transform: translateY(-120cqw); opacity: 0; transition: none; }
.ticket.away { transform: translateX(-90cqw) rotate(-18deg); opacity: 0; filter: grayscale(1); }
.ticket.gone { transform: translateY(-40cqw) scale(.9); opacity: 0; }
.t-body {
  background: var(--control);
  padding: 2.4cqw 2.4cqw 2.6cqw;
  border-radius: 1.6cqw 1.6cqw 0 0;
  -webkit-mask: radial-gradient(circle 2.4cqw at 0 100%, transparent 98%, #000) top left / 51% 100% no-repeat,
                radial-gradient(circle 2.4cqw at 100% 100%, transparent 98%, #000) top right / 51% 100% no-repeat;
          mask: radial-gradient(circle 2.4cqw at 0 100%, transparent 98%, #000) top left / 51% 100% no-repeat,
                radial-gradient(circle 2.4cqw at 100% 100%, transparent 98%, #000) top right / 51% 100% no-repeat;
}
.poster { position: relative; width: 100%; aspect-ratio: 2 / 3; border-radius: 1cqw; overflow: hidden; background: #0d0d0d; }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-title { margin-top: 2cqw; font-weight: 800; font-size: 3.6cqw; line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; }
.t-meta { margin-top: .6cqw; font-weight: 500; font-size: 2.4cqw; line-height: 1.2; color: var(--secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-stub {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 2cqw;
  background: var(--control);
  padding: 2.2cqw 2.4cqw;
  border-radius: 0 0 1.6cqw 1.6cqw;
  -webkit-mask: radial-gradient(circle 2.4cqw at 0 0, transparent 98%, #000) bottom left / 51% 100% no-repeat,
                radial-gradient(circle 2.4cqw at 100% 0, transparent 98%, #000) bottom right / 51% 100% no-repeat;
          mask: radial-gradient(circle 2.4cqw at 0 0, transparent 98%, #000) bottom left / 51% 100% no-repeat,
                radial-gradient(circle 2.4cqw at 100% 0, transparent 98%, #000) bottom right / 51% 100% no-repeat;
  transition: transform .6s cubic-bezier(.4,0,.6,1), opacity .6s;
}
.t-stub::before {
  content: ""; position: absolute; left: 3.4cqw; right: 3.4cqw; top: -.2cqw; height: .5cqw;
  background: radial-gradient(circle .35cqw, var(--bg) 92%, transparent) 0 0 / 1.6cqw .5cqw repeat-x;
}
.ticket.torn .t-stub { transform: translateY(26cqw) rotate(-16deg); opacity: 0; }
.ticket.torn .t-body { transform: translateY(-1cqw) rotate(2deg); transition: transform .3s; }
.note-label { font-weight: 600; font-size: 1.9cqw; letter-spacing: .06em; text-transform: uppercase; color: var(--secondary); }
.note-value { font-weight: 800; font-size: 5cqw; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stub-right { display: grid; justify-items: end; gap: .8cqw; }
.stub-right img { width: 7.2cqw; height: auto; display: block; }
.count { font-weight: 600; font-size: 2.2cqw; color: var(--secondary); font-variant-numeric: tabular-nums; }
.stamp {
  position: absolute; left: 50%; top: 46%;
  padding: 1cqw 2.6cqw; border: .7cqw solid var(--ink); border-radius: 1.4cqw;
  font-weight: 800; font-size: 7.4cqw; line-height: 1; letter-spacing: .02em; white-space: nowrap;
  background: rgba(0,0,0,.35);
  transform: translate(-50%, -50%) rotate(-12deg) scale(2.2);
  opacity: 0; pointer-events: none;
}
.stamp.on { animation: stamp .32s cubic-bezier(.3,1.4,.6,1) forwards; }
@keyframes stamp { to { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(1); } }

/* ---------- Chrome ---------- */
.top {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; align-items: flex-start; justify-content: flex-end;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px 0;
  pointer-events: none;
}
.pile { position: relative; width: 64px; height: 44px; }
.pile .mini {
  position: absolute; right: 0; top: 4px; width: 56px; height: 26px;
  border-radius: 4px; background: var(--control); outline: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 11px;
  animation: land .35s cubic-bezier(.3,1.3,.6,1);
}
@keyframes land { from { transform: translateY(40px) rotate(-20deg); opacity: 0; } }
.pile-count {
  position: absolute; right: -6px; top: -4px; z-index: 20;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--ink); color: var(--on-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 12px; font-variant-numeric: tabular-nums;
}

.lost {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 10px 18px; border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-weight: 600; font-size: 16px; white-space: nowrap;
}

.answers {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 0 18px calc(env(safe-area-inset-bottom, 0px) + 22px);
}
.glass-btn {
  display: grid; gap: 2px; justify-items: center;
  min-height: 60px; padding: 10px 8px; border-radius: 999px; border: 1px solid var(--hairline);
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  cursor: pointer; transition: opacity .2s, transform .15s;
}
.glass-btn b { font-weight: 700; font-size: 17px; line-height: 1.1; }
.glass-btn span { font-weight: 500; font-size: 12px; color: var(--secondary); }
.glass-btn:active { transform: scale(.97); }
.glass-btn:disabled { opacity: .35; cursor: default; }

/* ---------- Intro and result ---------- */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 70px) 20px calc(env(safe-area-inset-bottom, 0px) + 22px);
  text-align: center;
}
.intro { background: linear-gradient(to bottom, rgba(0,0,0,0) 40%, rgba(0,0,0,.75) 62%, #000 82%); }
.intro-text { display: grid; gap: 12px; justify-items: center; margin-bottom: 26px; }
.hero { margin: 0; font-weight: 800; font-size: clamp(34px, 10.5cqw, 52px); line-height: .95; letter-spacing: -.035em; text-transform: uppercase; text-wrap: balance; }
.lead { margin: 0; max-width: 58ch; font-size: 16px; line-height: 1.4; color: var(--secondary); text-wrap: balance; }
.bottom { width: 100%; display: grid; gap: 12px; justify-items: center; }
.error { margin: 0; max-width: 36ch; font-size: 14px; line-height: 1.4; color: var(--ink); text-wrap: balance; }
.cta {
  width: 100%; max-width: 420px; height: 62px;
  border: 0; border-radius: 999px;
  background: var(--ink); color: var(--on-ink);
  font-weight: 700; font-size: 19px; letter-spacing: -.01em;
  cursor: pointer; transition: transform .15s, opacity .2s;
}
.cta:active { transform: scale(.98); }
.cta:disabled { opacity: .6; cursor: default; }
.cta.ghost { background: var(--control); color: var(--ink); border: 1px solid var(--hairline); }
.cta:focus-visible, .glass-btn:focus-visible, .preview-qr:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.result { justify-content: center; gap: 18px; background: rgba(0,0,0,.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.result .bottom { margin-top: 6px; }
.r-ticket { flex: 0 0 auto; width: min(82cqw, 680px); text-align: left; animation: rise .5s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { transform: translateY(20cqw) scale(.94); opacity: 0; } }
.r-ticket .t-body { padding: 4cqw 4cqw 4.4cqw; border-radius: 2.4cqw 2.4cqw 0 0; }
.r-ticket .t-stub { padding: 3.2cqw 4cqw; border-radius: 0 0 2.4cqw 2.4cqw; }
.r-score { font-weight: 800; font-size: 22cqw; line-height: .9; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.r-score small { font-size: 9cqw; color: var(--faint); letter-spacing: -.02em; }
.r-tier { font-weight: 700; font-size: 5cqw; line-height: 1.1; margin-top: 1.6cqw; }
.r-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.4cqw; margin-top: 4cqw; }
.r-grid div { position: relative; aspect-ratio: 2/3; border-radius: .8cqw; overflow: hidden; background: #0d0d0d; }
.r-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.r-grid .no img { filter: grayscale(1) brightness(.35); }
.r-grid .yes::after {
  content: "VU"; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) rotate(-12deg);
  padding: .3cqw 1cqw; border: .4cqw solid var(--ink); border-radius: .6cqw;
  font-weight: 800; font-size: 2.6cqw; background: rgba(0,0,0,.35);
}
.r-brand { display: flex; align-items: center; gap: 2cqw; font-weight: 800; font-size: 4.4cqw; letter-spacing: -.02em; }
.r-brand img { width: 8cqw; height: auto; }

/* Short screens (small phones, landscape laptops): keep the CTA in view. */
@media (max-height: 640px) {
  .lead { font-size: 14px; }
  .tip { display: none; }
  .r-ticket { width: min(64cqw, 340px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
