:root {
  color-scheme: dark;
  --ink: #060607;
  --wine: #170509;
  --card: #1b1719;
  --card-2: #241b1e;
  --red: #dc202e;
  --red-deep: #990b18;
  --gold: #ffb238;
  --cream: #fff8ec;
  --muted: rgba(255, 248, 236, 0.62);
  --line: rgba(255, 255, 255, 0.1);
  --success: #35d17d;
  --display: "Barlow Condensed", sans-serif;
  --body: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--body);
}

body {
  min-height: 100svh;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    radial-gradient(circle at 84% 4%, rgba(220, 32, 46, 0.22), transparent 34rem),
    radial-gradient(circle at 4% 94%, rgba(255, 178, 56, 0.08), transparent 30rem),
    linear-gradient(145deg, #030304 0%, var(--wine) 48%, #030304 100%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.23;
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0,
    transparent 42px,
    rgba(255, 255, 255, 0.025) 43px,
    transparent 44px
  );
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.42; }

.shell {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 0 max(40px, env(safe-area-inset-bottom));
  animation: shell-in 600ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes shell-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.masthead-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.status-chip {
  padding: 7px 10px;
  border: 1px solid rgba(53,209,125,.24);
  border-radius: 999px;
  color: var(--success);
  background: rgba(53,209,125,.08);
  font-size: .72rem;
  font-weight: 800;
}

.status-chip.offline {
  border-color: rgba(255,178,56,.3);
  color: var(--gold);
  background: rgba(255,178,56,.08);
}

.brand-kicker,
.eyebrow {
  margin: 0;
  color: var(--gold);
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.23em;
  text-transform: uppercase;
}

.brand {
  margin: -4px 0 0;
  font-family: var(--display);
  font-size: clamp(2.4rem, 7vw, 3.5rem);
  font-weight: 900;
  letter-spacing: 0.015em;
  line-height: 0.88;
}

.preview-badge {
  align-self: center;
  padding: 7px 10px;
  border: 1px solid rgba(255, 178, 56, 0.34);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(255, 178, 56, 0.08);
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.progress-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}

.progress-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  padding: 10px 7px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: rgba(255,255,255,.35);
  background: rgba(255,255,255,.05);
  font-family: var(--display);
  font-size: clamp(.7rem, 2.4vw, .82rem);
  font-weight: 800;
  letter-spacing: .04em;
}

.progress-frame.active {
  border-color: rgba(255,178,56,.7);
  color: white;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  box-shadow: 0 10px 30px rgba(220, 32, 46, 0.18);
}

.progress-frame.complete {
  color: white;
  background: rgba(255,255,255,.12);
}

.frame-number {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.13);
  font-size: .7rem;
}

.act-card,
.results-card,
.message-card {
  position: relative;
  overflow: hidden;
  padding: clamp(21px, 5vw, 30px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(220,32,46,.14), transparent 38%, rgba(255,178,56,.05)),
    var(--card);
  box-shadow: 0 24px 60px rgba(0,0,0,.42);
  animation: card-in 380ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateX(24px) scale(.985); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.act-card::before,
.results-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  content: "";
  background: linear-gradient(var(--gold), var(--red), transparent);
}

.act-title {
  margin: 5px 0 4px;
  font-family: var(--display);
  font-size: clamp(2.1rem, 8vw, 3.25rem);
  font-weight: 800;
  line-height: .98;
}

.act-prompt,
.message-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.game-stage { margin: 24px 0; }

.connection-context {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.connection-transition {
  display: grid;
  gap: 5px;
  padding-left: 12px;
  border-left: 1px solid var(--gold);
}

.connection-kicker {
  color: var(--gold);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.connection-film-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.connection-film {
  min-width: 0;
  margin: 0;
}

.connection-poster {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,178,56,.16), rgba(255,255,255,.04));
  box-shadow: 0 12px 24px rgba(0,0,0,.2);
}

.connection-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.connection-poster-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.connection-film figcaption {
  overflow: hidden;
  margin-top: 7px;
  font-size: .84rem;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-question {
  margin: 2px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.emoji-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.emoji-frame {
  display: grid;
  min-height: 86px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  background: rgba(0,0,0,.27);
  font-size: clamp(2rem, 9vw, 3rem);
}

.answer-input {
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px;
  outline: 0;
  color: white;
  background: rgba(0,0,0,.31);
  font-size: 1.05rem;
  font-weight: 600;
}

.answer-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255,178,56,.12);
}

.choice-list,
.arrange-list {
  display: grid;
  gap: 10px;
}

.choice,
.arrange-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  color: white;
  background: rgba(0,0,0,.24);
  text-align: left;
  transition: 160ms ease;
}

.choice:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.2); }
.choice.selected { border-color: var(--red); background: rgba(220,32,46,.2); }
.choice-marker { color: var(--gold); font-size: 1.2rem; }

.arrange-row { border-left: 3px solid var(--red); }
.arrange-index {
  width: 25px;
  color: var(--gold);
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 900;
}
.arrange-label { flex: 1; font-weight: 600; }
.arrange-control {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: white;
  background: rgba(255,255,255,.08);
}

.primary,
.secondary,
.utility {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 15px;
  font-weight: 700;
}

.primary {
  padding: 16px;
  color: white;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  box-shadow: 0 12px 26px rgba(220,32,46,.18);
}
.primary:not(:disabled):active { transform: scale(.985); }

.secondary {
  min-height: 48px;
  padding: 14px;
  color: white;
  background: rgba(255,255,255,.075);
}

.assist-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.utility {
  min-height: 46px;
  padding: 11px 7px;
  color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.055);
  font-size: .79rem;
}

.feedback {
  display: flex;
  gap: 11px;
  margin: 0 0 16px;
  padding: 13px;
  border-radius: 13px;
  background: rgba(255,178,56,.1);
  color: var(--gold);
  animation: feedback-in 240ms ease-out both;
}

@keyframes feedback-in {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: scale(1); }
}

.feedback.correct { color: var(--success); background: rgba(53,209,125,.1); }
.feedback p { margin: 0; color: var(--cream); line-height: 1.4; }

.transition-reveal,
.final-reveal {
  position: relative;
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(255,178,56,.34);
  border-radius: 16px;
  background:
    linear-gradient(120deg, rgba(255,178,56,.16), rgba(229,31,50,.09) 58%, rgba(255,255,255,.035)),
    rgba(12,9,10,.72);
  box-shadow: inset 0 1px rgba(255,255,255,.07), 0 14px 36px rgba(0,0,0,.18);
}

.transition-reveal {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  margin: 14px 0 16px;
  padding: 14px;
  animation: reveal-beat-in 460ms cubic-bezier(.16,1,.3,1) both;
}

.transition-reveal::after,
.final-reveal::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.11) 48%, transparent 66%);
  transform: translateX(-110%);
  animation: reveal-light-pass 900ms 180ms cubic-bezier(.16,1,.3,1) both;
}

.transition-reveal-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: #17100a;
  background: var(--gold);
  box-shadow: 0 0 22px rgba(255,178,56,.28);
  font-weight: 900;
}

.transition-reveal.was-revealed .transition-reveal-mark { color: var(--cream); background: var(--red); }
.transition-reveal-kicker { margin: 0 0 3px; color: var(--gold); font-family: var(--display); font-size: .72rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.transition-reveal h3, .final-reveal h3 { margin: 0; color: var(--cream); font-family: var(--display); font-size: clamp(1.25rem, 4.7vw, 1.7rem); line-height: 1; }
.transition-reveal p:last-child, .final-reveal p:last-child { margin: 6px 0 0; color: rgba(255,248,235,.78); font-size: .86rem; line-height: 1.4; }

.final-reveal { margin: 0 0 18px; padding: 15px 16px; text-align: center; animation: reveal-beat-in 520ms 100ms cubic-bezier(.16,1,.3,1) both; }

.reveal-confirmation {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(255,178,56,.28);
  border-radius: 16px;
  background: rgba(24,17,18,.97);
  box-shadow: 0 16px 40px rgba(0,0,0,.34);
  animation: reveal-beat-in 220ms cubic-bezier(.16,1,.3,1) both;
}

.reveal-confirmation strong, .reveal-confirmation span { display: block; }
.reveal-confirmation strong { color: var(--cream); }
.reveal-confirmation span { margin-top: 4px; color: var(--muted); font-size: .82rem; }
.reveal-confirmation-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reveal-confirmation-actions .primary, .reveal-confirmation-actions .secondary { min-height: 44px; padding: 9px; }

@keyframes reveal-beat-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes reveal-light-pass {
  to { transform: translateX(110%); }
}

.score {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: clamp(5.2rem, 22vw, 8.5rem);
  font-weight: 900;
  line-height: .82;
  text-align: center;
}

.score-label {
  margin: 11px 0 26px;
  color: var(--muted);
  font-family: var(--display);
  font-size: .83rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-align: center;
}

.result-acts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}

.result-act {
  padding: 14px 4px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: var(--gold);
  font-family: var(--display);
  font-size: .78rem;
  font-weight: 800;
  text-align: center;
}

.result-actions { display: grid; gap: 10px; }
.results-eyebrow { text-align: center; }

.festival-card {
  display: grid;
  gap: 12px;
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid rgba(255,178,56,.16);
  border-radius: 16px;
  background: rgba(0,0,0,.22);
}

.festival-card.complete {
  border-color: rgba(255,178,56,.38);
  box-shadow: inset 0 0 30px rgba(255,178,56,.05);
}

.festival-ticket {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  overflow: hidden;
  padding: 11px 13px;
  border: 1px solid rgba(255,178,56,.24);
  border-radius: 12px;
  background:
    linear-gradient(100deg, rgba(217,30,52,.18), rgba(255,178,56,.08)),
    rgba(255,255,255,.025);
}

.festival-ticket::after {
  position: absolute;
  inset: 0 0 0 auto;
  width: 4px;
  content: "";
  background: repeating-linear-gradient(to bottom, var(--gold) 0 6px, transparent 6px 11px);
  opacity: .7;
}

.ticket-icon { font-size: 1.55rem; filter: drop-shadow(0 4px 9px rgba(255,178,56,.18)); }
.ticket-copy { display: grid; min-width: 0; gap: 1px; }
.ticket-copy span,
.ticket-serial small {
  color: var(--muted);
  font-family: var(--display);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .12em;
}
.ticket-copy strong { overflow: hidden; font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
.ticket-serial { display: grid; gap: 2px; padding-right: 4px; text-align: right; }
.ticket-serial span { color: var(--gold); font-family: var(--display); font-size: .72rem; font-weight: 900; letter-spacing: .06em; }

.festival-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.festival-heading > div { display: grid; gap: 3px; }
.festival-heading strong { font-size: .94rem; }

.festival-kicker {
  color: var(--gold);
  font-family: var(--display);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.festival-streak {
  flex: 0 0 auto;
  color: var(--success);
  font-size: .72rem;
  font-weight: 800;
}

.festival-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.festival-stamp {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  color: rgba(255,255,255,.28);
  background: rgba(255,255,255,.025);
  font-family: var(--display);
  font-size: .78rem;
  font-weight: 900;
  line-height: .75;
}

.festival-stamp small { font-size: .42rem; letter-spacing: .08em; opacity: .68; }

.festival-stamp.filled {
  border-color: rgba(255,178,56,.28);
  color: var(--cream);
  background: linear-gradient(145deg, rgba(217,30,52,.72), rgba(255,178,56,.42));
  box-shadow: 0 0 14px rgba(255,178,56,.12);
}

.festival-stamp.current { animation: stamp-in 440ms cubic-bezier(.2,.9,.2,1.25) both; }
@keyframes stamp-in { from { opacity: .3; transform: scale(.72) rotate(-5deg); } to { opacity: 1; transform: scale(1) rotate(0); } }

.festival-reward { margin: 0; color: var(--cream); font-size: .72rem; font-weight: 700; }

.next-reel {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
}

.next-reel b { color: var(--cream); }

.result-action-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.install-button {
  min-height: 46px;
  padding: 10px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: .8rem;
  font-weight: 700;
}

.install-button:hover { color: var(--cream); }
.message-card { min-height: 420px; display: grid; align-content: center; gap: 15px; }
.message-card h1 { margin: 0; font: 800 clamp(2.4rem, 10vw, 4rem)/.95 var(--display); }

.loader {
  display: grid;
  min-height: 70svh;
  place-items: center;
  text-align: center;
}
.reel-icon { font-size: 4rem; animation: rock 800ms ease-in-out infinite alternate; }
@keyframes rock { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }

.toast {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 16px;
  z-index: 10;
  width: fit-content;
  max-width: min(420px, calc(100% - 32px));
  margin: auto;
  padding: 12px 16px;
  border: 1px solid rgba(255,178,56,.28);
  border-radius: 999px;
  background: rgba(15,12,13,.94);
  box-shadow: 0 14px 38px rgba(0,0,0,.4);
  font-size: .87rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* A restrained cinema-motion system: one projector entrance, then fast feedback. */
::selection {
  color: #160e0e;
  background: rgba(255,178,56,.92);
}

* {
  scrollbar-color: rgba(255,178,56,.58) rgba(255,255,255,.05);
  scrollbar-width: thin;
}

*::-webkit-scrollbar { width: 10px; }
*::-webkit-scrollbar-track { background: rgba(255,255,255,.04); }
*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 10px;
  background: rgba(255,178,56,.58);
  background-clip: padding-box;
}

:where(button, input):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.brand {
  transform-origin: left bottom;
}

.progress-frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: color 180ms ease, background-color 220ms ease, transform 180ms cubic-bezier(.16,1,.3,1);
}

.answer-input {
  caret-color: var(--gold);
  transition: border-color 160ms ease, box-shadow 220ms ease, background-color 180ms ease;
}

.choice,
.primary,
.utility,
.arrange-control {
  transition: transform 160ms cubic-bezier(.16,1,.3,1), border-color 160ms ease, background-color 180ms ease, color 180ms ease, box-shadow 220ms ease;
}

.choice {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.choice::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(255,178,56,.18), rgba(216,32,48,.14));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 220ms cubic-bezier(.16,1,.3,1);
  pointer-events: none;
}

.choice.selected {
  border-color: var(--gold);
  box-shadow: 0 9px 24px rgba(0,0,0,.24);
  animation: choice-locked 180ms cubic-bezier(.16,1,.3,1) both;
}

.choice.selected::before { transform: scaleX(1); }

.connection-poster {
  contain: paint;
  transform: translateZ(0);
  transition: transform 320ms cubic-bezier(.16,1,.3,1), box-shadow 320ms ease, filter 260ms ease;
}

.connection-poster img {
  transition: transform 520ms cubic-bezier(.16,1,.3,1), filter 260ms ease;
}

.feedback {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  animation: quiet-feedback-in 180ms ease-out both;
}

.results-card {
  animation: quiet-result-in 220ms ease-out both;
}

@media (hover: hover) and (pointer: fine) {
  .choice:not(:disabled):hover { transform: translateX(2px); }
  .primary:not(:disabled):hover,
  .utility:not(:disabled):hover { transform: translateY(-1px); }
  .connection-film:hover .connection-poster {
    filter: saturate(1.08) contrast(1.02);
    transform: translateY(-3px) rotate(-.2deg);
    box-shadow: 0 15px 28px rgba(0,0,0,.3);
  }
  .connection-film:nth-child(even):hover .connection-poster { transform: translateY(-3px) rotate(.2deg); }
  .connection-film:hover .connection-poster img { transform: scale(1.02); }
}

.choice:not(:disabled):active,
.primary:not(:disabled):active,
.utility:not(:disabled):active,
.arrange-control:not(:disabled):active {
  transform: translateY(1px) scale(.985);
}

@keyframes choice-locked {
  0% { transform: scale(.99); }
  100% { transform: scale(1); }
}

@keyframes quiet-feedback-in {
  0% { opacity: .9; transform: translateY(2px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes quiet-result-in {
  0% { opacity: 1; transform: translateY(3px); }
  100% { opacity: 1; transform: translateY(0); }
}

.shell,
.act-card {
  animation: none;
}

.masthead { view-transition-name: reel-masthead; }
.progress-strip { view-transition-name: reel-progress; }
.act-card,
.results-card,
.message-card { view-transition-name: reel-scene; }
.act-card > .primary[data-action="submit"] { view-transition-name: reel-submit; }
.act-card > .assist-row { view-transition-name: reel-assists; }

::view-transition-group(reel-masthead),
::view-transition-group(reel-progress),
::view-transition-group(reel-submit),
::view-transition-group(reel-assists) {
  animation-duration: 280ms;
  animation-timing-function: cubic-bezier(.16, 1, .3, 1);
}

::view-transition-old(reel-masthead),
::view-transition-old(reel-progress),
::view-transition-old(reel-submit),
::view-transition-old(reel-assists) {
  animation: none;
  opacity: 0;
}

::view-transition-new(reel-masthead),
::view-transition-new(reel-progress),
::view-transition-new(reel-submit),
::view-transition-new(reel-assists) {
  animation: none;
  opacity: 1;
}

html[data-reel-transition="advance"]::view-transition-old(reel-scene) {
  animation: reel-scene-out 150ms cubic-bezier(.4, 0, 1, 1) both;
}

html[data-reel-transition="advance"]::view-transition-new(reel-scene) {
  animation: reel-scene-in 330ms cubic-bezier(.16, 1, .3, 1) both;
}

html[data-reel-transition="refresh"]::view-transition-old(reel-scene) {
  animation: reel-refresh-out 110ms ease-in both;
}

html[data-reel-transition="refresh"]::view-transition-new(reel-scene) {
  animation: reel-refresh-in 220ms cubic-bezier(.16, 1, .3, 1) both;
}

.primary.is-checking {
  position: relative;
  overflow: hidden;
  color: var(--cream);
  opacity: 1;
  cursor: wait;
}

.primary.is-checking::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.18) 48%, transparent 66%);
  content: "";
  transform: translateX(-110%);
  animation: reel-checking-scan 700ms cubic-bezier(.4, 0, .2, 1) infinite;
  pointer-events: none;
}

.scene-arriving {
  animation: reel-fallback-in 280ms cubic-bezier(.16, 1, .3, 1) both !important;
}

@keyframes reel-scene-out {
  to {
    opacity: 0;
    clip-path: inset(0 100% 0 0 round 28px);
    filter: blur(3px);
    transform: translateX(-18px) scale(.992);
  }
}

@keyframes reel-scene-in {
  from {
    opacity: 0;
    clip-path: inset(0 0 0 100% round 28px);
    filter: blur(4px);
    transform: translateX(24px) scale(.994);
  }
  to {
    opacity: 1;
    clip-path: inset(0 round 28px);
    filter: blur(0);
    transform: translateX(0) scale(1);
  }
}

@keyframes reel-refresh-out {
  to { opacity: .72; filter: blur(2px); transform: scale(.995); }
}

@keyframes reel-refresh-in {
  from { opacity: .72; filter: blur(2px); transform: scale(.995); }
  to { opacity: 1; filter: blur(0); transform: scale(1); }
}

@keyframes reel-fallback-in {
  from { opacity: .8; filter: blur(2px); transform: translateX(12px); }
  to { opacity: 1; filter: blur(0); transform: translateX(0); }
}

@keyframes reel-checking-scan {
  to { transform: translateX(110%); }
}

@media (max-width: 480px) {
  .shell { width: min(100% - 24px, 760px); }
  .act-card, .results-card, .message-card { border-radius: 22px; }
  .progress-frame { gap: 4px; }
  .progress-frame .frame-number { display: none; }
  .assist-row { gap: 6px; }
  .utility { font-size: .72rem; }
  .connection-film-grid { gap: 8px; }
  .connection-poster { border-radius: 10px; }
  .connection-film figcaption { font-size: .7rem; }
  .status-chip { display: none; }
  .festival-ticket { gap: 8px; padding: 9px 10px; }
  .ticket-icon { font-size: 1.25rem; }
  .ticket-copy strong { font-size: .82rem; }
  .ticket-serial small { display: none; }
  .festival-stamp { min-height: 29px; }
  .festival-stamp small { display: none; }
}

.rival-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  padding: 10px 13px;
  border: 1px solid rgba(255,178,56,.3);
  border-radius: 14px;
  color: var(--cream);
  background: linear-gradient(90deg, rgba(255,178,56,.15), rgba(216,32,48,.1));
}
.rival-banner span { color: var(--gold); font: 900 .64rem/1 var(--display); letter-spacing: .12em; }
.rival-banner strong { font-size: .86rem; }
.rival-banner small { color: var(--muted); font-size: .7rem; }

.rival-result {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255,178,56,.28);
  border-radius: 15px;
  background: rgba(255,178,56,.08);
  text-align: center;
}
.rival-result.won { border-color: rgba(53,209,125,.38); background: rgba(53,209,125,.09); }
.rival-result h3 { margin: 3px 0 5px; color: var(--cream); font: 800 1.35rem/1 var(--display); }
.rival-result p:last-child { margin: 0; color: var(--muted); font-size: .82rem; }

@media (max-width: 480px) {
  .rival-banner { grid-template-columns: auto 1fr; }
  .rival-banner small { display: none; }
}

@media (max-width: 480px) and (max-height: 900px) {
  .shell {
    width: min(100% - 16px, 760px);
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .masthead { margin-bottom: 8px; }
  .progress-strip {
    gap: 5px;
    margin-bottom: 12px;
  }
  .progress-frame { padding: 8px 6px; }
  .act-card:has(.connection-context) {
    padding: 14px;
    border-radius: 20px;
  }
  .act-card:has(.connection-context) > .eyebrow,
  .act-card:has(.connection-context) > .act-prompt { display: none; }
  .act-card:has(.connection-context) > .act-title {
    margin: 0 0 8px;
    font-size: clamp(2rem, 8.5vw, 2.2rem);
    line-height: .98;
  }
  .act-card:has(.connection-context) > .game-stage { margin: 8px 0; }
  .connection-context {
    gap: 7px;
    margin-bottom: 10px;
  }
  .connection-transition {
    display: flex;
    align-items: baseline;
    gap: 7px;
    padding-left: 8px;
  }
  .connection-kicker {
    flex: 0 0 auto;
    font-size: .62rem;
  }
  .connection-transition strong {
    font-size: .8rem;
    line-height: 1.2;
  }
  .connection-film-grid {
    grid-template-columns: repeat(3, minmax(0, 86px));
    justify-content: center;
    gap: 6px;
  }
  .connection-poster { border-radius: 9px; }
  .connection-film figcaption {
    display: -webkit-box;
    min-height: 2.2em;
    margin-top: 5px;
    overflow: hidden;
    font-size: .68rem;
    line-height: 1.1;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .connection-question {
    margin: 0;
    font-size: .9rem;
    line-height: 1.2;
  }
  .choice-list { gap: 6px; }
  .choice {
    min-height: 46px;
    padding: 10px 12px;
    gap: 9px;
    font-size: .92rem;
    line-height: 1.15;
  }
  .act-card:has(.connection-context) > .primary {
    min-height: 46px;
    padding: 10px;
    font-size: .92rem;
  }
  .act-card:has(.connection-context) > .assist-row {
    margin-top: 8px;
    padding-top: 8px;
  }
  .act-card:has(.connection-context) .utility {
    min-height: 46px;
    padding: 8px 5px;
    font-size: .68rem;
  }
  .results-card { padding: 16px; }
  .results-card .score { font-size: clamp(4.6rem, 21vw, 6rem); }
  .results-card .score-label { margin: 8px 0 14px; }
  .results-card .result-acts { margin-bottom: 12px; }
  .results-card .result-act { padding: 9px 4px; }
  .festival-card {
    gap: 9px;
    margin-bottom: 12px;
    padding: 12px;
  }
  .result-actions { gap: 7px; }
  .result-actions .primary,
  .result-actions .secondary { min-height: 46px; padding: 10px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .primary.is-checking::after,
  .scene-arriving { animation: none !important; }
  .brand,
  .progress-frame,
  .connection-film,
  .connection-poster,
  .connection-poster img,
  .choice,
  .primary,
  .utility,
  .arrange-control,
  .feedback,
  .transition-reveal,
  .final-reveal,
  .reveal-confirmation,
  .results-card {
    clip-path: none !important;
    filter: none !important;
    transform: none !important;
  }
}

.loader-copy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .9rem;
}

.recovery-card { max-width: 680px; }
.message-actions { display: grid; gap: 10px; margin-top: 8px; }
.message-actions .secondary { width: 100%; }
.recovery-note {
  margin: 0;
  color: rgba(255,248,235,.58);
  font-size: .78rem;
  line-height: 1.4;
}

.arrange-list.is-updating { animation: arrange-settle 180ms cubic-bezier(.16,1,.3,1) both; }
@keyframes arrange-settle {
  from { transform: translateY(2px); }
  to { transform: translateY(0); }
}

.share-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(255,178,56,.3);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,178,56,.12), rgba(216,32,48,.09)), rgba(5,5,5,.92);
  animation: reveal-beat-in 260ms cubic-bezier(.16,1,.3,1) both;
}
.share-panel h3 { margin: 0; color: var(--cream); font: 800 1.45rem/1 var(--display); }
.share-panel > p:not(.transition-reveal-kicker) { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.4; }
.share-copy {
  width: 100%;
  min-height: 122px;
  resize: vertical;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px;
  color: var(--cream);
  background: rgba(0,0,0,.34);
  font: 600 .8rem/1.45 var(--body);
}
.share-panel-actions { display: grid; grid-template-columns: .75fr 1.25fr; gap: 8px; }

.app-store-cta {
  display: grid;
  gap: 2px;
  padding: 13px 15px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  color: var(--cream);
  background: rgba(255,255,255,.055);
  text-decoration: none;
  transition: transform 160ms cubic-bezier(.16,1,.3,1), border-color 160ms ease, background-color 180ms ease;
}
.app-store-cta span { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.app-store-cta strong { font-size: .9rem; }
.app-store-cta:hover { transform: translateY(-1px); border-color: rgba(255,178,56,.4); background: rgba(255,178,56,.08); }

@media (max-width: 480px) {
  .share-panel { padding: 13px; }
  .share-copy { min-height: 104px; }
  .share-panel-actions { grid-template-columns: 1fr; }
}

/* Readability pass: reserve the condensed display face for large cinematic type. */
:where(
  .brand-kicker,
  .preview-badge,
  .eyebrow,
  .score-label,
  .transition-reveal-kicker,
  .festival-kicker,
  .progress-frame,
  .result-act,
  .ticket-copy > span,
  .ticket-serial > span,
  .ticket-serial > small,
  .festival-stamp > span,
  .festival-stamp > small
) {
  font-family: "DM Sans", sans-serif;
  text-rendering: optimizeLegibility;
}

.brand-kicker,
.preview-badge,
.eyebrow,
.transition-reveal-kicker {
  font-size: 0.8125rem;
  line-height: 1.35;
  letter-spacing: 0.1em;
}

.results-eyebrow {
  font-size: 0.9375rem;
  letter-spacing: 0.12em;
}

.score-label {
  color: rgba(255, 248, 236, 0.8);
  font-size: 0.875rem;
  line-height: 1.3;
  letter-spacing: 0.1em;
}

.progress-frame {
  font-size: 0.875rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.result-act {
  font-size: 0.9375rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.ticket-copy > span {
  color: rgba(255, 248, 236, 0.8);
  font-size: 0.75rem;
  line-height: 1.3;
  letter-spacing: 0.07em;
}

.ticket-copy > strong {
  font-size: 1rem;
  line-height: 1.25;
}

.ticket-serial > span {
  font-size: 0.75rem;
  line-height: 1.25;
  letter-spacing: 0.03em;
}

.ticket-serial > small {
  color: rgba(255, 248, 236, 0.76);
  font-size: 0.6875rem;
  line-height: 1.25;
  letter-spacing: 0.05em;
}

.festival-kicker {
  font-size: 0.75rem;
  line-height: 1.3;
  letter-spacing: 0.08em;
}

.festival-stamp > span {
  font-size: 0.9rem;
  line-height: 1;
}

.festival-stamp > small {
  font-size: 0.6875rem;
  line-height: 1;
  letter-spacing: 0.04em;
}

.festival-stamp:not(.filled) > span,
.festival-stamp:not(.filled) > small {
  color: rgba(255, 248, 236, 0.5);
}

.final-reveal > p,
.next-reel,
.app-store-cta > span,
.install-button {
  color: rgba(255, 248, 236, 0.78);
}

.festival-ticket,
.ticket-copy,
.ticket-serial {
  min-width: 0;
}

@media (max-width: 640px) {
  .progress-frame {
    font-size: 0.8125rem;
  }

  .result-act {
    font-size: 0.875rem;
  }

  .ticket-serial > span {
    overflow-wrap: anywhere;
  }
}
