:root {
  --bg: #07050a;
  --gold: #c9a84c;
  --gold-l: #e8c97a;
  --rose: #c9455a;
  --rose-l: #e8607a;
  --cream: #f5ede0;
  --muted: #6a5868;
  --card-h: min(360px, 50dvh);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --mood-rgb: 232, 201, 122;
  --mood-glow: rgba(232,201,122,0.16);
  --mood-symbol: '✦   ◇   ✦';
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--cream);
  font-family: 'Cormorant Garamond', serif;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 2px solid rgba(232, 201, 122, 0.72);
  outline-offset: 3px;
}

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

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  transition: background 1.8s cubic-bezier(0.4,0,0.2,1), opacity 1.8s cubic-bezier(0.4,0,0.2,1);
  will-change: transform, background;
}

.orb-a {
  width: 75vw;
  height: 75vw;
  max-width: 420px;
  max-height: 420px;
  background: rgba(201,168,76,0.14);
  bottom: -15%;
  left: -15%;
  animation: drift-a 14s ease-in-out infinite;
}

.orb-b {
  width: 65vw;
  height: 65vw;
  max-width: 370px;
  max-height: 370px;
  background: rgba(201,69,90,0.10);
  top: -10%;
  right: -15%;
  animation: drift-b 18s ease-in-out infinite;
}

.orb-c {
  width: 40vw;
  height: 40vw;
  max-width: 240px;
  max-height: 240px;
  background: rgba(140,40,80,0.06);
  top: 40%;
  left: 30%;
  animation: drift-c 22s ease-in-out infinite;
  opacity: 0;
  transition: opacity 1.5s ease, background 1.5s ease;
}

.heat-wash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 62%, rgba(145, 10, 20, 0.72), transparent 52%),
    linear-gradient(180deg, rgba(72, 0, 10, 0.7), rgba(130, 8, 12, 0.8));
  mix-blend-mode: screen;
  transition: opacity 0.85s cubic-bezier(0.4,0,0.2,1);
}

body.mood-pulse .heat-wash {
  animation: mood-wash 1.2s ease both;
}

@keyframes mood-wash {
  0% { filter: saturate(1); }
  28% { filter: saturate(1.28) brightness(1.08); }
  100% { filter: saturate(1); }
}

.rift-bg {
  --rift-main: 198, 80, 255;
  --rift-hot: 246, 221, 255;
  --rift-cool: 118, 210, 255;
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.94;
  mix-blend-mode: screen;
  contain: layout paint style;
}

.rift-bg.palette-yes {
  --rift-main: 198, 80, 255;
  --rift-hot: 246, 221, 255;
  --rift-cool: 118, 210, 255;
}

.rift-bg.palette-never {
  --rift-main: 126, 211, 255;
  --rift-hot: 255, 255, 255;
  --rift-cool: 182, 244, 255;
}

.rift-bg.palette-truth {
  --rift-main: 255, 190, 44;
  --rift-hot: 255, 246, 210;
  --rift-cool: 255, 236, 141;
}

.rift-bg.palette-dare {
  --rift-main: 255, 62, 82;
  --rift-hot: 255, 225, 230;
  --rift-cool: 255, 142, 160;
}

.rift-shear,
.rift-veil,
.rift-line,
.rift-shock,
.rift-shard {
  position: absolute;
  pointer-events: none;
  will-change: transform, opacity;
}

.rift-shear {
  inset: -18%;
  opacity: 0;
  transform: scale(0.9) rotate(-4deg);
  background:
    linear-gradient(104deg, transparent 35%, rgba(var(--rift-cool),0.26) 43%, rgba(var(--rift-hot),0.58) 50%, rgba(var(--rift-main),0.54) 58%, transparent 68%),
    radial-gradient(circle at 50% 52%, rgba(255,255,255,0.22), transparent 18%);
  filter: blur(4px) saturate(1.18);
}

.rift-veil {
  inset: -14%;
  opacity: 0;
  background:
    radial-gradient(ellipse at 29% 48%, rgba(var(--rift-cool),0.3), transparent 35%),
    radial-gradient(ellipse at 73% 56%, rgba(var(--rift-main),0.48), transparent 39%),
    radial-gradient(ellipse at 50% 50%, rgba(var(--rift-hot),0.24), transparent 52%);
  filter: blur(9px) saturate(1.32);
  transform: scale(0.94);
}

.rift-line {
  left: 50%;
  top: 13%;
  width: 2px;
  height: 74%;
  opacity: 0;
  transform: translateX(-50%) scaleY(0.08);
  background: linear-gradient(transparent, rgba(255,255,255,0.98), rgba(var(--rift-hot),0.88), rgba(var(--rift-main),0.82), transparent);
  box-shadow:
    0 0 22px rgba(255,255,255,0.78),
    0 0 58px rgba(var(--rift-main),0.88),
    0 0 96px rgba(var(--rift-cool),0.24);
}

.rift-shock {
  left: 50%;
  top: 53%;
  width: 44vmin;
  height: 44vmin;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.1);
  background: radial-gradient(circle, rgba(255,255,255,0.4), rgba(var(--rift-hot),0.28) 28%, rgba(var(--rift-main),0.22) 48%, transparent 72%);
  filter: blur(3px);
}

.rift-shard {
  left: 50%;
  top: 52%;
  width: var(--s);
  height: calc(var(--s) * 5.8);
  border-radius: 999px;
  opacity: 0;
  display: none;
  transform: translate(-50%, -50%) rotate(var(--a)) scaleY(0.2);
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(var(--rift-hot),0.72) 38%, rgba(var(--rift-main),0.46) 70%, transparent);
  box-shadow:
    0 0 18px rgba(255,255,255,0.78),
    0 0 34px rgba(var(--rift-main),0.68);
}

.rift-shard.is-live {
  display: block;
}

.rift-bg.playing .rift-shear {
  animation: rift-shear 1.05s cubic-bezier(0.08,0.82,0.18,1) both;
}

.rift-bg.playing .rift-veil {
  animation: rift-veil 1.2s ease both;
}

.rift-bg.playing .rift-line {
  animation: rift-line 0.9s cubic-bezier(0.08,0.82,0.18,1) both;
}

.rift-bg.playing .rift-shock {
  animation: rift-shock 1.08s cubic-bezier(0.08,0.82,0.18,1) both;
}

html.fx-recommended .rift-bg.playing .rift-shock,
html.fx-low .rift-bg.playing .rift-shock {
  animation-name: rift-shock-lite;
}

.rift-bg.playing .rift-shard.is-live {
  animation: rift-shard-fly var(--d) cubic-bezier(0.08,0.82,0.18,1) var(--delay) both;
}

@keyframes rift-shear {
  0% { opacity: 0; transform: scale(0.88) rotate(-7deg); }
  16% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.18) rotate(3deg); }
}

@keyframes rift-veil {
  0% { opacity: 0; transform: scale(0.94); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.13); }
}

@keyframes rift-line {
  0% { opacity: 0; transform: translateX(-50%) scaleY(0.06); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) scaleY(1.22); }
}

@keyframes rift-shock {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.1); filter: blur(0); }
  18% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(4.4); filter: blur(18px); }
}

@keyframes rift-shock-lite {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.1); }
  18% { opacity: 0.68; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(4.2); }
}

@keyframes rift-shard-fly {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) scaleY(0.18); }
  11% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--a)) scaleY(0.02); }
}

@keyframes drift-a {
  0%,100% { transform: translate(0,0) scale(1); }
  35% { transform: translate(6%,5%) scale(1.06); }
  70% { transform: translate(-3%,8%) scale(0.96); }
}

@keyframes drift-b {
  0%,100% { transform: translate(0,0) scale(1); }
  40% { transform: translate(-6%,4%) scale(1.09); }
  75% { transform: translate(5%,-5%) scale(0.94); }
}

@keyframes drift-c {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-10%,10%) scale(1.2); }
}

html.fx-medium .rift-shear {
  filter: blur(2px) saturate(1.08);
}

html.fx-recommended .rift-shear {
  filter: blur(1.5px) saturate(1.04);
}

html.fx-medium .rift-veil {
  filter: blur(6px) saturate(1.12);
}

html.fx-recommended .rift-veil {
  filter: blur(4px) saturate(1.08);
}

html.fx-medium .rift-shock {
  filter: blur(2px);
}

html.fx-recommended .rift-shock {
  filter: blur(1px);
}

html.fx-medium .rift-shard {
  box-shadow:
    0 0 12px rgba(255,255,255,0.6),
    0 0 22px rgba(var(--rift-main),0.48);
}

html.fx-recommended .rift-shard {
  box-shadow:
    0 0 10px rgba(255,255,255,0.5),
    0 0 18px rgba(var(--rift-main),0.42);
}

html.fx-low .rift-bg {
  opacity: 0.82;
}

html.fx-low .rift-veil {
  display: none;
}

html.fx-low .rift-shear {
  filter: blur(1px) saturate(1);
}

html.fx-low .rift-shock {
  filter: none;
}

html.fx-low .rift-line {
  box-shadow:
    0 0 16px rgba(255,255,255,0.54),
    0 0 34px rgba(var(--rift-main),0.58);
}

html.fx-low .rift-shard {
  box-shadow: 0 0 12px rgba(var(--rift-main),0.46);
}

.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.022;
  pointer-events: none;
  z-index: 999;
  animation: grain-anim 0.9s steps(1) infinite;
}

@keyframes grain-anim {
  0%  { transform: translate(0,0); }
  25% { transform: translate(-4%,-4%); }
  50% { transform: translate(4%,2%); }
  75% { transform: translate(-2%,5%); }
}

#splash {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 60%, #12050e 0%, #07050a 100%);
  gap: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.42s ease, visibility 0s linear 0.42s;
}

body.age-ok #splash {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

#splash > .sp-flame,
#splash > .sp-title,
#splash > .sp-sub,
#splash > .sp-sub-2,
#splash > .sp-lang,
#splash > .sp-divider,
#splash > .sp-btn {
  position: relative;
  z-index: 3;
}

#splash > .splash-legal {
  z-index: 3;
}

.sp-flame {
  font-size: 6.6rem;
  filter: drop-shadow(0 0 50px rgba(201,69,90,0.9));
  animation: sp-flame-in 0.9s cubic-bezier(0.34,1.56,0.64,1) both, sp-breathe 2.8s 0.9s ease-in-out infinite;
}

#splash .sp-flame {
  opacity: 0;
  transform: scale(0.4) translateY(30px);
  animation: none;
}

#splash.splash-intro .sp-flame {
  animation: sp-flame-in 0.7s 0.78s cubic-bezier(0.34,1.56,0.64,1) both, sp-breathe 2.8s 1.48s ease-in-out infinite;
}

#splash.splash-anticipating .splash-fire-reveal {
  animation: splash-fire-anticipation 0.25s cubic-bezier(0.22,0.72,0.22,1) both;
}

#splash.splash-anticipating .splash-fire-orbit {
  animation: splash-orbit-anticipation 0.25s cubic-bezier(0.22,0.72,0.22,1) both;
}

@keyframes sp-flame-in {
  from { opacity:0; transform: scale(0.4) translateY(30px); }
  to { opacity:1; transform: scale(1) translateY(0); }
}

@keyframes splash-fire-anticipation {
  0% { opacity: 0; transform: scale(0.92); filter: brightness(0.8) saturate(1); }
  100% { opacity: 0.22; transform: scale(1); filter: brightness(1.08) saturate(1.12); }
}

@keyframes splash-orbit-anticipation {
  0% { opacity: 0; transform: translate3d(-50%, -50%, 0) scale(0.9); }
  100% { opacity: 0.28; transform: translate3d(-50%, -50%, 0) scale(1); }
}

@keyframes sp-breathe {
  0%,100% { filter: drop-shadow(0 0 50px rgba(201,69,90,0.9)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 80px rgba(201,69,90,1)); transform: scale(1.07); }
}

.sp-title,
#after h1,
#mode-select h1 {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(4.5rem, 18vw, 6rem);
  background: linear-gradient(140deg, var(--gold) 0%, var(--gold-l) 40%, var(--rose-l) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 40px rgba(201,168,76,0.35));
  line-height: 1.16;
  margin-top: 14px;
  padding-bottom: 0.08em;
}

#after h1,
#mode-select h1 {
  animation: sp-up 0.8s 0.25s cubic-bezier(0.34,1.4,0.64,1) both;
}

#splash .sp-title {
  animation: none;
  opacity: 1;
  transform: none;
}

.sp-sub {
  font-size: 0.82rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: -2px;
  padding-top: 5px;
  animation: sp-up 0.8s 0.45s cubic-bezier(0.34,1.4,0.64,1) both;
}

.sp-sub-2 {
  font-size: 0.7rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(106,88,104,0.8);
  margin-top: 8px;
  animation: sp-up 0.8s 0.55s cubic-bezier(0.34,1.4,0.64,1) both;
}

.sp-lang,
.mini-lang {
  display: flex;
  gap: 4px;
}

.sp-lang {
  margin-top: 22px;
  animation: sp-up 0.8s 0.58s cubic-bezier(0.34,1.4,0.64,1) both;
}

.lang-btn {
  min-width: 30px;
  height: 28px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(201,168,76,0.20);
  background: rgba(255,255,255,0.035);
  color: rgba(245,237,224,0.46);
  cursor: pointer;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.lang-btn.active {
  color: var(--gold-l);
  border-color: rgba(201,168,76,0.46);
  background: rgba(201,168,76,0.10);
}

.sp-divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin-top: 34px;
  animation: sp-up 0.8s 0.6s cubic-bezier(0.34,1.4,0.64,1) both;
}

.sp-btn {
  margin-top: 32px;
  padding: 16px 52px;
  border-radius: 50px;
  border: 1px solid rgba(201,168,76,0.38);
  background: rgba(201,168,76,0.07);
  color: var(--gold-l);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: sp-up 0.8s 0.8s cubic-bezier(0.34,1.4,0.64,1) both, sp-glow 2.5s 1.6s ease-in-out infinite;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.sp-btn:active { transform: scale(0.96); }

@keyframes sp-glow {
  0%,100% { box-shadow: 0 0 0 0 rgba(201,168,76,0); }
  50% { box-shadow: 0 0 30px 4px rgba(201,168,76,0.12); }
}

.sp-btn::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 52px;
  border: 1px solid rgba(201,168,76,0.2);
  animation: sp-ring 2.5s 1.6s ease-in-out infinite;
  pointer-events: none;
}

#splash .sp-sub,
#splash .sp-sub-2,
#splash .sp-lang,
#splash .sp-divider,
#splash .sp-btn,
#splash .splash-legal {
  opacity: 0;
  filter: blur(10px);
  transform: scale(1.1);
  animation: none;
}

#splash.splash-intro .sp-sub {
  animation: sp-up 0.8s 1.1s cubic-bezier(0.34,1.4,0.64,1) both;
}

#splash.splash-intro .sp-sub-2 {
  animation: sp-up 0.8s 1.2s cubic-bezier(0.34,1.4,0.64,1) both;
}

#splash.splash-intro .sp-lang {
  animation: sp-up 0.8s 1.23s cubic-bezier(0.34,1.4,0.64,1) both;
}

#splash.splash-intro .sp-divider {
  animation: sp-up 0.8s 1.25s cubic-bezier(0.34,1.4,0.64,1) both;
}

#splash.splash-intro .sp-btn {
  animation: sp-up 0.8s 1.42s cubic-bezier(0.34,1.4,0.64,1) both, sp-glow 2.5s 2.15s ease-in-out infinite;
}

#splash.splash-intro .splash-legal {
  animation: sp-up 0.8s 1.52s cubic-bezier(0.34,1.4,0.64,1) both;
}

.splash-fire-reveal {
  position: absolute;
  inset: -18%;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
}

.splash-fire-reveal::before,
.splash-fire-reveal::after {
  content: '';
  position: absolute;
  inset: -20%;
  pointer-events: none;
}

.splash-fire-reveal::before {
  background:
    radial-gradient(ellipse at 50% 54%, rgba(255,242,184,0.56), rgba(255,190,90,0.28) 18%, transparent 44%),
    radial-gradient(ellipse at 50% 76%, rgba(255,222,148,0.74), rgba(255,160,68,0.28) 23%, transparent 52%),
    radial-gradient(ellipse at 46% 64%, rgba(255,70,90,0.6), rgba(201,69,90,0.25) 35%, transparent 62%),
    linear-gradient(125deg, transparent 10%, rgba(255,196,88,0.58) 35%, rgba(201,69,90,0.52) 55%, transparent 86%);
  filter: blur(10px) saturate(1.08);
  transform-origin: 50% 58%;
  will-change: transform, opacity;
}

.splash-fire-reveal::after {
  background:
    radial-gradient(ellipse at 50% 54%, rgba(255,255,255,0.74), transparent 10%),
    radial-gradient(ellipse at 50% 56%, rgba(255,206,83,0.66), transparent 26%),
    radial-gradient(ellipse at 50% 58%, rgba(201,69,90,0.58), transparent 48%);
  filter: blur(24px);
}

.splash-fire-orbit {
  position: fixed;
  z-index: 7;
  left: var(--splash-logo-cx, 50vw);
  top: var(--splash-logo-cy, 43vh);
  width: var(--splash-orbit-w, 620px);
  height: var(--splash-orbit-h, 260px);
  pointer-events: none;
  perspective: 820px;
  transform: translate3d(-50%, -50%, 0);
  transform-style: preserve-3d;
  opacity: 0;
  contain: layout paint style;
}

.splash-fire-orbit::before,
.splash-fire-orbit::after {
  content: '';
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transform-style: preserve-3d;
}

.splash-fire-orbit::before {
  inset: 31% 6%;
  border: 1px solid rgba(255,203,92,0.26);
  border-right-color: rgba(255,88,66,0.42);
  border-bottom-color: rgba(255,246,190,0.12);
  box-shadow:
    0 0 20px rgba(255,119,54,0.18),
    inset 0 0 26px rgba(201,69,90,0.16);
}

.splash-fire-orbit::after {
  inset: 18% 1%;
  background:
    radial-gradient(ellipse at 84% 48%, rgba(255,239,178,0.34), transparent 12%),
    radial-gradient(ellipse at 18% 58%, rgba(255,87,66,0.22), transparent 18%),
    linear-gradient(95deg, transparent 18%, rgba(255,190,76,0.16), rgba(201,69,90,0.18), transparent 82%);
  filter: blur(10px);
}

.splash-fire-particle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--particle-w, 8px);
  height: var(--particle-h, 3px);
  border-radius: 999px;
  background:
    radial-gradient(circle at 28% 48%, rgba(255,255,230,0.98) 0 12%, rgba(255,213,98,0.92) 13% 38%, rgba(255,92,58,0.64) 58%, transparent 72%),
    linear-gradient(90deg, rgba(255,240,178,0.92), rgba(255,126,48,0.72), rgba(201,69,90,0));
  box-shadow:
    0 0 7px rgba(255,188,80,0.56),
    0 0 16px rgba(201,69,90,0.3);
  opacity: 0;
  mix-blend-mode: screen;
  transform-style: preserve-3d;
  will-change: transform, opacity;
}

.splash-fire-particle.is-coal {
  background:
    radial-gradient(circle at 42% 44%, rgba(255,190,86,0.86), rgba(201,69,90,0.62) 44%, rgba(74,9,26,0) 72%);
  box-shadow:
    0 0 8px rgba(201,69,90,0.42),
    0 0 18px rgba(255,92,58,0.22);
}

.splash-fire-particle.is-gold {
  background:
    radial-gradient(circle at 30% 42%, rgba(255,255,226,1) 0 16%, rgba(255,221,115,0.94) 34%, rgba(255,136,42,0.44) 66%, transparent 76%);
  box-shadow:
    0 0 8px rgba(255,224,132,0.72),
    0 0 18px rgba(255,136,42,0.34);
}

.splash-logo-mask-stage {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  contain: layout paint style;
}

.splash-logo-mask-text {
  position: fixed;
  left: var(--splash-logo-x, 50%);
  top: var(--splash-logo-y, 50%);
  width: var(--splash-logo-w, auto);
  height: var(--splash-logo-h, auto);
  display: block;
  font-family: var(--splash-logo-font-family, 'Playfair Display', serif);
  font-style: var(--splash-logo-font-style, italic);
  font-weight: var(--splash-logo-font-weight, 700);
  font-size: var(--splash-logo-font-size, 6rem);
  line-height: var(--splash-logo-line-height, 1.16);
  letter-spacing: var(--splash-logo-letter-spacing, normal);
  text-align: var(--splash-logo-text-align, center);
  color: #ffe8a6;
  -webkit-text-fill-color: #ffe8a6;
  mix-blend-mode: exclusion;
  transform: none;
}

.splash-logo-mask-text.is-feather {
  opacity: 0.62;
  filter: blur(2.8px) saturate(1.12) drop-shadow(0 0 42px rgba(255,86,56,0.56));
}

.splash-logo-mask-text.is-core {
  opacity: 0.72;
  filter: blur(0.15px) saturate(1.04) drop-shadow(0 0 16px rgba(255,230,170,0.38));
}

.splash-logo-mask-text::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: #0a0307;
  -webkit-text-fill-color: #0a0307;
  mix-blend-mode: color-burn;
  opacity: 0.36;
  filter: blur(0.2px);
}

#splash.splash-intro .splash-fire-reveal {
  animation: splash-fire-layer 1.08s cubic-bezier(0.12,0.82,0.18,1) both;
}

#splash.splash-intro .splash-fire-reveal::before {
  animation: splash-fire-velvet 1.08s cubic-bezier(0.08,0.82,0.18,1) both;
}

#splash.splash-intro .splash-fire-reveal::after {
  animation: splash-fire-core 1.08s cubic-bezier(0.12,0.82,0.18,1) both;
}

#splash.splash-intro .splash-logo-mask-stage {
  animation: splash-mask-logo 1.34s cubic-bezier(0.12,0.82,0.18,1) both;
}

#splash.splash-intro .splash-fire-orbit {
  animation: splash-orbit-stage 1.22s cubic-bezier(0.13,0.82,0.18,1) both;
}

#splash.splash-intro .splash-fire-orbit::before {
  animation: splash-orbit-ring 1.16s cubic-bezier(0.16,0.86,0.18,1) both;
}

#splash.splash-intro .splash-fire-orbit::after {
  animation: splash-orbit-bloom 1.08s cubic-bezier(0.16,0.86,0.18,1) both;
}

#splash.splash-intro .splash-fire-particle {
  animation: splash-particle-swoosh var(--particle-dur, 1.02s) cubic-bezier(0.14,0.82,0.2,1) var(--particle-delay, 0s) both;
}

html.fx-medium #splash.splash-intro .splash-fire-reveal,
html.fx-medium #splash.splash-intro .splash-fire-reveal::before,
html.fx-medium #splash.splash-intro .splash-fire-reveal::after {
  animation-duration: 1.22s;
}

html.fx-recommended #splash.splash-intro .splash-fire-reveal,
html.fx-recommended #splash.splash-intro .splash-fire-reveal::before,
html.fx-recommended #splash.splash-intro .splash-fire-reveal::after {
  animation-duration: 1.08s;
}

html.fx-medium #splash.splash-intro .splash-fire-orbit,
html.fx-medium #splash.splash-intro .splash-fire-orbit::before,
html.fx-medium #splash.splash-intro .splash-fire-orbit::after {
  animation-duration: 1.34s;
}

html.fx-recommended #splash.splash-intro .splash-fire-orbit,
html.fx-recommended #splash.splash-intro .splash-fire-orbit::before,
html.fx-recommended #splash.splash-intro .splash-fire-orbit::after {
  animation-duration: 1.22s;
}

html.fx-medium .splash-fire-reveal::before {
  filter: blur(7px) saturate(1.04);
}

html.fx-recommended .splash-fire-reveal::before {
  filter: blur(10px) saturate(1.08);
}

html.fx-medium .splash-fire-reveal::after {
  filter: blur(16px);
}

html.fx-recommended .splash-fire-reveal::after {
  filter: blur(24px);
}

html.fx-low #splash.splash-intro .splash-fire-reveal,
html.fx-low #splash.splash-intro .splash-fire-reveal::before,
html.fx-low #splash.splash-intro .splash-fire-reveal::after,
html.fx-low #splash.splash-intro .splash-fire-orbit,
html.fx-low #splash.splash-intro .splash-fire-orbit::before,
html.fx-low #splash.splash-intro .splash-fire-orbit::after {
  animation-duration: 1.12s;
}

html.fx-low .splash-fire-reveal::before,
html.fx-low .splash-fire-reveal::after {
  filter: blur(8px);
}

html.fx-low .splash-fire-orbit::after {
  display: none;
}

@keyframes sp-ring {
  0%,100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.07); opacity: 0; }
}

@keyframes splash-fire-layer {
  0% { opacity: 0; }
  14% { opacity: 1; }
  58% { opacity: 0.88; }
  100% { opacity: 0; }
}

@keyframes splash-fire-velvet {
  0% { opacity: 0; transform: scale(0.96); }
  18% { opacity: 1; transform: scale(1.015); }
  46% { opacity: 0.68; transform: scale(1.035); }
  100% { opacity: 0; transform: scale(1.075); }
}

@keyframes splash-fire-core {
  0% { opacity: 0; transform: scale(0.62); }
  16% { opacity: 0.78; transform: scale(0.96); }
  48% { opacity: 0.42; transform: scale(1.18); }
  100% { opacity: 0; transform: scale(1.34); }
}

@keyframes splash-mask-logo {
  0% { opacity: 0; transform: none; }
  28% { opacity: 0; }
  44% { opacity: 0.86; transform: none; }
  58% { opacity: 0.72; transform: none; }
  74% { opacity: 0.34; transform: none; }
  100% { opacity: 0; transform: none; }
}

@keyframes splash-orbit-stage {
  0% { opacity: 0; }
  10% { opacity: 1; }
  74% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes splash-orbit-ring {
  0% { opacity: 0; transform: rotateX(68deg) rotateZ(-24deg) scale(0.56); }
  25% { opacity: 0.86; transform: rotateX(68deg) rotateZ(-7deg) scale(0.86); }
  58% { opacity: 0.46; transform: rotateX(68deg) rotateZ(18deg) scale(1.06); }
  100% { opacity: 0; transform: rotateX(68deg) rotateZ(42deg) scale(1.2); }
}

@keyframes splash-orbit-bloom {
  0% { opacity: 0; transform: rotateZ(-10deg) scale(0.84); }
  22% { opacity: 0.72; transform: rotateZ(4deg) scale(1); }
  62% { opacity: 0.34; transform: rotateZ(15deg) scale(1.08); }
  100% { opacity: 0; transform: rotateZ(26deg) scale(1.16); }
}

@keyframes splash-particle-swoosh {
  0% {
    opacity: 0;
    transform:
      translate3d(var(--sx), var(--sy), var(--z0))
      rotateZ(var(--r0))
      rotateY(var(--ry0))
      scale(0.18);
  }
  16% { opacity: var(--particle-op, 0.92); }
  48% {
    opacity: var(--particle-op-mid, 0.72);
    transform:
      translate3d(var(--mx), var(--my), var(--z1))
      rotateZ(var(--r1))
      rotateY(var(--ry1))
      scale(var(--particle-scale, 1));
  }
  100% {
    opacity: 0;
    transform:
      translate3d(var(--ex), var(--ey), var(--z2))
      rotateZ(var(--r2))
      rotateY(var(--ry2))
      scale(0.08);
  }
}

@keyframes sp-up {
  from { opacity: 0; filter: blur(10px); transform: scale(1.1); }
  to { opacity: 1; filter: blur(0); transform: scale(1); }
}

#splash.leaving {
  animation: sp-leave 0.92s cubic-bezier(0.42,0,0.2,1) forwards;
  pointer-events: none;
}

@keyframes sp-leave {
  0% { opacity:1; filter: blur(0); transform: scale(1); }
  52% { opacity:0.72; filter: blur(2px); transform: scale(1.015); }
  100% { opacity:0; filter: blur(12px); transform: scale(1.055); }
}

#mode-select {
  position: fixed;
  inset: 0;
  z-index: 550;
  display: grid;
  place-items: start center;
  padding: calc(var(--safe-top) + 11px) 20px calc(var(--safe-bot) + 22px);
  background:
    radial-gradient(ellipse at 50% 35%, rgba(70,18,38,0.28), transparent 42%),
    radial-gradient(ellipse at 50% 78%, rgba(201,168,76,0.10), transparent 42%),
    radial-gradient(ellipse at 50% 56%, #140711 0%, #07050a 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
  overflow: hidden;
}

#mode-select::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -18%;
  width: min(1180px, 175vw);
  height: min(580px, 68vh);
  transform: translateX(-50%) rotateX(68deg);
  transform-origin: center bottom;
  background:
    linear-gradient(rgba(201,168,76,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,168,76,0.08) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at 50% 42%, #000 0%, rgba(0,0,0,0.62) 44%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 42%, #000 0%, rgba(0,0,0,0.62) 44%, transparent 72%);
  opacity: 0.26;
  pointer-events: none;
  animation: plane-drift 7s linear infinite;
}

#mode-select::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 20%;
  width: min(620px, 96vw);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.3), transparent);
  opacity: 0.45;
}

#mode-select.ritual-picking::after {
  display: none;
}

#mode-select.ritual-picking {
  --ritual-stage-bottom: 142px;
}

@keyframes plane-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 72px, 72px 0; }
}

#mode-select.on {
  opacity: 1;
  pointer-events: all;
}

#mode-select.from-splash {
  transition-duration: 0.92s;
  transition-timing-function: cubic-bezier(0.18,0.72,0.2,1);
}

.mode-close {
  position: fixed;
  top: calc(var(--safe-top) + 18px);
  right: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.28);
  background:
    radial-gradient(circle at 50% 40%, rgba(201,168,76,0.10), transparent 62%),
    rgba(0,0,0,0.2);
  color: rgba(245,237,224,0.78);
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  display: none;
  padding: 0;
  opacity: 0;
  transform: translateY(-8px) scale(0.94);
  pointer-events: none;
  z-index: 4;
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 42px rgba(0,0,0,0.32);
  transition: opacity 0.34s ease, transform 0.38s cubic-bezier(0.34,1.4,0.64,1), border-color 0.22s ease;
}

#mode-select.ritual-picking .ritual-back {
  display: grid;
}

.mode-close::before,
.mode-close::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 1.3px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 9px rgba(232,201,122,0.26);
}

.mode-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

#mode-select.reselect .mode-close {
  display: grid;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.mode-close:hover,
.mode-close:focus-visible {
  border-color: rgba(201,168,76,0.48);
}

.mode-shell {
  width: min(100%, 560px);
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  position: relative;
  z-index: 1;
  perspective: 1100px;
}

#mode-select h1 {
  font-size: clamp(2.7rem, 10vw, 4.25rem);
  margin-top: 4px;
  animation-delay: 0s;
}

#mode-select p {
  color: rgba(106,88,104,0.84);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-top: -6px;
  margin-bottom: -4px;
}

.mode-grid {
  width: min(100%, 500px);
  height: clamp(300px, 46vh, 360px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 0;
  margin-top: 8px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  position: relative;
}

.mode-card {
  width: min(220px, 44vw);
  min-height: clamp(270px, 42vh, 325px);
  border: 1px solid rgba(201,168,76,0.18);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent 28%),
    linear-gradient(145deg, rgba(30,14,22,0.92), rgba(12,7,12,0.96));
  box-shadow: 0 28px 80px rgba(0,0,0,0.58), 0 0 72px rgba(201,69,90,0.08) inset;
  color: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 26px 20px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.42s cubic-bezier(0.34,1.35,0.64,1), border-color 0.2s, box-shadow 0.25s, filter 0.25s, opacity 0.25s;
  animation: mode-float 4.8s ease-in-out infinite;
  will-change: transform;
}

#mode-select.on .mode-never {
  animation: mode-never-in 0.72s cubic-bezier(0.16,1,0.3,1) backwards, mode-float 4.8s 0.72s ease-in-out infinite;
}

#mode-select.on .mode-td {
  animation: mode-td-in 0.72s cubic-bezier(0.16,1,0.3,1) backwards, mode-float 4.8s 0.72s ease-in-out infinite;
}

#mode-select.on .mode-never.is-current {
  animation: mode-never-current-in 0.72s cubic-bezier(0.16,1,0.3,1) backwards, mode-float 4.8s 0.72s ease-in-out infinite;
}

#mode-select.on .mode-td.is-current {
  animation: mode-td-current-in 0.72s cubic-bezier(0.16,1,0.3,1) backwards, mode-float 4.8s 0.72s ease-in-out infinite;
}

.mode-card::before,
.mode-card::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.mode-card::before {
  inset: 18px;
  border: 1px solid rgba(201,168,76,0.13);
  border-radius: 15px;
}

.mode-card::after {
  left: 24px;
  right: 24px;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.12), transparent);
}

.mode-never {
  justify-self: end;
  transform: translateX(18px) rotateY(18deg) rotateZ(-1.2deg);
}

.mode-td {
  justify-self: start;
  transform: translateX(-18px) rotateY(-18deg) rotateZ(1.2deg);
  animation-delay: -1.6s;
}

.mode-card:active { filter: brightness(1.08); }

.mode-card.is-current {
  opacity: 0.74;
  filter: saturate(0.78) brightness(0.88);
  box-shadow: 0 24px 68px rgba(0,0,0,0.56), 0 0 38px rgba(201,168,76,0.08) inset;
  cursor: pointer;
}

.mode-card.is-locked {
  opacity: 0.58;
  filter: saturate(0.5) brightness(0.72);
  cursor: not-allowed;
}

.mode-card.is-locked::after,
.ritual-card.is-locked::after {
  content: '🔒';
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background:
    repeating-linear-gradient(135deg, rgba(245,237,224,0.075) 0 8px, rgba(7,5,10,0.10) 8px 17px),
    radial-gradient(circle at 50% 50%, rgba(7,5,10,0.18), rgba(7,5,10,0.46));
  color: rgba(245,237,224,0.82);
  font-size: 2rem;
  text-shadow: 0 0 18px rgba(232,201,122,0.32);
  box-shadow: inset 0 0 0 1px rgba(201,168,76,0.09);
  opacity: 0.82;
  pointer-events: none;
  z-index: 5;
}

.mode-card:hover,
.mode-card:focus-visible {
  border-color: rgba(201,168,76,0.38);
  box-shadow: 0 34px 90px rgba(0,0,0,0.65), 0 0 95px rgba(201,168,76,0.12) inset;
  z-index: 2;
}

.mode-never:hover,
.mode-never:focus-visible {
  transform: translateX(46px) translateZ(82px) rotateY(5deg) rotateZ(-0.4deg);
}

.mode-td:hover,
.mode-td:focus-visible {
  transform: translateX(-46px) translateZ(82px) rotateY(-5deg) rotateZ(0.4deg);
}

.mode-never.is-locked:hover,
.mode-never.is-locked:focus-visible {
  transform: translateX(18px) rotateY(18deg) rotateZ(-1.2deg);
}

.mode-td.is-locked:hover,
.mode-td.is-locked:focus-visible {
  transform: translateX(-18px) rotateY(-18deg) rotateZ(1.2deg);
}

.mode-card.is-current:hover,
.mode-card.is-current:focus-visible,
.mode-card.is-current:active {
  filter: saturate(0.9) brightness(0.96);
  border-color: rgba(201,168,76,0.34);
  box-shadow: 0 34px 90px rgba(0,0,0,0.65), 0 0 76px rgba(201,168,76,0.10) inset;
}

.mode-card.swipe-arming,
.ritual-card.swipe-arming {
  z-index: 6;
  filter: brightness(1.08) saturate(1.06);
}

.mode-card.swipe-ready,
.ritual-card.swipe-ready {
  box-shadow: 0 34px 92px rgba(0,0,0,0.62), 0 0 80px rgba(232,201,122,0.12) inset;
}

.mode-never.is-current:hover,
.mode-never.is-current:focus-visible {
  transform: translateX(38px) translateZ(58px) rotateY(8deg) rotateZ(-0.7deg);
}

.mode-td.is-current:hover,
.mode-td.is-current:focus-visible {
  transform: translateX(-38px) translateZ(58px) rotateY(-8deg) rotateZ(0.7deg);
}

.mode-icon {
  font-size: clamp(3.4rem, 12vw, 5rem);
  filter: drop-shadow(0 0 28px rgba(201,69,90,0.72));
  margin-bottom: 8px;
}

.mode-card strong {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.42rem, 5.2vw, 2rem);
  line-height: 1.04;
  color: var(--gold-l);
  font-weight: 700;
  max-width: 9ch;
}

@media (max-width: 520px) {
  .mode-shell { width: min(100%, 440px); }
  #mode-select h1 { font-size: clamp(2.55rem, 13vw, 4.2rem); }
  .mode-grid {
    width: min(100%, 430px);
    height: clamp(330px, 49vh, 400px);
  }
  .mode-card {
    width: min(198px, 46vw);
    min-height: clamp(285px, 44vh, 350px);
  }
  .mode-sponsor {
    padding: 10px 14px;
  }
  .mode-sponsor em {
    display: none;
  }
}

.mode-card em {
  color: rgba(245,237,224,0.66);
  font-size: 0.88rem;
  line-height: 1.36;
  font-style: normal;
  max-width: 18ch;
}

#mode-select.ritual-picking .mode-shell > h1,
#mode-select.ritual-picking .mode-shell > p,
#mode-select.ritual-picking .mode-grid {
  display: none;
}

#mode-select.ritual-picking .mode-shell {
  position: fixed;
  top: calc(var(--safe-top) + 11px);
  bottom: calc(var(--safe-bot) + var(--ritual-stage-bottom));
  left: 50%;
  width: min(500px, calc(100vw - 40px));
  height: auto;
  min-height: 0;
  padding-bottom: 0;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  transform: translateX(-50%);
}

#mode-select.ritual-picking .mode-shell > .sp-flame {
  font-size: clamp(4.7rem, 16vw, 5.9rem);
  margin-top: -6px;
}

.ritual-shell {
  width: min(100%, 500px);
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 2px;
  min-height: 0;
  height: 100%;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  animation: sp-up 0.56s cubic-bezier(0.16,1,0.3,1) both;
}

.ritual-back {
  position: fixed;
  top: calc(var(--safe-top) + 18px);
  left: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.28);
  background:
    radial-gradient(circle at 50% 40%, rgba(201,168,76,0.10), transparent 62%),
    rgba(0,0,0,0.2);
  color: rgba(245,237,224,0.78);
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  display: none;
  place-items: center;
  padding: 0;
  z-index: 4;
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 42px rgba(0,0,0,0.32);
  transition: opacity 0.34s ease, transform 0.38s cubic-bezier(0.34,1.4,0.64,1), border-color 0.22s ease;
}

.ritual-back::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-left: 1.35px solid currentColor;
  border-bottom: 1.35px solid currentColor;
  transform: translate(-37%, -50%) rotate(45deg);
  filter: drop-shadow(0 0 7px rgba(232,201,122,0.28));
}

.ritual-back:hover,
.ritual-back:focus-visible {
  border-color: rgba(201,168,76,0.48);
  color: var(--gold-l);
}

.ritual-kicker {
  color: var(--gold);
  font-size: 0.58rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.ritual-shell h2 {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  color: var(--gold-l);
  font-size: clamp(2.25rem, 9vw, 3.7rem);
  line-height: 1.05;
  text-shadow: 0 0 34px rgba(201,168,76,0.24);
}

.ritual-shell > p {
  max-width: 35ch;
  color: rgba(245,237,224,0.58);
  font-size: 0.92rem;
  line-height: 1.28;
  padding-top: 5px;
  margin-bottom: -5px;
}

.ritual-grid-wrap {
  width: 100%;
  position: relative;
  margin-top: 6px;
  min-height: 0;
  height: 100%;
  isolation: isolate;
  overflow: hidden;
}

.ritual-grid-wrap::before {
  content: '';
  position: absolute;
  z-index: 4;
  pointer-events: none;
  left: 0;
  right: 0;
  top: 0;
  height: 5px;
  background: linear-gradient(to bottom, rgba(14,6,13,0.64), rgba(14,6,13,0));
  opacity: 0.68;
}

.ritual-grid-wrap::after {
  content: '';
  position: absolute;
  z-index: 4;
  pointer-events: none;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: linear-gradient(to top, rgba(14,6,13,0.64), rgba(14,6,13,0));
  opacity: 0.68;
}

.ritual-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(128px, 1fr);
  align-content: stretch;
  gap: 8px;
  max-height: none;
  overflow: auto;
  padding: 5px 3px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ritual-grid::-webkit-scrollbar {
  display: none;
}

.ritual-card {
  min-height: 142px;
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 16px 12px;
  border: 1px solid rgba(201,168,76,0.17);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 10%, rgba(var(--mood-rgb),0.12), transparent 48%),
    linear-gradient(145deg, rgba(30,14,22,0.94), rgba(11,6,11,0.98));
  color: var(--cream);
  cursor: pointer;
  box-shadow: 0 24px 68px rgba(0,0,0,0.48), 0 0 54px rgba(201,69,90,0.05) inset;
  transition: transform 0.24s cubic-bezier(0.34,1.4,0.64,1), border-color 0.24s ease, box-shadow 0.24s ease;
}

.ritual-card::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(201,168,76,0.09);
  border-radius: 13px;
  pointer-events: none;
}

.ritual-card:hover,
.ritual-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(201,168,76,0.34);
  box-shadow: 0 30px 78px rgba(0,0,0,0.56), 0 0 76px rgba(201,168,76,0.08) inset;
}

.ritual-card.is-locked:hover,
.ritual-card.is-locked:focus-visible {
  transform: none;
  border-color: rgba(201,168,76,0.17);
  box-shadow: 0 24px 68px rgba(0,0,0,0.48), 0 0 54px rgba(201,69,90,0.05) inset;
}

.ritual-card > span {
  color: var(--gold-l);
  font-size: 1.7rem;
  line-height: 1;
  filter: drop-shadow(0 0 18px rgba(201,69,90,0.34));
}

.ritual-card strong {
  font-family: 'Playfair Display', serif;
  color: var(--gold-l);
  font-size: 1.25rem;
  line-height: 1.06;
}

.ritual-card em {
  max-width: 19ch;
  color: rgba(245,237,224,0.62);
  font-size: 0.78rem;
  line-height: 1.2;
  font-style: normal;
}

.ritual-card small {
  color: rgba(201,168,76,0.58);
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.ritual-card.is-classic {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent 36%),
    linear-gradient(145deg, rgba(21,10,17,0.94), rgba(9,5,10,0.98));
}

.ritual-card.is-locked {
  opacity: 0.58;
  filter: saturate(0.48) brightness(0.72);
  cursor: not-allowed;
}

.ritual-card.is-locked > span,
.ritual-card.is-locked strong,
.ritual-card.is-locked em {
  opacity: 0.72;
}

.ritual-card.is-done::after {
  content: '✦';
  position: absolute;
  right: 13px;
  top: 10px;
  color: rgba(232,201,122,0.72);
  font-size: 0.82rem;
}

.ritual-card.is-choice-open {
  transform: translateY(-3px) rotateY(180deg);
  border-color: rgba(201,168,76,0.38);
  box-shadow: 0 30px 78px rgba(0,0,0,0.58), 0 0 84px rgba(201,168,76,0.11) inset;
}

.ritual-card.is-choice-open > span,
.ritual-card.is-choice-open > strong,
.ritual-card.is-choice-open > em,
.ritual-card.is-choice-open > small {
  opacity: 0;
}

.ritual-play-choice {
  position: absolute;
  inset: 9px;
  z-index: 3;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 7px;
  place-items: center;
  padding: 11px 10px;
  border-radius: 13px;
  background:
    radial-gradient(circle at 50% 20%, rgba(201,168,76,0.12), transparent 58%),
    rgba(8,4,9,0.78);
  opacity: 0;
  transform: rotateY(180deg) scale(0.96);
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.3s cubic-bezier(0.34,1.4,0.64,1);
}

.ritual-card.is-choice-open .ritual-play-choice {
  opacity: 1;
  transform: rotateY(180deg) scale(1);
  pointer-events: auto;
}

.ritual-play-choice b {
  color: var(--gold-l);
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  line-height: 1;
}

.ritual-play-choice div {
  width: 100%;
  display: grid;
  gap: 7px;
  justify-items: center;
}

.ritual-play-choice button {
  min-height: 37px;
  width: min(100%, 210px);
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(201,168,76,0.24);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(201,168,76,0.10), rgba(201,69,90,0.08)),
    rgba(255,255,255,0.035);
  color: rgba(245,237,224,0.84);
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(0.58rem, 2.6vw, 0.72rem);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.34em;
  white-space: nowrap;
  padding: 0 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

.ritual-play-choice .play-label {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  color: inherit;
  font-family: inherit;
  font-size: inherit !important;
  font-style: normal;
  font-weight: 600;
  line-height: 1;
  letter-spacing: inherit !important;
  text-transform: inherit;
  filter: none !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ritual-play-choice .play-emoji {
  display: inline-block;
  flex: 0 0 auto;
  font-size: 0.92em;
  line-height: 1;
  opacity: 0.88;
  filter: grayscale(1) sepia(0.65) saturate(0.7) hue-rotate(348deg) brightness(1.34) contrast(0.92);
}

.ritual-play-choice button:active {
  transform: scale(0.97);
}

@keyframes mode-float {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -10px; }
}

@keyframes mode-never-in {
  0% {
    opacity: 0;
    filter: blur(16px);
    transform: translateX(-82vw) translateY(18px) translateZ(-180px) rotateY(42deg) rotateZ(-8deg);
  }
  62% { opacity: 1; }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateX(18px) rotateY(18deg) rotateZ(-1.2deg);
  }
}

@keyframes mode-td-in {
  0% {
    opacity: 0;
    filter: blur(16px);
    transform: translateX(82vw) translateY(18px) translateZ(-180px) rotateY(-42deg) rotateZ(8deg);
  }
  62% { opacity: 1; }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateX(-18px) rotateY(-18deg) rotateZ(1.2deg);
  }
}

@keyframes mode-never-current-in {
  0% {
    opacity: 0.18;
    filter: blur(16px) saturate(0.78) brightness(0.88);
    transform: translateX(-82vw) translateY(18px) translateZ(-180px) rotateY(42deg) rotateZ(-8deg);
  }
  100% {
    opacity: 0.74;
    filter: saturate(0.78) brightness(0.88);
    transform: translateX(18px) rotateY(18deg) rotateZ(-1.2deg);
  }
}

@keyframes mode-td-current-in {
  0% {
    opacity: 0.18;
    filter: blur(16px) saturate(0.78) brightness(0.88);
    transform: translateX(82vw) translateY(18px) translateZ(-180px) rotateY(-42deg) rotateZ(8deg);
  }
  100% {
    opacity: 0.74;
    filter: saturate(0.78) brightness(0.88);
    transform: translateX(-18px) rotateY(-18deg) rotateZ(1.2deg);
  }
}

#app {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--safe-top) + 16px) 20px calc(var(--safe-bot) + 12px);
  opacity: 0;
  transition: opacity 0.7s 0.1s ease;
  pointer-events: none;
}

#app.on { opacity:1; pointer-events: all; }

.hdr {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
  padding-bottom: 14px;
}

.hdr-brand {
  position: relative;
  display: block;
  min-width: max-content;
  min-height: 45px;
}

.hdr-logo {
  position: relative;
  display: block;
  overflow: visible;
  border: 0;
  background: transparent;
  padding: 0;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.82rem;
  line-height: 1;
  color: transparent;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: left;
  transition: transform 0.24s cubic-bezier(0.34,1.4,0.64,1), filter 0.24s ease;
}

.hdr-logo::before {
  content: 'Ignight';
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  padding: 0 0 0.4em;
  font: inherit;
  line-height: 1.16;
  letter-spacing: inherit;
  background: linear-gradient(125deg, var(--gold) 0%, var(--rose-l) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(201,168,76,0.3));
  pointer-events: none;
}

.hdr-logo:hover,
.hdr-logo:focus-visible {
  transform: translateY(-1px);
  filter: drop-shadow(0 0 18px rgba(201,168,76,0.46));
  outline: none;
}

.hdr-logo:active {
  transform: scale(0.96);
}

.game-label {
  position: absolute;
  top: 33px;
  left: 0;
  color: rgba(106,88,104,0.82);
  font-size: 0.6rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hdr-right {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  width: max-content;
}

.mini-lang {
  width: max-content;
  justify-content: flex-end;
}

.mini-lang .lang-btn {
  min-width: 24px;
  height: 21px;
  font-size: 0.54rem;
  padding: 0 5px;
}

.prog-bar {
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
}

.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--rose));
  border-radius: 2px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  transform-origin: left;
}

.prog-lbl {
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  color: rgba(122,96,112,0.68);
  text-transform: uppercase;
  text-align: right;
}

body.locale-swap .game-label,
body.locale-swap .prog-lbl,
body.locale-swap .tab,
body.locale-swap .front-hint,
body.locale-swap .badge,
body.locale-swap .c-text,
body.locale-swap .stat-lbl,
body.locale-swap .mode-card strong,
body.locale-swap .mode-card em,
body.locale-swap .after-card,
body.locale-swap [data-i18n] {
  animation: locale-swap 0.24s ease both;
}

@keyframes locale-swap {
  0% { opacity: 0.44; filter: blur(5px); }
  100% { opacity: 1; filter: blur(0); }
}

/* I keep splash language swaps on a filter transition so the entrance never restarts. */
#splash [data-i18n] {
  transition: filter 0.22s ease;
}
body.splash-lang-swap #splash [data-i18n] {
  filter: blur(5px);
  transition: none;
}

.tabs-wrap {
  width: 100%;
  flex-shrink: 0;
  position: relative;
  z-index: 46;
  overflow: visible;
}

.tabs {
  display: flex;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 13px;
  padding: 4px;
  position: relative;
}

.tab-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 9px;
  background: rgba(201,168,76,0.13);
  border: 1px solid rgba(201,168,76,0.32);
  box-shadow: 0 0 14px rgba(201,168,76,0.15), 0 0 0 1px rgba(201,168,76,0.05) inset;
  transition: left 0.38s cubic-bezier(0.34,1.4,0.64,1), width 0.38s cubic-bezier(0.34,1.4,0.64,1);
  pointer-events: none;
  will-change: left, width;
}

.tab {
  flex: 1;
  padding: 8px 2px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 9px;
  transition: color 0.3s ease;
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.tab.active { color: var(--gold-l); }

.tabs.is-ritual {
  background:
    radial-gradient(circle at 12% 50%, rgba(var(--mood-rgb),0.16), transparent 34%),
    rgba(255,255,255,0.035);
  border-color: rgba(201,168,76,0.14);
}

.tabs.is-ritual .tab,
.tabs.is-ritual .tab-pill {
  display: none;
}

.mp-bar {
  display: none;
  position: relative;
  z-index: 46;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 5px 5px 12px;
  border: 1px solid rgba(201,168,76,0.18);
  border-radius: 13px;
  background:
    radial-gradient(circle at 12% 50%, rgba(201,168,76,0.14), transparent 40%),
    linear-gradient(90deg, rgba(201,168,76,0.06), rgba(201,69,90,0.055)),
    rgba(255,255,255,0.032);
  box-shadow: 0 14px 38px rgba(0,0,0,0.22), 0 0 0 1px rgba(255,255,255,0.018) inset;
  overflow: visible;
}

body.mp-active .tabs {
  display: none;
}

body.mp-active .mp-bar {
  display: flex;
  animation: actions-flow-in 0.42s cubic-bezier(0.16,1,0.3,1) both;
}

body.mp-results .mp-bar {
  display: none;
}

.mp-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  text-align: left;
  cursor: default;
  touch-action: manipulation;
}

.mp-bar[data-copyable="true"] .mp-copy {
  cursor: pointer;
}

.mp-copy span {
  color: rgba(232,96,122,0.72);
  font-size: 0.48rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.mp-copy strong {
  overflow: hidden;
  color: var(--gold-l);
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.035em;
  line-height: 1.04;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-bar[data-copyable="true"] .mp-copy:hover strong,
.mp-bar[data-copyable="true"] .mp-copy:focus-visible strong {
  color: #fff2b9;
}

.mp-debug-panel {
  position: fixed;
  z-index: 1200;
  left: 10px;
  bottom: 10px;
  width: min(520px, calc(100vw - 20px));
  max-height: min(42dvh, 340px);
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid rgba(232,201,122,0.28);
  border-radius: 14px;
  background: rgba(7,4,9,0.88);
  box-shadow: 0 20px 70px rgba(0,0,0,0.48), 0 0 42px rgba(201,69,90,0.10);
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mp-debug-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border-bottom: 1px solid rgba(232,201,122,0.16);
}

.mp-debug-head b {
  flex: 1;
  color: var(--gold-l);
  font: 700 0.62rem/1 system-ui, sans-serif;
  letter-spacing: 0.18em;
}

.mp-debug-head button {
  border: 1px solid rgba(232,201,122,0.24);
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: rgba(245,237,224,0.82);
  font: 600 0.58rem/1 system-ui, sans-serif;
  padding: 5px 8px;
}

.mp-debug-log {
  margin: 0;
  padding: 8px;
  min-height: 110px;
  max-height: min(34dvh, 288px);
  overflow: auto;
  color: rgba(245,237,224,0.78);
  font: 500 0.62rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.mp-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.mp-emoji-wrap {
  position: relative;
  z-index: 1;
}

.mp-emoji-wrap.is-open {
  z-index: 90;
}

.mp-tool,
.mp-emoji-dial button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.24);
  background:
    radial-gradient(circle at 50% 38%, rgba(201,168,76,0.11), transparent 62%),
    rgba(0,0,0,0.18);
  color: rgba(245,237,224,0.82);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  box-shadow: 0 12px 28px rgba(0,0,0,0.25);
  transition: transform 0.16s cubic-bezier(0.34,1.4,0.64,1), opacity 0.2s ease, border-color 0.2s ease;
}

.mp-tool:active,
.mp-emoji-dial button:active {
  transform: scale(0.92);
}

.mp-tool:hover,
.mp-tool:focus-visible,
.mp-emoji-dial button:hover,
.mp-emoji-dial button:focus-visible {
  border-color: rgba(201,168,76,0.46);
}

.mp-camera {
  position: relative;
  font-size: 0;
  line-height: 0;
}

.mp-camera::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 17px;
  height: 12px;
  border: 1.45px solid currentColor;
  border-radius: 3.5px;
  transform: translate(-50%, -40%);
  background:
    linear-gradient(currentColor, currentColor) 3px -3px / 6px 4px no-repeat,
    radial-gradient(circle at 50% 52%, rgba(245,237,224,0.08), transparent 42%);
  box-shadow: 0 0 10px rgba(232,201,122,0.18);
}

.mp-camera::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border: 1.35px solid currentColor;
  border-radius: 50%;
  transform: translate(-50%, -40%);
  box-shadow: -6px -5px 0 -3.1px currentColor;
}

.mp-camera.is-off {
  opacity: 0.46;
}

.mp-camera.is-off::before {
  box-shadow: none;
}

.mp-camera.is-off i,
.mp-camera.is-off::after {
  opacity: 0.5;
}

.mp-camera.is-off {
  background:
    linear-gradient(135deg, transparent 43%, rgba(245,237,224,0.62) 46%, rgba(245,237,224,0.62) 53%, transparent 56%),
    radial-gradient(circle at 50% 38%, rgba(201,168,76,0.08), transparent 62%),
    rgba(0,0,0,0.18);
}

.mp-exit {
  position: relative;
  font-size: 0;
  line-height: 0;
  color: rgba(245,237,224,0.78);
}

.mp-exit::before,
.mp-exit::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 1.3px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 9px rgba(232,201,122,0.26);
}

.mp-exit::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.mp-emoji-dial {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 91;
  display: grid;
  grid-template-columns: repeat(4, 32px);
  gap: 5px;
  padding: 7px;
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 999px;
  background: rgba(9,5,10,0.84);
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
  pointer-events: none;
  filter: blur(5px);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 48px rgba(0,0,0,0.42);
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.34,1.4,0.64,1), filter 0.18s ease;
}

.mp-emoji-wrap.is-open .mp-emoji-dial {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  filter: blur(0);
}

.ritual-active-tab {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(201,168,76,0.26);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(201,168,76,0.08), rgba(var(--mood-rgb),0.08)),
    rgba(12,7,12,0.34);
  color: var(--gold-l);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  padding: 7px 10px 7px 14px;
  box-shadow: 0 0 22px rgba(var(--mood-rgb),0.08) inset;
}

.ritual-active-tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ritual-active-tab b {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: block;
  position: relative;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.28);
  background: rgba(0,0,0,0.18);
  color: rgba(245,237,224,0.76);
  font-size: 0;
  line-height: 0;
}

.ritual-active-tab b::before,
.ritual-active-tab b::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 1.2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.ritual-active-tab b::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.ritual-active-tab:hover,
.ritual-active-tab:focus-visible {
  border-color: rgba(201,168,76,0.46);
  box-shadow: 0 0 26px rgba(var(--mood-rgb),0.13) inset, 0 10px 30px rgba(0,0,0,0.2);
  outline: none;
}

.card-area {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 14px 0;
}

.card-area::before,
.card-area::after {
  content: '';
  position: absolute;
  pointer-events: none;
  opacity: 0;
  z-index: 0;
}

.card-area::before {
  inset: -58px -34px;
  border-radius: 40px;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(var(--mood-rgb),0.24), transparent 58%),
    radial-gradient(ellipse at 50% 70%, rgba(201,168,76,0.08), transparent 64%);
  filter: blur(22px);
  transform: scale(0.9);
  mix-blend-mode: screen;
}

.card-area::after {
  content: var(--mood-symbol);
  left: 50%;
  top: 50%;
  width: min(104%, 470px);
  transform: translate(-50%, -50%) scale(0.96);
  color: rgba(var(--mood-rgb),0.16);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(1.8rem, 9vw, 3.6rem);
  letter-spacing: 0.36em;
  text-align: center;
  text-shadow: 0 0 22px rgba(var(--mood-rgb),0.2);
  filter: blur(8px);
  mix-blend-mode: screen;
}

body.mood-pulse .card-area::before {
  animation: mood-breath-field 1.45s cubic-bezier(0.18,0.72,0.2,1) both;
}

body.mood-pulse .card-area::after {
  animation: mood-breath-glyphs 1.45s cubic-bezier(0.18,0.72,0.2,1) both;
}

body[data-mood="power"].mood-pulse .card-area::before,
body[data-mood="fire"].mood-pulse .card-area::before {
  animation-name: mood-breath-field-sharp;
}

body[data-mood="voyeur"].mood-pulse .card-area::after {
  letter-spacing: 0.52em;
  color: rgba(190,118,255,0.18);
}

@keyframes mood-breath-field {
  0% { opacity: 0; transform: scale(0.88); filter: blur(28px); }
  28% { opacity: 0.55; transform: scale(1.02); filter: blur(20px); }
  100% { opacity: 0; transform: scale(1.18); filter: blur(34px); }
}

@keyframes mood-breath-field-sharp {
  0% { opacity: 0; transform: scale(0.86); filter: blur(26px) saturate(1); }
  22% { opacity: 0.62; transform: scale(0.99); filter: blur(16px) saturate(1.25); }
  100% { opacity: 0; transform: scale(1.12); filter: blur(30px) saturate(1); }
}

@keyframes mood-breath-glyphs {
  0% { opacity: 0; filter: blur(10px); transform: translate(-50%, -50%) scale(0.94); }
  24% { opacity: 1; filter: blur(2px); transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; filter: blur(11px); transform: translate(-50%, -50%) scale(1.08); }
}

.bg-card,
.card-wrap {
  width: 100%;
  height: var(--card-h);
}

.bg-card {
  position: absolute;
  border-radius: 20px;
  background: linear-gradient(145deg, #1e0e16 0%, #100810 50%, #1b0a13 100%);
  border: 1px solid rgba(201,168,76,0.2);
  box-shadow: 0 0 0 1px rgba(201,168,76,0.04) inset, 0 28px 80px rgba(0,0,0,0.85), 0 0 80px rgba(201,69,90,0.12) inset;
  transform: scale(0.95) translateY(11px);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 28px;
  overflow: hidden;
}

.bg-card::before,
.bg-card::after,
.front::before,
.front::after {
  content: '';
  position: absolute;
  background: rgba(201,168,76,0.05);
  pointer-events: none;
}

.bg-card::before,
.front::before {
  left: 30px;
  right: 30px;
  height: 1px;
  top: 50%;
}

.bg-card::after,
.front::after {
  top: 30px;
  bottom: 30px;
  width: 1px;
  left: 50%;
}

.card-wrap {
  position: relative;
  perspective: 1100px;
  -webkit-perspective: 1100px;
  z-index: 3;
}

.mp-webcam-bubble {
  position: absolute;
  z-index: 14;
  top: 0;
  left: 0;
  width: min(34vw, 141px);
  aspect-ratio: 1 / 1;
  min-width: 97px;
  overflow: hidden;
  display: none;
  border: 1px solid rgba(232,201,122,0.34);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 16%, rgba(232,201,122,0.10), transparent 64px),
    #050207;
  box-shadow:
    0 18px 54px rgba(0,0,0,0.56),
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 0 32px rgba(201,69,90,0.10);
  opacity: 0;
  pointer-events: none;
  cursor: grab;
  transform: translate3d(var(--mp-webcam-x, 0px), var(--mp-webcam-y, 0px), 0) scale(0);
  transform-origin: 50% 50%;
  filter: blur(8px);
  transition:
    opacity 0.28s ease,
    transform 0.56s cubic-bezier(0.18,0.72,0.2,1),
    filter 0.3s ease,
    border-color 0.24s ease,
    box-shadow 0.24s ease;
  will-change: transform, opacity, filter;
}

body.mp-active .mp-webcam-bubble {
  display: block;
}

body.mp-active .mp-webcam-bubble.is-visible,
body.mp-active.mp-webcam-peek .mp-webcam-bubble {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(var(--mp-webcam-x, 0px), var(--mp-webcam-y, 0px), 0) scale(1);
  filter: blur(0);
}

.mp-webcam-bubble.is-dragging {
  cursor: grabbing;
  transition: opacity 0.18s ease, filter 0.18s ease;
  z-index: 20;
}

.mp-webcam-bubble.is-animating {
  transition: none !important;
}

.mp-webcam-bubble.is-minimizing {
  opacity: 0;
  pointer-events: none;
  transform: translate3d(var(--mp-webcam-x, 0px), var(--mp-webcam-y, 0px), 0) scale(0);
  filter: blur(10px);
}

.mp-webcam-bubble.is-preview {
  border-color: rgba(232,201,122,0.46);
  box-shadow:
    0 18px 54px rgba(0,0,0,0.56),
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 0 42px rgba(232,201,122,0.16),
    0 0 34px rgba(201,69,90,0.12);
}

.mp-webcam-bubble::after {
  content: '';
  position: absolute;
  z-index: 7;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #e8607a;
  box-shadow:
    0 0 0 1px rgba(255,210,218,0.24),
    0 0 18px rgba(232,96,122,0.66),
    0 0 36px rgba(201,69,90,0.32),
    0 0 54px rgba(201,69,90,0.16);
  animation: live-dot 2.15s ease-in-out infinite;
}

@keyframes live-dot {
  0%, 100% {
    opacity: 0.42;
  }
  50% {
    opacity: 1;
  }
}

.mp-video,
.mp-relay-image,
.mp-video-empty {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mp-video {
  object-fit: cover;
  opacity: 0;
  background: #050207;
  transition: opacity 0.28s ease, width 0.28s ease, height 0.28s ease, border-radius 0.28s ease;
}

.mp-relay-image {
  z-index: 2;
  display: block;
  object-fit: cover;
  opacity: 0;
  background: #050207;
  transition: opacity 0.3s ease;
}

.mp-video.is-remote {
  z-index: 1;
}

.mp-video.is-local {
  z-index: 3;
}

.mp-webcam-bubble.has-local:not(.has-remote) .mp-video.is-local,
.mp-webcam-bubble.has-remote .mp-video.is-remote {
  opacity: 1;
}

.mp-webcam-bubble.has-relay-remote:not(.remote-video-live) .mp-relay-image {
  opacity: 1;
}

.mp-webcam-bubble.has-relay-remote:not(.remote-video-live) .mp-video.is-remote {
  opacity: 0;
}

.mp-webcam-bubble.remote-video-live .mp-relay-image {
  opacity: 0;
}

.mp-webcam-bubble.has-remote.has-local .mp-video.is-local {
  inset: auto 7px 7px auto;
  width: 34%;
  height: 34%;
  border: 1px solid rgba(232,201,122,0.32);
  border-radius: 9px;
  opacity: 1;
  box-shadow: 0 8px 24px rgba(0,0,0,0.46);
}

.mp-video-empty {
  z-index: 4;
  display: grid;
  grid-auto-rows: max-content;
  align-content: center;
  justify-items: center;
  place-items: center;
  gap: 8px;
  padding: 24px 12px 16px;
  background:
    radial-gradient(circle at 50% 32%, rgba(201,69,90,0.16), transparent 70px),
    linear-gradient(145deg, rgba(5,2,7,0.82), rgba(5,2,7,0.95));
}

.mp-video-empty b {
  color: rgba(245,237,224,0.72);
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.045em;
  line-height: 1;
}

.mp-empty-camera {
  position: relative;
  width: 42px;
  height: 34px;
  border: 1px solid rgba(232,201,122,0.34);
  border-radius: 13px;
  background:
    radial-gradient(circle at 50% 48%, rgba(232,201,122,0.12), transparent 42%),
    rgba(255,255,255,0.035);
  box-shadow:
    0 10px 28px rgba(0,0,0,0.30),
    0 0 24px rgba(232,201,122,0.10);
}

.mp-empty-camera::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 14px;
  border: 1.55px solid rgba(245,237,224,0.68);
  border-radius: 4px;
  transform: translate(-50%, -38%);
  background:
    linear-gradient(rgba(245,237,224,0.68), rgba(245,237,224,0.68)) 3px -4px / 8px 4px no-repeat,
    radial-gradient(circle at 50% 52%, rgba(245,237,224,0.10), transparent 44%);
}

.mp-empty-camera::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border: 1.35px solid rgba(245,237,224,0.68);
  border-radius: 50%;
  transform: translate(-50%, -38%);
  box-shadow: -7px -5px 0 -3.2px rgba(245,237,224,0.68);
}

.mp-webcam-bubble.has-local .mp-video-empty,
.mp-webcam-bubble.has-remote .mp-video-empty {
  display: none;
}

.card-wrap::before {
  content: '';
  position: absolute;
  inset: -18px;
  border-radius: 28px;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(var(--mood-rgb),0.26), transparent 62%);
  filter: blur(18px);
  transform: scale(0.94);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

body.mood-pulse .card-wrap::before {
  animation: mood-card-breath 1.2s ease both;
}

@keyframes mood-card-breath {
  0% { opacity: 0; transform: scale(0.94); }
  24% { opacity: 0.58; }
  100% { opacity: 0; transform: scale(1.08); }
}

.deck-formation {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: var(--card-h);
  z-index: 2;
  pointer-events: none;
  perspective: 1100px;
  -webkit-perspective: 1100px;
  transform-style: flat;
  -webkit-transform-style: flat;
  transform: translateY(-50%);
  overflow: visible;
  contain: layout style;
}

body.forming-deck .deck-formation {
  z-index: 8;
}

body.forming-deck .card-wrap {
  z-index: 1;
}

.deck-formation-glow {
  position: absolute;
  left: 50%;
  top: 54%;
  width: min(74vw, 390px);
  height: min(74vw, 390px);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(232,201,122,0.24), rgba(201,69,90,0.12) 38%, transparent 68%);
  filter: blur(20px);
  will-change: transform, opacity;
}

.deck-formation-card {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 1px solid rgba(201,168,76,0.2);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.055), transparent 34%),
    linear-gradient(145deg, #1e0e16 0%, #100810 50%, #1b0a13 100%);
  box-shadow: 0 0 0 1px rgba(201,168,76,0.04) inset, 0 28px 80px rgba(0,0,0,0.85), 0 0 80px rgba(201,69,90,0.12) inset;
  opacity: 0;
  display: none;
  transform-style: flat;
  -webkit-transform-style: flat;
  will-change: transform, opacity, filter;
}

.deck-formation-card.is-live {
  display: block;
}

html.fx-medium .deck-formation-glow {
  filter: blur(14px);
}

html.fx-recommended .deck-formation-glow {
  filter: blur(10px);
  opacity: 0.58;
}

html.fx-medium .deck-formation-card {
  box-shadow: 0 0 0 1px rgba(201,168,76,0.04) inset, 0 22px 54px rgba(0,0,0,0.72), 0 0 48px rgba(201,69,90,0.09) inset;
}

html.fx-recommended .deck-formation-card {
  filter: none;
  box-shadow: 0 0 0 1px rgba(201,168,76,0.045) inset, 0 0 34px rgba(201,69,90,0.07) inset;
}

html.fx-recommended .deck-formation-card.is-landing {
  box-shadow: 0 0 0 1px rgba(201,168,76,0.055) inset, 0 22px 64px rgba(0,0,0,0.74), 0 0 66px rgba(201,69,90,0.11) inset;
}

html.fx-low .deck-formation-glow {
  filter: none;
  opacity: 0.4;
}

html.fx-low .deck-formation-card {
  filter: none !important;
  box-shadow: 0 0 0 1px rgba(201,168,76,0.04) inset, 0 18px 42px rgba(0,0,0,0.66), 0 0 28px rgba(201,69,90,0.07) inset;
}

.deck-formation-card::before,
.deck-formation-card::after {
  content: '';
  position: absolute;
  background: rgba(201,168,76,0.05);
  pointer-events: none;
}

.deck-formation-card::before {
  left: 30px;
  right: 30px;
  top: 50%;
  height: 1px;
}

.deck-formation-card::after {
  top: 30px;
  bottom: 30px;
  left: 50%;
  width: 1px;
}

.deck-formation.running .deck-formation-glow {
  animation: deck-formation-glow 1s ease both;
}

.deck-formation.running .deck-formation-card.is-live {
  animation: deck-sidecut var(--form-dur, 0.66s) var(--form-ease, cubic-bezier(0.12,0.9,0.18,1)) var(--delay) both;
}

.deck-formation.running.formation-sidecut .deck-formation-card.is-live.is-landing {
  animation-name: deck-sidecut-landing;
}

.deck-formation.running.formation-crown .deck-formation-card.is-live {
  animation-name: deck-crown-arc;
}

.deck-formation.running.formation-orbit .deck-formation-card.is-live {
  animation-name: deck-orbit-weave;
}

.deck-formation.running.formation-spiral .deck-formation-card.is-live {
  animation-name: deck-spiral-fall;
}

.deck-formation.running.formation-swan .deck-formation-card.is-live {
  animation-name: deck-swan-fan;
}

html.fx-recommended .deck-formation.running .deck-formation-card.is-live,
html.fx-low .deck-formation.running .deck-formation-card.is-live {
  animation-name: deck-sidecut-lite;
}

html.fx-recommended .deck-formation.running.formation-sidecut .deck-formation-card.is-live.is-landing,
html.fx-low .deck-formation.running.formation-sidecut .deck-formation-card.is-live.is-landing {
  animation-name: deck-sidecut-landing-lite;
}

html.fx-recommended .deck-formation.running.formation-crown .deck-formation-card.is-live,
html.fx-low .deck-formation.running.formation-crown .deck-formation-card.is-live {
  animation-name: deck-crown-arc-lite;
}

html.fx-recommended .deck-formation.running.formation-orbit .deck-formation-card.is-live,
html.fx-low .deck-formation.running.formation-orbit .deck-formation-card.is-live {
  animation-name: deck-orbit-weave-lite;
}

html.fx-recommended .deck-formation.running.formation-spiral .deck-formation-card.is-live,
html.fx-low .deck-formation.running.formation-spiral .deck-formation-card.is-live {
  animation-name: deck-spiral-fall-lite;
}

html.fx-recommended .deck-formation.running.formation-swan .deck-formation-card.is-live,
html.fx-low .deck-formation.running.formation-swan .deck-formation-card.is-live {
  animation-name: deck-swan-fan-lite;
}

.deck-formation-card.is-landing {
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 28px;
  background: linear-gradient(145deg, #1e0e16 0%, #100810 50%, #1b0a13 100%);
  --form-ease: cubic-bezier(0.17,0.82,0.08,1);
}

.deck-formation-card.is-landing .front-icon,
.deck-formation-card.is-landing .front-hint {
  position: relative;
  z-index: 3;
  opacity: 1;
  transform: none;
}

.card {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  --choice-face-opacity: 1;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  will-change: transform, opacity;
  touch-action: none;
  cursor: pointer;
  position: relative;
}

.card.deck-form-hidden {
  opacity: 0;
  filter: blur(10px);
  transform: scale(1.06) translateY(10px);
  pointer-events: none;
}

html.fx-recommended .card.deck-form-hidden,
html.fx-low .card.deck-form-hidden {
  filter: none;
  transform: scale(1.045) translateY(8px);
}

.card.deck-form-land {
  pointer-events: none;
  animation: deck-real-land 0.42s cubic-bezier(0.16,1,0.3,1) both;
}

html.fx-recommended .card.deck-form-land,
html.fx-low .card.deck-form-land {
  animation-name: deck-real-land-lite;
}

@keyframes deck-sidecut {
  0% {
    opacity: 0;
    filter: blur(12px);
    transform: translate3d(var(--from-x), var(--from-y), 0) rotateZ(var(--from-rz)) scale(0.98);
  }
  46% {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(var(--mid-x), var(--mid-y), 0) rotateZ(var(--mid-rz)) scale(1.04);
  }
  100% {
    opacity: var(--final-opacity);
    filter: blur(0);
    transform: translate3d(var(--to-x), var(--to-y), var(--to-z)) rotateZ(var(--to-rz)) scale(var(--to-scale));
  }
}

@keyframes deck-sidecut-landing {
  0% {
    opacity: 0;
    filter: blur(10px);
    transform: translate3d(var(--from-x), var(--from-y), 0) rotateZ(var(--from-rz)) scale(0.98);
  }
  42% {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(var(--mid-x), var(--mid-y), 0) rotateZ(var(--mid-rz)) scale(1);
  }
  78% {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, -10px, 0) rotateZ(0deg) scale(1);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) rotateZ(0deg) scale(1);
  }
}

@keyframes deck-crown-arc {
  0% {
    opacity: 0;
    filter: blur(6px);
    transform: translate3d(var(--wide-from-x), var(--wide-from-y), 0) rotateX(54deg) rotateY(var(--tilt-y)) rotateZ(var(--wide-from-rz)) scale(var(--start-scale, 0.72));
  }
  34% {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(var(--arc-x), var(--arc-y), 0) rotateX(16deg) rotateY(var(--tilt-y)) rotateZ(var(--arc-rz)) scale(var(--mid-scale, 1.04));
  }
  72% {
    opacity: 0.96;
    transform: translate3d(var(--fan-x), var(--fan-y), 0) rotateX(5deg) rotateY(0deg) rotateZ(var(--fan-rz)) scale(var(--pre-scale, 1.02));
  }
  100% {
    opacity: var(--final-opacity);
    filter: blur(0);
    transform: translate3d(var(--to-x), var(--to-y), 0) rotateX(0deg) rotateZ(var(--to-rz)) scale(var(--to-scale));
  }
}

@keyframes deck-orbit-weave {
  0% {
    opacity: 0;
    filter: blur(7px);
    transform: translate3d(var(--orbit-start-x), var(--orbit-start-y), 0) rotateX(62deg) rotateY(var(--tilt-y)) rotateZ(var(--wide-from-rz)) scale(var(--start-scale, 0.68));
  }
  30% {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(var(--orbit-mid-x), var(--orbit-mid-y), 0) rotateX(24deg) rotateY(var(--tilt-y)) rotateZ(var(--orbit-rz)) scale(var(--mid-scale, 1.06));
  }
  62% {
    opacity: 0.94;
    transform: translate3d(var(--weave-x), var(--weave-y), 0) rotateX(8deg) rotateY(calc(var(--tilt-y) * -0.35)) rotateZ(var(--weave-rz)) scale(var(--pre-scale, 1.01));
  }
  100% {
    opacity: var(--final-opacity);
    filter: blur(0);
    transform: translate3d(var(--to-x), var(--to-y), 0) rotateX(0deg) rotateZ(var(--to-rz)) scale(var(--to-scale));
  }
}

@keyframes deck-spiral-fall {
  0% {
    opacity: 0;
    filter: blur(7px);
    transform: translate3d(var(--spiral-a-x), var(--spiral-a-y), 0) rotateX(70deg) rotateY(var(--tilt-y)) rotateZ(calc(var(--spiral-rz) - 120deg)) scale(var(--start-scale, 0.58));
  }
  30% {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(var(--spiral-b-x), var(--spiral-b-y), 0) rotateX(32deg) rotateY(calc(var(--tilt-y) * 0.4)) rotateZ(var(--spiral-rz)) scale(var(--mid-scale, 0.94));
  }
  66% {
    opacity: 0.98;
    transform: translate3d(var(--spiral-c-x), var(--spiral-c-y), 0) rotateX(9deg) rotateY(0deg) rotateZ(var(--spiral-end-rz)) scale(var(--pre-scale, 1.04));
  }
  100% {
    opacity: var(--final-opacity);
    filter: blur(0);
    transform: translate3d(var(--to-x), var(--to-y), 0) rotateX(0deg) rotateZ(var(--to-rz)) scale(var(--to-scale));
  }
}

@keyframes deck-swan-fan {
  0% {
    opacity: 0;
    filter: blur(6px);
    transform: translate3d(var(--swan-start-x), var(--swan-start-y), 0) rotateX(58deg) rotateY(var(--tilt-y)) rotateZ(var(--wide-from-rz)) scale(var(--start-scale, 0.64));
  }
  36% {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(var(--swan-wing-x), var(--swan-wing-y), 0) rotateX(20deg) rotateY(var(--tilt-y)) rotateZ(var(--swan-wing-rz)) scale(var(--mid-scale, 1.05));
  }
  74% {
    opacity: 0.98;
    transform: translate3d(var(--swan-fan-x), var(--swan-fan-y), 0) rotateX(4deg) rotateY(0deg) rotateZ(var(--swan-fan-rz)) scale(var(--pre-scale, 1.03));
  }
  100% {
    opacity: var(--final-opacity);
    filter: blur(0);
    transform: translate3d(var(--to-x), var(--to-y), 0) rotateX(0deg) rotateZ(var(--to-rz)) scale(var(--to-scale));
  }
}

@keyframes deck-real-land {
  from { opacity: 0; filter: blur(10px); transform: scale(1.06) translateY(10px); }
  to { opacity: 1; filter: blur(0); transform: scale(1) translateY(0); }
}

@keyframes deck-sidecut-lite {
  0% {
    opacity: 0;
    transform: translate3d(var(--from-x), var(--from-y), 0) rotateZ(var(--from-rz)) scale(0.98);
  }
  46% {
    opacity: 1;
    transform: translate3d(var(--mid-x), var(--mid-y), 0) rotateZ(var(--mid-rz)) scale(1.04);
  }
  100% {
    opacity: var(--final-opacity);
    transform: translate3d(var(--to-x), var(--to-y), var(--to-z)) rotateZ(var(--to-rz)) scale(var(--to-scale));
  }
}

@keyframes deck-sidecut-landing-lite {
  0% {
    opacity: 0;
    transform: translate3d(var(--from-x), var(--from-y), 0) rotateZ(var(--from-rz)) scale(0.98);
  }
  42% {
    opacity: 1;
    transform: translate3d(var(--mid-x), var(--mid-y), 0) rotateZ(var(--mid-rz)) scale(1);
  }
  78% {
    opacity: 1;
    transform: translate3d(0, -10px, 0) rotateZ(0deg) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateZ(0deg) scale(1);
  }
}

@keyframes deck-crown-arc-lite {
  0% {
    opacity: 0;
    transform: translate3d(var(--wide-from-x), var(--wide-from-y), 0) rotateX(54deg) rotateY(var(--tilt-y)) rotateZ(var(--wide-from-rz)) scale(var(--start-scale, 0.72));
  }
  34% {
    opacity: 1;
    transform: translate3d(var(--arc-x), var(--arc-y), 0) rotateX(16deg) rotateY(var(--tilt-y)) rotateZ(var(--arc-rz)) scale(var(--mid-scale, 1.04));
  }
  72% {
    opacity: 0.96;
    transform: translate3d(var(--fan-x), var(--fan-y), 0) rotateX(5deg) rotateY(0deg) rotateZ(var(--fan-rz)) scale(var(--pre-scale, 1.02));
  }
  100% {
    opacity: var(--final-opacity);
    transform: translate3d(var(--to-x), var(--to-y), 0) rotateX(0deg) rotateZ(var(--to-rz)) scale(var(--to-scale));
  }
}

@keyframes deck-orbit-weave-lite {
  0% {
    opacity: 0;
    transform: translate3d(var(--orbit-start-x), var(--orbit-start-y), 0) rotateX(62deg) rotateY(var(--tilt-y)) rotateZ(var(--wide-from-rz)) scale(var(--start-scale, 0.68));
  }
  30% {
    opacity: 1;
    transform: translate3d(var(--orbit-mid-x), var(--orbit-mid-y), 0) rotateX(24deg) rotateY(var(--tilt-y)) rotateZ(var(--orbit-rz)) scale(var(--mid-scale, 1.06));
  }
  62% {
    opacity: 0.94;
    transform: translate3d(var(--weave-x), var(--weave-y), 0) rotateX(8deg) rotateY(calc(var(--tilt-y) * -0.35)) rotateZ(var(--weave-rz)) scale(var(--pre-scale, 1.01));
  }
  100% {
    opacity: var(--final-opacity);
    transform: translate3d(var(--to-x), var(--to-y), 0) rotateX(0deg) rotateZ(var(--to-rz)) scale(var(--to-scale));
  }
}

@keyframes deck-spiral-fall-lite {
  0% {
    opacity: 0;
    transform: translate3d(var(--spiral-a-x), var(--spiral-a-y), 0) rotateX(70deg) rotateY(var(--tilt-y)) rotateZ(calc(var(--spiral-rz) - 120deg)) scale(var(--start-scale, 0.58));
  }
  30% {
    opacity: 1;
    transform: translate3d(var(--spiral-b-x), var(--spiral-b-y), 0) rotateX(32deg) rotateY(calc(var(--tilt-y) * 0.4)) rotateZ(var(--spiral-rz)) scale(var(--mid-scale, 0.94));
  }
  66% {
    opacity: 0.98;
    transform: translate3d(var(--spiral-c-x), var(--spiral-c-y), 0) rotateX(9deg) rotateY(0deg) rotateZ(var(--spiral-end-rz)) scale(var(--pre-scale, 1.04));
  }
  100% {
    opacity: var(--final-opacity);
    transform: translate3d(var(--to-x), var(--to-y), 0) rotateX(0deg) rotateZ(var(--to-rz)) scale(var(--to-scale));
  }
}

@keyframes deck-swan-fan-lite {
  0% {
    opacity: 0;
    transform: translate3d(var(--swan-start-x), var(--swan-start-y), 0) rotateX(58deg) rotateY(var(--tilt-y)) rotateZ(var(--wide-from-rz)) scale(var(--start-scale, 0.64));
  }
  36% {
    opacity: 1;
    transform: translate3d(var(--swan-wing-x), var(--swan-wing-y), 0) rotateX(20deg) rotateY(var(--tilt-y)) rotateZ(var(--swan-wing-rz)) scale(var(--mid-scale, 1.05));
  }
  74% {
    opacity: 0.98;
    transform: translate3d(var(--swan-fan-x), var(--swan-fan-y), 0) rotateX(4deg) rotateY(0deg) rotateZ(var(--swan-fan-rz)) scale(var(--pre-scale, 1.03));
  }
  100% {
    opacity: var(--final-opacity);
    transform: translate3d(var(--to-x), var(--to-y), 0) rotateX(0deg) rotateZ(var(--to-rz)) scale(var(--to-scale));
  }
}

@keyframes deck-real-land-lite {
  from { opacity: 0; transform: scale(1.045) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes deck-formation-glow {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.44); }
  36% { opacity: 0.82; }
  100% { opacity: 0.46; transform: translate(-50%, -50%) scale(1.08); }
}

.face {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 28px;
  overflow: hidden;
  transition: transform 0.62s cubic-bezier(0.4,0,0.2,1), opacity 0.12s ease, visibility 0s linear 0.12s;
}

.front {
  transform: rotateY(0deg);
  -webkit-transform: rotateY(0deg);
  background: linear-gradient(145deg, #1e0e16 0%, #100810 50%, #1b0a13 100%);
  border: 1px solid rgba(201,168,76,0.2);
  box-shadow: 0 0 0 1px rgba(201,168,76,0.04) inset, 0 28px 80px rgba(0,0,0,0.85), 0 0 80px rgba(201,69,90,0.12) inset;
  opacity: 1;
  visibility: visible;
}

.card.td-tutorial .front {
  border-color: rgba(201,168,76,0.34);
  box-shadow: 0 0 0 1px rgba(201,168,76,0.07) inset, 0 28px 80px rgba(0,0,0,0.85), 0 0 90px rgba(201,69,90,0.16) inset;
}

.card.never-tutorial .back {
  border-color: rgba(201,168,76,0.34);
  box-shadow: 0 28px 80px rgba(0,0,0,0.85), 0 0 80px rgba(201,168,76,0.1) inset;
}

.corner {
  position: absolute;
  width: 26px;
  height: 26px;
  opacity: 0.28;
  transition: opacity 0.3s;
}

.corner svg { width: 100%; height: 100%; }
.corner.tl { top: 13px; left: 13px; }
.corner.tr { top: 13px; right: 13px; transform: rotate(90deg); }
.corner.bl { bottom: 13px; left: 13px; transform: rotate(-90deg); }
.corner.br { bottom: 13px; right: 13px; transform: rotate(180deg); }

.front-icon {
  font-size: 3.4rem;
  opacity: var(--choice-face-opacity, 1);
  filter: drop-shadow(0 0 28px rgba(201,69,90,0.95));
  animation: breathe 2.8s ease-in-out infinite;
  margin-bottom: 14px;
  transition: opacity 0.1s ease;
}

@keyframes breathe {
  0%,100% { transform: scale(1); filter: drop-shadow(0 0 28px rgba(201,69,90,0.95)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 50px rgba(255,60,80,1)); }
}

.front-hint {
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  animation: hint-blink 2.2s ease-in-out infinite;
}

body.forming-deck .front-hint,
body.forming-deck .deck-formation-card.is-landing .front-hint {
  animation: none;
  opacity: 0.58;
}

@keyframes hint-blink {
  0%,100% { opacity:0.35; }
  50% { opacity:0.85; }
}

.back {
  transform: rotateY(-180deg);
  -webkit-transform: rotateY(-180deg);
  border: 1px solid rgba(201,69,90,0.18);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.62s cubic-bezier(0.4,0,0.2,1), background 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease, opacity 0.12s ease, visibility 0s linear 0.12s;
}

.back.t-warm {
  background: linear-gradient(145deg, #180e13 0%, #100a10 100%);
  border-color: rgba(201,168,76,0.2);
  box-shadow: 0 28px 80px rgba(0,0,0,0.85), 0 0 60px rgba(201,168,76,0.07) inset;
}

.back.t-hot {
  background: linear-gradient(145deg, #1c0810 0%, #0f0509 100%);
  border-color: rgba(201,69,90,0.25);
  box-shadow: 0 28px 80px rgba(0,0,0,0.85), 0 0 60px rgba(201,69,90,0.12) inset;
}

.back.t-fire {
  background: linear-gradient(145deg, #230509 0%, #140305 100%);
  border-color: rgba(255,70,90,0.3);
  box-shadow: 0 28px 80px rgba(0,0,0,0.9), 0 0 100px rgba(255,50,70,0.18) inset;
}

.badge {
  font-size: 0.63rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 22px;
  opacity: 0;
  filter: blur(10px);
  transform: scale(1.1);
  transition: opacity 0.4s 0.32s ease, filter 0.42s 0.32s ease, transform 0.45s 0.32s cubic-bezier(0.34,1.5,0.64,1);
}

.t-warm .badge { color: var(--gold); border: 1px solid rgba(201,168,76,0.35); background: rgba(201,168,76,0.09); }
.t-hot .badge { color: var(--rose-l); border: 1px solid rgba(201,69,90,0.35); background: rgba(201,69,90,0.09); }
.t-fire .badge { color: #ff8fa2; border: 1px solid rgba(255,70,90,0.42); background: rgba(255,50,75,0.11); }

.c-text {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1rem, 3.9vw, 1.28rem);
  line-height: 1.62;
  text-align: center;
  color: var(--cream);
  opacity: 0;
  filter: blur(10px);
  transform: scale(1.1);
  transition: opacity 0.5s 0.46s ease, filter 0.5s 0.46s ease, transform 0.5s 0.46s cubic-bezier(0.34,1.4,0.64,1);
}

.c-emoji {
  font-size: 2.1rem;
  margin-top: 22px;
  opacity: 0;
  transform: scale(0.3);
  transition: opacity 0.4s 0.62s ease, transform 0.55s 0.62s cubic-bezier(0.34,1.7,0.64,1);
}

.back.shown .badge,
.back.shown .c-text,
.back.shown .c-emoji {
  opacity: 1;
  filter: blur(0);
  transform: none;
}

.dir-left,
.dir-right {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, filter 0.12s ease;
  z-index: 5;
  text-align: center;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(46px);
}

.dir-left::before,
.dir-right::before {
  content: '';
  position: absolute;
  inset: -18%;
  opacity: 0.9;
  pointer-events: none;
}

.dir-left::after,
.dir-right::after {
  width: min(92%, 380px);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(2.5rem, 12vw, 4.65rem);
  line-height: 0.96;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  font-weight: 700;
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.dir-emoji {
  position: relative;
  z-index: 1;
  font-size: clamp(3.9rem, 17vw, 5.8rem);
  line-height: 1;
}

.dir-right {
  color: #f6ddff;
  background: radial-gradient(circle at 50% 42%, rgba(236,112,255,0.44), transparent 44%), rgba(139,27,255,0.24);
  box-shadow: 0 0 44px rgba(186,74,255,0.78), 0 0 120px rgba(209,53,255,0.45) inset;
}

.dir-right::before {
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.17), transparent 28%), radial-gradient(circle at 50% 50%, rgba(191,60,255,0.65), transparent 62%);
  filter: blur(18px);
}

.dir-right::after {
  content: attr(data-label);
  background: linear-gradient(125deg, #fff6ff 0%, #f5ddff 42%, #d486ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 14px rgba(255,255,255,0.45)) drop-shadow(0 0 34px rgba(220,90,255,0.9));
}

.dir-left {
  color: #e9f8ff;
  background: radial-gradient(circle at 50% 40%, rgba(214,244,255,0.51), transparent 45%), rgba(126,211,255,0.21);
  box-shadow: 0 0 36px rgba(136,224,255,0.54), 0 0 110px rgba(173,230,255,0.42) inset;
}

.dir-left::before {
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.21), transparent 26%), radial-gradient(circle at 50% 50%, rgba(151,222,255,0.57), transparent 64%);
  filter: blur(18px);
}

.dir-left::after {
  content: attr(data-label);
  background: linear-gradient(125deg, #ffffff 0%, #def6ff 44%, #7ed3ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 14px rgba(255,255,255,0.42)) drop-shadow(0 0 32px rgba(128,220,255,0.8));
}

body[data-game="truthOrDare"] .dir-left {
  color: #fff0a7;
  background: radial-gradient(circle at 50% 42%, rgba(255,210,72,0.44), transparent 44%), rgba(190,126,18,0.25);
  box-shadow: 0 0 42px rgba(255,203,62,0.55), 0 0 120px rgba(255,180,28,0.36) inset;
}

body[data-game="truthOrDare"] .dir-left::before {
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.2), transparent 26%), radial-gradient(circle at 50% 50%, rgba(255,198,46,0.66), transparent 64%);
  filter: blur(18px);
}

body[data-game="truthOrDare"] .dir-left::after {
  background: linear-gradient(125deg, #fffaf0 0%, #ffe68d 44%, #ffb72d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 14px rgba(255,246,210,0.48)) drop-shadow(0 0 32px rgba(255,186,34,0.82));
}

body[data-game="truthOrDare"] .dir-right {
  color: #ffd4dc;
  background: radial-gradient(circle at 50% 42%, rgba(255,75,94,0.48), transparent 44%), rgba(156,13,38,0.3);
  box-shadow: 0 0 46px rgba(255,62,82,0.68), 0 0 128px rgba(210,18,50,0.46) inset;
}

body[data-game="truthOrDare"] .dir-right::before {
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.16), transparent 26%), radial-gradient(circle at 50% 50%, rgba(255,54,82,0.68), transparent 64%);
  filter: blur(18px);
}

body[data-game="truthOrDare"] .dir-right::after {
  background: linear-gradient(125deg, #fff4f5 0%, #ffc1ca 42%, #ff4964 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 14px rgba(255,225,230,0.48)) drop-shadow(0 0 34px rgba(255,66,88,0.88));
}

body[data-game="truthOrDare"][data-td-phase="result"] .dir-left {
  color: #e9f8ff;
  background: radial-gradient(circle at 50% 40%, rgba(214,244,255,0.51), transparent 45%), rgba(126,211,255,0.21);
  box-shadow: 0 0 36px rgba(136,224,255,0.54), 0 0 110px rgba(173,230,255,0.42) inset;
}

body[data-game="truthOrDare"][data-td-phase="result"] .dir-left::before {
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.21), transparent 26%), radial-gradient(circle at 50% 50%, rgba(151,222,255,0.57), transparent 64%);
}

body[data-game="truthOrDare"][data-td-phase="result"] .dir-left::after {
  background: linear-gradient(125deg, #ffffff 0%, #def6ff 44%, #7ed3ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 14px rgba(255,255,255,0.42)) drop-shadow(0 0 32px rgba(128,220,255,0.8));
}

body[data-game="truthOrDare"][data-td-phase="result"] .dir-right {
  color: #f6ddff;
  background: radial-gradient(circle at 50% 42%, rgba(236,112,255,0.44), transparent 44%), rgba(139,27,255,0.24);
  box-shadow: 0 0 44px rgba(186,74,255,0.78), 0 0 120px rgba(209,53,255,0.45) inset;
}

body[data-game="truthOrDare"][data-td-phase="result"] .dir-right::before {
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.17), transparent 28%), radial-gradient(circle at 50% 50%, rgba(191,60,255,0.65), transparent 62%);
}

body[data-game="truthOrDare"][data-td-phase="result"] .dir-right::after {
  background: linear-gradient(125deg, #fff6ff 0%, #f5ddff 42%, #d486ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 14px rgba(255,255,255,0.45)) drop-shadow(0 0 34px rgba(220,90,255,0.9));
}

.card.do-flip {
  transform: none;
}

.card.do-flip .front {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  opacity: 0;
  visibility: hidden;
  transition-delay: 0s;
}

.card.do-flip .back {
  transform: rotateY(0deg);
  -webkit-transform: rotateY(0deg);
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

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

.ember {
  position: absolute;
  bottom: 28%;
  border-radius: 50%;
  opacity: 0;
  animation: ember-rise linear forwards;
}

.ember.mood-glyph {
  width: auto !important;
  height: auto !important;
  color: rgba(var(--mood-rgb),0.32);
  font-family: 'Playfair Display', serif;
  font-size: 0.86rem;
  text-shadow: 0 0 18px rgba(var(--mood-rgb),0.22);
  filter: blur(0.15px);
}

.emoji-rain {
  position: absolute;
  bottom: -3rem;
  font-size: var(--rain-size, 1.35rem);
  opacity: 0;
  line-height: 1;
  isolation: isolate;
  text-shadow:
    0 0 7px rgba(255,255,255,0.5),
    0 0 18px var(--rain-glow, rgba(218,75,255,0.56)),
    0 0 36px var(--rain-glow, rgba(218,75,255,0.34)),
    0 0 58px var(--rain-hot, rgba(246,194,255,0.2));
  filter:
    drop-shadow(0 0 10px rgba(255,255,255,0.22))
    drop-shadow(0 0 18px var(--rain-glow, rgba(218,75,255,0.56)));
  animation: emoji-rain-rise var(--rain-dur, 3.2s) cubic-bezier(0.18,0.82,0.2,1) var(--rain-delay, 0s) forwards;
  will-change: transform, opacity;
}

.emoji-rain::before,
.emoji-rain::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle, rgba(255,255,255,0.86) 0 18%, var(--rain-spark, rgba(229,91,255,0.48)) 22% 42%, transparent 70%);
  filter: blur(0.2px);
  opacity: 0;
  animation: emoji-rain-spark var(--rain-dur, 3.2s) cubic-bezier(0.18,0.82,0.2,1) var(--rain-delay, 0s) forwards;
}

.emoji-rain::before {
  transform-origin: -1.2rem 1.1rem;
}

.emoji-rain::after {
  width: 0.26rem;
  height: 0.26rem;
  transform-origin: 1.5rem -0.8rem;
  animation-delay: calc(var(--rain-delay, 0s) + 0.16s);
}

.emoji-rain.is-angel {
  filter:
    drop-shadow(0 0 10px rgba(255,255,255,0.24))
    drop-shadow(0 0 20px var(--rain-glow, rgba(126,211,255,0.58)));
}

.emoji-rain.is-devil {
  filter:
    drop-shadow(0 0 10px rgba(255,255,255,0.22))
    drop-shadow(0 0 21px var(--rain-glow, rgba(218,75,255,0.62)));
}

@keyframes ember-rise {
  0% { opacity:0; transform:translateY(0) scale(1) rotate(0deg); }
  8% { opacity:1; }
  75% { opacity:0.7; }
  100% { opacity:0; transform:translateY(-65vh) scale(0.15) rotate(540deg); }
}

@keyframes emoji-rain-rise {
  0% {
    opacity: 0;
    transform: translate3d(var(--rain-x0, 0px), 0, 0) scale(0.68) rotate(0deg);
  }
  10% {
    opacity: 0.86;
  }
  32% {
    transform: translate3d(var(--rain-x1, 0px), -28vh, 0) scale(1.1) rotate(var(--rain-rot-mid, 12deg));
  }
  62% {
    opacity: 0.68;
    transform: translate3d(var(--rain-x2, 0px), -64vh, 0) scale(0.94) rotate(calc(var(--rain-rot, 0deg) * 0.55));
  }
  86% {
    opacity: 0.4;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--rain-x3, 0px), -104vh, 0) scale(1.14) rotate(var(--rain-rot, 0deg));
  }
}

@keyframes emoji-rain-spark {
  0%, 12% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg) translate3d(0, 0, 0) scale(0.4);
  }
  26% {
    opacity: 0.72;
    transform: translate(-50%, -50%) rotate(48deg) translate3d(-1.25rem, 0.6rem, 0) scale(1);
  }
  58% {
    opacity: 0.52;
    transform: translate(-50%, -50%) rotate(126deg) translate3d(1.55rem, -0.9rem, 0) scale(0.78);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(220deg) translate3d(-0.5rem, -2.2rem, 0) scale(0.35);
  }
}

.actions {
  width: 100%;
  height: 100%;
  display: flex;
  gap: 10px;
  position: absolute;
  inset: 0;
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
  will-change: opacity, filter, transform;
}

.actions-slot {
  width: 100%;
  height: 58px;
  flex: 0 0 58px;
  position: relative;
  margin-bottom: 10px;
}

.actions.hidden { display: none; }

.actions.flow-enter {
  animation: actions-flow-in 0.42s cubic-bezier(0.16,1,0.3,1) both;
}

.actions.flow-exit {
  pointer-events: none;
  animation: actions-flow-out 0.26s cubic-bezier(0.5,0,0.75,0) both;
}

.actions.flow-enter .btn {
  animation: btn-single-in 0.48s cubic-bezier(0.16,1,0.3,1) both;
}

.actions.flow-exit .btn {
  animation: btn-single-out 0.26s cubic-bezier(0.5,0,0.75,0) both;
}

.actions.flow-enter .btn:first-child:not(:only-child) {
  animation-name: btn-left-in;
}

.actions.flow-enter .btn:last-child:not(:only-child) {
  animation-name: btn-right-in;
}

.actions.flow-exit .btn:first-child:not(:only-child) {
  animation-name: btn-left-out;
}

.actions.flow-exit .btn:last-child:not(:only-child) {
  animation-name: btn-right-out;
}

@keyframes actions-flow-in {
  from { opacity: 0; filter: blur(10px); transform: scale(1.04); }
  to { opacity: 1; filter: blur(0); transform: scale(1); }
}

@keyframes actions-flow-out {
  from { opacity: 1; filter: blur(0); transform: scale(1); }
  to { opacity: 0; filter: blur(8px); transform: scale(0.98); }
}

@keyframes btn-single-in {
  from { opacity: 0; filter: blur(10px); transform: translateY(80px) scale(1.04); }
  to { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}

@keyframes btn-single-out {
  from { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
  to { opacity: 0; filter: blur(8px); transform: translateY(70px) scale(0.98); }
}

@keyframes btn-left-in {
  from { opacity: 0; filter: blur(10px); transform: translateX(-62vw) scale(1.04); }
  to { opacity: 1; filter: blur(0); transform: translateX(0) scale(1); }
}

@keyframes btn-right-in {
  from { opacity: 0; filter: blur(10px); transform: translateX(62vw) scale(1.04); }
  to { opacity: 1; filter: blur(0); transform: translateX(0) scale(1); }
}

@keyframes btn-left-out {
  from { opacity: 1; filter: blur(0); transform: translateX(0) scale(1); }
  to { opacity: 0; filter: blur(8px); transform: translateX(-58vw) scale(0.98); }
}

@keyframes btn-right-out {
  from { opacity: 1; filter: blur(0); transform: translateX(0) scale(1); }
  to { opacity: 0; filter: blur(8px); transform: translateX(58vw) scale(0.98); }
}

html.fx-recommended .actions.flow-enter,
html.fx-low .actions.flow-enter {
  animation-name: actions-flow-in-lite;
}

html.fx-recommended .actions.flow-exit,
html.fx-low .actions.flow-exit {
  animation-name: actions-flow-out-lite;
}

html.fx-recommended .actions.flow-enter .btn,
html.fx-low .actions.flow-enter .btn {
  animation-name: btn-single-in-lite;
}

html.fx-recommended .actions.flow-exit .btn,
html.fx-low .actions.flow-exit .btn {
  animation-name: btn-single-out-lite;
}

html.fx-recommended .actions.flow-enter .btn:first-child:not(:only-child),
html.fx-low .actions.flow-enter .btn:first-child:not(:only-child) {
  animation-name: btn-left-in-lite;
}

html.fx-recommended .actions.flow-enter .btn:last-child:not(:only-child),
html.fx-low .actions.flow-enter .btn:last-child:not(:only-child) {
  animation-name: btn-right-in-lite;
}

html.fx-recommended .actions.flow-exit .btn:first-child:not(:only-child),
html.fx-low .actions.flow-exit .btn:first-child:not(:only-child) {
  animation-name: btn-left-out-lite;
}

html.fx-recommended .actions.flow-exit .btn:last-child:not(:only-child),
html.fx-low .actions.flow-exit .btn:last-child:not(:only-child) {
  animation-name: btn-right-out-lite;
}

@keyframes actions-flow-in-lite {
  from { opacity: 0; transform: scale(1.025); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes actions-flow-out-lite {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.985); }
}

@keyframes btn-single-in-lite {
  from { opacity: 0; transform: translateY(72px) scale(1.025); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes btn-single-out-lite {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(62px) scale(0.985); }
}

@keyframes btn-left-in-lite {
  from { opacity: 0; transform: translateX(-62vw) scale(1.025); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes btn-right-in-lite {
  from { opacity: 0; transform: translateX(62vw) scale(1.025); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes btn-left-out-lite {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(-58vw) scale(0.985); }
}

@keyframes btn-right-out-lite {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(58vw) scale(0.985); }
}

.btn {
  border: none;
  border-radius: 14px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.98rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.12s cubic-bezier(0.34,1.5,0.64,1), box-shadow 0.2s ease;
  -webkit-user-select: none;
}

.btn:active { transform: scale(0.94) !important; }

.btn:disabled {
  opacity: 0.34;
  cursor: default;
  box-shadow: none;
}

.btn:disabled:active { transform: none !important; }

.btn::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,0.3);
  top: var(--ry, 50%);
  left: var(--rx, 50%);
  transform: translate(-50%,-50%) scale(0);
  opacity: 0;
}

.btn.rip::after {
  transition: transform 0.42s ease, opacity 0.42s ease;
  transform: translate(-50%,-50%) scale(45);
  opacity: 0;
}

.btn-draw {
  flex: 1;
  padding: 17px;
  background: linear-gradient(135deg, rgba(201,168,76,0.16), rgba(201,69,90,0.1));
  border: 1px solid rgba(201,168,76,0.38);
  color: var(--gold-l);
  box-shadow: 0 0 24px rgba(201,168,76,0.1);
  animation: btn-idle 3s ease-in-out infinite;
}

html.fx-recommended .btn-draw,
html.fx-low .btn-draw {
  animation: none;
  box-shadow: 0 0 26px rgba(201,168,76,0.15);
}

@keyframes btn-idle {
  0%,100% { box-shadow: 0 0 24px rgba(201,168,76,0.10); }
  50% { box-shadow: 0 0 36px rgba(201,168,76,0.20); }
}

.btn-never {
  flex: 1;
  padding: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(126,211,255,0.24);
  color: #ccefff;
}

.btn-yes {
  flex: 1.5;
  padding: 14px;
  background: linear-gradient(135deg, rgba(201,168,76,0.14), rgba(201,69,90,0.09));
  border: 1px solid rgba(201,168,76,0.33);
  color: var(--gold-l);
  box-shadow: 0 0 20px rgba(201,168,76,0.08);
}

.btn-truth,
.btn-dare,
.btn-done,
.btn-skip {
  flex: 1;
  padding: 14px;
}

.btn-truth {
  color: var(--gold-l);
  background: linear-gradient(135deg, rgba(201,168,76,0.15), rgba(255,255,255,0.035));
  border: 1px solid rgba(201,168,76,0.34);
  box-shadow: 0 0 20px rgba(201,168,76,0.08);
}

.btn-dare {
  color: #ffd4dc;
  background: linear-gradient(135deg, rgba(201,69,90,0.16), rgba(80,10,28,0.18));
  border: 1px solid rgba(201,69,90,0.34);
  box-shadow: 0 0 20px rgba(201,69,90,0.10);
}

.btn-done {
  flex: 1.45;
  color: var(--gold-l);
  background: linear-gradient(135deg, rgba(201,168,76,0.15), rgba(201,69,90,0.09));
  border: 1px solid rgba(201,168,76,0.34);
}

.btn-skip {
  color: rgba(245,237,224,0.68);
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.09);
}

.btn-skip.denied {
  color: var(--rose-l);
  border-color: rgba(201,69,90,0.36);
  animation: skip-denied-btn 0.48s cubic-bezier(0.36,0.9,0.4,1) both;
}

.card.skip-denied {
  animation: skip-denied-card 0.5s cubic-bezier(0.36,0.9,0.4,1);
}

@keyframes skip-denied-btn {
  0%, 100% { transform: translateX(0) scale(1); }
  18% { transform: translateX(-6px) scale(1.015); }
  38% { transform: translateX(5px) scale(1.01); }
  58% { transform: translateX(-3px) scale(1.006); }
  76% { transform: translateX(2px) scale(1.002); }
}

@keyframes skip-denied-card {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  22% { transform: translateX(-5px) rotate(-0.7deg); }
  46% { transform: translateX(5px) rotate(0.7deg); }
  68% { transform: translateX(-2px) rotate(-0.35deg); }
}

.stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  flex-shrink: 0;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 5px;
  border-radius: 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.055);
}

.stat-lbl {
  font-size: 0.49rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(106,88,104,0.72);
  white-space: nowrap;
}

.stat-val {
  font-family: 'Playfair Display', serif;
  font-size: 1.42rem;
  line-height: 1;
  transition: color 0.4s ease;
}

.stat:nth-child(1) .stat-val { color: var(--gold); }
.stat:nth-child(2) .stat-val { color: rgba(245,237,224,0.7); }
.stat:nth-child(3) .stat-val { color: #f6ddff; }
.stat:nth-child(4) .stat-val { color: #ccefff; }

@keyframes tick {
  0% { transform:translateY(0); opacity:1; }
  35% { transform:translateY(-10px); opacity:0; }
  36% { transform:translateY(10px); opacity:0; }
  100% { transform:translateY(0); opacity:1; }
}

.stat-val.ticking { animation: tick 0.38s ease; }

#toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(20,10,18,0.9);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold-l);
  padding: 9px 22px;
  border-radius: 50px;
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.34,1.4,0.64,1);
}

#toast.on {
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

#age-gate {
  position: fixed;
  inset: 0;
  z-index: 850;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-top) + 22px) 22px calc(var(--safe-bot) + 22px);
  background:
    radial-gradient(ellipse at 50% 42%, rgba(64,12,30,0.82), transparent 48%),
    radial-gradient(ellipse at 50% 72%, rgba(201,168,76,0.13), transparent 45%),
    rgba(7,5,10,0.98);
  backdrop-filter: blur(18px);
  opacity: 1;
  transition: opacity 0.42s ease, filter 0.42s ease;
}

#age-gate.leaving {
  opacity: 0;
  filter: blur(10px);
  pointer-events: none;
}

.age-card {
  width: min(100%, 430px);
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 12px;
  padding: 12px 8px;
}

.age-card h1 {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(4rem, 17vw, 5.8rem);
  line-height: 1.08;
  padding-bottom: 0.08em;
  background: linear-gradient(140deg, var(--gold) 0%, var(--gold-l) 42%, var(--rose-l) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 40px rgba(201,168,76,0.35));
}

.age-kicker {
  color: var(--gold);
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.age-card p {
  max-width: 34ch;
  color: rgba(245,237,224,0.72);
  font-size: 1.08rem;
  line-height: 1.45;
}

.age-actions {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}

.age-accept {
  width: min(100%, 310px);
  margin-top: 0;
}

.age-exit {
  border: 0;
  background: transparent;
  color: rgba(245,237,224,0.48);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin-top: 10px;
}

.legal-links button {
  border: 0;
  background: transparent;
  color: rgba(106,88,104,0.84);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.legal-links button:hover,
.legal-links button:focus-visible,
.age-exit:hover,
.age-exit:focus-visible {
  color: var(--gold-l);
}

.splash-legal {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: calc(var(--safe-bot) + 18px);
  margin-top: 0;
  animation: sp-up 0.8s 0.95s cubic-bezier(0.34,1.4,0.64,1) both;
}

#after {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 20%, rgba(var(--mood-rgb),0.16), transparent 34%),
    radial-gradient(ellipse at 50% 42%, rgba(38, 8, 20, 0.96), rgba(7,5,10,0.98) 68%);
  backdrop-filter: blur(14px);
}

#after.after-entering {
  animation: after-scrim-in 0.62s cubic-bezier(0.16,1,0.3,1) both;
}

#after.after-entering .after-card {
  animation: after-card-in 0.86s 0.06s cubic-bezier(0.16,1,0.3,1) both;
}

#after::before {
  content: '';
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,201,122,0.08), transparent 62%);
  filter: blur(18px);
  opacity: 0.75;
  pointer-events: none;
  animation: after-room-breathe 4.8s ease-in-out infinite alternate;
}

@keyframes after-scrim-in {
  from { opacity: 0; backdrop-filter: blur(0); }
  to { opacity: 1; backdrop-filter: blur(14px); }
}

@keyframes after-card-in {
  from { opacity: 0; filter: blur(14px); transform: translateY(18px) scale(1.035); }
  to { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}

#after.hidden,
.hidden {
  display: none !important;
}

.after-card {
  position: relative;
  z-index: 1;
  width: min(100%, 456px);
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bot) - 36px);
  overflow: auto;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding-top: 12px;
  scrollbar-width: none;
}

.after-card::-webkit-scrollbar {
  display: none;
}

.after-card .sp-flame {
  font-size: clamp(2.45rem, 8vw, 3.25rem);
  line-height: 1.12;
  margin-top: -5px;
  overflow: visible;
}

#after h1 {
  font-size: clamp(2.25rem, 9.2vw, 3.35rem);
  margin-top: 0;
  margin-bottom: -4px;
  animation-delay: 0s;
}

#after-deck {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.after-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 2px;
}

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

.after-stat {
  position: relative;
  overflow: hidden;
  padding: 8px 7px 11px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.024)),
    rgba(10,6,11,0.48);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 12px 28px rgba(0,0,0,0.22), 0 0 20px rgba(var(--mood-rgb),0.05) inset;
}

.after-stat::after {
  content: '';
  position: absolute;
  left: 7px;
  right: auto;
  bottom: 6px;
  width: var(--bar-width, 0%);
  max-width: calc(100% - 14px);
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(201,168,76,0.72), rgba(var(--mood-rgb),0.9));
  box-shadow: 0 0 12px rgba(var(--mood-rgb),0.45);
  transition: width 0.88s cubic-bezier(0.16,1,0.3,1);
}

.after-stat b {
  display: block;
  font-family: 'Playfair Display', serif;
  color: var(--gold-l);
  font-size: 1.42rem;
  line-height: 1;
}

.after-stat span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.54rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.after-verdict {
  max-width: 34ch;
  display: grid;
  justify-items: center;
  gap: 3px;
  color: rgba(245,237,224,0.74);
  line-height: 1.08;
  text-align: center;
}

.after-verdict span {
  color: rgba(201,168,76,0.72);
  font-size: 0.5rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.after-verdict b {
  color: var(--gold-l);
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1;
  filter: drop-shadow(0 0 18px rgba(var(--mood-rgb),0.2));
}

.after-gamification {
  --after-glow-border: 0.6;
  --after-glow-layer: 0.35;
  --after-glow-shadow: 0.18;
  --after-glow-halo-shadow: 0.09;
  --after-glow-radius: 23px;
  --after-glow-bright: 1.08;
  width: 100%;
  display: grid;
  gap: 7px;
  justify-items: center;
  padding: 10px;
  border-radius: 15px;
  border: 1px solid rgba(201,168,76,0.13);
  background:
    radial-gradient(circle at 50% 0%, rgba(var(--mood-rgb),0.11), transparent 56%),
    rgba(255,255,255,0.024);
  box-shadow: 0 18px 46px rgba(0,0,0,0.22), 0 0 34px var(--mood-glow) inset;
  overflow: hidden;
}

.after-kicker {
  color: var(--gold);
  font-size: 0.5rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.after-xp {
  width: 100%;
  display: grid;
  gap: 5px;
  text-align: left;
}

.after-xp-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
}

.after-xp-head b {
  color: var(--gold-l);
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  line-height: 0.98;
  filter: drop-shadow(0 0 18px rgba(var(--mood-rgb),0.18));
}

.after-xp-head span {
  color: rgba(232,201,122,0.88);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.after-xp-bar {
  position: relative;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(201,168,76,0.12);
  background: rgba(7,5,10,0.58);
  box-shadow: 0 0 22px rgba(0,0,0,0.32) inset, 0 0 0 rgba(232,201,122,0);
}

.after-xp-bar i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(201,168,76,0.7), rgba(var(--mood-rgb),1), rgba(245,237,224,0.9));
  box-shadow: 0 0 14px rgba(var(--mood-rgb),0.48), 0 0 28px rgba(232,201,122,0.18);
  transition: width 2.95s cubic-bezier(0.16,1,0.3,1), filter 0.8s ease;
}

.after-xp.is-filling .after-xp-bar {
  animation: ember-bar-breathe 5.8s ease-in-out both;
}

.after-xp.is-filling .after-xp-bar i {
  filter: brightness(1.24) saturate(1.16);
  box-shadow: 0 0 18px rgba(var(--mood-rgb),0.78), 0 0 42px rgba(232,201,122,0.24);
}

.after-collection-board {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.after-collection-section {
  width: 100%;
  justify-self: stretch;
  min-width: 0;
  display: grid;
  gap: 4px;
}

#after-rituals-section,
#after-ritual-unlocks {
  width: 100%;
  justify-self: stretch;
}

#after-ritual-unlocks {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  justify-items: stretch;
}

#after-ritual-unlocks .after-collection-item {
  aspect-ratio: 1;
  min-height: 0;
  padding: 4px 3px;
}

.after-collection-section h3 {
  color: rgba(201,168,76,0.72);
  font-size: 0.49rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 400;
  text-align: left;
}

.after-collection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.after-collection-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.after-collection-item {
  appearance: none;
  color: inherit;
  font: inherit;
  text-align: center;
  position: relative;
  min-width: 0;
  min-height: 32px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 5px 4px;
  overflow: hidden;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.07);
  background:
    radial-gradient(circle at 12% 16%, rgba(var(--mood-rgb),0.08), transparent 46%),
    rgba(255,255,255,0.022);
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: after-item-in 0.82s cubic-bezier(0.16,1,0.3,1) both;
  animation-delay: calc(0.72s + var(--order, 0) * 82ms);
  transition:
    border-color 1.05s cubic-bezier(0.16,1,0.3,1),
    box-shadow 1.25s cubic-bezier(0.16,1,0.3,1),
    background 1.05s cubic-bezier(0.16,1,0.3,1),
    filter 1.05s cubic-bezier(0.16,1,0.3,1),
    opacity 1.05s cubic-bezier(0.16,1,0.3,1);
}

button.after-collection-item {
  cursor: pointer;
}

button.after-collection-item.is-locked {
  cursor: not-allowed;
}

button.after-collection-item.is-open:not(.is-new):not(.is-opening):not(.is-receiving):not(.is-contact):not(.is-unlocked):hover,
button.after-collection-item.is-open:not(.is-new):not(.is-opening):not(.is-receiving):not(.is-contact):not(.is-unlocked):focus-visible,
button.after-collection-item.is-open:not(.is-new):not(.is-opening):not(.is-receiving):not(.is-contact):not(.is-unlocked).is-tip-open {
  border-color: rgba(255,205,104,0.7);
  box-shadow: 0 0 18px rgba(255,151,48,0.18), 0 0 26px rgba(232,201,122,0.08) inset;
}

button.after-collection-item.is-unlocked:hover,
button.after-collection-item.is-unlocked:focus-visible,
button.after-collection-item.is-unlocked.is-tip-open {
  filter: brightness(1.12) saturate(1.06);
}

button.after-collection-item.is-unlocked:hover::before,
button.after-collection-item.is-unlocked:focus-visible::before,
button.after-collection-item.is-unlocked.is-tip-open::before {
  opacity: calc(var(--after-glow-layer, 0.28) + 0.05);
  filter: brightness(calc(var(--after-glow-bright, 1.06) + 0.1)) saturate(1.14);
}

.after-collection-item::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 34%, rgba(255,213,92,0.2), transparent 56%),
    radial-gradient(circle at 50% 100%, rgba(var(--mood-rgb),0.16), transparent 62%);
  opacity: 0;
  pointer-events: none;
  filter: brightness(1) saturate(1);
  transition: opacity 1.45s cubic-bezier(0.16,1,0.3,1), filter 1.45s cubic-bezier(0.16,1,0.3,1);
  z-index: 0;
}

.after-collection-item > * {
  position: relative;
  z-index: 1;
}

.after-collection-item.is-open {
  opacity: 1;
  border-color: rgba(201,168,76,0.18);
  background:
    radial-gradient(circle at 12% 16%, rgba(var(--mood-rgb),0.15), transparent 48%),
    rgba(201,168,76,0.045);
}

.after-collection-item.is-locked {
  opacity: 0.54;
  filter: saturate(0.55) brightness(0.78);
}

.after-collection-item.is-new:not(.is-opening):not(.is-unlocked) {
  border-color: rgba(201,168,76,0.38);
  box-shadow: 0 0 18px rgba(201,168,76,0.12), 0 0 24px rgba(var(--mood-rgb),0.07) inset;
}

.after-collection-item.is-locked:not(.is-unlocked)::after,
.after-collection-item.is-opening:not(.is-unlocked)::after {
  content: '🔒';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background:
    repeating-linear-gradient(135deg, rgba(245,237,224,0.075) 0 7px, rgba(7,5,10,0.12) 7px 15px),
    radial-gradient(circle at 50% 50%, rgba(7,5,10,0.14), rgba(7,5,10,0.48));
  color: rgba(245,237,224,0.82);
  font-size: 1.34rem;
  text-shadow: 0 0 18px rgba(232,201,122,0.32);
  box-shadow: inset 0 0 0 1px rgba(201,168,76,0.08);
  pointer-events: none;
  z-index: 5;
}

.after-collection-item.is-opening:not(.is-unlocked)::after {
  opacity: 0.9;
  transform: translate3d(0, 0, 0) scale(1);
  will-change: opacity, transform, filter;
}

.after-collection-item.is-contact:not(.is-unlocked)::after {
  animation: unlock-veil-release 1.5s cubic-bezier(0.16,1,0.3,1) both;
}

.after-collection-item.is-receiving {
  border-color: rgba(232,201,122,0.32);
  box-shadow:
    0 0 18px rgba(var(--mood-rgb),0.08),
    0 0 28px rgba(255,142,38,0.07),
    0 0 24px rgba(232,201,122,0.07) inset;
}

.after-collection-item.is-unlocking:not(.is-unlocked) {
  opacity: 0.86;
  filter: saturate(0.96) brightness(0.99);
  border-color: rgba(255,198,84,0.48);
  background:
    radial-gradient(circle at 50% 25%, rgba(255,220,112,0.19), transparent 55%),
    radial-gradient(circle at 12% 16%, rgba(var(--mood-rgb),0.18), transparent 48%),
    rgba(201,168,76,0.055);
  box-shadow:
    0 0 22px rgba(255,151,48,0.18),
    0 0 36px rgba(var(--mood-rgb),0.12),
    0 0 28px rgba(232,201,122,0.1) inset;
}

.after-collection-item.is-unlocking:not(.is-unlocked)::before {
  opacity: 0.34;
  filter: brightness(1.16) saturate(1.14);
}

.after-collection-item.is-receiving::before {
  opacity: 0.18;
}

.after-collection-item.is-contact::before {
  animation: unlock-contact-flare 2.05s cubic-bezier(0.16,1,0.3,1) both;
}

.after-collection-item.is-unlocked {
  border-color: rgba(255,188,72,var(--after-glow-border,0.5));
  box-shadow:
    0 0 var(--after-glow-radius, 18px) rgba(255,151,48,var(--after-glow-shadow,0.14)),
    0 0 calc(var(--after-glow-radius, 18px) * 1.55) rgba(232,201,122,var(--after-glow-halo-shadow,0.09)),
    0 0 26px rgba(232,201,122,0.09) inset;
}

.after-collection-item.is-unlocked::before {
  opacity: var(--after-glow-layer, 0.28);
  filter: brightness(var(--after-glow-bright,1.06)) saturate(1.08);
}

.after-collection-item.is-unlocked.is-fresh-unlock {
  animation: after-unlocked-arrival 3.35s cubic-bezier(0.16,1,0.3,1) both;
}

.after-collection-item.is-arrived:not(.is-fresh-unlock) {
  animation: none;
}

.after-collection-item.is-unlocked.is-fresh-unlock::before {
  animation: after-unlocked-aura 3.35s cubic-bezier(0.16,1,0.3,1) both;
}

.after-collection-item b {
  align-self: center;
  color: var(--gold-l);
  font-family: 'Playfair Display', serif;
  font-size: 0.78rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(var(--mood-rgb),0.28));
}

#after-ritual-unlocks .after-collection-item b {
  font-size: 0.79rem;
}

.after-collection-item span {
  min-width: 0;
  max-width: 100%;
  color: rgba(245,237,224,0.82);
  font-size: 0.54rem;
  line-height: 1.02;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
}

#after-ritual-unlocks .after-collection-item span {
  font-size: 0.5rem;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.after-collection-item em {
  color: rgba(201,168,76,0.62);
  font-size: 0.35rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-style: normal;
  line-height: 1;
}

#after-ritual-unlocks .after-collection-item em {
  font-size: 0.34rem;
}

#after-ritual-unlocks .after-collection-item.is-locked:not(.is-unlocked)::after,
#after-ritual-unlocks .after-collection-item.is-opening:not(.is-unlocked)::after {
  font-size: 0.96rem;
}

.after-next {
  color: rgba(245,237,224,0.52);
  font-size: 0.72rem;
  line-height: 1.12;
  min-height: 0.8rem;
}

.after-item-tooltip {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 930;
  width: min(232px, calc(100vw - 22px));
  display: grid;
  gap: 5px;
  padding: 10px 12px 11px;
  border-radius: 13px;
  border: 1px solid rgba(255,205,104,0.34);
  background:
    radial-gradient(circle at 50% 0%, rgba(var(--mood-rgb),0.22), transparent 58%),
    rgba(19,11,15,0.94);
  box-shadow:
    0 18px 42px rgba(0,0,0,0.42),
    0 0 28px rgba(var(--mood-rgb),0.16),
    0 0 22px rgba(232,201,122,0.08) inset;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-50%, 7px, 0) scale(0.985);
  transition:
    opacity 0.22s cubic-bezier(0.16,1,0.3,1),
    transform 0.28s cubic-bezier(0.16,1,0.3,1);
}

.after-item-tooltip.on {
  opacity: 1;
  transform: translate3d(-50%, 0, 0) scale(1);
}

.after-item-tooltip.below {
  transform: translate3d(-50%, -7px, 0) scale(0.985);
}

.after-item-tooltip.below.on {
  transform: translate3d(-50%, 0, 0) scale(1);
}

.after-item-tooltip b {
  color: var(--gold-l);
  font-family: 'Playfair Display', serif;
  font-size: 0.82rem;
  line-height: 1.04;
  text-align: center;
}

.after-item-tooltip span {
  color: rgba(245,237,224,0.74);
  font-size: 0.62rem;
  line-height: 1.26;
  text-align: center;
}

.after-item-tooltip em {
  color: rgba(255,155,126,0.86);
  font-size: 0.46rem;
  letter-spacing: 0.18em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  font-style: normal;
}

.after-tools {
  display: flex;
  justify-content: center;
  gap: 9px;
}

.after-tool {
  border: 1px solid rgba(201,168,76,0.18);
  background: rgba(255,255,255,0.025);
  color: var(--gold-l);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 0.54rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}

.after-tool:hover,
.after-tool:focus-visible {
  border-color: rgba(201,168,76,0.4);
}

.after-ember-particle {
  position: fixed;
  z-index: 720;
  width: var(--size, 5px);
  height: var(--size, 5px);
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(255,255,255,0.98) 0 12%, rgba(255,213,92,0.96) 28%, rgba(255,92,32,0.78) 58%, rgba(var(--mood-rgb),0.22) 80%, transparent);
  box-shadow:
    0 0 10px rgba(255,214,96,0.88),
    0 0 22px rgba(255,89,28,0.54),
    0 0 34px rgba(var(--mood-rgb),0.32);
  animation: after-ember-flight var(--flight, 3180ms) cubic-bezier(0.16,1,0.3,1) var(--delay, 0s) both;
  will-change: transform, opacity;
}

.after-ember-particle::before,
.after-ember-particle::after {
  content: '';
  position: absolute;
  inset: -55%;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(255,179,57,0.5), transparent 64%);
  filter: blur(2px);
  opacity: 0.72;
}

.after-ember-particle::after {
  inset: 45% 80% 45% -260%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255,113,42,0.72), rgba(255,217,102,0.22));
  transform: rotate(var(--trail-r, -12deg));
  filter: blur(1px);
}

.after-unlock-impact,
.after-unlock-spark {
  position: fixed;
  z-index: 721;
  left: 0;
  top: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.after-unlock-impact {
  width: var(--impact-size, 70px);
  height: var(--impact-size, 70px);
  border-radius: 50%;
  border: 1px solid rgba(255,216,112,0.5);
  background:
    radial-gradient(circle, rgba(255,240,172,0.3) 0 10%, rgba(255,176,58,0.13) 24%, rgba(var(--mood-rgb),0.09) 42%, transparent 68%);
  box-shadow:
    0 0 28px rgba(255,149,42,0.28),
    0 0 46px rgba(var(--mood-rgb),0.13);
  transform: translate3d(-50%, -50%, 0) scale(0.26);
  animation: after-unlock-impact 1.55s cubic-bezier(0.16,1,0.3,1) both;
}

.after-unlock-spark {
  width: var(--spark-size, 4px);
  height: var(--spark-size, 4px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,245,0.96) 0 12%, rgba(255,220,96,0.92) 32%, rgba(255,101,37,0.62) 68%, transparent);
  box-shadow:
    0 0 9px rgba(255,218,92,0.72),
    0 0 18px rgba(255,104,36,0.38);
  animation: after-unlock-spark 1.18s cubic-bezier(0.16,1,0.3,1) var(--spark-delay, 0ms) both;
}

@keyframes after-item-in {
  0% { filter: blur(7px); transform: translateY(8px) scale(1.012); }
  100% { filter: blur(0); transform: translateY(0) scale(1); }
}

@keyframes ember-bar-breathe {
  0% { box-shadow: 0 0 22px rgba(0,0,0,0.32) inset, 0 0 0 rgba(232,201,122,0); }
  32% { box-shadow: 0 0 18px rgba(0,0,0,0.26) inset, 0 0 26px rgba(255,171,50,0.24), 0 0 48px rgba(var(--mood-rgb),0.16); }
  62% { box-shadow: 0 0 18px rgba(0,0,0,0.26) inset, 0 0 42px rgba(255,171,50,0.32), 0 0 72px rgba(var(--mood-rgb),0.18); }
  100% { box-shadow: 0 0 22px rgba(0,0,0,0.32) inset, 0 0 12px rgba(232,201,122,0.14); }
}

@keyframes unlock-veil-release {
  0% {
    opacity: 0.9;
    transform: translate3d(0, 0, 0) scale(1);
    filter: brightness(1) blur(0);
  }
  18% {
    opacity: 0.96;
    transform: translate3d(0, -1px, 0) scale(1.012);
    filter: brightness(1.42) blur(0);
  }
  46% {
    opacity: 0.58;
    transform: translate3d(0, -2px, 0) scale(1.025);
    filter: brightness(1.22) blur(2px);
  }
  74% {
    opacity: 0.18;
    transform: translate3d(0, -2px, 0) scale(1.035);
    filter: brightness(1.06) blur(5px);
  }
  100% {
    opacity: 0;
    transform: translate3d(0, -3px, 0) scale(1.045);
    filter: brightness(1) blur(9px);
  }
}

@keyframes unlock-contact-flare {
  0% {
    opacity: 0.26;
    filter: brightness(1.04) saturate(1.04);
  }
  30% {
    opacity: 0.78;
    filter: brightness(1.48) saturate(1.22);
  }
  62% {
    opacity: 0.5;
    filter: brightness(1.22) saturate(1.14);
  }
  100% {
    opacity: 0.36;
    filter: brightness(1.1) saturate(1.08);
  }
}

@keyframes after-unlocked-arrival {
  0% {
    border-color: rgba(255,207,104,0.52);
    box-shadow:
      0 0 18px rgba(255,151,48,0.16),
      0 0 32px rgba(var(--mood-rgb),0.1),
      0 0 24px rgba(232,201,122,0.1) inset;
    filter: brightness(1.02) saturate(1.03);
  }
  22% {
    border-color: rgba(255,224,132,0.86);
    box-shadow:
      0 0 34px rgba(255,151,48,0.36),
      0 0 58px rgba(var(--mood-rgb),0.18),
      0 0 36px rgba(232,201,122,0.17) inset;
    filter: brightness(1.18) saturate(1.16);
  }
  54% {
    border-color: rgba(255,197,88,0.62);
    box-shadow:
      0 0 25px rgba(255,151,48,0.22),
      0 0 42px rgba(var(--mood-rgb),0.12),
      0 0 30px rgba(232,201,122,0.12) inset;
    filter: brightness(1.08) saturate(1.08);
  }
  100% {
    border-color: rgba(255,188,72,var(--after-glow-border,0.5));
    box-shadow:
      0 0 var(--after-glow-radius, 18px) rgba(255,151,48,var(--after-glow-shadow,0.14)),
      0 0 calc(var(--after-glow-radius, 18px) * 1.55) rgba(232,201,122,var(--after-glow-halo-shadow,0.09)),
      0 0 26px rgba(232,201,122,0.09) inset;
    filter: brightness(1) saturate(1);
  }
}

@keyframes after-unlocked-aura {
  0% {
    opacity: 0.18;
    filter: brightness(1.08) saturate(1.06);
  }
  22% {
    opacity: 0.62;
    filter: brightness(1.42) saturate(1.22);
  }
  56% {
    opacity: 0.42;
    filter: brightness(1.18) saturate(1.12);
  }
  100% {
    opacity: var(--after-glow-layer, 0.28);
    filter: brightness(var(--after-glow-bright,1.06)) saturate(1.08);
  }
}

@keyframes after-unlock-impact {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(0.26);
    filter: blur(0);
  }
  18% {
    opacity: 0.76;
    transform: translate3d(-50%, -50%, 0) scale(0.58);
    filter: blur(0);
  }
  64% {
    opacity: 0.3;
    transform: translate3d(-50%, -50%, 0) scale(1.06);
    filter: blur(1px);
  }
  100% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(1.24);
    filter: blur(4px);
  }
}

@keyframes after-unlock-spark {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(0.3);
  }
  16% {
    opacity: 1;
  }
  70% {
    opacity: 0.72;
    transform: translate3d(calc(-50% + var(--sx)), calc(-50% + var(--sy)), 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(-50% + var(--sx2)), calc(-50% + var(--sy2)), 0) scale(0.25);
  }
}

@keyframes unlocked-ember-breathe {
  0%, 100% {
    opacity: 0.26;
    filter: brightness(1.02) saturate(1.02);
  }
  28% {
    opacity: 0.39;
    filter: brightness(1.14) saturate(1.09);
  }
  50% {
    opacity: 0.52;
    filter: brightness(1.24) saturate(1.15);
  }
  72% {
    opacity: 0.38;
    filter: brightness(1.12) saturate(1.08);
  }
}

@keyframes unlocked-ember-border {
  0%, 100% {
    border-color: rgba(255,188,72,0.48);
    box-shadow: 0 0 17px rgba(255,151,48,0.13), 0 0 25px rgba(232,201,122,0.08) inset;
  }
  28% {
    border-color: rgba(255,197,88,0.56);
    box-shadow: 0 0 22px rgba(255,151,48,0.18), 0 0 34px rgba(var(--mood-rgb),0.09), 0 0 28px rgba(232,201,122,0.1) inset;
  }
  50% {
    border-color: rgba(255,205,104,0.66);
    box-shadow: 0 0 29px rgba(255,151,48,0.25), 0 0 46px rgba(var(--mood-rgb),0.13), 0 0 31px rgba(232,201,122,0.13) inset;
  }
  72% {
    border-color: rgba(255,197,88,0.55);
    box-shadow: 0 0 21px rgba(255,151,48,0.17), 0 0 32px rgba(var(--mood-rgb),0.08), 0 0 27px rgba(232,201,122,0.1) inset;
  }
}

@keyframes after-ember-flight {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(0.28) rotate(0deg); }
  8% { opacity: 0.92; }
  26% { opacity: 1; transform: translate3d(calc(var(--mx) * 0.68), calc(var(--my) * 0.82), 0) scale(1.08) rotate(var(--rot1)); }
  56% { opacity: 0.98; transform: translate3d(var(--mx), var(--my), 0) scale(1) rotate(var(--rot2)); }
  82% { opacity: 0.96; transform: translate3d(calc(var(--dx) * 0.9), calc(var(--dy) * 0.9), 0) scale(0.76) rotate(var(--rot2)); }
  92% { opacity: 1; transform: translate3d(var(--dx), var(--dy), 0) scale(0.48) rotate(var(--rot3)); }
  100% { opacity: 0; transform: translate3d(var(--dx), var(--dy), 0) scale(0.2) rotate(var(--rot3)); }
}

@keyframes after-room-breathe {
  from { transform: scale(0.94); opacity: 0.48; }
  to { transform: scale(1.06); opacity: 0.82; }
}

.sponsor-card {
  position: relative;
  display: grid;
  gap: 3px;
  width: min(100%, 420px);
  padding: 13px 16px;
  border-radius: 16px;
  border: 1px solid rgba(201,168,76,0.16);
  background:
    linear-gradient(135deg, rgba(201,168,76,0.075), rgba(201,69,90,0.055)),
    rgba(255,255,255,0.025);
  color: rgba(245,237,224,0.72);
  text-align: left;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,0.32), 0 0 36px rgba(201,168,76,0.045) inset;
  transition: transform 0.22s cubic-bezier(0.34,1.4,0.64,1), border-color 0.22s ease, background 0.22s ease;
}

.sponsor-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 92% 12%, rgba(232,201,122,0.14), transparent 34%);
  pointer-events: none;
}

.sponsor-card span,
.sponsor-card strong,
.sponsor-card em,
.sponsor-card b {
  position: relative;
  z-index: 1;
}

.sponsor-card span {
  color: var(--gold);
  font-size: 0.52rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.sponsor-card strong {
  font-family: 'Playfair Display', serif;
  color: var(--gold-l);
  font-size: 1.02rem;
  line-height: 1.1;
}

.sponsor-card em {
  color: rgba(245,237,224,0.6);
  font-size: 0.86rem;
  line-height: 1.2;
  font-style: normal;
}

.sponsor-card b {
  color: var(--rose-l);
  font-size: 0.56rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-top: 3px;
}

.sponsor-card:hover,
.sponsor-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(201,168,76,0.34);
  background:
    linear-gradient(135deg, rgba(201,168,76,0.11), rgba(201,69,90,0.075)),
    rgba(255,255,255,0.035);
  outline: none;
}

.mode-sponsor {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bot) + 48px);
  width: min(420px, calc(100vw - 42px));
  transform: translateX(-50%);
  z-index: 6;
  background:
    linear-gradient(135deg, rgba(201,168,76,0.095), rgba(201,69,90,0.075)),
    rgba(15,8,13,0.58);
}

#mode-select.on .mode-sponsor {
  animation: sponsor-rise 0.54s 0.16s cubic-bezier(0.16,1,0.3,1) backwards;
}

.mode-sponsor:hover,
.mode-sponsor:focus-visible {
  transform: translateX(-50%) translateY(-2px);
  background:
    linear-gradient(135deg, rgba(201,168,76,0.13), rgba(201,69,90,0.09)),
    rgba(15,8,13,0.64);
}

@keyframes sponsor-rise {
  from { opacity: 0; filter: blur(10px); transform: translateX(-50%) translateY(90px) scale(1.04); }
  to { opacity: 1; filter: blur(0); transform: translateX(-50%) translateY(0) scale(1); }
}

.mode-legal {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: calc(var(--safe-bot) + 12px);
  margin-top: 0;
  z-index: 2;
}

.after-sponsor {
  width: 100%;
  margin-top: -2px;
  padding: 9px 13px;
  gap: 2px;
}

.after-sponsor em {
  display: none;
}

.after-sponsor strong {
  font-size: 0.94rem;
}

.after-sponsor b {
  margin-top: 1px;
}

.after-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.after-btn {
  width: 100%;
  margin-top: 0;
  min-height: 44px;
  padding-inline: 12px;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
}

.after-btn.secondary {
  color: rgba(245,237,224,0.72);
  background: rgba(255,255,255,0.035);
  border-color: rgba(255,255,255,0.09);
}

#legal-modal {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7,5,10,0.72);
  backdrop-filter: blur(18px);
}

#collection-modal {
  position: fixed;
  inset: 0;
  z-index: 940;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-top) + 22px) 20px calc(var(--safe-bot) + 22px);
  background:
    radial-gradient(ellipse at 50% 40%, rgba(46,10,24,0.86), transparent 58%),
    rgba(7,5,10,0.78);
  backdrop-filter: blur(18px);
}

#confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 960;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(42,10,24,0.62), transparent 62%),
    rgba(7,5,10,0.54);
  backdrop-filter: blur(12px);
  animation: confirm-scrim-in 0.24s ease both;
}

.confirm-card {
  width: min(100%, 390px);
  position: relative;
  display: grid;
  gap: 12px;
  padding: 28px 22px 22px;
  border-radius: 20px;
  border: 1px solid rgba(201,168,76,0.2);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), transparent 34%),
    linear-gradient(145deg, rgba(26,12,19,0.94), rgba(8,5,9,0.98));
  box-shadow: 0 32px 94px rgba(0,0,0,0.64), 0 0 80px rgba(201,69,90,0.08) inset;
  text-align: center;
  animation: confirm-card-in 0.3s cubic-bezier(0.16,1,0.3,1) both;
}

.confirm-kicker {
  color: var(--gold);
  font-size: 0.56rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.confirm-card h2 {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: var(--gold-l);
  font-size: clamp(2.15rem, 9vw, 3rem);
  line-height: 1.02;
}

.confirm-card p {
  color: rgba(245,237,224,0.66);
  font-size: 0.94rem;
  line-height: 1.32;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  gap: 10px;
  margin-top: 4px;
}

.confirm-cancel,
.confirm-primary {
  min-height: 44px;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}

.confirm-cancel {
  border: 1px solid rgba(245,237,224,0.12);
  color: rgba(245,237,224,0.72);
  background: rgba(255,255,255,0.035);
}

.confirm-primary {
  border: 1px solid rgba(201,168,76,0.34);
  color: var(--gold-l);
  background:
    linear-gradient(135deg, rgba(201,168,76,0.22), rgba(201,69,90,0.12)),
    rgba(255,255,255,0.04);
  box-shadow: 0 0 28px rgba(201,168,76,0.08) inset;
}

@keyframes confirm-scrim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes confirm-card-in {
  from { opacity: 0; filter: blur(10px); transform: scale(1.06) translateY(8px); }
  to { opacity: 1; filter: blur(0); transform: scale(1) translateY(0); }
}

.collection-card {
  width: min(100%, 470px);
  max-height: min(86dvh, 760px);
  overflow: auto;
  position: relative;
  display: grid;
  gap: 14px;
  padding: 30px 22px 24px;
  border-radius: 22px;
  border: 1px solid rgba(201,168,76,0.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), transparent 30%),
    linear-gradient(145deg, rgba(24,12,18,0.96), rgba(8,5,9,0.98));
  box-shadow: 0 30px 90px rgba(0,0,0,0.66), 0 0 80px rgba(201,69,90,0.08) inset;
  scrollbar-width: none;
}

.collection-card::-webkit-scrollbar {
  display: none;
}

.collection-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.22);
  background: rgba(255,255,255,0.03);
  color: var(--gold-l);
  cursor: pointer;
  display: block;
  font-size: 0;
  line-height: 1;
}

.collection-close::before,
.collection-close::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 1.4px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 9px rgba(232,201,122,0.28);
}

.collection-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.collection-kicker {
  color: var(--gold);
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-align: center;
}

.collection-card h2 {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: var(--gold-l);
  text-align: center;
  font-size: clamp(2.35rem, 10vw, 3.7rem);
  line-height: 1;
}

.collection-embers {
  justify-self: center;
  color: rgba(245,237,224,0.66);
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.collection-section {
  display: grid;
  gap: 8px;
}

.collection-section h3 {
  color: rgba(201,168,76,0.72);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 400;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.collection-item {
  min-height: 76px;
  display: grid;
  gap: 3px;
  align-content: center;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.024);
  opacity: 0.46;
}

.collection-item.is-open {
  opacity: 1;
  border-color: rgba(201,168,76,0.2);
  background: rgba(201,168,76,0.055);
  box-shadow: 0 0 30px rgba(201,168,76,0.04) inset;
}

.collection-item b {
  color: var(--gold-l);
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  line-height: 1;
}

.collection-item span {
  color: rgba(245,237,224,0.82);
  font-size: 0.84rem;
  line-height: 1.1;
}

.collection-item em {
  color: rgba(106,88,104,0.9);
  font-size: 0.54rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-style: normal;
}

.legal-card {
  width: min(100%, 440px);
  position: relative;
  padding: 30px 26px 26px;
  border-radius: 20px;
  border: 1px solid rgba(201,168,76,0.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), transparent 30%),
    linear-gradient(145deg, rgba(24,12,18,0.96), rgba(8,5,9,0.98));
  box-shadow: 0 30px 90px rgba(0,0,0,0.66), 0 0 80px rgba(201,69,90,0.08) inset;
}

.legal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.22);
  background: rgba(255,255,255,0.035);
  color: var(--gold-l);
  display: grid;
  place-items: center;
  padding: 0 0 2px;
  line-height: 1;
  cursor: pointer;
}

.legal-kicker {
  color: var(--gold);
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.legal-card h2 {
  font-family: 'Playfair Display', serif;
  color: var(--gold-l);
  font-size: 2rem;
  line-height: 1.1;
  margin-bottom: 14px;
}

.legal-card p {
  color: rgba(245,237,224,0.72);
  font-size: 1rem;
  line-height: 1.48;
  white-space: pre-line;
}

.dev-panel {
  position: fixed;
  right: 12px;
  bottom: calc(var(--safe-bot) + 12px);
  z-index: 5000;
  width: min(360px, calc(100vw - 24px));
  max-height: min(58dvh, 430px);
  overflow: auto;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(232,201,122,0.24);
  background: rgba(7,5,10,0.82);
  color: var(--gold-l);
  box-shadow: 0 18px 60px rgba(0,0,0,0.5), 0 0 32px rgba(232,201,122,0.08) inset;
  backdrop-filter: blur(14px);
}

.dev-panel details {
  display: grid;
  gap: 6px;
}

.dev-panel summary {
  list-style: none;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(232,201,122,0.22);
  background: rgba(255,255,255,0.045);
  color: var(--gold-l);
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.05em;
}

.dev-panel summary::-webkit-details-marker {
  display: none;
}

.dev-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(232,201,122,0.08);
}

.dev-panel details:not([open]) {
  width: 42px;
}

.dev-panel:has(details:not([open])) {
  width: auto;
  overflow: visible;
}

.dev-panel b,
.dev-panel button {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.05em;
}

.dev-panel b {
  color: rgba(245,237,224,0.72);
  padding: 0 5px;
}

.dev-fx-readout {
  align-items: flex-start;
}

.dev-fx-readout span {
  flex: 1 1 240px;
  color: rgba(245,237,224,0.72);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.56rem;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.dev-panel button {
  min-height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(232,201,122,0.22);
  background: rgba(255,255,255,0.045);
  color: var(--gold-l);
  padding: 4px 8px;
  cursor: pointer;
}

.dev-panel button:hover,
.dev-panel button:focus-visible {
  border-color: rgba(232,201,122,0.52);
}

@keyframes app-in {
  from { opacity: 0; filter: blur(10px); transform: scale(1.1); }
  to { opacity: 1; filter: blur(0); transform: scale(1); }
}

.hdr { animation: app-in 0.55s 0.1s cubic-bezier(0.34,1.4,0.64,1) both; }
.tabs-wrap { animation: app-in 0.55s 0.2s cubic-bezier(0.34,1.4,0.64,1) both; }
.card-area { animation: app-in 0.55s 0.3s cubic-bezier(0.34,1.4,0.64,1) both; }
.stats { animation: app-in 0.55s 0.5s cubic-bezier(0.34,1.4,0.64,1) both; }

/* I keep the iOS cleanup narrow, with the shared deck formation path intact. */
html.ios .hdr,
html.ios .tabs-wrap,
html.ios .card-area,
html.ios .stats,
html.ios .sp-title,
html.ios .sp-sub,
html.ios .sp-sub-2,
html.ios .sp-lang,
html.ios .sp-divider,
html.ios .sp-btn,
html.ios .splash-legal,
html.ios .lang-btn,
html.ios .mini-lang {
  -webkit-filter: none !important;
  filter: none !important;
}

html.ios .hdr,
html.ios .tabs-wrap,
html.ios .card-area,
html.ios .stats {
  animation-name: ios-app-in;
}

html.ios body.locale-swap .game-label,
html.ios body.locale-swap .prog-lbl,
html.ios body.locale-swap .tab,
html.ios body.locale-swap .front-hint,
html.ios body.locale-swap .badge,
html.ios body.locale-swap .c-text,
html.ios body.locale-swap .stat-lbl,
html.ios body.locale-swap .mode-card strong,
html.ios body.locale-swap .mode-card em,
html.ios body.locale-swap .after-card,
html.ios body.locale-swap [data-i18n] {
  animation-name: ios-locale-swap;
  -webkit-filter: none !important;
  filter: none !important;
}

html.ios #splash [data-i18n] {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

html.ios body.splash-lang-swap #splash [data-i18n] {
  opacity: 0.56;
  transform: scale(1.012);
  -webkit-filter: none !important;
  filter: none !important;
}

html.ios .actions {
  -webkit-filter: none !important;
  filter: none !important;
  will-change: opacity, transform;
}

html.ios .actions.flow-enter { animation-name: ios-actions-flow-in; }
html.ios .actions.flow-exit { animation-name: ios-actions-flow-out; }
html.ios .actions.flow-enter .btn { animation-name: ios-btn-single-in; }
html.ios .actions.flow-exit .btn { animation-name: ios-btn-single-out; }
html.ios .actions.flow-enter .btn:first-child:not(:only-child) { animation-name: ios-btn-left-in; }
html.ios .actions.flow-enter .btn:last-child:not(:only-child) { animation-name: ios-btn-right-in; }
html.ios .actions.flow-exit .btn:first-child:not(:only-child) { animation-name: ios-btn-left-out; }
html.ios .actions.flow-exit .btn:last-child:not(:only-child) { animation-name: ios-btn-right-out; }

html.ios body.forming-deck .deck-formation {
  z-index: 9 !important;
  -webkit-transform: translate3d(0,-50%,1px);
  transform: translate3d(0,-50%,1px);
}

html.ios body.forming-deck .card-wrap {
  z-index: 0;
}

html.ios body.forming-deck .card.deck-form-hidden {
  visibility: hidden;
  opacity: 0 !important;
  -webkit-filter: none !important;
  filter: none !important;
  -webkit-transform: translate3d(0,10px,-1px) scale(1.06);
  transform: translate3d(0,10px,-1px) scale(1.06);
}

html.ios body.forming-deck .card.deck-form-hidden .face,
html.ios body.forming-deck .card.deck-form-hidden .dir-left,
html.ios body.forming-deck .card.deck-form-hidden .dir-right {
  visibility: hidden;
  opacity: 0 !important;
}

@keyframes ios-app-in {
  from { opacity: 0; transform: translateZ(0) scale(1.04); }
  to { opacity: 1; transform: translateZ(0) scale(1); }
}

@keyframes ios-locale-swap {
  0% { opacity: 0.5; transform: scale(1.012); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes ios-deck-sidecut {
  0% {
    opacity: 0;
    transform: translate3d(var(--from-x), var(--from-y), 0) rotateZ(var(--from-rz)) scale(0.98);
  }
  46% {
    opacity: 1;
    transform: translate3d(var(--mid-x), var(--mid-y), 0) rotateZ(var(--mid-rz)) scale(1.04);
  }
  100% {
    opacity: var(--final-opacity);
    transform: translate3d(var(--to-x), var(--to-y), 0) rotateZ(var(--to-rz)) scale(var(--to-scale));
  }
}

@keyframes ios-deck-sidecut-landing {
  0% {
    opacity: 0;
    transform: translate3d(var(--from-x), var(--from-y), 0) rotateZ(var(--from-rz)) scale(0.98);
  }
  42% {
    opacity: 1;
    transform: translate3d(var(--mid-x), var(--mid-y), 0) rotateZ(var(--mid-rz)) scale(1);
  }
  78% {
    opacity: 1;
    transform: translate3d(0, -10px, 0) rotateZ(0deg) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateZ(0deg) scale(1);
  }
}

@keyframes ios-deck-real-land {
  from { opacity: 0; transform: scale(1.04) translate3d(0, 10px, 0); }
  to { opacity: 1; transform: scale(1) translate3d(0, 0, 0); }
}

@keyframes ios-actions-flow-in {
  from { opacity: 0; transform: scale(1.025); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes ios-actions-flow-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.985); }
}

@keyframes ios-btn-single-in {
  from { opacity: 0; transform: translateY(72px) scale(1.03); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ios-btn-single-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(64px) scale(0.99); }
}

@keyframes ios-btn-left-in {
  from { opacity: 0; transform: translateX(-62vw) scale(1.03); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes ios-btn-right-in {
  from { opacity: 0; transform: translateX(62vw) scale(1.03); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes ios-btn-left-out {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(-58vw) scale(0.99); }
}

@keyframes ios-btn-right-out {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(58vw) scale(0.99); }
}

@media (max-height: 700px) {
  :root { --card-h: min(330px, 46dvh); }
  #app { padding-left: 16px; padding-right: 16px; }
  .card-area { margin: 10px 0; }
  .c-text { font-size: clamp(0.94rem, 3.4vw, 1.16rem); line-height: 1.5; }
  .c-emoji { margin-top: 16px; }
  .stats { gap: 6px; }
  .stat { padding: 8px 4px; }
  .stat-val { font-size: 1.26rem; }
  .mode-sponsor {
    transform: translateX(-50%) scale(0.92);
    transform-origin: center bottom;
    bottom: calc(var(--safe-bot) + 38px);
  }
  .mode-sponsor:hover,
  .mode-sponsor:focus-visible {
    transform: translateX(-50%) translateY(-2px) scale(0.92);
  }
  .sponsor-card em { display: none; }
  .age-card .sp-flame { font-size: 5.04rem; }
  .age-card p { font-size: 0.98rem; }
  #after { padding: 14px; }
  .after-card { gap: 7px; max-height: calc(100dvh - var(--safe-top) - var(--safe-bot) - 22px); padding-top: 12px; }
  .after-card .sp-flame { font-size: 3.6rem; line-height: 1.12; margin-top: -5px; }
  #after h1 { font-size: clamp(2.35rem, 11vw, 3.4rem); }
  #after-deck { font-size: 0.66rem; letter-spacing: 0.22em; }
  .after-stat { padding: 10px 6px 13px; }
  .after-stat b { font-size: 1.48rem; }
  .after-stat span { font-size: 0.52rem; letter-spacing: 0.12em; }
  .after-verdict { font-size: 0.88rem; line-height: 1.25; }
  .after-gamification { padding: 9px; gap: 6px; }
  .after-xp-head b { font-size: 1.42rem; }
  .after-collection-board { gap: 4px; }
  .after-collection-grid { gap: 4px; }
  .after-collection-item { min-height: 35px; padding: 5px 4px; }
  .after-collection-item span { font-size: 0.54rem; }
  .after-collection-item em { font-size: 0.36rem; }
  .after-next { font-size: 0.72rem; }
  .after-actions { gap: 7px; }
  .after-btn { min-height: 42px; }
}

@media (max-width: 520px) and (max-height: 760px) {
  #mode-select {
    padding-top: calc(var(--safe-top) + 6px);
  }

  #mode-select .sp-flame {
    font-size: 5.45rem;
  }

  #mode-select h1 {
    font-size: clamp(2.35rem, 11.5vw, 3.55rem);
    margin-top: 0;
  }

  #mode-select p {
    font-size: 0.68rem;
    margin-top: -4px;
    margin-bottom: -4px;
  }

  .mode-grid {
    height: clamp(286px, 43dvh, 334px);
    margin-top: 2px;
  }

  .mode-card {
    min-height: clamp(258px, 40dvh, 306px);
    padding: 21px 15px;
    gap: 12px;
  }

  .mode-icon {
    font-size: clamp(3rem, 10vw, 4.2rem);
    margin-bottom: 4px;
  }

  .mode-card strong {
    font-size: clamp(1.3rem, 4.9vw, 1.78rem);
  }

  .mode-card em {
    font-size: 0.8rem;
    line-height: 1.26;
  }

  .ritual-shell {
    gap: 6px;
    margin-top: 0;
  }

  #mode-select.ritual-picking {
    padding-top: calc(var(--safe-top) + 4px);
    --ritual-stage-bottom: 128px;
  }

  #mode-select.ritual-picking .mode-shell {
    gap: 4px;
    top: calc(var(--safe-top) + 4px);
    width: min(500px, calc(100vw - 40px));
    height: auto;
    padding-bottom: 0;
  }

  #mode-select.ritual-picking .mode-shell > .sp-flame {
    font-size: clamp(4.15rem, 17vw, 5.1rem);
    margin-top: -10px;
  }

  .ritual-shell h2 {
    font-size: clamp(1.92rem, 7.5vw, 2.82rem);
  }

  .ritual-shell > p {
    font-size: 0.82rem;
    line-height: 1.2;
    padding-top: 5px;
    margin-bottom: -5px;
  }

  .ritual-grid-wrap {
    margin-top: 2px;
  }

  .ritual-grid-wrap::before {
    top: 0;
    height: 5px;
  }

  .ritual-grid-wrap::after {
    bottom: 0;
    height: 5px;
  }

  .ritual-grid {
    height: 100%;
    max-height: none;
    grid-auto-rows: minmax(116px, 1fr);
    padding: 5px 3px;
  }

  .ritual-card {
    min-height: 116px;
    padding: 12px 9px;
    gap: 5px;
  }

  .ritual-play-choice {
    inset: 7px;
    gap: 5px;
    padding: 8px;
  }

  .ritual-play-choice b {
    font-size: 0.98rem;
  }

  .ritual-play-choice div {
    gap: 5px;
    width: 100%;
  }

  .ritual-play-choice button {
    min-height: 31px;
    width: min(100%, 202px);
    font-size: clamp(0.54rem, 2.85vw, 0.66rem);
    letter-spacing: 0.005em;
    padding: 0 10px;
  }

  .mode-sponsor {
    bottom: calc(var(--safe-bot) + 34px);
    width: min(388px, calc(100vw - 36px));
    padding: 10px 14px;
  }
}

@media (max-width: 390px) and (max-height: 690px) {
  .mode-sponsor {
    padding: 8px 12px;
  }

  .mode-sponsor strong {
    font-size: 0.95rem;
  }

  .mode-sponsor span,
  .mode-sponsor b {
    font-size: 0.5rem;
  }
}

@media (max-height: 620px) {
  .mode-sponsor {
    bottom: calc(var(--safe-bot) + 26px);
    padding: 7px 12px;
    transform: translateX(-50%) scale(0.88);
    transform-origin: center bottom;
  }

  .mode-sponsor:hover,
  .mode-sponsor:focus-visible {
    transform: translateX(-50%) translateY(-2px) scale(0.88);
  }

  .mode-sponsor strong {
    font-size: 0.88rem;
  }

  .mode-sponsor span,
  .mode-sponsor b {
    font-size: 0.46rem;
  }

  .mode-legal {
    bottom: calc(var(--safe-bot) + 8px);
  }
}

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