:root {
  color-scheme: light;
  --ink: #3e2d35;
  --muted: #78646d;
  --muted-2: #9c858e;
  --paper: rgba(255, 252, 249, 0.78);
  --paper-strong: #fffdfa;
  --line: rgba(111, 79, 91, 0.16);
  --rose: #c66f87;
  --rose-dark: #9b5068;
  --rose-soft: #f4cdd5;
  --peach: #f4d7c3;
  --cream: #fbf3eb;
  --lilac: #d9cde7;
  --focus: #74445a;
  --shadow: 0 28px 80px rgba(91, 58, 70, 0.14), 0 6px 24px rgba(91, 58, 70, 0.08);
  --radius-lg: 32px;
  --radius-md: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f8eee8;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.92), transparent 32%),
    linear-gradient(145deg, #fffaf4 0%, #f7e9e6 46%, #eee7f0 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(116, 68, 90, 0.42);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  color: #fff;
  background: var(--focus);
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  width: 42vw;
  height: 42vw;
  min-width: 360px;
  min-height: 360px;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.52;
  animation: drift 18s var(--ease) infinite alternate;
}

.orb--rose {
  top: -15%;
  right: -8%;
  background: radial-gradient(circle, rgba(244, 181, 199, 0.65), rgba(244, 181, 199, 0));
}

.orb--peach {
  bottom: -22%;
  left: -8%;
  background: radial-gradient(circle, rgba(250, 210, 178, 0.76), rgba(250, 210, 178, 0));
  animation-delay: -7s;
}

.orb--lilac {
  top: 36%;
  left: 40%;
  width: 28vw;
  height: 28vw;
  background: radial-gradient(circle, rgba(198, 182, 221, 0.43), rgba(198, 182, 221, 0));
  animation-delay: -12s;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.13;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

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

.spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(161, 103, 128, 0.35);
  box-shadow: 0 0 18px rgba(176, 108, 138, 0.7);
  animation: float-spark var(--duration, 8s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}

.app-shell {
  width: min(100%, 1120px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 24px max(18px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 18px;
}

.topbar {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.wordmark__mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--rose-dark);
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 8px 22px rgba(105, 70, 83, 0.1);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.text-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button[aria-pressed="true"] {
  color: var(--rose-dark);
  border-color: rgba(169, 91, 119, 0.28);
  background: rgba(255, 247, 249, 0.8);
}

.sound-off {
  opacity: 1;
}

.sound-wave {
  opacity: 0;
}

#sound-toggle[aria-pressed="true"] .sound-off {
  opacity: 0;
}

#sound-toggle[aria-pressed="true"] .sound-wave {
  opacity: 1;
}

.text-button {
  padding: 0 16px;
}

.text-button--quiet:hover,
.icon-button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
}

.progress-wrap {
  width: min(100%, 760px);
  margin: 0 auto;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(117, 79, 93, 0.1);
}

.progress-value {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c77b91, #ab7bb5);
  transition: width 650ms var(--ease);
}

.experience {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 560px;
  outline: none;
}

.stage {
  width: min(100%, 760px);
}

.screen {
  animation: reveal 720ms var(--ease) both;
}

.card {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 6vw, 58px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(118%);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 14%;
  left: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
}

.card--center {
  text-align: center;
}

.card--final {
  padding: clamp(26px, 5vw, 48px);
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--rose-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.title {
  max-width: 680px;
  margin: 0;
  text-wrap: balance;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 7vw, 68px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.title[tabindex="-1"]:focus {
  outline: none;
}

.title--question {
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.06;
}

.title--small {
  font-size: clamp(30px, 5vw, 48px);
}

.lede {
  max-width: 570px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2.4vw, 19px);
  line-height: 1.65;
  text-wrap: balance;
}

.card--center .lede {
  margin-right: auto;
  margin-left: auto;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.4);
  font-size: 13px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}

.card--center .actions {
  justify-content: center;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button {
  border: 1px solid transparent;
  color: #fff;
  background: linear-gradient(135deg, #b8617d, #8d617e);
  box-shadow: 0 14px 30px rgba(151, 78, 106, 0.24);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.64);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
}

.primary-button:hover {
  box-shadow: 0 18px 36px rgba(151, 78, 106, 0.31);
}

.intro-symbol {
  position: relative;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  margin: 0 auto 30px;
  border: 1px solid rgba(176, 105, 130, 0.2);
  border-radius: 50%;
  color: var(--rose-dark);
  background: radial-gradient(circle, #fff 0%, #fae9ed 58%, rgba(250, 233, 237, 0) 70%);
  font-size: 34px;
  box-shadow: 0 0 70px rgba(197, 116, 146, 0.22);
  animation: breathe 4s ease-in-out infinite;
}

.intro-symbol::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(180, 111, 137, 0.14);
  border-radius: 50%;
  animation: orbit 13s linear infinite;
}

.options {
  display: grid;
  gap: 12px;
  margin-top: 32px;
}

.option {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 62px;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  text-align: left;
  cursor: pointer;
  transition: transform 220ms var(--ease), border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.option:hover:not(:disabled) {
  z-index: 1;
  border-color: rgba(178, 99, 127, 0.32);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 30px rgba(87, 54, 67, 0.09);
  transform: translateY(-2px);
}

.option:disabled {
  cursor: default;
}

.option:not(.is-selected):disabled {
  opacity: 0.46;
}

.option.is-selected {
  border-color: rgba(171, 86, 118, 0.48);
  background: rgba(255, 247, 250, 0.94);
  box-shadow: 0 12px 30px rgba(113, 61, 80, 0.12);
}

.option__letter {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--rose-dark);
  background: rgba(213, 142, 166, 0.13);
  font-size: 12px;
  font-weight: 850;
}

.option__text {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
}

.option__arrow {
  color: var(--muted-2);
  font-size: 20px;
  transition: transform 180ms ease;
}

.option:hover .option__arrow {
  transform: translateX(3px);
}

.response {
  margin-top: 22px;
  padding: 18px 20px;
  border-left: 3px solid rgba(181, 94, 126, 0.5);
  border-radius: 0 16px 16px 0;
  color: var(--muted);
  background: rgba(255, 249, 250, 0.7);
  line-height: 1.55;
  animation: response-in 420ms var(--ease) both;
}

.continue-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
  animation: response-in 520ms var(--ease) 80ms both;
}

.boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 34px;
  perspective: 900px;
}

.mystery-box {
  position: relative;
  min-height: 184px;
  padding: 18px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.48);
  cursor: pointer;
  transition: transform 260ms var(--ease), border-color 220ms ease, background 220ms ease, opacity 220ms ease;
}

.mystery-box:hover:not(:disabled) {
  border-color: rgba(178, 99, 127, 0.36);
  background: rgba(255, 255, 255, 0.75);
  transform: translateY(-5px) rotateX(2deg);
}

.mystery-box:disabled:not(.is-open) {
  opacity: 0.38;
}

.box-visual {
  position: relative;
  width: 92px;
  height: 98px;
  margin: 0 auto 12px;
}

.box-base,
.box-lid {
  position: absolute;
  left: 50%;
  width: 82px;
  border: 1px solid rgba(128, 77, 96, 0.16);
  background: linear-gradient(145deg, #f8d8df, #eebfcb);
  box-shadow: 0 12px 28px rgba(124, 72, 91, 0.14);
}

.box-base {
  bottom: 0;
  height: 68px;
  border-radius: 8px 8px 13px 13px;
  transform: translateX(-50%);
}

.box-lid {
  z-index: 2;
  top: 19px;
  height: 22px;
  border-radius: 8px;
  transform: translateX(-50%);
  transform-origin: 18% 100%;
  transition: transform 650ms var(--ease);
}

.box-ribbon {
  position: absolute;
  z-index: 3;
  top: 18px;
  left: 50%;
  width: 14px;
  height: 80px;
  background: rgba(255, 250, 244, 0.64);
  transform: translateX(-50%);
}

.box-item {
  position: absolute;
  z-index: 1;
  top: 42px;
  left: 50%;
  color: var(--rose-dark);
  font-size: 36px;
  opacity: 0;
  transform: translate(-50%, 15px) scale(0.5) rotate(-9deg);
  transition: opacity 380ms ease 210ms, transform 650ms var(--ease) 180ms;
  filter: drop-shadow(0 8px 10px rgba(112, 64, 81, 0.18));
}

.mystery-box.is-open {
  border-color: rgba(171, 86, 118, 0.4);
  background: rgba(255, 249, 250, 0.88);
  transform: translateY(-4px);
}

.mystery-box.is-open .box-lid {
  transform: translateX(-62%) translateY(-18px) rotate(-24deg);
}

.mystery-box.is-open .box-item {
  opacity: 1;
  transform: translate(-50%, -30px) scale(1) rotate(4deg);
}

.box-label {
  display: block;
  font-weight: 750;
}

.word-choice.is-selected .option__text {
  color: var(--rose-dark);
  text-shadow: 0 0 26px rgba(182, 98, 129, 0.22);
  transform: scale(1.03);
  transform-origin: left center;
}

.interlude {
  min-height: 430px;
  display: grid;
  place-items: center;
  text-align: center;
}

.interlude__copy {
  max-width: 620px;
}

.interlude-line {
  margin: 14px 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(21px, 3.4vw, 30px);
  line-height: 1.35;
  opacity: 0;
  transform: translateY(12px);
  animation: line-in 850ms var(--ease) forwards;
}

.interlude-line:nth-child(2) { animation-delay: 900ms; }
.interlude-line:nth-child(3) { animation-delay: 1800ms; }

.interlude__action {
  margin-top: 30px;
  opacity: 0;
  animation: line-in 650ms var(--ease) 2800ms forwards;
}

.ticket-scene {
  position: relative;
  min-height: 475px;
  display: grid;
  place-items: center;
  margin-top: 20px;
}

.light-paths {
  position: absolute;
  inset: 5% 4% 18%;
  overflow: hidden;
  opacity: 0.68;
}

.light-path {
  position: absolute;
  top: 48%;
  left: 50%;
  width: 130%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(186, 102, 134, 0.9), transparent);
  box-shadow: 0 0 18px rgba(186, 102, 134, 0.54);
  transform-origin: center;
  animation: draw-line 1.1s var(--ease) both;
}

.light-path:first-child { transform: translate(-50%, -50%) rotate(24deg) scaleX(0); }
.light-path:last-child { transform: translate(-50%, -50%) rotate(-24deg) scaleX(0); animation-delay: 220ms; }

.artifact {
  position: absolute;
  z-index: 4;
  top: 43%;
  left: 50%;
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 1px solid rgba(183, 105, 134, 0.28);
  border-radius: 50%;
  color: var(--rose-dark);
  background: rgba(255, 250, 248, 0.9);
  box-shadow: 0 0 56px rgba(183, 105, 134, 0.28);
  font-size: 34px;
  transform: translate(-50%, -50%) scale(0);
  animation: artifact-in 760ms var(--ease) 580ms forwards, artifact-out 650ms var(--ease) 1750ms forwards;
}

.artifact--coin {
  animation: coin-in 800ms var(--ease) 580ms forwards, coin-flip 700ms ease-in-out 1220ms, artifact-out 650ms var(--ease) 1950ms forwards;
}

.artifact--note {
  border-radius: 12px;
  animation: note-in 800ms var(--ease) 580ms forwards, note-open 850ms var(--ease) 1320ms forwards, artifact-out 650ms var(--ease) 2200ms forwards;
}

.envelope {
  position: absolute;
  z-index: 3;
  top: 43%;
  left: 50%;
  width: 148px;
  height: 98px;
  border: 1px solid rgba(133, 82, 100, 0.18);
  border-radius: 8px;
  background: linear-gradient(145deg, #fffaf5, #f3dadd);
  box-shadow: 0 24px 44px rgba(91, 55, 68, 0.16);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.72);
  animation: envelope-in 780ms var(--ease) 1850ms forwards, envelope-away 700ms var(--ease) 3150ms forwards;
}

.artifact--note + .envelope {
  animation-delay: 2250ms, 3450ms;
}

.artifact--coin + .envelope {
  animation-delay: 2000ms, 3300ms;
}

.envelope::before,
.envelope::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 50% 56%, 100% 0);
}

.envelope::before {
  z-index: 2;
  background: #efd0d7;
  transform-origin: 50% 0;
  animation: flap-open 650ms var(--ease) 2480ms forwards;
}

.artifact--note + .envelope::before { animation-delay: 2880ms; }
.artifact--coin + .envelope::before { animation-delay: 2630ms; }

.envelope::after {
  z-index: 1;
  clip-path: polygon(0 100%, 0 0, 50% 56%, 100% 0, 100% 100%);
  background: #f8e5e7;
}

.tickets {
  position: relative;
  z-index: 5;
  display: grid;
  width: min(100%, 650px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  opacity: 0;
  transform: translateY(28px) scale(0.96);
  animation: tickets-in 900ms var(--ease) 3550ms forwards;
}

.artifact--note ~ .tickets { animation-delay: 3850ms; }
.artifact--coin ~ .tickets { animation-delay: 3700ms; }

.ticket {
  position: relative;
  min-height: 230px;
  padding: 26px 24px;
  overflow: hidden;
  border: 1px solid rgba(114, 75, 88, 0.18);
  border-radius: 20px;
  color: #473039;
  background:
    linear-gradient(90deg, transparent 0 9%, rgba(137, 84, 103, 0.05) 9% 9.5%, transparent 9.5%),
    linear-gradient(150deg, #fffdf8 0%, #faede9 100%);
  box-shadow: 0 20px 44px rgba(90, 58, 69, 0.16);
}

.ticket::before,
.ticket::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(114, 75, 88, 0.14);
  border-radius: 50%;
  background: #f1e6e5;
  transform: translateY(-50%);
}

.ticket::before { left: -13px; }
.ticket::after { right: -13px; }

.ticket--evgeniy {
  transform: rotate(-2.2deg) translateY(8px);
}

.ticket--polina {
  transform: rotate(2deg) translateY(-2px);
}

.ticket__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 17px;
  border-bottom: 1px dashed rgba(117, 76, 91, 0.22);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ticket__name {
  margin: 25px 0 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(27px, 4vw, 38px);
  font-weight: 500;
}

.ticket__status {
  color: var(--muted);
  font-size: 13px;
}

.ticket__code {
  position: absolute;
  right: 22px;
  bottom: 22px;
  display: flex;
  gap: 3px;
  opacity: 0.46;
}

.ticket__code span {
  width: 2px;
  height: 27px;
  background: var(--ink);
}

.ticket__code span:nth-child(2n) { width: 4px; }
.ticket__code span:nth-child(3n) { height: 20px; }

.name-reveal span {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px);
  animation: letter-in 300ms var(--ease) forwards;
  animation-delay: calc(4.35s + var(--i) * 120ms);
}

.artifact--note ~ .tickets .name-reveal span {
  animation-delay: calc(4.65s + var(--i) * 120ms);
}

.artifact--coin ~ .tickets .name-reveal span {
  animation-delay: calc(4.5s + var(--i) * 120ms);
}

.ticket-caption {
  margin: 12px auto 0;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
  opacity: 0;
  animation: line-in 600ms var(--ease) 5.25s forwards;
}

.claim-row {
  display: flex;
  justify-content: center;
  margin-top: 22px;
  opacity: 0;
  animation: line-in 600ms var(--ease) 5.55s forwards;
}

.claim-button {
  min-width: 210px;
}

.invitation {
  display: grid;
  grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1fr);
  gap: clamp(24px, 6vw, 58px);
  align-items: center;
}

.ticket-flip {
  min-height: 280px;
  perspective: 1200px;
}

.ticket-flip__inner {
  position: relative;
  width: 100%;
  min-height: 280px;
  transform-style: preserve-3d;
  animation: flip-ticket 1s var(--ease) both;
}

.ticket-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 28px;
  border: 1px solid rgba(114, 75, 88, 0.18);
  border-radius: 22px;
  background: linear-gradient(145deg, #fffdf8, #f7e5e6);
  box-shadow: 0 22px 50px rgba(90, 58, 69, 0.16);
  backface-visibility: hidden;
  text-align: center;
}

.ticket-face--back {
  color: #fff;
  background: linear-gradient(150deg, #a95f7a, #71566f);
  transform: rotateY(180deg);
}

.ticket-flip__inner .ticket-face--front {
  transform: rotateY(180deg);
}

.ticket-flip__inner .ticket-face--back {
  transform: rotateY(360deg);
}

.ticket-face__small {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
}

.ticket-face__name {
  margin-top: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
}

.invitation__copy .title {
  font-size: clamp(32px, 5vw, 50px);
}

.invitation__text {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.invitation__note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid rgba(174, 92, 122, 0.18);
  border-radius: 14px;
  color: #70535f;
  background: rgba(251, 235, 240, 0.64);
  font-size: 14px;
  line-height: 1.55;
}

.personal-line {
  margin: 18px 0 0;
  color: var(--rose-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-style: italic;
  line-height: 1.45;
}

.exit-mark {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  margin: 0 auto 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--rose-dark);
  background: rgba(255, 255, 255, 0.55);
  font-size: 26px;
}

.resume-box {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.42);
}

.resume-box p {
  margin: 0 0 14px;
  font-size: 14px;
}

.resume-box .actions {
  margin-top: 0;
}

.footer {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted-2);
  font-size: 12px;
}

.noscript {
  position: fixed;
  z-index: 200;
  inset: 24px;
  display: grid;
  place-items: center;
  padding: 30px;
  border-radius: 24px;
  color: var(--ink);
  background: #fffaf6;
  box-shadow: var(--shadow);
  text-align: center;
}

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

body[data-path="mystery"] .orb--rose { opacity: 0.67; }
body[data-path="mystery"] .spark { animation-duration: calc(var(--duration) * 0.72); }
body[data-path="calm"] .orb { animation-duration: 28s; opacity: 0.42; }
body[data-path="mixed"] .orb--lilac { opacity: 0.62; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(18px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

@keyframes response-in {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

@keyframes line-in {
  to { opacity: 1; transform: none; }
}

@keyframes drift {
  to { transform: translate3d(8vw, 4vh, 0) scale(1.12); }
}

@keyframes float-spark {
  to { transform: translate3d(14px, -22px, 0) scale(1.35); opacity: 0.7; }
}

@keyframes breathe {
  50% { transform: scale(1.045); box-shadow: 0 0 90px rgba(197, 116, 146, 0.3); }
}

@keyframes orbit {
  to { transform: rotate(360deg); }
}

@keyframes draw-line {
  to { transform: translate(-50%, -50%) rotate(var(--rotation, 24deg)) scaleX(1); }
}

.light-path:first-child { --rotation: 24deg; }
.light-path:last-child { --rotation: -24deg; }

@keyframes artifact-in {
  to { transform: translate(-50%, -50%) scale(1); }
}

@keyframes artifact-out {
  to { opacity: 0; transform: translate(-50%, -105%) scale(0.66); }
}

@keyframes coin-in {
  to { transform: translate(-50%, -50%) scale(1) rotateY(0); }
}

@keyframes coin-flip {
  50% { transform: translate(-50%, -90%) rotateY(540deg) scale(1.08); }
  100% { transform: translate(-50%, -50%) rotateY(1080deg); }
}

@keyframes note-in {
  to { transform: translate(-50%, -50%) scale(1) rotate(-4deg); }
}

@keyframes note-open {
  to { width: 135px; border-radius: 7px; transform: translate(-50%, -50%) scale(1) rotate(0); }
}

@keyframes envelope-in {
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes flap-open {
  to { transform: rotateX(180deg); }
}

@keyframes envelope-away {
  to { opacity: 0; transform: translate(-50%, -28%) scale(1.1); }
}

@keyframes tickets-in {
  to { opacity: 1; transform: none; }
}

@keyframes letter-in {
  to { opacity: 1; transform: none; }
}

@keyframes flip-ticket {
  from { transform: rotateY(180deg) translateY(10px); opacity: 0; }
  to { transform: rotateY(360deg); opacity: 1; }
}

@media (max-width: 720px) {
  .app-shell {
    padding-right: 16px;
    padding-left: 16px;
    gap: 12px;
  }

  .control-label {
    display: none;
  }

  .icon-button {
    width: 44px;
    justify-content: center;
    padding: 0;
  }

  .wordmark span:last-child {
    display: none;
  }

  .experience {
    min-height: 520px;
  }

  .card {
    padding: 28px 20px;
    border-radius: 26px;
  }

  .options {
    margin-top: 26px;
  }

  .option {
    grid-template-columns: 34px 1fr auto;
    padding: 11px 13px;
  }

  .boxes {
    gap: 9px;
  }

  .mystery-box {
    min-height: 158px;
    padding-right: 4px;
    padding-left: 4px;
  }

  .box-visual {
    width: 74px;
    height: 82px;
  }

  .box-base,
  .box-lid {
    width: 68px;
  }

  .box-base { height: 56px; }
  .box-lid { top: 15px; }
  .box-ribbon { top: 14px; height: 67px; }
  .box-item { top: 34px; }

  .tickets {
    width: min(100%, 360px);
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .ticket-scene {
    min-height: 500px;
  }

  .ticket {
    min-height: 166px;
    padding: 20px;
  }

  .ticket--evgeniy {
    transform: rotate(-1deg);
  }

  .ticket--polina {
    transform: rotate(1deg);
  }

  .ticket__name {
    margin-top: 16px;
  }

  .invitation {
    grid-template-columns: 1fr;
  }

  .ticket-flip,
  .ticket-flip__inner {
    min-height: 200px;
  }

  .footer span:nth-child(2),
  .footer span:last-child {
    display: none;
  }
}

@media (max-width: 430px) {
  .topbar__actions {
    gap: 5px;
  }

  .text-button {
    padding: 0 12px;
    font-size: 13px;
  }

  .title {
    font-size: 39px;
  }

  .title--question,
  .title--small {
    font-size: 31px;
  }

  .option__text {
    font-size: 14px;
  }

  .boxes {
    grid-template-columns: 1fr;
  }

  .mystery-box {
    min-height: 116px;
    display: grid;
    grid-template-columns: 96px 1fr;
    align-items: center;
    text-align: left;
  }

  .box-visual {
    margin-bottom: 0;
  }
}

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

body[data-reduced-motion="true"] *,
body[data-reduced-motion="true"] *::before,
body[data-reduced-motion="true"] *::after {
  animation-duration: 0.01ms !important;
  animation-delay: 0ms !important;
  transition-duration: 0.01ms !important;
}

body[data-reduced-motion="true"] .constellation,
body[data-reduced-motion="true"] .orb--lilac {
  display: none;
}

/* S U M E R K I  —  redesigned interface */
:root {
  color-scheme: dark;
  --ink: #f8f0f5;
  --muted: #c2b2c0;
  --muted-2: #8f7e8e;
  --paper: rgba(31, 21, 35, 0.68);
  --paper-strong: #211725;
  --line: rgba(255, 226, 238, 0.13);
  --rose: #e7a0b7;
  --rose-dark: #f0aec2;
  --rose-soft: #8f4e69;
  --peach: #f1bd92;
  --cream: #fff3e7;
  --lilac: #a78abc;
  --focus: #ffd2df;
  --shadow: 0 34px 100px rgba(0, 0, 0, 0.5), 0 8px 30px rgba(0, 0, 0, 0.24);
}

html {
  background: #0b0710;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -12%, rgba(100, 43, 80, 0.58), transparent 42%),
    radial-gradient(circle at 8% 62%, rgba(69, 44, 98, 0.34), transparent 36%),
    radial-gradient(circle at 96% 74%, rgba(125, 55, 76, 0.25), transparent 34%),
    linear-gradient(145deg, #09070e 0%, #17101c 47%, #0c0911 100%);
}

body::before {
  content: "";
  position: fixed;
  z-index: -2;
  inset: -20%;
  background:
    radial-gradient(ellipse at 32% 38%, rgba(194, 88, 129, 0.14), transparent 28%),
    radial-gradient(ellipse at 68% 66%, rgba(216, 151, 101, 0.1), transparent 26%);
  filter: blur(14px);
  animation: night-bloom 20s var(--ease) infinite alternate;
  pointer-events: none;
}

button:focus-visible,
a:focus-visible {
  outline-color: rgba(255, 210, 223, 0.78);
}

.ambient {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 46%);
}

.orb {
  filter: blur(44px);
  opacity: 0.32;
}

.orb--rose {
  top: -26%;
  right: -10%;
  background: radial-gradient(circle, rgba(181, 64, 111, 0.62), rgba(181, 64, 111, 0));
}

.orb--peach {
  bottom: -34%;
  left: -12%;
  background: radial-gradient(circle, rgba(196, 116, 73, 0.42), rgba(196, 116, 73, 0));
}

.orb--lilac {
  top: 34%;
  left: 34%;
  background: radial-gradient(circle, rgba(92, 58, 133, 0.42), rgba(92, 58, 133, 0));
}

.grain {
  opacity: 0.2;
  mix-blend-mode: soft-light;
}

.spark {
  width: 3px;
  height: 3px;
  background: rgba(255, 220, 232, 0.42);
  box-shadow: 0 0 16px rgba(255, 177, 207, 0.68);
}

.app-shell {
  width: min(100%, 1180px);
  padding: max(20px, env(safe-area-inset-top)) 28px max(16px, env(safe-area-inset-bottom));
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
}

.topbar {
  position: relative;
  min-height: 66px;
  justify-content: center;
}

.wordmark {
  min-height: 48px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  color: #fff6fb;
  text-align: center;
}

.wordmark__title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.wordmark__subtitle {
  display: block;
  color: rgba(229, 204, 219, 0.56);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.exit-button {
  position: absolute;
  top: 50%;
  right: 0;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: rgba(246, 231, 239, 0.68);
  background: rgba(22, 15, 26, 0.42);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  font-size: 25px;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-50%);
  backdrop-filter: blur(16px);
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.exit-button:hover {
  color: #fff;
  border-color: rgba(255, 222, 233, 0.26);
  background: rgba(69, 42, 58, 0.58);
  transform: translateY(-50%) rotate(6deg);
}

.sound-fab {
  position: fixed;
  z-index: 20;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 225, 236, 0.14);
  border-radius: 50%;
  color: rgba(242, 221, 232, 0.66);
  background: rgba(24, 16, 29, 0.7);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.sound-fab:hover,
.sound-fab[aria-pressed="true"] {
  color: #ffd5e2;
  border-color: rgba(255, 211, 225, 0.32);
  background: rgba(80, 43, 62, 0.82);
  transform: translateY(-2px);
}

.sound-fab svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-fab[aria-pressed="true"] .sound-off { opacity: 0; }
.sound-fab[aria-pressed="true"] .sound-wave { opacity: 1; }

.progress-wrap {
  width: min(100%, 730px);
  padding: 0 14px;
}

.progress-meta {
  margin-bottom: 11px;
  color: rgba(232, 207, 220, 0.58);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.progress-dots {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 8px;
  align-items: center;
}

.progress-dot {
  position: relative;
  height: 3px;
  overflow: visible;
  border-radius: 999px;
  background: rgba(255, 224, 236, 0.09);
  transition: background 500ms var(--ease), box-shadow 500ms var(--ease), transform 500ms var(--ease);
}

.progress-dot.is-complete {
  background: linear-gradient(90deg, rgba(216, 121, 156, 0.7), rgba(187, 137, 198, 0.72));
}

.progress-dot.is-current {
  background: #ffd0df;
  box-shadow: 0 0 16px rgba(233, 132, 170, 0.65);
  transform: scaleY(1.8);
}

.experience {
  min-height: 600px;
}

.screen {
  animation: dark-reveal 700ms var(--ease) both;
}

.card {
  border: 1px solid rgba(255, 228, 239, 0.11);
  background:
    linear-gradient(145deg, rgba(49, 31, 51, 0.69), rgba(24, 17, 30, 0.72)),
    rgba(27, 19, 32, 0.72);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(30px) saturate(118%);
}

.card::before {
  right: 20%;
  left: 20%;
  background: linear-gradient(90deg, transparent, rgba(255, 219, 232, 0.24), transparent);
}

.card::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: 15%;
  bottom: -24%;
  left: 15%;
  height: 45%;
  border-radius: 50%;
  background: rgba(178, 69, 113, 0.12);
  filter: blur(46px);
  pointer-events: none;
}

.eyebrow {
  color: #e9a6bb;
}

.title {
  color: #fff8fc;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.18);
}

.lede {
  color: #cbbcc8;
}

.meta-pill {
  border-color: rgba(255, 225, 237, 0.1);
  color: rgba(233, 214, 224, 0.66);
  background: rgba(255, 255, 255, 0.025);
}

.primary-button {
  color: #1c1118;
  background: linear-gradient(135deg, #f2b0c3 0%, #d996b3 48%, #d9ac8f 100%);
  box-shadow: 0 16px 38px rgba(190, 78, 122, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.primary-button:hover {
  box-shadow: 0 20px 46px rgba(190, 78, 122, 0.34);
}

.secondary-button {
  border-color: rgba(255, 225, 236, 0.14);
  color: #f7ebf2;
  background: rgba(255, 255, 255, 0.045);
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.085);
}

.intro-symbol {
  border-color: rgba(255, 207, 224, 0.18);
  color: #ffc7d9;
  background: radial-gradient(circle, rgba(144, 62, 96, 0.42), rgba(60, 31, 53, 0.18) 56%, transparent 72%);
  box-shadow: 0 0 90px rgba(188, 74, 117, 0.3);
}

.intro-symbol::after {
  border-color: rgba(255, 211, 227, 0.12);
}

.option {
  border-color: rgba(255, 225, 238, 0.1);
  color: #f6edf3;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
}

.option:hover:not(:disabled) {
  border-color: rgba(238, 158, 187, 0.34);
  background: linear-gradient(120deg, rgba(152, 73, 106, 0.22), rgba(112, 70, 127, 0.12));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.option.is-selected {
  border-color: rgba(244, 161, 191, 0.46);
  background: linear-gradient(120deg, rgba(160, 72, 108, 0.3), rgba(103, 64, 119, 0.2));
  box-shadow: 0 0 0 1px rgba(255, 203, 222, 0.04), 0 14px 36px rgba(0, 0, 0, 0.22);
}

.option__letter {
  color: #f4b7c9;
  background: rgba(225, 130, 164, 0.12);
}

.option__arrow {
  color: rgba(235, 206, 220, 0.48);
}

.response {
  border-left-color: rgba(234, 142, 175, 0.58);
  color: #cbbbc7;
  background: rgba(255, 255, 255, 0.035);
}

.mystery-box {
  border-color: rgba(255, 225, 237, 0.1);
  color: #f6edf3;
  background: rgba(255, 255, 255, 0.035);
}

.mystery-box:hover:not(:disabled),
.mystery-box.is-open {
  border-color: rgba(238, 157, 187, 0.36);
  background: rgba(117, 54, 83, 0.18);
}

.box-base,
.box-lid {
  border-color: rgba(255, 220, 233, 0.14);
  background: linear-gradient(145deg, #87455f, #5b3048);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
}

.box-ribbon {
  background: rgba(242, 190, 206, 0.34);
}

.box-item,
.word-choice.is-selected .option__text {
  color: #ffc6d8;
}

.interlude-line {
  color: #d8c8d3;
}

.resume-box {
  border-color: rgba(255, 224, 236, 0.1);
  color: #bfaebb;
  background: rgba(255, 255, 255, 0.025);
}

/* Sequential tickets emerging from below */
.card--final {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 104%, rgba(180, 70, 115, 0.22), transparent 38%),
    linear-gradient(145deg, rgba(42, 27, 46, 0.74), rgba(18, 13, 23, 0.8));
}

.ticket-scene {
  position: relative;
  min-height: 470px;
  display: block;
  overflow: hidden;
  margin: 16px -18px 0;
}

.ticket-glow {
  position: absolute;
  right: 10%;
  bottom: -44px;
  left: 10%;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(236, 125, 166, 0.46), rgba(125, 68, 143, 0.16) 46%, transparent 72%);
  filter: blur(24px);
  animation: floor-glow 2.2s ease-out both;
}

.result-token {
  position: absolute;
  z-index: 2;
  top: 14%;
  left: 50%;
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 1px solid rgba(255, 215, 228, 0.2);
  border-radius: 50%;
  color: #ffd0df;
  background: rgba(80, 42, 65, 0.64);
  box-shadow: 0 0 50px rgba(221, 102, 148, 0.28);
  font-size: 28px;
  opacity: 0;
  transform: translate(-50%, -10px) scale(0.66);
  animation: token-signal 1.7s var(--ease) 150ms both;
}

.tickets {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: 28px;
  left: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  width: 100%;
  opacity: 1;
  transform: none;
  animation: none;
  perspective: 1300px;
}

.ticket-reveal {
  width: min(44%, 295px);
  min-height: 222px;
  perspective: 1200px;
}

.ticket-reveal--first {
  transform: rotate(-2.5deg) translateY(4px);
}

.ticket-reveal--second {
  transform: rotate(2.2deg) translateY(-5px);
}

.ticket-reveal__inner {
  position: relative;
  width: 100%;
  min-height: 222px;
  opacity: 0;
  transform-style: preserve-3d;
}

.ticket-reveal--first .ticket-reveal__inner {
  animation: rise-flip 1.45s var(--ease) 1.05s forwards;
}

.ticket-reveal--second .ticket-reveal__inner {
  animation: rise-flip 1.45s var(--ease) 2.65s forwards;
}

.ticket-reveal__back,
.ticket-reveal__front {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.ticket-reveal__back {
  display: grid;
  place-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 219, 233, 0.2);
  border-radius: 20px;
  color: #f6bfd1;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(315deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(145deg, #6f3853, #33203a);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.38);
  transform: rotateY(180deg);
  text-align: center;
}

.ticket-reveal__back span {
  font-size: 30px;
}

.ticket-reveal__back small {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ticket-reveal__front {
  transform: rotateY(360deg);
}

.ticket {
  min-height: 222px;
  border-color: rgba(99, 61, 77, 0.22);
  color: #452d38;
  background:
    linear-gradient(90deg, transparent 0 9%, rgba(137, 84, 103, 0.05) 9% 9.5%, transparent 9.5%),
    radial-gradient(circle at 86% 16%, rgba(236, 177, 151, 0.22), transparent 30%),
    linear-gradient(150deg, #fff9f4 0%, #f5e3e4 100%);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.34);
}

.ticket::before,
.ticket::after {
  background: #241726;
}

.ticket-caption {
  position: relative;
  z-index: 6;
  color: rgba(231, 210, 221, 0.68);
  opacity: 0;
  animation: line-in 600ms var(--ease) 4.25s forwards;
}

.claim-row {
  position: relative;
  z-index: 6;
  opacity: 0;
  animation: line-in 600ms var(--ease) 4.5s forwards;
}

.invitation__text {
  color: #cbbbc7;
}

.invitation__note {
  border-color: rgba(245, 171, 198, 0.16);
  color: #d9c5d0;
  background: rgba(255, 255, 255, 0.035);
}

.personal-line {
  color: #f0adc1;
}

.ticket-face {
  border-color: rgba(255, 221, 233, 0.14);
  background: linear-gradient(145deg, #fbefeb, #e9cfd5);
}

.ticket-face--back {
  background: linear-gradient(150deg, #7f415d, #3f2c4a);
}

.exit-mark {
  border-color: rgba(255, 225, 236, 0.12);
  color: #f1aec3;
  background: rgba(255, 255, 255, 0.035);
}

.footer {
  color: rgba(238, 205, 220, 0.28);
  font-size: 10px;
}

body[data-path="mystery"] .orb--rose { opacity: 0.52; }
body[data-path="calm"] .orb { opacity: 0.24; }
body[data-path="mixed"] .orb--lilac { opacity: 0.46; }

@keyframes night-bloom {
  from { transform: translate3d(-2%, -1%, 0) rotate(-2deg) scale(1); }
  to { transform: translate3d(3%, 2%, 0) rotate(3deg) scale(1.1); }
}

@keyframes dark-reveal {
  from { opacity: 0; transform: translateY(20px) scale(0.985); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes floor-glow {
  from { opacity: 0; transform: scaleX(0.4); }
  to { opacity: 1; transform: scaleX(1); }
}

@keyframes token-signal {
  0% { opacity: 0; transform: translate(-50%, -10px) scale(0.66); }
  36% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  72% { opacity: 1; transform: translate(-50%, 12px) scale(0.9); }
  100% { opacity: 0; transform: translate(-50%, 90px) scale(0.42); }
}

@keyframes rise-flip {
  0% { opacity: 0; transform: translateY(210px) rotateY(180deg) scale(0.9); }
  43% { opacity: 1; transform: translateY(0) rotateY(180deg) scale(1); }
  62% { opacity: 1; transform: translateY(-10px) rotateY(180deg) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) rotateY(360deg) scale(1); }
}

@media (max-width: 720px) {
  .app-shell {
    padding-right: 16px;
    padding-left: 16px;
  }

  .wordmark__title {
    font-size: 16px;
  }

  .wordmark__subtitle {
    display: block;
  }

  .card {
    padding: 28px 20px;
    border-radius: 28px;
  }

  .ticket-scene {
    min-height: 610px;
    margin-right: -10px;
    margin-left: -10px;
  }

  .tickets {
    top: 74px;
    bottom: 0;
    display: block;
  }

  .ticket-reveal {
    position: absolute;
    left: 50%;
    width: min(88%, 340px);
  }

  .ticket-reveal--first {
    top: 38px;
    transform: translateX(-52%) rotate(-2.4deg);
  }

  .ticket-reveal--second {
    top: 292px;
    transform: translateX(-48%) rotate(2deg);
  }

  .ticket-reveal__inner,
  .ticket {
    min-height: 210px;
  }

  .ticket-caption {
    margin-top: -18px;
  }
}

@media (max-width: 430px) {
  .experience {
    min-height: 550px;
  }

  .topbar {
    min-height: 58px;
  }

  .exit-button {
    right: 2px;
    width: 38px;
    height: 38px;
  }

  .progress-wrap {
    padding: 0 6px;
  }

  .progress-dots {
    gap: 6px;
  }

  .title {
    font-size: 40px;
  }

  .title--question,
  .title--small {
    font-size: 31px;
  }

  .mystery-box {
    background: rgba(255, 255, 255, 0.028);
  }

  .sound-fab {
    width: 42px;
    height: 42px;
  }
}

body[data-reduced-motion="true"] .result-token {
  display: none;
}

body[data-reduced-motion="true"] .ticket-reveal__inner {
  opacity: 1;
  transform: none;
}

/* Detailed gifts and interactive ticket pull — v5 */
.boxes {
  gap: clamp(10px, 2vw, 20px);
  margin-top: 28px;
}

.mystery-box {
  min-width: 0;
  min-height: 238px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 10px 16px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 42%, rgba(181, 83, 125, 0.14), transparent 42%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
}

.mystery-box::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: 10%;
  bottom: 48px;
  left: 10%;
  height: 45px;
  border-radius: 50%;
  background: rgba(214, 105, 150, 0.1);
  filter: blur(22px);
  transition: opacity 260ms ease, transform 420ms var(--ease);
}

.mystery-box:hover:not(:disabled) {
  transform: translateY(-6px);
}

.mystery-box:hover:not(:disabled)::before {
  opacity: 1.5;
  transform: scale(1.18);
}

.mystery-box.is-open {
  transform: translateY(-4px);
}

.gift-illustration {
  display: block;
  width: min(100%, 172px);
  margin: -2px auto 2px;
}

.gift-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.gift-shadow {
  fill: rgba(4, 2, 7, 0.52);
  filter: blur(5px);
}

.gift-body__front,
.gift-body__side,
.gift-lid__top,
.gift-lid__front,
.gift-lid__side,
.gift-ribbon {
  stroke: rgba(255, 225, 237, 0.14);
  stroke-width: 1;
}

.gift-body__shine {
  fill: rgba(255, 255, 255, 0.08);
}

.gift-body {
  transform-origin: 50% 100%;
  transition: transform 420ms var(--ease);
}

.gift-lid {
  transform-box: fill-box;
  transform-origin: 18% 82%;
  transition: transform 760ms cubic-bezier(0.2, 0.82, 0.18, 1.08);
}

.gift-bow {
  stroke: rgba(255, 238, 244, 0.25);
  stroke-width: 1;
}

.gift-sparkles {
  fill: #ffd3df;
  opacity: 0.46;
  transform-origin: center;
  transition: opacity 400ms ease, transform 700ms var(--ease);
}

.gift-item {
  fill: none;
  stroke: #f7cf9f;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: translateY(34px) scale(0.54) rotate(-9deg);
  transition: opacity 320ms ease 230ms, transform 760ms cubic-bezier(0.2, 0.88, 0.18, 1.08) 170ms;
  filter: drop-shadow(0 8px 9px rgba(0, 0, 0, 0.35));
}

.gift-item-fill {
  fill: rgba(247, 207, 159, 0.11);
}

.gift-svg--note .gift-item {
  stroke: #ffd7e3;
}

.gift-svg--coin .gift-item {
  stroke: #f2c680;
}

.mystery-box:hover:not(:disabled) .gift-body {
  transform: translateY(-2px) scale(1.015);
}

.mystery-box:hover:not(:disabled) .gift-lid {
  transform: translateY(-3px) rotate(-1deg);
}

.mystery-box.is-open .gift-lid {
  transform: translate(-14px, -28px) rotate(-13deg);
}

.mystery-box.is-open .gift-body {
  transform: translateY(3px) scale(1.02);
}

.mystery-box.is-open .gift-item {
  opacity: 1;
  transform: translateY(-40px) scale(1) rotate(4deg);
}

.mystery-box.is-open .gift-sparkles {
  opacity: 0.94;
  transform: scale(1.18) rotate(9deg);
}

.box-label {
  position: relative;
  z-index: 5;
  margin-top: -2px;
  color: #fff5fa;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.box-hint {
  position: relative;
  z-index: 5;
  margin-top: 4px;
  color: rgba(238, 205, 221, 0.43);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mystery-box.is-open .box-hint {
  color: #efacc1;
}

/* A pair of long, dark tickets: the first opens itself, the second waits for a tap. */
.card--final {
  padding-bottom: 30px;
}

.ticket-scene {
  min-height: 390px;
  overflow: visible;
  margin-top: 2px;
}

.ticket-glow {
  right: 4%;
  bottom: 12px;
  left: 4%;
  height: 130px;
  background: radial-gradient(ellipse, rgba(218, 101, 146, 0.33), rgba(119, 63, 139, 0.12) 48%, transparent 72%);
}

.tickets {
  position: absolute;
  z-index: 5;
  top: auto;
  right: auto;
  bottom: 48px;
  left: 50%;
  display: grid;
  width: min(94%, 850px);
  max-width: 850px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(4px, 1vw, 14px);
  opacity: 1;
  transform: translateX(-50%);
  animation: none;
  perspective: 1600px;
}

.ticket-reveal {
  position: relative;
  left: auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 2.22 / 1;
  padding: 0;
  border: 0;
  border-radius: 14px;
  color: inherit;
  background: transparent;
  opacity: 0;
  perspective: 1400px;
  transform-style: preserve-3d;
}

.ticket-reveal--first {
  top: auto;
  animation: ticket-rise-left 980ms cubic-bezier(0.18, 0.82, 0.2, 1.04) 420ms forwards;
}

.ticket-reveal--second {
  top: auto;
  cursor: pointer;
  animation: ticket-rise-right 980ms cubic-bezier(0.18, 0.82, 0.2, 1.04) 760ms forwards;
}

.ticket-tugger,
.ticket-reveal__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  transform-style: preserve-3d;
}

.ticket-reveal--second .ticket-tugger {
  animation: ticket-tug 2.25s ease-in-out 2.2s infinite;
}

.ticket-reveal__inner {
  opacity: 1;
  transform: rotateY(180deg);
  transition: transform 1.05s cubic-bezier(0.2, 0.78, 0.22, 1);
}

.ticket-reveal--first .ticket-reveal__inner {
  animation: ticket-auto-flip 1.1s cubic-bezier(0.2, 0.78, 0.22, 1) 1.45s forwards;
}

.ticket-reveal--second .ticket-reveal__inner {
  animation: none;
}

.story-ticket {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  color: #fff8fb;
  background:
    radial-gradient(circle at 24% 0%, rgba(156, 72, 105, 0.17), transparent 34%),
    linear-gradient(145deg, #100d12, #050507 72%);
  box-shadow: 0 28px 55px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.story-ticket::before,
.story-ticket::after {
  content: "";
  position: absolute;
  z-index: 5;
  top: 50%;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #211524;
  transform: translateY(-50%);
}

.story-ticket::before { left: -11px; }
.story-ticket::after { right: -11px; }

.story-ticket--front {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(72px, 24%, 104px);
  transform: rotateY(0deg);
}

.story-ticket--back {
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 18px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 12px),
    radial-gradient(circle at 50% 50%, rgba(153, 70, 108, 0.18), transparent 42%),
    linear-gradient(145deg, #0e0c10, #040405);
  transform: rotateY(180deg);
  text-align: center;
}

.story-ticket__seal {
  color: #f2b0c3;
  font-size: clamp(20px, 3vw, 30px);
  text-shadow: 0 0 28px rgba(226, 113, 156, 0.5);
}

.story-ticket__back-copy {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(14px, 2.2vw, 22px);
  letter-spacing: 0.02em;
}

.story-ticket__pull {
  color: rgba(237, 207, 220, 0.55);
  font-size: clamp(7px, 1vw, 10px);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.story-ticket__main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(14px, 3vw, 25px);
  text-align: left;
}

.story-ticket__kicker,
.story-ticket__line {
  color: rgba(244, 222, 232, 0.55);
  font-size: clamp(6px, 1vw, 9px);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.story-ticket__name {
  display: block;
  max-width: 100%;
  margin: clamp(6px, 1vw, 12px) 0;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 5vw, 58px);
  font-weight: 400;
  line-height: 0.95;
  text-overflow: ellipsis;
  text-shadow: 0 6px 26px rgba(0, 0, 0, 0.44);
  white-space: nowrap;
}

.story-ticket__stub {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-left: 1px dashed rgba(255, 255, 255, 0.25);
  color: rgba(249, 229, 237, 0.62);
  font-size: clamp(6px, 0.8vw, 9px);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.story-ticket__stub strong {
  color: #fff;
  font-size: clamp(9px, 1.2vw, 13px);
}

.story-ticket__barcode {
  width: 54%;
  height: 35%;
  margin-top: 3px;
  background: repeating-linear-gradient(90deg, #fff 0 1px, transparent 1px 3px, #fff 3px 5px, transparent 5px 7px);
  opacity: 0.84;
}

.ticket-reveal--second:focus-visible {
  outline: none;
}

.ticket-reveal--second:focus-visible .ticket-tugger {
  border-radius: 14px;
  outline: 3px solid rgba(255, 190, 214, 0.68);
  outline-offset: 5px;
}

.ticket-reveal--second:hover:not(:disabled) .story-ticket--back {
  border-color: rgba(255, 190, 214, 0.35);
  box-shadow: 0 32px 62px rgba(0, 0, 0, 0.56), 0 0 34px rgba(217, 93, 142, 0.16);
}

.tickets.is-claimed .ticket-reveal--second {
  cursor: default;
}

.tickets.is-claimed .ticket-reveal--second .ticket-tugger {
  animation: ticket-pull-out 860ms cubic-bezier(0.16, 0.86, 0.2, 1.08) forwards;
}

.tickets.is-claimed .ticket-reveal--second .ticket-reveal__inner {
  transform: rotateY(0deg);
}

.ticket-caption {
  min-height: 24px;
  margin: 4px auto 0;
  color: rgba(235, 215, 226, 0.68);
  opacity: 0;
  animation: line-in 540ms var(--ease) 2.35s forwards;
}

.ticket-next {
  position: relative;
  z-index: 8;
  min-height: 54px;
  margin-top: 15px;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  visibility: hidden;
  pointer-events: none;
}

.ticket-next.is-visible {
  visibility: visible;
  pointer-events: auto;
  animation: ticket-next-in 620ms var(--ease) forwards;
}

.ticket-next p {
  margin: 0 0 14px;
  color: #d7c3cf;
  font-size: 14px;
}

@keyframes ticket-rise-left {
  0% { opacity: 0; transform: translate(-18%, 230px) rotate(-14deg) scale(0.86); }
  72% { opacity: 1; transform: translate(2%, -10px) rotate(-5deg) scale(1.02); }
  100% { opacity: 1; transform: translate(4%, 8px) rotate(-4deg) scale(1); }
}

@keyframes ticket-rise-right {
  0% { opacity: 0; transform: translate(18%, 255px) rotate(15deg) scale(0.86); }
  72% { opacity: 1; transform: translate(-2%, -14px) rotate(5deg) scale(1.02); }
  100% { opacity: 1; transform: translate(-4%, -4px) rotate(4deg) scale(1); }
}

@keyframes ticket-auto-flip {
  0% { transform: rotateY(180deg); }
  44% { transform: rotateY(92deg) scale(1.035); }
  100% { transform: rotateY(0deg); }
}

@keyframes ticket-tug {
  0%, 72%, 100% { transform: translateY(0); }
  78% { transform: translateY(-9px); }
  83% { transform: translateY(3px); }
  88% { transform: translateY(-6px); }
  94% { transform: translateY(0); }
}

@keyframes ticket-pull-out {
  0% { transform: translateY(0) scale(1); }
  48% { transform: translateY(-34px) scale(1.035); }
  100% { transform: translateY(-8px) scale(1); }
}

@keyframes ticket-next-in {
  to { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
  .boxes {
    gap: 8px;
  }

  .mystery-box {
    min-height: 200px;
    padding: 10px 6px 13px;
  }

  .gift-illustration {
    width: min(100%, 142px);
  }

  .ticket-scene {
    min-height: 295px;
    margin-right: -10px;
    margin-left: -10px;
  }

  .tickets {
    top: auto;
    bottom: 38px;
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
  }

  .ticket-reveal {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    min-height: 0;
    aspect-ratio: 2.08 / 1;
  }

  .ticket-reveal__inner {
    min-height: 0;
  }

  .story-ticket__main {
    padding: 12px 10px 12px 14px;
  }

  .story-ticket__name {
    font-size: clamp(24px, 7vw, 38px);
  }

  .story-ticket__line {
    display: none;
  }

  .story-ticket__back-copy {
    font-size: clamp(11px, 2.8vw, 17px);
  }

  .story-ticket__pull {
    font-size: 6px;
  }

  .ticket-caption {
    margin-top: 2px;
  }
}

@media (max-width: 430px) {
  .boxes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .mystery-box {
    min-height: 154px;
    display: flex;
    grid-template-columns: none;
    padding: 6px 3px 10px;
    text-align: center;
  }

  .gift-illustration {
    width: min(100%, 105px);
    margin-bottom: -1px;
  }

  .box-label {
    font-size: 11px;
  }

  .box-hint {
    margin-top: 2px;
    font-size: 6px;
  }

  .ticket-scene {
    min-height: 250px;
  }

  .story-ticket {
    border-radius: 10px;
  }

  .story-ticket__main {
    padding: 9px 7px 9px 11px;
  }

  .story-ticket__kicker {
    font-size: 5px;
    letter-spacing: 0.08em;
  }

  .story-ticket__name {
    margin: 4px 0;
    font-size: clamp(22px, 7.5vw, 32px);
  }

  .story-ticket--front {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .story-ticket__stub {
    gap: 2px;
    font-size: 5px;
  }

  .story-ticket__stub strong {
    font-size: 7px;
  }

  .story-ticket__barcode {
    height: 29%;
  }

  .story-ticket__seal {
    font-size: 17px;
  }

  .story-ticket__back-copy {
    font-size: 10px;
  }

  .ticket-caption {
    max-width: 280px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticket-reveal--first,
  .ticket-reveal--second {
    opacity: 1;
    animation: none;
  }

  .ticket-reveal--first {
    transform: translate(4%, 8px) rotate(-4deg);
  }

  .ticket-reveal--second {
    transform: translate(-4%, -4px) rotate(4deg);
  }

  .ticket-reveal--first .ticket-reveal__inner {
    transform: rotateY(0deg);
    animation: none;
  }

  .ticket-reveal--second .ticket-reveal__inner {
    transform: rotateY(180deg);
  }

  .tickets.is-claimed .ticket-reveal--second .ticket-reveal__inner {
    transform: rotateY(0deg);
  }

  .ticket-reveal--second .ticket-tugger,
  .tickets.is-claimed .ticket-reveal--second .ticket-tugger {
    animation: none;
  }
}

body[data-reduced-motion="true"] .ticket-reveal--first,
body[data-reduced-motion="true"] .ticket-reveal--second {
  opacity: 1;
  animation: none;
}

body[data-reduced-motion="true"] .ticket-reveal--first {
  transform: translate(4%, 8px) rotate(-4deg);
}

body[data-reduced-motion="true"] .ticket-reveal--second {
  transform: translate(-4%, -4px) rotate(4deg);
}

body[data-reduced-motion="true"] .ticket-reveal--first .ticket-reveal__inner {
  transform: rotateY(0deg);
  animation: none;
}

body[data-reduced-motion="true"] .ticket-reveal--second .ticket-reveal__inner {
  transform: rotateY(180deg);
}

body[data-reduced-motion="true"] .tickets.is-claimed .ticket-reveal--second .ticket-reveal__inner {
  transform: rotateY(0deg);
}

body[data-reduced-motion="true"] .ticket-reveal--second .ticket-tugger,
body[data-reduced-motion="true"] .tickets.is-claimed .ticket-reveal--second .ticket-tugger {
  animation: none;
}

/* Quiet star field, readable gift reveal and sculpted ticket stock — v7 */
.sound-fab {
  display: none !important;
}

.constellation {
  opacity: 0.82;
}

.constellation::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 250, 255, 0.42) 0 0.7px, transparent 1px),
    radial-gradient(circle, rgba(221, 215, 234, 0.28) 0 0.7px, transparent 1px),
    radial-gradient(circle, rgba(255, 238, 247, 0.18) 0 0.6px, transparent 0.9px);
  background-position: 9px 17px, 42px 71px, 81px 28px;
  background-size: 92px 92px, 137px 137px, 173px 173px;
}

.spark {
  width: var(--size, 1px);
  height: var(--size, 1px);
  background: rgba(248, 242, 250, 0.9);
  box-shadow: 0 0 5px rgba(224, 216, 234, 0.35);
  opacity: var(--star-opacity, 0.28);
  animation: star-twinkle var(--duration, 14s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.orb,
body[data-path="mystery"] .orb--rose,
body[data-path="calm"] .orb,
body[data-path="mixed"] .orb--lilac {
  opacity: 0.16;
}

.orb--lilac {
  opacity: 0.2;
}

.box-purpose {
  max-width: 680px;
  margin: 13px auto -5px;
  color: rgba(231, 211, 223, 0.64);
  font-size: clamp(12px, 1.6vw, 15px);
  line-height: 1.5;
  text-align: center;
}

.mystery-box {
  overflow: visible;
}

.mystery-box:disabled:not(.is-open) {
  opacity: 0.28;
  filter: saturate(0.55);
}

.mystery-box.is-open {
  z-index: 6;
  border-color: rgba(239, 172, 199, 0.5);
  box-shadow: 0 23px 55px rgba(0, 0, 0, 0.34), 0 0 35px rgba(181, 83, 125, 0.12);
}

.mystery-box.is-open .gift-lid {
  transform: translate(-23px, -36px) rotate(-18deg);
}

.mystery-box.is-open .gift-body {
  transform: translateY(5px) scale(0.98);
  opacity: 0.78;
}

.mystery-box.is-open .gift-item {
  opacity: 1;
  stroke-width: 5;
  transform: translateY(-52px) scale(1.28) rotate(3deg);
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 8px rgba(250, 205, 221, 0.34));
}

.box-found {
  position: relative;
  z-index: 8;
  display: block;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  color: #f6c4d5;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  opacity: 0;
  transform: translateY(6px);
  transition: max-height 280ms ease 500ms, margin 280ms ease 500ms, opacity 320ms ease 540ms, transform 320ms ease 540ms;
}

.mystery-box.is-open .box-hint {
  display: none;
}

.mystery-box.is-open .box-found {
  max-height: 28px;
  margin-top: 4px;
  opacity: 1;
  transform: none;
}

.response--found {
  display: grid;
  gap: 7px;
  text-align: left;
}

.found-item,
.found-item__note {
  display: block;
}

.found-item {
  color: #ffe9f0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 3vw, 28px);
}

.found-item__note {
  margin-bottom: 5px;
  color: #e4adc2;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.story-ticket {
  border-radius: 4px;
  clip-path: polygon(
    10px 0,
    calc(100% - 10px) 0,
    100% 10px,
    100% calc(50% - 13px),
    calc(100% - 8px) calc(50% - 7px),
    calc(100% - 8px) calc(50% + 7px),
    100% calc(50% + 13px),
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    10px 100%,
    0 calc(100% - 10px),
    0 calc(50% + 13px),
    8px calc(50% + 7px),
    8px calc(50% - 7px),
    0 calc(50% - 13px),
    0 10px
  );
}

.story-ticket::before,
.story-ticket::after {
  display: none;
}

.story-ticket__status {
  color: rgba(244, 222, 232, 0.58);
  font-size: clamp(7px, 1.05vw, 10px);
  font-weight: 750;
  letter-spacing: 0.07em;
}

.story-ticket__stub::before,
.story-ticket__stub::after {
  content: "";
  position: absolute;
  z-index: 4;
  left: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1b111d;
}

.story-ticket__stub::before {
  top: -10px;
}

.story-ticket__stub::after {
  bottom: -10px;
}

.ticket-caption.is-cleared {
  visibility: hidden;
}

@keyframes star-twinkle {
  0%, 100% { transform: scale(0.78); filter: brightness(0.72); }
  50% { transform: scale(1.22); filter: brightness(1.18); }
}

@media (max-width: 430px) {
  .box-purpose {
    margin-top: 10px;
    font-size: 11px;
  }

  .mystery-box.is-open .gift-lid {
    transform: translate(-16px, -28px) rotate(-18deg);
  }

  .mystery-box.is-open .gift-item {
    transform: translateY(-43px) scale(1.18) rotate(3deg);
  }

  .box-found {
    font-size: 7px;
    letter-spacing: 0.02em;
  }

  .story-ticket__status {
    max-width: 100%;
    font-size: 5.5px;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }
}

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

  .mystery-box.is-open .gift-item {
    transition: none;
  }
}

/* Reference-led refinement — v8 */
.ambient {
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
}

.constellation {
  opacity: 1;
}

.constellation::before {
  opacity: 0.72;
}

.spark {
  width: calc(var(--size, 1px) * 1.35);
  height: calc(var(--size, 1px) * 1.35);
  background: rgba(255, 249, 255, 0.96);
  box-shadow: 0 0 7px rgba(234, 222, 241, 0.58);
  opacity: max(var(--star-opacity, 0.3), 0.34);
}

.gift-svg--key .gift-item {
  stroke: #f5bd64;
}

.gift-svg--note .gift-item {
  stroke: #ffd9e7;
}

.gift-svg--note .gift-item-fill {
  fill: #a74f75;
}

.gift-svg--coin .gift-item {
  stroke: #ffe0a1;
}

.gift-svg--coin .gift-item-fill {
  fill: #c99036;
}

.mystery-box.is-open .gift-item {
  transform: translateY(-64px) scale(1.38) rotate(2deg);
  filter: drop-shadow(0 10px 9px rgba(0, 0, 0, 0.58)) drop-shadow(0 0 10px rgba(255, 205, 224, 0.4));
}

.story-ticket {
  border-radius: 8px 3px;
  clip-path: polygon(
    10px 0,
    calc(100% - 10px) 0,
    100% 10px,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    10px 100%,
    0 calc(100% - 10px),
    0 10px
  );
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 9px),
    radial-gradient(circle at 22% 0%, rgba(164, 73, 108, 0.2), transparent 36%),
    linear-gradient(145deg, #110d12, #040405 74%);
}

.story-ticket::before,
.story-ticket::after {
  display: block;
  width: 24px;
  height: 24px;
  background: #211524;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.story-ticket::before {
  left: -13px;
}

.story-ticket::after {
  right: -13px;
}

.story-ticket__frame {
  position: absolute;
  z-index: 1;
  inset: 7px;
  border: 1px solid rgba(242, 203, 220, 0.14);
  border-radius: 3px;
  pointer-events: none;
}

.story-ticket__frame::before,
.story-ticket__frame::after {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  width: 2px;
  border-top: 1px solid rgba(242, 203, 220, 0.2);
  border-bottom: 1px solid rgba(242, 203, 220, 0.2);
}

.story-ticket__frame::before {
  left: 6px;
}

.story-ticket__frame::after {
  right: 6px;
}

.story-ticket__main,
.story-ticket__stub {
  z-index: 2;
}

.story-ticket__main {
  justify-content: center;
}

.story-ticket__kicker {
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(240, 207, 221, 0.16);
}

.story-ticket__status {
  color: rgba(250, 223, 234, 0.68);
}

.story-ticket__micro {
  display: block;
  margin-top: 7px;
  color: rgba(228, 195, 210, 0.34);
  font-size: clamp(5px, 0.75vw, 8px);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.story-ticket__stub {
  background: rgba(255, 255, 255, 0.018);
}

.story-ticket__qr {
  width: clamp(17px, 3vw, 27px);
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.74);
  background:
    linear-gradient(90deg, #fff 22%, transparent 22% 42%, #fff 42% 61%, transparent 61% 78%, #fff 78%),
    linear-gradient(#fff 18%, transparent 18% 39%, #fff 39% 58%, transparent 58% 80%, #fff 80%);
  background-blend-mode: screen;
  opacity: 0.72;
}

.story-ticket__barcode {
  width: 66%;
  height: 18%;
}

@media (max-width: 430px) {
  .mystery-box.is-open .gift-item {
    transform: translateY(-57px) scale(1.28) rotate(2deg);
  }

  .ticket-scene {
    min-height: 285px;
  }

  .ticket-reveal {
    aspect-ratio: 1.76 / 1;
  }

  .story-ticket--front {
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  .story-ticket__main {
    padding: 11px 8px 10px 13px;
  }

  .story-ticket__name {
    margin: 5px 0;
    font-size: clamp(25px, 8vw, 34px);
  }

  .story-ticket__micro {
    margin-top: 5px;
    font-size: 4.5px;
    letter-spacing: 0.08em;
  }

  .story-ticket__qr {
    width: 18px;
    border-width: 1px;
  }

  .story-ticket__barcode {
    height: 14%;
  }
}

/* Living 3D world — v9. Без WebGL класс has-world не ставится и остаётся 2D-фон выше. */
.world-canvas,
.world-fade {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.world-canvas {
  opacity: 0;
  transition: opacity 1.4s ease;
}

.world-canvas.is-ready {
  opacity: 1;
}

.world-fade {
  z-index: 0;
  opacity: 0;
}

.ambient {
  transition: opacity 1.4s ease;
}

body.has-world {
  background: #0b0710;
}

body.has-world::before {
  display: none;
}

body.has-world .ambient {
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.4s ease, visibility 0s linear 1.4s;
}

body.has-world .app-shell {
  z-index: 1;
}

/* HUD — ближайший слой: полупрозрачный, мир читается сквозь карточки. */
body.has-world .stage {
  transform: translate3d(var(--hud-x, 0px), var(--hud-y, 0px), 0);
}

body.has-world .card {
  background:
    linear-gradient(145deg, rgba(44, 27, 47, 0.5), rgba(20, 13, 25, 0.56)),
    rgba(22, 15, 27, 0.3);
  backdrop-filter: blur(9px) saturate(120%);
  -webkit-backdrop-filter: blur(9px) saturate(120%);
}

body.has-world .exit-button {
  backdrop-filter: blur(8px);
}

@media (max-width: 720px) {
  body.has-world .card {
    backdrop-filter: blur(7px) saturate(118%);
    -webkit-backdrop-filter: blur(7px) saturate(118%);
  }
}

body[data-reduced-motion="true"].has-world .stage {
  transform: none;
}

/* Нить света от объекта сцены к карточке вопроса */
.world-tether {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms ease;
  filter: drop-shadow(0 0 6px rgba(255, 190, 150, 0.6));
}

/* Раскладка в 3D-мире: сцена сверху, вопрос — в нижней части экрана, как «табличка» на борту лодки */
body.has-world .app-shell {
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
}

body.has-world .experience {
  min-height: 0;
  place-items: end center;
  align-self: stretch;
}

body.has-world .footer {
  display: none;
}

body.has-world .stage {
  width: min(100%, 720px);
}

body.has-world .topbar {
  min-height: 52px;
}

@media (max-width: 720px) {
  body.has-world .app-shell {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  body.has-world .experience {
    min-height: 0;
  }

  body.has-world .card {
    padding: 22px 18px 20px;
    border-radius: 24px;
  }
}

@media (max-height: 700px) and (max-width: 720px) {
  body.has-world .card {
    padding: 16px 16px 14px;
  }
}

/* v10 — интерфейс вшит в сцену: без плашки, текст на объектах мира, мягкое затемнение вместо рамки */
body.has-world .card,
body.has-world .card--final,
body.has-world .card--center {
  overflow: visible;
  padding: 6px 4px 2px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

body.has-world .card::before,
body.has-world .card::after {
  display: none;
}

body.has-world .stage {
  position: relative;
  isolation: isolate;
}

body.has-world .stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -90px 0 -28px;
  pointer-events: none;
  background: radial-gradient(ellipse 62% 56% at 50% 60%, rgba(9, 4, 17, 0.78), rgba(9, 4, 17, 0.5) 46%, rgba(9, 4, 17, 0) 80%);
}

body.has-world .title,
body.has-world .eyebrow,
body.has-world .lede,
body.has-world .invitation__text,
body.has-world .personal-line,
body.has-world .invitation__note,
body.has-world .interlude-line,
body.has-world .box-purpose,
body.has-world .ticket-caption {
  text-shadow: 0 2px 22px rgba(4, 1, 10, 0.95), 0 0 3px rgba(4, 1, 10, 0.7);
}

body.has-world .option {
  border: 1px solid rgba(255, 226, 214, 0.26);
  background: linear-gradient(135deg, rgba(36, 18, 46, 0.5), rgba(18, 9, 28, 0.42));
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28);
}

body.has-world .option:hover,
body.has-world .option:focus-visible {
  border-color: rgba(255, 214, 190, 0.6);
  background: linear-gradient(135deg, rgba(74, 36, 70, 0.62), rgba(34, 16, 44, 0.55));
}

body.has-world .response,
body.has-world .resume-box,
body.has-world .invitation__note {
  background: rgba(18, 9, 28, 0.42);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

body.has-world .mystery-box {
  background: rgba(24, 12, 34, 0.34);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

@media (max-width: 720px) {
  body.has-world .card,
  body.has-world .card--final,
  body.has-world .card--center {
    padding: 4px 2px 0;
  }

  body.has-world .stage::before {
    inset: -80px 0 -20px;
  }
}

html, body { overflow-x: clip; }

/* v11 — опросник «прикреплён» к объекту сцены: компактная панель на скале/маяке/корабле */
body.world-pinned .stage {
  position: fixed;
  z-index: 5;
  top: var(--qy, 60%);
  left: var(--qx, 50%);
  width: var(--qw, 320px);
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 520ms ease;
}

body.world-pinned .stage::before {
  inset: -46px -26px;
  background: radial-gradient(ellipse 66% 62% at 50% 50%, rgba(9, 4, 17, 0.7), rgba(9, 4, 17, 0.42) 52%, rgba(9, 4, 17, 0) 82%);
}

body.world-moving .stage {
  opacity: 0;
  pointer-events: none;
}

body.world-pinned .experience {
  min-height: 0;
}

body.world-pinned .eyebrow {
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: 0.16em;
}

body.world-pinned .title--question {
  margin: 0 0 12px;
  font-size: clamp(17px, 4.7vw, 23px);
  line-height: 1.16;
}

body.world-pinned .options {
  gap: 7px;
}

body.world-pinned .option {
  min-height: 0;
  padding: 9px 12px;
  border-radius: 15px;
  font-size: 13.5px;
  line-height: 1.25;
}

body.world-pinned .option__letter {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

body.world-pinned .box-purpose {
  display: none;
}

body.world-pinned .mystery-box {
  padding-bottom: 8px;
}

body.world-pinned .response {
  padding: 10px 12px;
  font-size: 13px;
}

body.world-pinned .found-item {
  font-size: 18px;
}

body.world-pinned .continue-row {
  margin-top: 10px;
}

@media (min-width: 721px) {
  body.world-pinned .title--question {
    font-size: 24px;
  }

  body.world-pinned .option {
    font-size: 14.5px;
  }
}

/* v12 — вопросы живут в 3D-сцене (таблички на раме у объекта); DOM-версия остаётся для клавиатуры и скринридеров */
body.world-signs .stage {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  opacity: 1 !important;
  transform: none !important;
  white-space: nowrap;
}

body.world-signs .stage::before {
  display: none;
}

body.world-signs .experience {
  min-height: 0;
}

/* v16 финал — реакция DOM на фазы мира (body[data-finale]); без WebGL класс has-world не ставится, правила не действуют (2D-финал со всеми текстами) */
body.has-world[data-finale="f0"] .interlude-line,
body.has-world[data-finale="f0"] .interlude__action,
body.has-world[data-finale="f1"]:not([data-finale-text]) .interlude-line,
body.has-world[data-finale="f1"]:not([data-finale-text]) .interlude__action {
  animation-play-state: paused;
}

body.has-world[data-finale] .stage .card {
  transition: opacity 900ms ease;
}

/* билеты стартуют из ящика: мир пишет --ticketN-dx/dy (смещение центра билета к ящику, px) */
body.has-world[data-finale] .ticket-reveal--first { animation-name: finale-ticket-rise-left; }
body.has-world[data-finale] .ticket-reveal--second { animation-name: finale-ticket-rise-right; }

@keyframes finale-ticket-rise-left {
  0% { opacity: 0; transform: translate(var(--ticket1-dx, -18%), var(--ticket1-dy, 230px)) rotate(-14deg) scale(0.34); }
  72% { opacity: 1; transform: translate(2%, -10px) rotate(-5deg) scale(1.02); }
  100% { opacity: 1; transform: translate(4%, 8px) rotate(-4deg) scale(1); }
}

@keyframes finale-ticket-rise-right {
  0% { opacity: 0; transform: translate(var(--ticket2-dx, 18%), var(--ticket2-dy, 255px)) rotate(15deg) scale(0.34); }
  72% { opacity: 1; transform: translate(-2%, -14px) rotate(5deg) scale(1.02); }
  100% { opacity: 1; transform: translate(-4%, -4px) rotate(4deg) scale(1); }
}

/* F3: камера летит к маяку, текст приглашения скрыт до конца полёта */
body.has-world[data-finale="f3"] .stage .card {
  opacity: 0;
  pointer-events: none;
}

/* F4: «стеклянная» карточка у окна ламповой */
body.has-world[data-finale="f4"] .stage .card {
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid rgba(255, 226, 214, 0.22);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(30, 18, 40, 0.64), rgba(14, 9, 24, 0.72));
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
  box-shadow: 0 18px 60px rgba(4, 1, 10, 0.45);
}

/* F5: карточка растворяется, текст завершения появляется через 2.5 с */
body.has-world[data-finale="f5"] .stage .card--center {
  opacity: 0;
  animation: finale-card-in 900ms ease 2500ms forwards;
}

body.has-world .stage.is-dissolving .card {
  opacity: 0;
}

@keyframes finale-card-in {
  to { opacity: 1; }
}

.ticket-back {
  max-width: 440px;
  margin: 14px 0 0;
  padding: 12px 16px;
  border: 1px dashed rgba(255, 226, 214, 0.38);
  border-radius: 12px;
  color: #ecdbe4;
  font-size: 14px;
  line-height: 1.45;
}

.ticket-back p { margin: 2px 0; }
.ticket-back__serie { color: rgba(236, 219, 228, 0.7); font-size: 12px; letter-spacing: 0.08em; }
.ticket-back__date { color: rgba(236, 219, 228, 0.78); font-style: italic; }

body[data-reduced-motion="true"].has-world[data-finale="f5"] .stage .card--center {
  opacity: 1;
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  body.has-world[data-finale="f5"] .stage .card--center {
    opacity: 1;
    animation: none;
  }
  body.has-world[data-finale] .stage .card { transition: none; }
}

/* v2: в 3D-финале интерлюдия без карточки — подложка пустой карточки не рисуется */
.stage[data-silent] ::before,
.stage[data-silent]::before { display: none !important; }
.stage[data-silent] .card { display: none !important; }

/* ───── старт: пока мир собирается и шейдеры компилируются — тихая заставка (без текста), затем карточка и мир проявляются вместе ───── */
.boot { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 100%, #2a1530 0%, #140b1c 45%, #0b0710 100%); opacity: 1; transition: opacity 1.1s ease 0.15s; }
.boot__star { width: 46px; height: 46px; position: relative; animation: boot-breathe 2.4s ease-in-out infinite; }
.boot__star::before, .boot__star::after { content: ""; position: absolute; inset: 0; margin: auto; background: #f3c7d4; border-radius: 2px;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); filter: drop-shadow(0 0 10px rgba(255, 190, 210, 0.7)); }
.boot__star::after { transform: scale(0.45) rotate(45deg); opacity: 0.6; }
@keyframes boot-breathe { 0%, 100% { transform: scale(0.86); opacity: 0.55; } 50% { transform: scale(1); opacity: 1; } }
body:not(.is-booting) .boot { opacity: 0; }
body.is-booting .app-shell { opacity: 0; pointer-events: none; }
body .app-shell { transition: opacity 1s ease 0.25s; }
@media (prefers-reduced-motion: reduce) { .boot__star { animation: none; } }

/* ───── Ссылка «Данные и конфиденциальность» (аналитика, v22) ─────
   Видна только на начальном и прощальном экранах; на остальных её нет совсем — футер остаётся прежним.
   В 3D-режиме футер по-прежнему скрыт; на этих двух экранах показывается одна маленькая строка внизу поверх сцены. */
.footer__privacy {
  color: inherit;
  font-size: 11px;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  display: none;
}
body[data-screen="intro"] .footer__privacy,
body[data-screen="goodbye"] .footer__privacy { display: inline; }
.footer__privacy:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
body.has-world[data-screen="intro"] .footer,
body.has-world[data-screen="goodbye"] .footer {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(6px, env(safe-area-inset-bottom));
  min-height: 0;
  z-index: 5;
  pointer-events: none;
  color: rgba(255, 236, 244, 0.6);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
body.has-world .footer > span { display: none; }
body.has-world .footer__privacy { pointer-events: auto; padding: 6px 2px 2px; }
/* раньше ✦ был последним элементом футера и на узких экранах скрывался правилом .footer span:last-child — сохраняем это поведение */
@media (max-width: 720px) {
  .footer > span { display: none; }
}

/* Фоновая музыка (music.js): кнопка вкл/выкл слева в верхней панели — зеркально кнопке «×»; громкость раскрывается при наведении,
   фокусе с клавиатуры, а на телефоне — на пару секунд после нажатия. Без backdrop-filter: он дорог в Safari поверх 3D. */
.music {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 21px;
  color: rgba(246, 231, 239, 0.68);
  background: rgba(22, 15, 26, 0.56);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(-50%);
  transition: width 260ms ease, opacity 600ms ease, border-color 180ms ease, background 180ms ease;
}
.music[hidden], .music.is-done { display: none; }
.music:hover, .music:focus-within, .music.is-open {
  width: 156px;
  color: #fff;
  border-color: rgba(255, 222, 233, 0.26);
  background: rgba(69, 42, 58, 0.62);
}
.music__btn {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.music__btn:focus-visible, .music__vol:focus-visible { outline: 2px solid #ffe4dc; outline-offset: -2px; }
.music__vol {
  flex: 0 0 96px;
  width: 96px;
  height: 20px;
  margin: 0 12px 0 2px;
  accent-color: #f3c7d4;
  background: transparent;
  cursor: pointer;
}
@media (max-width: 720px) {
  .music { left: 2px; width: 38px; height: 38px; border-radius: 19px; }
  .music__btn { flex-basis: 36px; width: 36px; height: 36px; }
  .music:hover, .music:focus-within, .music.is-open { width: 148px; }
}
@media (prefers-reduced-motion: reduce) { .music { transition: none; } }
