/* ---------------------------------------------------------------
   The Great Christmas Rescue — passport theme.

   The look comes from the campaign poster: cranberry paper, chunky cream
   display type, torn edges, snow-white paper and a real photograph. Three
   colours only (red, cream, white); the logo's navy and yellow appear as
   small functional accents (route line, "next" marker), never as surfaces.
   One piece of decoration sits on top of that: a string of twinkling
   Christmas lights hanging under each header bar.
   --------------------------------------------------------------- */

:root {
  --red-950: #3f0911;
  --red-900: #570c17;
  --red-800: #73101d;
  --red-700: #8c1624;
  --red-600: #a51d2c;
  --red-500: #c22d3a;
  --cream-50: #fffaf0;
  --cream-100: #f9f0dd;
  --cream-200: #f1e3c8;
  --cream-300: #e3d1ad;
  --cream-400: #cbb58c;
  --snow: #f5f6f3;
  --ink: #2a1311;
  --ink-2: #5a3b36;
  --ink-3: #8a6c64;
  --navy: #1c2a8c;
  --sun: #ffd21f;

  --display: "Fraunces", "Cooper Black", Georgia, "Times New Roman", serif;
  --ui: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --col: 30rem;
  --gutter: 1rem;
  --tabs-h: 4.1rem;
  --torn: url("../assets/img/paper/torn-a.png");
  --torn-2: url("../assets/img/paper/torn-b.png");
  --shadow-paper: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 0.9rem 1.8rem rgba(30, 3, 7, 0.38), 0 0.15rem 0.4rem rgba(30, 3, 7, 0.3);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--red-800);
  color: var(--cream-100);
  font-family: var(--ui);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

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

.paper :focus-visible,
.sheet :focus-visible {
  outline-color: var(--navy);
}

/* ---------- Paper ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(194, 45, 58, 0.34), rgba(63, 9, 17, 0) 60%),
    linear-gradient(180deg, rgba(63, 9, 17, 0) 40%, rgba(63, 9, 17, 0.55) 100%),
    url("../assets/img/paper/paper-red.webp") center / cover,
    var(--red-800);
}

.paper {
  position: relative;
  background: url("../assets/img/paper/paper-snow.webp") center / cover, var(--cream-100);
  background-blend-mode: multiply;
  color: var(--ink);
  border-radius: 3px;
  box-shadow: var(--shadow-paper);
}

/* The one decoration: under each header bar, a fine strand of warm-white
   fairy lights with a few gold and red glass ornaments on gold thread. It
   hangs into the margin above the content, never over a photo or a button. */
.lights {
  position: absolute;
  top: 100%;
  left: 0;
  display: block;
  width: 100%;
  height: 60px;
  margin-top: -3px;
  overflow: visible;
  pointer-events: none;
}

.lights {
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.is-stuck > .lights {
  opacity: 0;
  transform: translateY(-8px);
}

.deco__cord {
  fill: none;
  stroke: #2b1410;
  stroke-width: 0.9;
  stroke-opacity: 0.85;
}

.deco__dot {
  fill: #fff6df;
  animation: deco-dot 3.2s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.deco__glow {
  animation: deco-glow 3.2s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.deco__thread {
  stroke: #d9b45c;
  stroke-width: 0.7;
}

@keyframes deco-glow {
  50% {
    opacity: 0.3;
  }
}

@keyframes deco-dot {
  50% {
    opacity: 0.7;
  }
}

/* The header bars: deep cranberry with a fine gold line along the foot. */
.top,
.sheet__bar {
  background: linear-gradient(180deg, #600e1b 0%, #4c0a14 100%);
  box-shadow:
    inset 0 -1px 0 rgba(233, 196, 106, 0.55),
    0 0.5rem 1.1rem rgba(30, 3, 7, 0.3);
}

/* ---------- Type ---------- */

.eyebrow {
  margin: 0;
  color: var(--cream-200);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow--red {
  color: var(--red-600);
}

.view__title,
.cover__title,
.page__title,
.sheet__title,
.finale__title,
.section-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  line-height: 1;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.view__title {
  margin-top: 0.3rem;
  color: var(--cream-100);
  font-size: clamp(2rem, 9.2vw, 2.6rem);
  text-shadow: 0 0.12em 0.3em rgba(40, 4, 9, 0.35);
}

.view__lede {
  margin: 0.55rem 0 0;
  max-width: 24rem;
  color: var(--cream-200);
  font-size: 0.98rem;
  line-height: 1.42;
  text-wrap: pretty;
}

.section-title {
  margin: 1.9rem 0 0.3rem;
  color: var(--cream-100);
  font-size: 1.45rem;
}

.section-lede {
  margin: 0 0 0.8rem;
  color: var(--cream-200);
  font-size: 0.92rem;
}

.fine {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.76rem;
  line-height: 1.4;
}

.fine--center,
.link--center {
  display: block;
  margin-inline: auto;
  text-align: center;
}

.status {
  min-height: 1.2em;
  margin: 0;
  color: var(--ink-2);
  font-size: 0.86rem;
  line-height: 1.4;
}

.status:empty {
  display: none;
}

.status--warn {
  color: var(--red-600);
  font-weight: 700;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.7rem 1.25rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  transition:
    transform 140ms var(--ease),
    background-color 140ms ease,
    box-shadow 140ms ease;
}

.btn svg {
  flex: none;
  width: 1.25em;
  height: 1.25em;
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
}

.btn:disabled {
  opacity: 0.42;
  cursor: default;
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--big {
  min-height: 3.4rem;
  font-size: 1.06rem;
}

/* On red paper: a cream button. */
.btn--primary {
  background: var(--cream-100);
  color: var(--red-700);
  box-shadow: 0 0.3rem 0 var(--cream-400), 0 0.8rem 1.4rem rgba(30, 3, 7, 0.35);
}

.btn--primary:hover:not(:disabled) {
  background: #fff;
}

/* On cream paper: a red button. */
.btn--red {
  background: var(--red-600);
  color: var(--cream-50);
  box-shadow: 0 0.28rem 0 var(--red-900);
}

.btn--red:hover:not(:disabled) {
  background: var(--red-500);
}

.btn--line {
  flex: 1;
  min-height: 2.75rem;
  padding-inline: 0.9rem;
  border-color: rgba(42, 19, 17, 0.28);
  background: transparent;
  color: var(--ink);
  font-size: 0.9rem;
}

.btn--line:hover:not(:disabled) {
  border-color: var(--ink);
}

.btn--line[aria-pressed="true"] {
  border-color: var(--red-600);
  background: rgba(165, 29, 44, 0.08);
  color: var(--red-700);
}

.link {
  padding: 0.5rem 0.25rem;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(63, 9, 17, 0.35);
  color: var(--cream-100);
}

.icon-btn svg {
  width: 1.35rem;
  height: 1.35rem;
}

.icon-btn--paper {
  background: var(--cream-50);
  color: var(--ink);
  box-shadow: 0 0.2rem 0.6rem rgba(30, 3, 7, 0.35);
}

.row {
  display: flex;
  gap: 0.6rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field__label {
  color: var(--ink-2);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.field__label i {
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
}

.field__input {
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 0.9rem;
  border: 2px solid rgba(42, 19, 17, 0.25);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

.field__input::placeholder {
  color: var(--ink-3);
  font-weight: 500;
  opacity: 0.8;
}

.field__input:focus {
  border-color: var(--red-600);
  outline: none;
  box-shadow: 0 0 0 3px rgba(165, 29, 44, 0.18);
}

.field__input--pin {
  max-width: 10rem;
  font-size: 1.4rem;
  letter-spacing: 0.4em;
  text-align: center;
}

/* A setting that is either on or off. */
.switch {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.8rem 0;
  border-top: 1.5px dashed rgba(42, 19, 17, 0.22);
  border-bottom: 1.5px dashed rgba(42, 19, 17, 0.22);
  cursor: pointer;
}

.switch input {
  appearance: none;
  flex: none;
  position: relative;
  width: 3rem;
  height: 1.75rem;
  margin: 0.1rem 0 0;
  border-radius: 999px;
  background: var(--cream-400);
  transition: background 200ms ease;
  cursor: pointer;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 200ms var(--ease);
}

.switch input:checked {
  background: var(--red-600);
}

.switch input:checked::after {
  transform: translateX(1.25rem);
}

.switch b {
  display: block;
  font-weight: 800;
}

.switch span {
  color: var(--ink-2);
  font-size: 0.88rem;
  line-height: 1.4;
}

/* ---------- Cover ---------- */

.cover {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(var(--col), 100%);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--red-800);
  box-shadow: 0 0 5rem rgba(30, 3, 7, 0.6);
}

/* The poster fills whatever height the ticket leaves, cropped from the top,
   so the title is always whole and a taller phone shows more of the family. */
.cover__art {
  position: relative;
  flex: 1 1 auto;
  min-height: 46vw;
  overflow: hidden;
}

.cover__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0%;
}

.cover__ticket {
  position: relative;
  flex: none;
  display: grid;
  gap: 0.7rem;
  padding: 1.1rem var(--gutter) calc(1.2rem + env(safe-area-inset-bottom));
  background: url("../assets/img/paper/paper-snow.webp") center / cover, var(--cream-100);
  background-blend-mode: multiply;
  color: var(--ink);
  animation: rise 700ms var(--ease) 150ms both;
}

.cover__ticket::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -25px;
  height: 26px;
  background: var(--cream-100);
  -webkit-mask: var(--torn-2) 0 0 / 760px 26px repeat-x;
  mask: var(--torn-2) 0 0 / 760px 26px repeat-x;
  transform: scaleY(-1);
}

.cover__ticket .eyebrow {
  color: var(--red-600);
}

.cover__title {
  color: var(--red-700);
  font-size: clamp(1.9rem, 9vw, 2.4rem);
}

.cover__lede {
  margin: -0.25rem 0 0;
  color: var(--ink-2);
  font-size: 0.98rem;
  line-height: 1.38;
}

.cover__form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.2rem;
}

/* ---------- App shell ---------- */

.app {
  position: relative;
  width: min(var(--col), 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(var(--tabs-h) + 2.4rem + env(safe-area-inset-bottom));
  overflow-x: clip;
}

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: calc(0.5rem + env(safe-area-inset-top, 0px)) var(--gutter) 0.5rem;
}

.top__logo {
  width: auto;
  height: 2.15rem;
  margin-right: auto;
  filter: drop-shadow(0 2px 5px rgba(30, 3, 7, 0.45));
}

.top__progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 0.85rem;
  border: 0;
  border-radius: 999px;
  background: rgba(63, 9, 17, 0.35);
  color: var(--cream-100);
}

.top__count {
  font-size: 0.86rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.top__count b {
  font-weight: 800;
}

.pips {
  display: flex;
  gap: 0.22rem;
}

.pips i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: 1.5px solid var(--cream-200);
  opacity: 0.55;
}

.pips i.is-done {
  border-color: var(--cream-50);
  background: var(--cream-50);
  opacity: 1;
}

.pips i.is-next {
  border-color: var(--sun);
  opacity: 1;
}

.views {
  min-width: 0;
  /* The decoration hangs into this margin. */
  padding: 3.3rem var(--gutter) 0;
}

.view {
  animation: view-in 320ms var(--ease) both;
}

.view__head {
  padding: 0 0.1rem 1.1rem;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
}

/* ---------- Tab bar ---------- */

.tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(var(--col), 100%);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding: 0 0.4rem env(safe-area-inset-bottom);
  transform: translateX(-50%);
  background: url("../assets/img/paper/paper-snow.webp") center / cover, var(--cream-100);
  background-blend-mode: multiply;
  color: var(--ink-2);
  filter: drop-shadow(0 -0.4rem 1rem rgba(30, 3, 7, 0.4));
}

.tabs::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -19px;
  height: 20px;
  background: var(--cream-100);
  -webkit-mask: var(--torn) 0 0 / 600px 20px repeat-x;
  mask: var(--torn) 0 0 / 600px 20px repeat-x;
  transform: scaleY(-1);
}

.tab {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.15rem;
  padding: 0.2rem 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tab svg {
  width: 1.5rem;
  height: 1.5rem;
}

.tab[aria-current="page"] {
  color: var(--red-600);
}

.tab[aria-current="page"]::after {
  content: "";
  position: absolute;
  top: 0.1rem;
  width: 1.6rem;
  height: 0.22rem;
  border-radius: 999px;
  background: var(--red-600);
}

.tab__dot {
  position: absolute;
  top: 0.55rem;
  left: calc(50% + 0.55rem);
  width: 0.6rem;
  height: 0.6rem;
  border: 2px solid var(--cream-100);
  border-radius: 50%;
  background: var(--red-500);
}

/* ---------- Passport: next mission ---------- */

.next {
  position: relative;
  display: grid;
  background: var(--cream-100);
  color: var(--ink);
  border-radius: 3px;
  box-shadow: var(--shadow-paper);
  overflow: hidden;
}

.next__photo {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--red-900);
}

.next__photo img:not(.next__sticker) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.next__photo::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 22px;
  background: var(--cream-100);
  -webkit-mask: var(--torn-2) 0 0 / 640px 22px repeat-x;
  mask: var(--torn-2) 0 0 / 640px 22px repeat-x;
  transform: scaleY(-1);
}

.next__flag {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: var(--red-600);
  color: var(--cream-50);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.next__sticker {
  position: absolute;
  right: 0.5rem;
  bottom: -5.2rem;
  z-index: 2;
  width: 5.8rem;
  height: 5.8rem;
  transform: rotate(7deg);
  filter: drop-shadow(0 0.35rem 0.5rem rgba(30, 3, 7, 0.35));
}

.next__body {
  display: grid;
  gap: 0.45rem;
  padding: 0.5rem 1rem 1.1rem;
}

.next__room {
  margin: 0;
  padding-right: 6.4rem;
  color: var(--red-600);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.next__title {
  margin: 0;
  padding-right: 5rem;
  font-family: var(--display);
  font-size: 1.62rem;
  font-weight: 900;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.next__story {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.93rem;
  line-height: 1.4;
}

.next__way {
  margin: 0.1rem 0 0.25rem;
  padding: 0.55rem 0.7rem;
  border-left: 3px solid var(--navy);
  background: rgba(28, 42, 140, 0.07);
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.35;
}

.next__way b {
  font-weight: 800;
}

.next--done .next__body {
  padding-top: 1.1rem;
}

.next--done .next__title,
.next--done .next__room {
  padding-right: 0;
}

/* ---------- Passport: the stamp page ---------- */

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 1.5rem;
  padding: 1.15rem 1rem 1.25rem;
}

.page__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 0.8rem;
  margin-bottom: 0.9rem;
}

.page__title {
  color: var(--red-700);
  font-size: 1.5rem;
}

.page__meta {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.78rem;
  font-weight: 700;
}

.stamps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stamp {
  position: relative;
  display: grid;
  gap: 0.1rem;
  width: 100%;
  padding: 0.55rem 0.55rem 0.7rem;
  border: 1.5px dashed rgba(42, 19, 17, 0.28);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.35);
  color: var(--ink);
  text-align: left;
}

.stamp__well {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  margin-bottom: 0.45rem;
}

.stamp__ghost {
  width: 78%;
  filter: grayscale(1) contrast(0.6) brightness(1.25);
  opacity: 0.22;
}

.stamp__n {
  position: absolute;
  top: 0;
  left: 0.1rem;
  color: var(--ink-3);
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.stamp__name {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.15;
}

.stamp__room {
  color: var(--ink-3);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.25;
}

.stamp.is-next {
  border: 2px solid var(--red-600);
  background: rgba(255, 255, 255, 0.7);
}

.stamp.is-next .stamp__ghost {
  filter: none;
  opacity: 0.5;
}

.stamp__flag {
  position: absolute;
  top: -0.6rem;
  right: 0.5rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--red-600);
  color: var(--cream-50);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stamp.is-done {
  border-style: solid;
  border-color: transparent;
  background: none;
}

.stamp__polaroid {
  position: absolute;
  inset: 3% 9% 9% 3%;
  padding: 4% 4% 14%;
  background: #fffdf7;
  box-shadow: 0 0.25rem 0.6rem rgba(42, 19, 17, 0.28);
  transform: rotate(-3.5deg);
}

.stamp:nth-child(even) .stamp__polaroid {
  transform: rotate(2.5deg);
}

.stamp__polaroid img,
.stamp__polaroid span {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--red-700) url("../assets/img/paper/paper-red.webp") center / cover;
}

.stamp__sticker {
  position: absolute;
  right: -7%;
  bottom: -9%;
  width: 34%;
  filter: drop-shadow(0 0.2rem 0.3rem rgba(42, 19, 17, 0.35));
  transform: rotate(6deg);
}

/* The photo's Christmas version is still being made. */
.stamp__busy {
  position: absolute;
  right: 6%;
  top: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--red-600);
  color: var(--cream-50);
  box-shadow: 0 0.15rem 0.35rem rgba(42, 19, 17, 0.35);
}

.stamp__busy svg {
  width: 0.9rem;
  height: 0.9rem;
  animation: twinkle 1.4s ease-in-out infinite;
}

.ink {
  position: absolute;
  top: -9%;
  left: -9%;
  width: 34%;
  color: var(--red-600);
  mix-blend-mode: multiply;
  opacity: 0.8;
  transform: rotate(-16deg);
  pointer-events: none;
}

.ink text {
  fill: currentColor;
  font-family: var(--ui);
  font-weight: 800;
}

.stamp.is-fresh .stamp__sticker {
  animation: sticker-on 520ms var(--ease) 80ms both;
}

.stamp.is-fresh .ink {
  animation: ink-on 380ms cubic-bezier(0.3, 1.5, 0.5, 1) 420ms both;
}

@keyframes sticker-on {
  from {
    opacity: 0;
    transform: rotate(-20deg) scale(1.7);
  }
}

@keyframes ink-on {
  from {
    opacity: 0;
    transform: rotate(-16deg) scale(2.2);
  }
}

@keyframes twinkle {
  50% {
    opacity: 0.35;
    transform: scale(0.8);
  }
}

/* ---------- Passport: rooms explored ---------- */

.explore {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  margin-top: 1.2rem;
  padding: 0.9rem 1rem;
  border: 1.5px solid rgba(249, 240, 221, 0.35);
  border-radius: 0.9rem;
  background: rgba(63, 9, 17, 0.32);
  color: var(--cream-100);
  text-align: left;
}

.explore__text {
  display: grid;
  gap: 0.45rem;
  flex: 1;
  font-size: 0.88rem;
}

.explore__text b {
  font-weight: 800;
}

.explore__bar {
  display: block;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(249, 240, 221, 0.22);
  overflow: hidden;
}

.explore__bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--cream-100);
  transition: width 500ms var(--ease);
}

.explore__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.explore__cta svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* ---------- Map ---------- */

.mapcard {
  margin-inline: -0.45rem;
  padding: 0.55rem 0.5rem 0.85rem;
  scroll-margin-top: 4.8rem;
}

.mapcard__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.1rem 0.15rem 0.45rem 0.45rem;
}

.mapcard__hint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--red-700);
  font-family: var(--display);
  font-size: 1.02rem;
  font-style: italic;
  font-weight: 700;
}

/* Zooming widens the drawing; the frame scrolls it with ordinary touch.
   The frame is the chart itself: a sheet of pale paper with a stitched edge. */
.mapcard__frame {
  position: relative;
  aspect-ratio: 808 / 612;
  border-radius: 0.5rem;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.7), transparent 46%),
    radial-gradient(circle at 86% 92%, rgba(203, 181, 140, 0.32), transparent 52%),
    #f6ecd6;
  outline: 1.5px dashed rgba(140, 22, 36, 0.38);
  outline-offset: -0.32rem;
  box-shadow: inset 0 0 0 1px rgba(42, 19, 17, 0.12), inset 0 0 1.6rem rgba(140, 100, 50, 0.16);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

#map {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  aspect-ratio: 808 / 612;
  user-select: none;
}

.mapcard__tools {
  display: flex;
  gap: 0.35rem;
}

.mapcard__tools button {
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 999px;
  background: var(--cream-50);
  color: var(--red-700);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0.16rem 0 var(--cream-400), 0 0 0 1px rgba(42, 19, 17, 0.12);
}

.mapcard__tools button:active {
  transform: translateY(0.12rem);
  box-shadow: 0 0.04rem 0 var(--cream-400), 0 0 0 1px rgba(42, 19, 17, 0.12);
}

.mapcard__tools button[data-zoom="reset"] {
  font-size: 0.86rem;
}

/* Rooms are paper cut-outs lifted off the chart by one shared shadow. */
.m-room {
  cursor: pointer;
  outline: none;
}

.m-shape {
  fill: #fffdf7;
  stroke: rgba(42, 19, 17, 0.62);
  stroke-width: 1.4;
  stroke-linejoin: round;
  transition: fill 200ms ease;
}

.m-ring {
  fill: none;
  stroke: none;
  stroke-linejoin: round;
  pointer-events: none;
}

.m-room.is-seen .m-shape {
  fill: #d7e2c8;
}

.m-room--mission .m-shape {
  fill: var(--red-600);
  stroke: var(--red-950);
}

.m-room--mission.is-done .m-shape {
  fill: var(--red-900);
}

.m-room.is-next .m-ring {
  stroke: var(--sun);
  stroke-width: 9;
  stroke-opacity: 0.95;
  animation: map-next 1.8s ease-in-out infinite;
}

@keyframes map-next {
  50% {
    stroke-width: 16;
    stroke-opacity: 0.4;
  }
}

.m-room:hover .m-shape,
.m-room:focus-visible .m-shape {
  stroke-width: 2.8;
}

.m-room:focus-visible .m-ring {
  stroke: var(--navy);
  stroke-width: 7;
}

/* One size for every room number: the plan is always a phone's width.
   A halo in the room's own colour keeps it readable where the trail crosses. */
.m-label {
  fill: var(--ink);
  stroke: #fffdf7;
  stroke-width: 5;
  stroke-linejoin: round;
  paint-order: stroke;
  font-family: var(--display);
  font-size: 23px;
  font-weight: 800;
  pointer-events: none;
}

.m-label--mission {
  fill: var(--cream-50);
  stroke: var(--red-800);
  font-size: 21px;
}

.m-caption {
  fill: var(--red-700);
  stroke: #fffdf7;
  stroke-width: 4;
  stroke-linejoin: round;
  paint-order: stroke;
  font-family: var(--ui);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.m-caption--mission {
  fill: var(--cream-50);
  stroke: var(--red-800);
}

/* The Rescue Crew, waiting in their rooms. */
.m-pin {
  pointer-events: none;
}

.m-pin__bob {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.m-pin.is-next .m-pin__bob {
  animation: pin-bob 1.5s var(--ease) infinite;
}

@keyframes pin-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(-7px) rotate(-4deg);
  }
}

.m-pin__tick {
  display: none;
}

.m-pin.is-done .m-pin__tick {
  display: block;
}

.m-pin__tick circle {
  fill: #2f6b3c;
  stroke: var(--cream-50);
  stroke-width: 2;
}

.m-pin__tick path {
  fill: none;
  stroke: var(--cream-50);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The trail: a candy cane laid along the route. */
.m-route path {
  fill: none;
  stroke-linejoin: round;
  pointer-events: none;
}

.m-route__case {
  stroke: rgba(42, 19, 17, 0.42);
  stroke-width: 7.4;
  stroke-linecap: round;
}

.m-route__white {
  stroke: #fffdf7;
  stroke-width: 5;
  stroke-linecap: round;
}

.m-route__line {
  stroke: var(--red-500);
  stroke-width: 5;
  stroke-dasharray: 7 7;
  animation: route-flow 1.6s linear infinite;
}

/* Spurs are the short side trips into a room: a thinner cane. */
.m-route__case.is-spur {
  stroke-width: 5.6;
}

.m-route__white.is-spur,
.m-route__line.is-spur {
  stroke-width: 3.6;
}

.m-route__line.is-spur {
  stroke-dasharray: 5 5;
  animation: none;
}

.m-route .m-route__head {
  fill: #fffdf7;
  stroke: var(--red-900);
  stroke-width: 2;
  stroke-linejoin: round;
}

@keyframes route-flow {
  to {
    stroke-dashoffset: -14;
  }
}

.m-route__arrow circle {
  fill: var(--cream-50);
  stroke: var(--red-800);
  stroke-width: 1.4;
  pointer-events: none;
}

.m-route .m-route__arrow path {
  stroke: var(--red-800);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.m-mark__pill {
  fill: var(--ink);
}

.m-mark__text {
  fill: var(--cream-50);
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* The corners the building leaves empty. */
.m-decor {
  pointer-events: none;
}

.m-title {
  fill: var(--red-700);
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
}

.m-title__cane-case {
  fill: none;
  stroke: #fffdf7;
  stroke-width: 4.4;
  stroke-linecap: round;
}

.m-title__cane {
  fill: none;
  stroke: var(--red-500);
  stroke-width: 4.4;
  stroke-dasharray: 7 7;
}

.m-title__sub {
  fill: var(--ink-3);
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.m-flake line,
.m-flake path {
  fill: none;
  stroke: rgba(140, 22, 36, 0.3);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0.7rem 0.4rem 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 700;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend__swatch {
  width: 0.95rem;
  height: 0.95rem;
  border: 1.5px solid rgba(42, 19, 17, 0.62);
  border-radius: 3px;
  background: #fffdf7;
}

.legend__swatch--mission {
  background: var(--red-600);
}

.legend__swatch--next {
  border-color: var(--sun);
  background: var(--red-600);
  box-shadow: 0 0 0 2px var(--sun);
}

.legend__swatch--seen {
  background: #d7e2c8;
}

.legend__swatch--route {
  width: 1.5rem;
  height: 0.36rem;
  border: 0;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, var(--red-500) 0 5px, #fffdf7 5px 10px);
  box-shadow: 0 0 0 1px rgba(42, 19, 17, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .m-route__line,
  .m-pin.is-next .m-pin__bob,
  .m-room.is-next .m-ring {
    animation: none;
  }
}

/* ---------- Route list (the guide to every room) ---------- */

.chips {
  display: flex;
  gap: 0.45rem;
  margin: 0 calc(var(--gutter) * -1) 0.8rem;
  padding: 0.2rem var(--gutter) 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  min-height: 2.75rem;
  padding: 0 0.95rem;
  border: 1.5px solid rgba(249, 240, 221, 0.45);
  border-radius: 999px;
  background: none;
  color: var(--cream-100);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.chip[aria-pressed="true"] {
  border-color: var(--cream-100);
  background: var(--cream-100);
  color: var(--red-700);
}

.route {
  position: relative;
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.route::before {
  content: "";
  position: absolute;
  top: 1.6rem;
  bottom: 1.6rem;
  left: 1.72rem;
  border-left: 2px dotted rgba(249, 240, 221, 0.5);
}

.stop {
  position: relative;
  display: grid;
  grid-template-columns: 3.5rem 1fr auto;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.45rem 0.8rem 0.45rem 0;
  border: 0;
  border-radius: 0.8rem;
  background: none;
  color: var(--cream-100);
  text-align: left;
}

.stop__thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 2.5px solid var(--cream-100);
  border-radius: 50%;
  background: var(--red-900);
  color: var(--cream-200);
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 900;
  overflow: hidden;
}

.stop__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stop__name {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}

.stop__meta {
  display: block;
  margin-top: 0.1rem;
  color: var(--cream-300);
  font-size: 0.78rem;
  line-height: 1.3;
}

.stop__state {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 1.5px solid rgba(249, 240, 221, 0.45);
  border-radius: 50%;
  color: transparent;
}

.stop__state svg {
  width: 1rem;
  height: 1rem;
}

.stop.is-seen .stop__state {
  border-color: var(--cream-100);
  background: var(--cream-100);
  color: var(--red-700);
}

.stop--mission .stop__thumb {
  border-color: var(--sun);
}

.stop.is-next {
  background: rgba(63, 9, 17, 0.4);
  box-shadow: 0 0 0 1.5px var(--sun) inset;
}

.goodtoknow ul {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 0.92rem;
  line-height: 1.42;
}

.goodtoknow b {
  color: var(--ink);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.16rem 0.55rem;
  border: 1.2px solid rgba(42, 19, 17, 0.3);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.tags li.tag--mission {
  border-color: var(--red-600);
  background: var(--red-600);
  color: var(--cream-50);
}

.tags li.tag--family {
  border-color: var(--navy);
  color: var(--navy);
}

.tip {
  display: grid;
  gap: 0.1rem;
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid var(--red-600);
  background: rgba(165, 29, 44, 0.07);
  font-size: 0.88rem;
  line-height: 1.38;
}

.tip b {
  color: var(--red-600);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Sheets ---------- */

.sheet {
  width: min(var(--col), 100%);
  max-width: none;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 1.1rem 1.1rem 0 0;
  background: url("../assets/img/paper/paper-snow.webp") center / cover, var(--cream-100);
  background-blend-mode: multiply;
  color: var(--ink);
  box-shadow: 0 -1rem 3rem rgba(30, 3, 7, 0.5);
  overflow: auto;
  overscroll-behavior: contain;
}

.sheet[open] {
  animation: sheet-up 380ms var(--ease) both;
}

.sheet::backdrop {
  background: rgba(40, 4, 9, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.sheet--full {
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
}

@keyframes sheet-up {
  from {
    transform: translateY(8%);
    opacity: 0;
  }
}

.sheet__body {
  position: relative;
  margin: 0;
  overflow-x: clip;
}

.sheet__close {
  position: sticky;
  top: 0.7rem;
  z-index: 5;
  float: right;
  margin: 0.7rem 0.7rem -3.45rem 0;
}

.sheet__bar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: calc(0.45rem + env(safe-area-inset-top, 0px)) var(--gutter) 0.45rem;
  color: var(--cream-100);
}

.sheet__bar-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sheet__bar-title svg {
  width: 0.95rem;
  height: 0.95rem;
  color: #e9c46a;
}

/* The mission photo sits inside the page, below where the lights hang. */
#mission-sheet .sheet__photo--tall {
  width: auto;
  margin: 3.4rem var(--gutter) 0;
  aspect-ratio: 16 / 10;
  max-height: 36dvh;
  border-radius: 0.9rem;
  background: none;
}

#mission-sheet .sheet__photo--tall > img:not(.sheet__sticker) {
  border-radius: 0.9rem;
  box-shadow: 0 0.5rem 1.2rem rgba(42, 19, 17, 0.25);
}

#mission-sheet .sheet__photo::after {
  display: none;
}

#mission-sheet .sheet__sticker {
  right: 0.2rem;
  bottom: -5.9rem;
  width: 5.6rem;
}

#mission-sheet .sheet__content {
  padding-top: 1.2rem;
}

/* The title keeps clear of the crew sticker beside it. */
.mission-brief .sheet__title {
  padding-right: 5.6rem;
}

.sheet__photo {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--red-900);
}

.sheet__photo:empty {
  display: none;
}

/* The mission photo is taller than a room photo. */
.sheet__photo--tall {
  aspect-ratio: 4 / 3;
  max-height: 44dvh;
  width: 100%;
}

.sheet__photo img:not(.sheet__sticker) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sheet__photo::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 24px;
  background: var(--cream-100);
  -webkit-mask: var(--torn) 0 0 / 700px 24px repeat-x;
  mask: var(--torn) 0 0 / 700px 24px repeat-x;
  transform: scaleY(-1);
}

.sheet__sticker {
  position: absolute;
  right: 0.8rem;
  bottom: -5.6rem;
  z-index: 2;
  width: 6rem;
  transform: rotate(8deg);
  filter: drop-shadow(0 0.35rem 0.5rem rgba(30, 3, 7, 0.38));
}

.sheet.is-done .sheet__sticker {
  display: none;
}

.sheet__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
  padding: 1rem var(--gutter) calc(1.5rem + env(safe-area-inset-bottom));
}

.sheet__photo:empty + .sheet__content,
.sheet__content--top {
  padding-top: 1.5rem;
}

.sheet__title {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding-right: 3rem;
  color: var(--red-700);
  font-size: clamp(1.7rem, 7.6vw, 2.1rem);
}

.sheet__title .num {
  color: var(--ink-3);
  font-size: 0.75em;
}

.sheet__text {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.45;
}

.sheet__actions {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.3rem;
}

.roomnext {
  justify-content: space-between;
  padding-inline: 1.25rem 1.05rem;
  text-align: left;
}

.roomnext.btn--line {
  flex: none;
  min-height: 3rem;
}

.roomnext__text {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.roomnext__text small {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.78;
}

.roomnext__text b {
  overflow: hidden;
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roomnext svg {
  width: 1.3rem;
  height: 1.3rem;
}

/* ---------- Mission ---------- */

[data-mission-label] {
  padding-right: 6.8rem;
}

.story {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.12rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1.32;
}

.steps {
  display: grid;
  gap: 0.55rem;
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  min-height: 1.9rem;
  padding: 0.18rem 0 0 2.6rem;
  counter-increment: step;
  line-height: 1.38;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 2px solid var(--red-600);
  border-radius: 50%;
  color: var(--red-600);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 900;
}

.shout {
  position: relative;
  margin: 0.2rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 0.2rem;
  background: var(--red-600) url("../assets/img/paper/paper-red.webp") center / cover;
  color: var(--cream-50);
  font-family: var(--display);
  font-size: clamp(1.5rem, 7vw, 1.9rem);
  font-weight: 900;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  line-height: 1.05;
  text-align: center;
  transform: rotate(-1.2deg);
}

.shout::before {
  content: "Everyone shout";
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--ui);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.85;
}

.note {
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid var(--navy);
  background: rgba(28, 42, 140, 0.07);
  font-size: 0.88rem;
  line-height: 1.38;
}

.cam {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.3rem;
  padding: 0.5rem;
}

.cam__frame {
  position: relative;
  aspect-ratio: 3 / 4;
  /* As wide as the page allows, but never so tall that the action bar
     below it is pushed off the screen. */
  width: min(100%, calc((100dvh - 15.5rem) * 0.75));
  margin-inline: auto;
  border-radius: 0.3rem;
  background: var(--red-950);
  box-shadow: 0 0 0 0.5rem #fffdf7, 0 0.6rem 1.4rem rgba(42, 19, 17, 0.32);
  overflow: hidden;
  scroll-margin-block: 1rem 9rem;
}

.cam__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.6rem;
  padding: 1.5rem;
  color: var(--cream-200);
  font-size: 0.92rem;
  line-height: 1.35;
  text-align: center;
}

.cam__empty svg {
  width: 2.6rem;
  height: 2.6rem;
  opacity: 0.8;
}

.cam__video,
.cam__legacy,
.cam__snow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The camera module keeps its own <img>; the flip card shows the photo. */
.cam__legacy {
  visibility: hidden;
}

.cam__snow {
  pointer-events: none;
}

.cam__frame[data-mirror="true"] .cam__video {
  transform: scaleX(-1);
}

.cam__frame.is-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  background: #fff;
  animation: flash 320ms ease-out both;
  pointer-events: none;
}

@keyframes flash {
  from {
    opacity: 0.9;
  }
  to {
    opacity: 0;
  }
}

.cam__count {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--display);
  font-size: 9rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0.1em 0.4em rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.cam__chip {
  position: absolute;
  top: 0.6rem;
  z-index: 5;
  display: grid;
  place-items: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.8rem;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(20, 4, 6, 0.55);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.cam__chip svg {
  width: 1.3rem;
  height: 1.3rem;
}

.cam__chip--right {
  right: 0.6rem;
  padding: 0;
}

.cam__chip--left {
  left: 0.6rem;
}

.cam__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.cam__actions .btn {
  flex: 1;
}

.file {
  display: none;
}

/* Retaking is not one tap: the photo has to be deleted first (see below). */
[data-cam="retake"] {
  display: none !important;
}

.mission-brief[data-cam-state="shot"] .mission-bar .cam__actions {
  display: none;
}

/* ---------- The photo that flips: Christmas version / original ---------- */

.flip {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  perspective: 1200px;
}

.flip__inner {
  position: absolute;
  inset: 0;
}

/* A tap squeezes the card to an edge, swaps the picture and opens it again. */
.flip.is-turning .flip__inner {
  animation: flip-turn 420ms var(--ease);
}

@keyframes flip-turn {
  50% {
    transform: scaleX(0.04);
  }
}

.flip__face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0s linear 210ms;
}

.flip__face--back,
.flip[data-side="original"] .flip__face:not(.flip__face--back) {
  opacity: 0;
}

.flip[data-side="original"] .flip__face--back {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .flip.is-turning .flip__inner {
    animation: none;
  }

  .flip__face {
    transition: none;
  }
}

/* Which side is showing, and that a tap turns it over. */
.flip__tag {
  position: absolute;
  left: 0.55rem;
  top: 0.55rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: calc(100% - 1.1rem);
  padding: 0.28rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(20, 4, 6, 0.6);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.flip__tag svg {
  flex: none;
  width: 1rem;
  height: 1rem;
}

/* While the Christmas version is being made: a slow shimmer over the photo. */
.flip[data-state="pending"]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(110deg, rgba(255, 250, 240, 0) 30%, rgba(255, 250, 240, 0.4) 50%, rgba(255, 250, 240, 0) 70%);
  background-size: 250% 100%;
  animation: shimmer 2.2s linear infinite;
  pointer-events: none;
}

@keyframes shimmer {
  from {
    background-position: 130% 0;
  }
  to {
    background-position: -130% 0;
  }
}

.flip[data-state="pending"] .flip__tag svg {
  animation: twinkle 1.4s ease-in-out infinite;
}

.flip--small .flip__tag {
  top: 0.3rem;
  left: 0.3rem;
  padding: 0.2rem 0.5rem;
  border-width: 1px;
  font-size: 0.66rem;
}

.flip--small .flip__tag svg {
  width: 0.75rem;
  height: 0.75rem;
}

.saves {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

/* Photos left for this mission: small print under the downloads. */
.saves__left {
  flex-basis: 100%;
  margin: 0.15rem 0 -0.2rem;
  color: var(--ink-2);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

/* No camera when the passport is closed or the mission's photos are used. */
.mission-brief[data-locked="closed"] .cam__actions,
.mission-brief[data-locked="limit"] .cam__actions {
  display: none;
}

.saves .link {
  flex-basis: 100%;
  padding: 0.3rem;
  color: var(--ink-3);
  font-weight: 500;
  text-align: center;
}

/* The optional sleigh-helper maker */

.helper {
  display: grid;
  gap: 0.7rem;
  padding: 0.9rem;
  border: 1.5px dashed rgba(42, 19, 17, 0.35);
  border-radius: 0.6rem;
}

.helper__title {
  margin: 0;
  color: var(--red-700);
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.1;
}

.helper__title i {
  margin-left: 0.3rem;
  color: var(--ink-3);
  font-family: var(--ui);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.helper__text {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.4;
}

.helper__form {
  display: grid;
  gap: 0.7rem;
}

.helper__result {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  text-align: center;
}

.helper__result img {
  width: min(15rem, 80%);
  filter: drop-shadow(0 0.5rem 0.8rem rgba(42, 19, 17, 0.3));
}

/* Pinned to the bottom of the mission sheet while the brief scrolls. */
.mission-bar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: grid;
  gap: 0.6rem;
  margin: 0 calc(var(--gutter) * -1);
  padding: 0.7rem var(--gutter) calc(0.8rem + env(safe-area-inset-bottom));
  background: url("../assets/img/paper/paper-snow.webp") center / cover, var(--cream-100);
  background-blend-mode: multiply;
  box-shadow: 0 -0.5rem 0.9rem rgba(42, 19, 17, 0.13);
}

.mission-bar .fine:empty {
  display: none;
}

/* Mission complete */

.done {
  justify-items: center;
  padding-top: 1.6rem;
  text-align: center;
}

.done__stamp {
  position: relative;
  width: min(13rem, 56vw);
  aspect-ratio: 1;
}

.done__sticker {
  width: 100%;
  filter: drop-shadow(0 0.6rem 0.9rem rgba(42, 19, 17, 0.35));
  animation: sticker-on 560ms var(--ease) both;
}

.done .ink {
  top: -8%;
  left: -18%;
  width: 62%;
  animation: ink-on 380ms cubic-bezier(0.3, 1.5, 0.5, 1) 460ms both;
}

.done .sheet__title {
  justify-content: center;
  padding: 0;
}

.done__crew {
  margin: -0.3rem 0 0;
  color: var(--ink-2);
  font-size: 0.92rem;
}

.santa-says {
  position: relative;
  margin: 0.5rem 0 0.3rem;
  padding: 1rem 1.1rem;
  border-radius: 0.2rem;
  background: var(--red-700) url("../assets/img/paper/paper-red.webp") center / cover;
  color: var(--cream-50);
  font-family: var(--display);
  font-size: 1.08rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1.34;
  text-align: left;
}

.santa-says::before {
  content: "Santa says";
  display: block;
  margin-bottom: 0.35rem;
  color: var(--cream-200);
  font-family: var(--ui);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ---------- Rewards ---------- */

.locked {
  justify-items: center;
  gap: 0.7rem;
  margin-top: 0;
  padding: 2rem 1.2rem;
  text-align: center;
}

.locked__icon {
  width: 2.6rem;
  height: 2.6rem;
  color: var(--red-600);
}

.locked p {
  margin: 0;
  color: var(--ink-2);
}

.film {
  gap: 0.85rem;
  margin-top: 0;
}

.film .page__head,
.prize .page__head {
  margin-bottom: 0;
}

.stage {
  position: relative;
  width: min(100%, 17rem);
  margin-inline: auto;
  aspect-ratio: 9 / 16;
  border-radius: 0.5rem;
  background: var(--red-950);
  box-shadow: 0 0 0 0.4rem #fffdf7, 0 0.8rem 1.6rem rgba(42, 19, 17, 0.35);
  overflow: hidden;
}

.stage__poster,
.stage__canvas,
.stage__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* While the film is made: the chosen style, dimmed, under a progress line. */
.stage__wait {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.6rem;
  padding: 1.2rem;
  background: rgba(40, 4, 9, 0.76);
  color: var(--cream-100);
  text-align: center;
}

.stage__wait b {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.05;
}

.stage__wait p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.meter {
  width: 9.5rem;
  height: 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.meter i {
  display: block;
  width: 4%;
  height: 100%;
  border-radius: inherit;
  background: var(--sun);
  transition: width 900ms linear;
}

.styles__label {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.styles {
  display: flex;
  gap: 0.55rem;
  margin: 0.45rem -1rem 0;
  padding: 0.2rem 1rem 0.4rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.styles::-webkit-scrollbar {
  display: none;
}

.style {
  flex: none;
  display: grid;
  align-content: start;
  gap: 0.3rem;
  width: 5.2rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  scroll-snap-align: start;
}

.style img {
  width: 100%;
  aspect-ratio: 9 / 16;
  border: 2px solid rgba(42, 19, 17, 0.2);
  border-radius: 0.45rem;
  object-fit: cover;
  opacity: 0.8;
}

.style[aria-pressed="true"] {
  color: var(--red-700);
}

.style[aria-pressed="true"] img {
  border-color: var(--red-600);
  box-shadow: 0 0 0 2px var(--red-600);
  opacity: 1;
}

.film__done {
  display: grid;
  gap: 0.7rem;
}

.caption {
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem 0.8rem;
  border: 1.5px dashed rgba(42, 19, 17, 0.3);
  border-radius: 0.5rem;
}

.caption__label {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.caption__text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.caption .link {
  justify-self: start;
  padding-left: 0;
}

/* Every mission photo, both versions */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 0.7rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.shot {
  display: grid;
  gap: 0.3rem;
}

.shot__pic {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 0.2rem;
  background: var(--red-700) url("../assets/img/paper/paper-red.webp") center / cover;
  box-shadow: 0 0 0 0.3rem #fffdf7, 0 0.4rem 0.9rem rgba(42, 19, 17, 0.28);
  overflow: hidden;
}

.shot__pic img.shot__sticker {
  position: absolute;
  inset: 14%;
  width: 72%;
  height: 72%;
  object-fit: contain;
}

.shot__name {
  margin-top: 0.4rem;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.shot__saves {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
}

.shot__saves button {
  min-height: 2.75rem;
  padding: 0 0.2rem;
  border: 0;
  background: none;
  color: var(--red-600);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.shot__saves button:disabled {
  color: var(--ink-3);
  font-weight: 500;
  text-decoration: none;
  cursor: default;
}

/* The wheel */

.prize {
  gap: 0.85rem;
}

.wheel {
  position: relative;
  width: min(18rem, 78vw);
  aspect-ratio: 1;
  margin: 0.6rem auto 0.2rem;
  filter: drop-shadow(0 0.9rem 1.2rem rgba(42, 19, 17, 0.35));
}

.wheel__disc {
  position: absolute;
  inset: 0;
  border: 0.45rem solid #fffdf7;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(42, 19, 17, 0.25);
  transform: rotate(0deg);
  transition: transform 4.2s cubic-bezier(0.16, 0.62, 0.06, 1);
}

/* Labels ride their slice round and stay upright: the disc adds --spin, the
   label subtracts the same angle over the same duration. */
.wheel__label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4.4rem;
  margin: -0.6rem 0 0 -2.2rem;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  transform: rotate(var(--angle)) translateY(-5.6rem) rotate(calc(-1 * var(--angle) - var(--spin, 0deg)));
  transition: transform 4.2s cubic-bezier(0.16, 0.62, 0.06, 1);
  pointer-events: none;
}

.wheel__label--toy {
  width: 3rem;
  margin: -0.85rem 0 0 -1.5rem;
  font-size: 0.78rem;
  line-height: 1;
}

.wheel__hub {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  transform: translate(-50%, -50%);
  border: 0.3rem solid #fffdf7;
  border-radius: 50%;
  background: var(--red-700);
  color: var(--sun);
}

.wheel__hub svg {
  width: 1.2rem;
  height: 1.2rem;
}

.wheel__pointer {
  position: absolute;
  top: -0.5rem;
  left: 50%;
  z-index: 3;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-top: 1.4rem solid var(--ink);
  border-right: 0.7rem solid transparent;
  border-left: 0.7rem solid transparent;
}

.prize__result {
  min-height: 1.4em;
  margin: 0;
  color: var(--red-700);
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
}

.prize__result:empty {
  display: none;
}

.prize__redeem,
.prize__ref {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: center;
}

.prize__ref {
  color: var(--red-600);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Menu ---------- */

.menu__about h3 {
  margin: 0.9rem 0 0.2rem;
  color: var(--red-700);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.menu__about p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.92rem;
  line-height: 1.42;
}

/* ---------- Finale ---------- */

html.is-locked,
html.is-locked body {
  overflow: hidden;
}

.finale {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  justify-items: center;
  background: rgba(63, 9, 17, 0.86) url("../assets/img/paper/paper-red.webp") center / cover;
  background-blend-mode: multiply;
  overflow: auto;
  animation: view-in 400ms ease both;
}

.finale__card {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.9rem;
  width: min(var(--col), 100%);
  min-height: 100%;
  padding: calc(4rem + env(safe-area-inset-top, 0px)) 1rem 1.5rem;
  overflow: hidden;
}

.finale__card > .lights {
  top: env(safe-area-inset-top, 0px);
  margin-top: 0;
}

.finale__santa {
  width: min(11rem, 44vw);
  height: auto;
  margin-bottom: -2.4rem;
  position: relative;
  z-index: 3;
  filter: drop-shadow(0 0.7rem 1rem rgba(30, 3, 7, 0.5));
  animation: santa-in 700ms var(--ease) 150ms both;
}

@keyframes santa-in {
  from {
    opacity: 0;
    transform: translateY(1.5rem) rotate(-8deg) scale(0.8);
  }
}

.finale__paper {
  display: grid;
  gap: 0.6rem;
  width: min(25rem, 100%);
  padding: 2.4rem 1.2rem 1.3rem;
  transform: rotate(-0.8deg);
}

.finale__paper p {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.45;
}

.finale__title {
  color: var(--red-700);
  font-size: clamp(1.6rem, 7.4vw, 2rem);
}

.finale__paper .finale__sign {
  color: var(--red-700);
  font-family: var(--display);
  font-size: 1.15rem;
  font-style: italic;
  font-weight: 700;
}

.finale__card > .btn {
  width: min(25rem, 100%);
}

.finale__tail {
  margin: 0;
  color: var(--cream-200);
  font-size: 0.86rem;
  line-height: 1.4;
  text-align: center;
}

.finale__tail:empty {
  display: none;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabs-h) + 1.6rem + env(safe-area-inset-bottom));
  z-index: 120;
  width: max-content;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.7rem 1.1rem;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream-50);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 0.6rem 1.5rem rgba(0, 0, 0, 0.4);
  animation: view-in 260ms var(--ease) both;
}

.noscript {
  margin: 2rem auto;
  max-width: 24rem;
  padding: 1rem;
  text-align: center;
}

/* ---------- Wider screens: the passport stays a phone-width booklet ---------- */

@media (min-width: 48rem) {
  .app,
  .cover {
    box-shadow: 0 0 0 1px rgba(249, 240, 221, 0.08), 0 0 6rem rgba(30, 3, 7, 0.55);
  }

  .app {
    background: rgba(87, 12, 23, 0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }

  .m-room.is-next .m-ring {
    stroke-width: 11;
  }
}

@media (prefers-reduced-motion: reduce) {
  .deco__glow,
  .deco__dot {
    animation: none;
  }
}
