:root {
  --bg: #07060d;
  --surface: rgba(255, 255, 255, 0.075);
  --surface-strong: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.15);
  --text: #fffaf7;
  --muted: rgba(255, 250, 247, 0.64);
  --pink: #f26ba5;
  --purple: #9a6bff;
  --gold: #f4cf75;
  --blue: #6da7ff;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
}

body {
  min-height: 100svh;
  isolation: isolate;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

#ambientCanvas,
#celebrationCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#ambientCanvas { z-index: -4; }
#celebrationCanvas { z-index: 30; }

.aurora {
  position: fixed;
  width: 70vw;
  height: 70vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .16;
  pointer-events: none;
  z-index: -3;
  animation: auroraMove 14s ease-in-out infinite alternate;
}

.aurora--one {
  top: -25vw;
  right: -25vw;
  background: linear-gradient(135deg, var(--pink), var(--purple));
}

.aurora--two {
  left: -30vw;
  bottom: -32vw;
  background: linear-gradient(135deg, var(--blue), var(--gold));
  animation-delay: -7s;
}

.film-grain {
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: .035;
  pointer-events: none;
  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='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) 22px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
}

.brand__mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  color: #16101a;
  background: linear-gradient(135deg, var(--gold), #fff2bd);
  box-shadow: 0 0 25px rgba(244, 207, 117, .3);
  font-family: "Playfair Display", serif;
  font-size: 1.1rem;
}

.sound-button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--muted);
  background: rgba(10, 8, 18, .45);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.sound-button.is-on {
  color: var(--gold);
  border-color: rgba(244, 207, 117, .4);
}

.sound-button__icon { font-size: .9rem; }
.sound-button__label { font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; }

.experience {
  position: relative;
  width: 100%;
  height: 100svh;
  overflow: hidden;
}

.progress-dots {
  position: fixed;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 18;
  display: flex;
  gap: 7px;
  transform: translateX(-50%);
}

.progress-dots span {
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .22);
  transition: width .45s var(--ease), background .45s;
}

.progress-dots span.is-active {
  width: 22px;
  background: linear-gradient(90deg, var(--gold), var(--pink));
}

.scene {
  position: absolute;
  inset: 0;
  display: grid;
  visibility: hidden;
  place-items: center;
  padding: 86px 20px 50px;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity .75s var(--ease), transform .75s var(--ease), visibility .75s;
  scrollbar-width: none;
}

.scene::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 15%, rgba(154, 107, 255, .13), transparent 35%),
    linear-gradient(180deg, transparent 55%, rgba(5, 4, 10, .55));
}

.scene--active {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
}

.scene__content {
  width: min(100%, 720px);
  margin: auto;
}

.scene__content--wide { width: min(100%, 820px); }
.scene__content--center { text-align: center; }

.eyebrow {
  margin: 0 0 16px;
  color: var(--gold);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .2em;
  line-height: 1.5;
  text-transform: uppercase;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 5px rgba(242, 107, 165, .12);
  animation: pulse 1.6s infinite;
}

h1,
.scene-title,
.final-reveal h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  letter-spacing: -.035em;
  text-wrap: balance;
}

h1 {
  max-width: 700px;
  font-size: clamp(2.8rem, 11vw, 5.7rem);
  line-height: .98;
}

h1 em {
  color: transparent;
  background: linear-gradient(100deg, var(--gold), #ff9ec5 50%, #bba3ff);
  -webkit-background-clip: text;
  background-clip: text;
}

.scene-title {
  max-width: 680px;
  font-size: clamp(2rem, 7.4vw, 4rem);
  line-height: 1.08;
}

.lead {
  max-width: 600px;
  margin: 22px 0 30px;
  color: var(--muted);
  font-size: clamp(.96rem, 3.6vw, 1.15rem);
  line-height: 1.65;
}

.lead--compact { margin: 14px 0 25px; }
.scene__content--center .lead { margin-right: auto; margin-left: auto; }

.primary-button,
.secondary-button {
  min-height: 54px;
  padding: 0 24px;
  border: 0;
  border-radius: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s, background .25s;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: #160f18;
  background: linear-gradient(105deg, #fff0b5, var(--gold) 40%, #f6a8c8);
  box-shadow: 0 14px 40px rgba(242, 107, 165, .2);
}

.secondary-button {
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(16px);
}

.primary-button:active,
.secondary-button:active,
.choice-card:active,
.personality-card:active,
.genre-card:active { transform: scale(.97); }

.play-icon {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid #160f18;
}

.is-hidden {
  visibility: hidden !important;
  opacity: 0 !important;
  transform: translateY(14px) !important;
}

.streaming-intro {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  text-align: center;
  background: #050409;
  transition: opacity 1s var(--ease), visibility 1s;
}

.streaming-intro.is-finished {
  visibility: hidden;
  opacity: 0;
}

.streaming-intro__logo {
  color: transparent;
  background: linear-gradient(135deg, var(--gold), var(--pink), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 24px rgba(242, 107, 165, .45));
  font-family: "Playfair Display", serif;
  font-size: 8rem;
  line-height: .8;
  animation: logoReveal 2.2s var(--ease) both;
}

.streaming-intro p {
  margin-top: 25px;
  color: rgba(255, 255, 255, .55);
  font-size: .62rem;
  letter-spacing: .32em;
  animation: fadeUp 1s .8s both;
}

.intro-content {
  transition: opacity .8s, transform .8s var(--ease), visibility .8s;
}

.loading-card,
.episode-card {
  max-width: 540px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  backdrop-filter: blur(22px);
}

.loading-card__top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: .76rem;
}

.loading-card__track,
.cinema-progress__track {
  height: 4px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, .1);
}

.loading-card__track span,
.cinema-progress__track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--purple), var(--pink), var(--gold));
  box-shadow: 0 0 14px var(--pink);
}

.episode-card {
  display: flex;
  align-items: center;
  gap: 16px;
  transition: opacity .6s, transform .6s var(--ease), visibility .6s;
}

.episode-card__number {
  color: rgba(255, 255, 255, .13);
  font-family: "Playfair Display", serif;
  font-size: 3.6rem;
  line-height: 1;
}

.episode-card span {
  color: var(--gold);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .15em;
}

.episode-card h2 {
  margin: 5px 0 0;
  font-size: 1rem;
}

#startButton { transition: opacity .6s, transform .6s var(--ease), visibility .6s, box-shadow .25s; }

.story-question { margin-top: 30px; }
.story-question > p { color: var(--muted); }

.choice-grid {
  display: grid;
  gap: 11px;
}

.choice-card,
.personality-card,
.genre-card {
  color: var(--text);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  backdrop-filter: blur(18px);
  cursor: pointer;
  transition: transform .25s, border-color .3s, background .3s, box-shadow .3s, opacity .3s;
}

.choice-card:hover,
.personality-card:hover,
.genre-card:hover {
  border-color: rgba(244, 207, 117, .5);
  background: rgba(244, 207, 117, .09);
  box-shadow: 0 12px 35px rgba(0,0,0,.2);
}

.choice-card {
  display: grid;
  grid-template-columns: 32px 1fr 24px;
  align-items: center;
  min-height: 66px;
  padding: 0 17px;
  border-radius: 17px;
  text-align: left;
}

.choice-card__number,
.choice-card__arrow { color: var(--gold); }
.choice-card__number { font-size: .68rem; letter-spacing: .1em; }
.choice-card__arrow { font-size: 1.25rem; }

.choice-grid.has-selection button:not(.is-selected),
.genre-list.has-selection button:not(.is-selected) {
  opacity: .38;
}

.choice-card.is-selected,
.personality-card.is-selected,
.genre-card.is-selected {
  border-color: var(--gold);
  background: rgba(244, 207, 117, .12);
  box-shadow: 0 0 0 1px rgba(244, 207, 117, .12), 0 18px 50px rgba(0,0,0,.3);
}

.response-card {
  display: none;
  margin-top: 18px;
  padding: 17px;
  border-left: 2px solid var(--gold);
  border-radius: 0 14px 14px 0;
  color: var(--muted);
  background: linear-gradient(90deg, rgba(244, 207, 117, .1), transparent);
  line-height: 1.55;
}

.response-card__text {
  margin: 0;
}

.response-card .primary-button {
  width: 100%;
  margin-top: 16px;
}

.response-card.is-visible {
  display: block;
  animation: fadeUp .5s var(--ease) both;
}

.response-card--center {
  border-right: 1px solid rgba(244, 207, 117, .15);
  border-left: 1px solid rgba(244, 207, 117, .15);
  border-radius: 14px;
  text-align: center;
}

.choice-grid--personality {
  grid-template-columns: repeat(2, 1fr);
}

.personality-card {
  display: flex;
  min-height: 112px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 20px;
}

.personality-card span { font-size: 1.8rem; }
.personality-card strong { font-size: .9rem; }

.mission-pill {
  display: inline-block;
  margin: 4px 0 18px;
  padding: 9px 13px;
  border: 1px solid rgba(244, 207, 117, .25);
  border-radius: 99px;
  color: var(--gold);
  background: rgba(244, 207, 117, .07);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.emoji-field {
  position: relative;
  height: min(46vh, 390px);
  min-height: 300px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 50%, rgba(154, 107, 255, .12), transparent 50%),
    rgba(255, 255, 255, .025);
  box-shadow: inset 0 0 80px rgba(0,0,0,.22);
}

.floating-emoji {
  position: absolute;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.035);
  font-size: var(--emoji-size, 1.15rem);
  cursor: pointer;
  animation: emojiFloat var(--duration) ease-in-out infinite alternate;
  animation-delay: var(--delay);
}

.floating-emoji.is-decoy.is-gone {
  pointer-events: none;
  animation: decoyGone .45s var(--ease) forwards;
}

.floating-emoji.is-heart {
  filter: drop-shadow(0 0 7px rgba(244, 207, 117, .25));
}

.attempt-counter {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: .68rem;
  text-align: center;
}

.game-success {
  display: none;
  padding: 24px 8px 0;
  text-align: center;
}

.game-success.is-visible {
  display: block;
  animation: fadeUp .7s var(--ease) both;
}

.game-success__icon {
  display: block;
  margin-bottom: 10px;
  font-size: 2rem;
}

.game-success p { color: var(--muted); line-height: 1.65; }
.game-success strong { color: var(--text); }
.game-success .primary-button { margin-top: 8px; }

.memory-status {
  display: flex;
  justify-content: space-between;
  width: min(100%, 520px);
  margin: 24px auto 10px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  width: min(100%, 520px);
  margin: 0 auto;
  perspective: 800px;
}

.memory-card {
  position: relative;
  min-height: 112px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform .55s var(--ease);
}

.memory-card.is-flipped,
.memory-card.is-matched {
  transform: rotateY(180deg);
}

.memory-card__face {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 19px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.memory-card__front {
  color: var(--gold);
  background:
    radial-gradient(circle at 50% 25%, rgba(154, 107, 255, .13), transparent 50%),
    rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 25px rgba(255, 255, 255, .025);
  font-family: "Playfair Display", serif;
  font-size: 1.35rem;
}

.memory-card__back {
  transform: rotateY(180deg);
  background: linear-gradient(145deg, rgba(244,207,117,.16), rgba(242,107,165,.1));
  box-shadow: inset 0 0 0 1px rgba(244, 207, 117, .12);
}

.memory-card__back span {
  font-size: 1.55rem;
}

.memory-card__back strong {
  font-size: .72rem;
}

.memory-card.is-matched .memory-card__back {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(244, 207, 117, .16);
}

.memory-success {
  display: none;
  width: min(100%, 520px);
  margin: 18px auto 0;
  padding: 22px;
  border: 1px solid rgba(244, 207, 117, .25);
  border-radius: 21px;
  background: linear-gradient(135deg, rgba(244,207,117,.1), rgba(242,107,165,.06));
}

.memory-success.is-visible {
  display: block;
  animation: unlockReveal .7s var(--ease) both;
}

.memory-success__icon {
  color: var(--gold);
  font-size: 1.35rem;
}

.memory-success h3 {
  margin: 8px 0;
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
}

.memory-success p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.memory-success .primary-button {
  width: 100%;
  margin-top: 18px;
}

.genre-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 25px;
}

.genre-card {
  display: grid;
  min-height: 132px;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  align-content: center;
  padding: 18px;
  border-radius: 20px;
  text-align: left;
}

.genre-card > span {
  grid-row: 1 / 3;
  color: var(--gold);
  font-size: .66rem;
}

.genre-card strong { align-self: end; }
.genre-card small {
  align-self: start;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.4;
}

.analysis-orb {
  position: relative;
  display: grid;
  width: 132px;
  height: 132px;
  margin: 0 auto 35px;
  place-items: center;
}

.analysis-orb__core {
  display: grid;
  width: 78px;
  height: 78px;
  z-index: 1;
  place-items: center;
  border-radius: 50%;
  color: var(--gold);
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.25), rgba(154,107,255,.2));
  box-shadow: 0 0 60px rgba(154, 107, 255, .35);
  font-size: 1.5rem;
  animation: orbPulse 2s ease-in-out infinite;
}

.analysis-orb__ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(244, 207, 117, .28);
  border-radius: 50%;
  border-top-color: var(--gold);
  animation: spin 4s linear infinite;
}

.analysis-orb__ring::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(242, 107, 165, .22);
  border-radius: 50%;
}

.analysis-detail {
  min-height: 24px;
  color: var(--muted);
}

.cinema-progress {
  width: min(100%, 520px);
  margin: 30px auto 0;
}

.cinema-progress__track { height: 6px; }
.cinema-progress__meta {
  display: flex;
  justify-content: space-between;
  margin-top: 11px;
  color: var(--muted);
  font-size: .63rem;
  letter-spacing: .12em;
}

.cinema-progress__meta strong { color: var(--gold); }

.unlocked-card {
  display: none;
  max-width: 520px;
  margin: 28px auto 0;
  padding: 25px;
  border: 1px solid rgba(244, 207, 117, .25);
  border-radius: 23px;
  background: linear-gradient(135deg, rgba(244,207,117,.1), rgba(242,107,165,.06));
  backdrop-filter: blur(18px);
}

.unlocked-card.is-visible {
  display: block;
  animation: unlockReveal .75s var(--ease) both;
}

.unlocked-card > span { color: var(--gold); font-size: 1.3rem; }
.unlocked-card h3 { margin: 8px 0; font-family: "Playfair Display", serif; font-size: 1.65rem; }
.unlocked-card p { margin: 0 0 20px; color: var(--muted); line-height: 1.5; }

.gift {
  position: relative;
  width: 200px;
  height: 210px;
  margin: 28px auto 8px;
  border: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 30px 35px rgba(0,0,0,.4));
}

.gift__glow {
  position: absolute;
  inset: 30px 10px 0;
  border-radius: 50%;
  background: rgba(242,107,165,.22);
  filter: blur(40px);
  animation: pulse 2s infinite;
}

.gift__box,
.gift__lid {
  position: absolute;
  left: 50%;
  display: block;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #552464, #8a3d7a 52%, #3e245d);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}

.gift__box {
  bottom: 20px;
  width: 138px;
  height: 110px;
  border-radius: 5px 5px 18px 18px;
}

.gift__lid {
  bottom: 126px;
  z-index: 2;
  width: 158px;
  height: 36px;
  border-radius: 10px 10px 5px 5px;
  animation: lidFloat 1.8s ease-in-out infinite;
}

.gift__box i,
.gift__lid i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 27px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #d6a843, #ffe49a, #c38d2d);
}

.gift__lid::before,
.gift__lid::after {
  content: "";
  position: absolute;
  bottom: 27px;
  width: 50px;
  height: 35px;
  border: 11px solid var(--gold);
  border-radius: 50% 50% 10% 50%;
}

.gift__lid::before { left: 32px; transform: rotate(18deg); }
.gift__lid::after { right: 32px; transform: scaleX(-1) rotate(18deg); }

.gift__spark {
  position: absolute;
  color: var(--gold);
  animation: sparkle 1.8s infinite;
}

.gift__spark--one { top: 15px; left: 22px; }
.gift__spark--two { top: 40px; right: 14px; animation-delay: -.6s; }
.gift__spark--three { top: 2px; right: 52px; animation-delay: -1.1s; }

.gift.is-opening .gift__lid { animation: giftOpen .8s var(--ease) forwards; }
.gift.is-opening .gift__box { animation: boxOpen .8s var(--ease) forwards; }

.tap-hint {
  color: var(--muted);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .2em;
  animation: pulse 1.5s infinite;
}

.final-content {
  width: min(100%, 750px);
}

.final-messages {
  min-height: 180px;
  display: grid;
  place-items: center;
}

.final-messages p {
  position: absolute;
  max-width: 690px;
  margin: 0;
  opacity: 0;
  transform: translateY(18px);
  font-family: "Playfair Display", serif;
  font-size: clamp(1.75rem, 7.5vw, 3.9rem);
  line-height: 1.18;
  text-wrap: balance;
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}

.final-messages p.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.final-reveal {
  display: none;
}

.final-reveal.is-visible {
  display: block;
  animation: unlockReveal 1s var(--ease) both;
}

.final-reveal__heart {
  margin-bottom: 12px;
  font-size: 2.8rem;
  filter: drop-shadow(0 0 22px rgba(244,207,117,.45));
  animation: heartBeat 1.4s infinite;
}

.final-reveal h2 {
  font-size: clamp(2.7rem, 11vw, 5.5rem);
  background: linear-gradient(100deg, #fff, var(--gold), #f6a8c8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.final-reveal > p:not(.eyebrow) {
  margin: 12px 0;
  color: var(--muted);
}

.final-reveal blockquote {
  margin: 22px auto 10px;
  color: var(--text);
  font-family: "Playfair Display", serif;
  font-size: 1.15rem;
  font-style: italic;
}

.signature {
  display: block;
  color: var(--gold);
  font-size: .72rem;
}

.final-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 560px;
  margin: 28px auto 0;
}

.final-actions .primary-button {
  width: 100%;
}

.transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
}

.transition-overlay::before,
.transition-overlay::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 51%;
  background: #040308;
  transition: transform .6s var(--ease);
}

.transition-overlay::before { left: 0; transform: translateX(-101%); }
.transition-overlay::after { right: 0; transform: translateX(101%); }

.transition-overlay.is-active { visibility: visible; }
.transition-overlay.is-active::before,
.transition-overlay.is-active::after { transform: translateX(0); }

.transition-overlay__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 1;
  width: 1px;
  opacity: 0;
  background: linear-gradient(transparent, var(--gold), transparent);
  box-shadow: 0 0 20px var(--gold);
}

.transition-overlay.is-active .transition-overlay__line {
  opacity: 1;
  transition: opacity .25s .25s;
}

.heart-rain {
  position: fixed;
  inset: 0;
  z-index: 45;
  overflow: hidden;
  pointer-events: none;
}

.rain-heart {
  position: absolute;
  top: -40px;
  animation: rainFall linear forwards;
  filter: drop-shadow(0 0 8px rgba(242,107,165,.4));
}

@keyframes auroraMove {
  to { transform: translate(12vw, 10vw) scale(1.15); }
}

@keyframes pulse {
  50% { opacity: .55; transform: scale(.94); }
}

@keyframes logoReveal {
  0% { opacity: 0; transform: scale(.7); filter: blur(18px); }
  55% { opacity: 1; transform: scale(1.08); filter: blur(0); }
  100% { transform: scale(1); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes emojiFloat {
  to { transform: translate(8px, -14px) rotate(12deg); }
}

@keyframes decoyGone {
  to { opacity: 0; transform: scale(0) rotate(80deg); filter: blur(8px); }
}

@keyframes orbPulse {
  50% { transform: scale(1.08); box-shadow: 0 0 80px rgba(242,107,165,.42); }
}

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

@keyframes unlockReveal {
  from { opacity: 0; transform: scale(.88) translateY(15px); filter: blur(7px); }
  to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

@keyframes lidFloat {
  50% { transform: translateX(-50%) translateY(-7px) rotate(-1deg); }
}

@keyframes sparkle {
  50% { opacity: .25; transform: scale(.7) rotate(45deg); }
}

@keyframes giftOpen {
  to { transform: translateX(-50%) translateY(-80px) rotate(-16deg); opacity: 0; }
}

@keyframes boxOpen {
  50% { transform: translateX(-50%) scale(1.06); }
  100% { transform: translateX(-50%) scale(.9); opacity: 0; }
}

@keyframes heartBeat {
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  45% { transform: scale(1.12); }
}

@keyframes rainFall {
  to { transform: translate(var(--drift), 110vh) rotate(var(--rotation)); opacity: .15; }
}

@media (max-width: 560px) {
  .scene {
    align-items: center;
    padding: 78px 18px 45px;
  }

  .topbar { padding-right: 17px; padding-left: 17px; }
  .brand {
    font-size: .61rem;
    letter-spacing: .09em;
  }
  .sound-button__label { display: none; }
  .sound-button { width: 35px; height: 35px; justify-content: center; padding: 0; }

  .genre-list { grid-template-columns: 1fr; }
  .genre-card { min-height: 91px; }
  .emoji-field { min-height: 260px; }
  .memory-card { min-height: 98px; }
  .analysis-orb { width: 105px; height: 105px; margin-bottom: 25px; }
  .analysis-orb__core { width: 65px; height: 65px; }
  .gift { transform: scale(.9); margin-top: 12px; margin-bottom: -5px; }
  .final-actions { grid-template-columns: 1fr; }
  .final-messages { min-height: 240px; }

  .aurora {
    filter: blur(55px);
    opacity: .12;
  }

  .choice-card,
  .personality-card,
  .genre-card,
  .loading-card,
  .episode-card,
  .unlocked-card,
  .secondary-button {
    backdrop-filter: blur(8px);
  }
}

@media (max-height: 700px) {
  .scene { align-items: start; }
  h1 { font-size: clamp(2.45rem, 10vw, 4rem); }
  .lead { margin-top: 14px; margin-bottom: 20px; }
  .personality-card { min-height: 88px; }
  .emoji-field { min-height: 235px; height: 36vh; }
  .gift { transform: scale(.75); margin-top: -5px; margin-bottom: -35px; }
  .analysis-orb { transform: scale(.75); margin-top: -15px; margin-bottom: 5px; }
}

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