:root {
  --ink: #f7efdf;
  --muted: rgba(247, 239, 223, 0.62);
  --gold-1: #fff1c2;
  --gold-2: #e9c46a;
  --gold-3: #a8741d;
  --green: #22c06b;
  --red: #c8172b;
  --bg: #050c09;
  --wheel: max(260px, min(calc(100vw - 48px), 560px, calc(100svh - 350px)));
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.2, 1.5, .35, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
body:not(.entered) { overflow: hidden; }
button { font: inherit; }

/* ---------- atmosphere ---------- */
.bg {
  position: fixed; inset: 0; z-index: -3; overflow: hidden;
  background: radial-gradient(120% 75% at 50% 60%, #0e4029 0%, #072117 40%, #030906 78%), var(--bg);
}
.bg::after {
  content: ''; position: absolute; inset: 0; opacity: 0.2; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.beam {
  position: absolute; top: -30%; width: 70vmax; height: 160vmax; left: 50%;
  transform-origin: 50% 0;
  background: linear-gradient(180deg, rgba(255, 226, 160, 0.13), rgba(255, 226, 160, 0) 70%);
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
  filter: blur(18px);
  opacity: 0; transition: opacity 2s 0.4s;
}
.entered .beam { opacity: 1; }
.b1 { margin-left: -35vmax; animation: sway1 14s ease-in-out infinite alternate; }
.b2 { margin-left: -35vmax; animation: sway2 17s ease-in-out infinite alternate; }
@keyframes sway1 { from { transform: rotate(-24deg); } to { transform: rotate(-6deg); } }
@keyframes sway2 { from { transform: rotate(22deg); } to { transform: rotate(5deg); } }
#dust { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
.vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at 50% 55%, transparent 35%, rgba(0, 0, 0, 0.85) 100%);
  opacity: 0; transition: opacity 0.8s;
}
.tension .vignette { opacity: 1; }
.tension .beam { opacity: 0.35; }

/* ---------- layout ---------- */
.app {
  position: relative; z-index: 1;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  gap: 8px;
  overflow-x: clip;
}

.rise { opacity: 0; transform: translateY(18px); filter: blur(6px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out), filter 1s var(--ease-out); transition-delay: calc(var(--d, 0s) + 0.5s); }
.entered .rise { opacity: 1; transform: none; filter: none; }

.hero { text-align: center; max-width: 620px; }
.eyebrow { margin: 4px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.34em; text-transform: uppercase; color: var(--gold-2); }
.title {
  margin: 0; font-family: 'Playfair Display', Georgia, serif; font-weight: 900;
  font-size: clamp(30px, 8.4vw, 58px); line-height: 1; letter-spacing: -0.01em;
  filter: drop-shadow(0 2px 16px rgba(233, 196, 106, 0.28));
}
.title .line { display: block; overflow: hidden; padding: 0 0.06em 0.1em; }
.title .line > span {
  display: inline-block;
  background: linear-gradient(100deg, var(--gold-3) 0%, var(--gold-1) 22%, var(--gold-2) 40%, #fff9e8 50%, var(--gold-2) 60%, var(--gold-3) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s linear infinite;
  transform: translateY(115%) rotate(5deg);
  transition: transform 1.3s var(--ease-out);
  transition-delay: calc(var(--d) + 0.55s);
}
.entered .title .line > span { transform: none; }
.title em { font-style: italic; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.sub { margin: 8px auto 0; max-width: 34ch; color: var(--muted); font-size: clamp(13px, 3.6vw, 15px); line-height: 1.5; }
.g { color: var(--green); }

.table { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }

/* ---------- HUD ---------- */
.hud {
  width: var(--wheel); display: flex; align-items: center; gap: 10px;
  padding: 5px 5px 5px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(233, 196, 106, 0.2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.stat { display: flex; align-items: baseline; gap: 8px; }
.stat .label { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.stat .value { display: inline-block; font-family: 'Playfair Display', serif; font-weight: 700; font-size: 20px; color: var(--gold-1); font-variant-numeric: tabular-nums; }
.stat .value.bump { animation: bump 0.55s var(--ease-spring); }
@keyframes bump { 0% { transform: translateY(60%) scale(0.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
.history { flex: 1; display: flex; gap: 5px; justify-content: flex-end; overflow: hidden; min-height: 28px; }
.icon-btn {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  color: var(--gold-1); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(233, 196, 106, 0.25);
  transition: transform 0.2s var(--ease-spring), background 0.2s;
}
.icon-btn:active { transform: scale(0.88); }
.icon-btn .off { display: none; }
.icon-btn.muted .on { display: none; }
.icon-btn.muted .off { display: block; }

.chip {
  flex: none; display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px;
  border-radius: 999px; font-family: 'Playfair Display', serif; font-weight: 700; font-size: 13px; color: #fff;
  border: 1px solid rgba(255, 230, 160, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 6px rgba(0, 0, 0, 0.4);
  animation: chipIn 0.6s var(--ease-spring);
}
.chip.red { background: linear-gradient(#e0263a, #8e0c19); }
.chip.black { background: linear-gradient(#3a3a3e, #0b0b0c); }
.chip.green { background: linear-gradient(#2ad57a, #0b7a3d); box-shadow: 0 0 14px rgba(60, 240, 140, 0.6); }
.history .chip.green { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.chip.big { min-width: 44px; height: 44px; font-size: 20px; }
@keyframes chipIn { from { transform: translateX(-30px) rotateY(180deg) scale(0.4); opacity: 0; } }

/* ---------- wheel stage ---------- */
.wheel-stage {
  position: relative; width: var(--wheel); aspect-ratio: 1;
  perspective: 1100px; perspective-origin: 50% 20%;
  margin: 14px 0 14px;
}
.wheel-tilt { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; transform: rotateX(70deg) scale(0.5); }
.wheel-tilt canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: 50%;
  touch-action: none; cursor: grab;
  box-shadow: 0 0 0 1px rgba(233, 196, 106, 0.3), 0 0 60px rgba(233, 196, 106, 0.1);
}
.wheel-shadow {
  position: absolute; left: 4%; right: 4%; bottom: -7%; height: 26%; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.75), transparent 70%);
  filter: blur(12px); opacity: 0; transition: opacity 1.5s 0.8s;
}
.entered .wheel-shadow { opacity: 1; }
.wheel-glow {
  position: absolute; inset: -12%; border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 196, 106, 0.2), transparent 62%);
  filter: blur(24px); transition: background 0.6s, transform 0.6s;
}
.is-spinning .wheel-glow { background: radial-gradient(circle, rgba(255, 214, 140, 0.3), transparent 64%); }
.tension .wheel-glow { animation: heartGlow 0.76s ease-out infinite; }
@keyframes heartGlow { 0%, 40% { transform: scale(1); } 10% { transform: scale(1.06); } 28% { transform: scale(1.03); } }
[data-lights="win"] .wheel-glow { background: radial-gradient(circle, rgba(60, 240, 140, 0.45), transparent 66%); }

/* marquee bulbs */
.bulbs { position: absolute; inset: 0; pointer-events: none; transform-style: preserve-3d; }
.bulbs i {
  --c: #ffe3a1;
  position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, var(--c) 45%, rgba(0, 0, 0, 0.2) 100%);
  transform: rotate(calc(var(--i) * 9deg)) translateY(calc(var(--wheel) * -0.5 - 12px));
  opacity: 0.22;
  animation: chase var(--dur, 2.4s) linear infinite;
  animation-delay: calc(var(--k) / 10 * var(--dur, 2.4s) * -1);
}
@keyframes chase {
  0% { opacity: 1; box-shadow: 0 0 6px 2px var(--c), 0 0 16px 4px rgba(255, 200, 100, 0.5); }
  30% { opacity: 0.22; box-shadow: none; }
  100% { opacity: 0.22; box-shadow: none; }
}
[data-lights="off"] .bulbs i { animation: none; opacity: 0.1; }
[data-lights="idle"] { --dur: 2.4s; }
[data-lights="spin"] { --dur: 0.7s; }
[data-lights="tension"] { --dur: 0.32s; }
[data-lights="tension"] .bulbs i { --c: #fff6e0; }
[data-lights="win"] .bulbs i { --c: #5dffa6; animation: winBlink 0.24s steps(1) infinite; }
[data-lights="win"] .bulbs i:nth-child(odd) { animation-delay: -0.12s; }
@keyframes winBlink { 0% { opacity: 1; box-shadow: 0 0 8px 3px #5dffa6, 0 0 22px 6px rgba(60, 240, 140, 0.6); } 50% { opacity: 0.15; box-shadow: none; } }
[data-lights="lose"] .bulbs i { --c: #ff4d5e; animation: loseFlash 0.32s steps(1) 3; opacity: 0.22; }
@keyframes loseFlash { 0% { opacity: 1; box-shadow: 0 0 8px 3px #ff4d5e; } 50% { opacity: 0.15; box-shadow: none; } }

/* result slam + toast */
.slam {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px;
  pointer-events: none; z-index: 5; opacity: 0;
}
.slam.go { animation: slam 1.9s var(--ease-out) forwards; }
@keyframes slam {
  0% { opacity: 0; transform: scale(2.6); filter: blur(14px); }
  12% { opacity: 1; transform: scale(0.94); filter: blur(0); }
  20% { transform: scale(1.02); }
  26% { transform: scale(1); }
  78% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.06) translateY(-16px); filter: blur(4px); }
}
.slam-chip {
  display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%;
  font-family: 'Playfair Display', serif; font-weight: 900; font-size: 44px; color: #fff;
  border: 4px solid var(--gold-2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 3px 8px rgba(255, 255, 255, 0.3);
}
.slam-chip.red { background: radial-gradient(circle at 35% 30%, #ff4b5e, #8e0c19 75%); }
.slam-chip.black { background: radial-gradient(circle at 35% 30%, #4a4a50, #08080a 75%); }
.slam-chip.green { background: radial-gradient(circle at 35% 30%, #4dffa0, #0b7a3d 75%); box-shadow: 0 0 60px rgba(60, 240, 140, 0.8), inset 0 3px 8px rgba(255, 255, 255, 0.3); }
.slam-word {
  font-family: 'Playfair Display', serif; font-weight: 900; font-style: italic; font-size: clamp(30px, 9vw, 52px);
  letter-spacing: 0.04em; color: var(--gold-1);
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.8), 0 0 30px rgba(233, 196, 106, 0.5);
}
.slam-word.green { color: #b8ffd6; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.8), 0 0 40px rgba(60, 240, 140, 0.9); }

.result {
  position: absolute; left: 50%; bottom: 6%; z-index: 6;
  transform: translate(-50%, 24px) scale(0.85);
  display: flex; align-items: center; gap: 12px; width: max-content; max-width: 88%;
  padding: 8px 18px 8px 8px; border-radius: 999px;
  background: rgba(8, 14, 11, 0.85); border: 1px solid rgba(233, 196, 106, 0.35);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  opacity: 0; pointer-events: none; transition: 0.55s var(--ease-spring);
}
.result.show { opacity: 1; transform: translate(-50%, 0) scale(1); transition-delay: 0.9s; }
.result .msg { font-size: 13.5px; font-weight: 600; line-height: 1.25; }

/* ---------- buttons ---------- */
.spin-btn {
  --power: 0;
  position: relative; border: 0; cursor: pointer; border-radius: 999px; padding: 2px; min-width: 220px;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3) 45%, var(--gold-2) 70%, var(--gold-1));
  box-shadow: 0 10px 30px rgba(233, 196, 106, 0.3), 0 2px 0 rgba(0, 0, 0, 0.4);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.3s, opacity 0.3s, filter 0.3s;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.spin-btn .btn-face {
  position: relative; display: block; overflow: hidden; padding: 14px 34px; border-radius: 999px;
  background: linear-gradient(#f6d784, #c9963a);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 8px rgba(110, 60, 0, 0.35);
}
.spin-btn .label {
  position: relative; display: block;
  color: #2a1803; font-family: 'Playfair Display', serif; font-weight: 900; font-size: 22px; letter-spacing: 0.18em; text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.spin-btn .power {
  position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(var(--power));
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.75));
  mix-blend-mode: overlay;
}
.spin-btn::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.6) 50%, transparent 70%);
  background-size: 250% 100%; animation: sweep 3s ease-in-out infinite; mix-blend-mode: overlay;
}
@keyframes sweep { 0%, 40% { background-position: 150% 0; } 100% { background-position: -100% 0; } }
.spin-btn:active { transform: translateY(2px) scale(0.97); }
.spin-btn.charging { transform: scale(calc(0.97 + var(--power) * 0.06)); box-shadow: 0 0 calc(20px + var(--power) * 50px) rgba(255, 214, 120, calc(0.3 + var(--power) * 0.5)); }
.spin-btn.full { animation: buzz 0.09s linear infinite; }
@keyframes buzz { 0% { translate: -1.5px 0; } 50% { translate: 1.5px 0; } 100% { translate: -1.5px 0; } }
.spin-btn:disabled { opacity: 0.45; cursor: default; filter: saturate(0.6); }
.spin-btn:disabled::after { animation: none; }
.spin-btn.small { min-width: 0; }
.spin-btn.small .btn-face { padding: 12px 20px; }
.spin-btn.small .label { white-space: nowrap; letter-spacing: 0.12em; }
.spin-btn.small .label { font-size: 15px; }
.entered .spin-btn.rise:disabled { opacity: 0.45; }

.hint { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; max-width: 36ch; }
.hint b { color: var(--ink); font-weight: 600; }
.link-btn { background: none; border: 0; color: var(--gold-2); font: 600 13px Inter, sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- full-screen fx ---------- */
.flash { position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 50%, var(--fc, #fff), transparent 75%); }
.flash.go { animation: flash 1s ease-out; }
@keyframes flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }
.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fx-back { z-index: 25; }
.fx-front { z-index: 45; }

/* ---------- gate ---------- */
.gate { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; overflow: hidden; }
.door {
  position: absolute; top: 0; bottom: 0; width: 50.5%;
  background:
    radial-gradient(120% 80% at var(--x) 50%, rgba(20, 90, 55, 0.55), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #06150e, #030806);
  transition: transform 1.5s cubic-bezier(.7, 0, .2, 1);
}
.door.left { left: 0; --x: 100%; box-shadow: inset -2px 0 0 rgba(233, 196, 106, 0.6), 10px 0 40px rgba(0, 0, 0, 0.7); }
.door.right { right: 0; --x: 0%; box-shadow: inset 2px 0 0 rgba(233, 196, 106, 0.6), -10px 0 40px rgba(0, 0, 0, 0.7); }
.door::after {
  content: ''; position: absolute; top: 50%; width: 10px; height: 90px; margin-top: -45px; border-radius: 6px;
  background: linear-gradient(90deg, #6b430c, #fff1c2, #a8741d);
}
.door.left::after { right: 22px; }
.door.right::after { left: 22px; }
.gate.open .door.left { transform: translateX(-102%); }
.gate.open .door.right { transform: translateX(102%); }
.gate.open { pointer-events: none; }
.gate-inner {
  position: relative; text-align: center; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 12px;
  transition: opacity 0.5s, transform 0.7s var(--ease-out);
  animation: gateIn 1.2s var(--ease-out) both;
}
@keyframes gateIn { from { opacity: 0; transform: translateY(20px) scale(0.96); filter: blur(8px); } }
.gate.open .gate-inner { opacity: 0; transform: scale(1.15); }
.chip-logo {
  width: 96px; height: 96px; border-radius: 50%; position: relative;
  background: repeating-conic-gradient(var(--green) 0 15deg, #f7efdf 15deg 30deg);
  box-shadow: 0 0 0 4px var(--gold-2), 0 0 50px rgba(233, 196, 106, 0.45), 0 12px 30px rgba(0, 0, 0, 0.6);
  animation: chipSpin 6s linear infinite;
}
.chip-logo span { position: absolute; inset: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #1fa75e, #064a26); box-shadow: inset 0 0 0 3px var(--gold-2); }
@keyframes chipSpin { to { transform: rotate(360deg); } }
.gate-eyebrow { margin: 10px 0 0; font-size: 12px; font-weight: 600; letter-spacing: 0.34em; text-transform: uppercase; color: var(--gold-2); }
.gate-title {
  margin: 0 0 10px; font-family: 'Playfair Display', serif; font-weight: 900; font-size: clamp(42px, 12vw, 76px); line-height: 0.95;
  background: linear-gradient(100deg, var(--gold-3), var(--gold-1) 30%, var(--gold-2) 55%, #fff9e8 70%, var(--gold-3));
  background-size: 220% 100%; animation: shimmer 5s linear infinite;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 24px rgba(233, 196, 106, 0.3));
}
.gate-title em { font-style: italic; }
.gate-hint { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- reveal ---------- */
.reveal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; overflow: hidden; }
.reveal[hidden] { display: none; }
.reveal-backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(10, 70, 40, 0.55), rgba(0, 0, 0, 0.82));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.6s;
}
.reveal.open .reveal-backdrop { opacity: 1; }
.rays {
  position: absolute; left: 50%; top: 45%; width: 180vmax; height: 180vmax; margin: -90vmax 0 0 -90vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 220, 140, 0.11) 0 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 45%); mask: radial-gradient(circle, #000 0, transparent 45%);
  animation: rays 40s linear infinite; opacity: 0; transition: opacity 1.2s;
}
.reveal.open .rays { opacity: 1; }
.reveal.flipped .rays { background: repeating-conic-gradient(from 0deg, rgba(120, 255, 180, 0.1) 0 5deg, transparent 5deg 15deg); }
@keyframes rays { to { transform: rotate(360deg); } }
.scene { perspective: 1600px; width: min(440px, 100%); position: relative; }
.card {
  position: relative; display: grid; transform-style: preserve-3d;
  transform: translateY(60px) scale(0.5) rotateX(35deg); opacity: 0;
  transition: transform 1.1s var(--ease-spring), opacity 0.5s;
}
.reveal.open .card { transform: none; opacity: 1; }
.reveal.flipped .card { transform: rotateY(180deg); transition: transform 1.2s cubic-bezier(.5, -0.2, .25, 1.25); }
.card-face {
  grid-area: 1 / 1; border-radius: 28px; padding: 28px 22px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: 1px solid rgba(255, 230, 160, 0.5);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.card-front {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 380px;
  background: radial-gradient(circle at 50% 35%, #22b866, #075a2c 60%, #032214);
}
.front-ring {
  width: 160px; height: 160px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #3ee68d, #0b7a3d 70%);
  border: 7px solid var(--gold-2);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3), 0 0 60px rgba(80, 255, 160, 0.55), inset 0 4px 10px rgba(255, 255, 255, 0.35);
  font-family: 'Playfair Display', serif; font-weight: 900; font-size: 78px; color: #fff; text-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  animation: glow 1.2s ease-in-out infinite alternate;
}
@keyframes glow { to { box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3), 0 0 120px rgba(80, 255, 160, 0.9), inset 0 4px 10px rgba(255, 255, 255, 0.35); transform: scale(1.04); } }
.front-word { margin: 6px 0 0; font-family: 'Playfair Display', serif; font-weight: 900; font-style: italic; font-size: 52px; color: var(--gold-1); letter-spacing: 0.04em; line-height: 1; }
.front-sub { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.34em; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); }
.card-back {
  transform: rotateY(180deg);
  background: radial-gradient(circle at 50% 0%, rgba(233, 196, 106, 0.2), transparent 55%), linear-gradient(160deg, #10241a, #06120c);
  text-align: center; max-height: calc(100svh - 32px); overflow-y: auto;
}
.r-eyebrow { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.34em; text-transform: uppercase; color: var(--green); }
.r-title {
  margin: 6px 0 14px; font-family: 'Playfair Display', serif; font-weight: 900; font-size: clamp(44px, 12vw, 62px); line-height: 1; letter-spacing: 0.03em;
  background: linear-gradient(100deg, var(--gold-3), var(--gold-1) 40%, var(--gold-2) 70%, var(--gold-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.reveal.flipped .r-title { animation: drop 0.9s 0.7s var(--ease-spring) both; }
.reveal.flipped .r-eyebrow { animation: fadeUp 0.7s 0.5s var(--ease-out) both; }
@keyframes drop { from { opacity: 0; transform: translateY(-40px) scale(1.3); filter: blur(8px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } }

.frame {
  display: inline-block; max-width: 100%; padding: 10px; border-radius: 18px; position: relative;
  background: linear-gradient(135deg, #fff1c2, #a8741d 30%, #e9c46a 55%, #6b430c 80%, #fff1c2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 60px rgba(233, 196, 106, 0.25);
}
.reveal.flipped .frame { animation: frameIn 1s 0.4s var(--ease-spring) both; }
@keyframes frameIn { from { opacity: 0; transform: scale(0.8) rotate(-4deg); } }
.frame-inner { position: relative; overflow: hidden; border-radius: 10px; background: #0b1410; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.5); }
.frame img {
  display: block; max-width: 100%; max-height: min(50svh, 520px); width: auto; height: auto; margin: 0 auto;
  filter: blur(18px) grayscale(1) brightness(1.9) contrast(0.6); transform: scale(1.12);
  transition: filter 3s ease 1s, transform 3s ease 1s;
}
.reveal.flipped .frame img { filter: none; transform: none; }
.frame img[hidden], .placeholder[hidden] { display: none; }
.placeholder {
  width: min(260px, 64vw); aspect-ratio: 3 / 4; display: grid; place-content: center; justify-items: center; gap: 10px;
  color: rgba(233, 196, 106, 0.8); font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  background: radial-gradient(circle at 50% 40%, #183626, #07130d);
}
.shine {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%);
  transform: translateX(-120%);
}
.reveal.flipped .shine { animation: shine 1.3s 3.6s ease-in-out; }
@keyframes shine { to { transform: translateX(120%); } }
.r-caption {
  margin: 16px 0 4px; font-family: 'Playfair Display', serif; font-weight: 900; font-style: italic;
  font-size: clamp(21px, 6.9vw, 36px); line-height: 1.05; letter-spacing: 0.02em; color: #b8ffd6; white-space: nowrap;
  text-shadow: 0 0 24px rgba(60, 240, 140, 0.7), 0 4px 16px rgba(0, 0, 0, 0.6);
}
.reveal.flipped .r-caption { animation: punch 0.9s 1.35s var(--ease-spring) both, pulse 1.6s 2.4s ease-in-out infinite; }
@keyframes punch { 0% { opacity: 0; transform: scale(2.4) rotate(-6deg); filter: blur(10px); } 60% { opacity: 1; transform: scale(0.94) rotate(1deg); filter: blur(0); } 100% { transform: none; } }
@keyframes pulse { 50% { transform: scale(1.05); text-shadow: 0 0 40px rgba(60, 240, 140, 1), 0 4px 16px rgba(0, 0, 0, 0.6); } }
.r-caption:empty { display: none; }
.r-lines { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 8px; }
.r-lines:empty { display: none; }
.r-lines li { padding: 11px 14px; border-radius: 12px; font-size: 15px; color: var(--muted); background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(233, 196, 106, 0.15); }
.r-lines b { color: var(--ink); }
.r-cta { display: block; margin: 0 0 14px; color: var(--gold-2); font-weight: 600; }
.r-actions { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 14px; }
.reveal.flipped .r-actions { animation: fadeUp 0.8s 1.8s var(--ease-out) both; }
.ghost-btn {
  padding: 13px 20px; border-radius: 999px; cursor: pointer; font: 600 14px Inter, sans-serif;
  color: var(--ink); background: transparent; border: 1px solid rgba(247, 239, 223, 0.3);
}

@media (max-height: 700px) {
  .frame img { max-height: 46svh; }
  .r-title { font-size: clamp(36px, 11vw, 62px); margin-bottom: 10px; }
  .card-face { padding: 22px 18px; }
}
@media (min-height: 860px) { :root { --wheel: max(260px, min(calc(100vw - 48px), 600px, calc(100svh - 420px))); } }
@media (prefers-reduced-motion: reduce) {
  .reveal.flipped .r-caption { animation: fadeUp 0.6s 1.35s both; }
  .beam, .title .line > span, .spin-btn::after, .front-ring, .rays, .chip-logo, .gate-title { animation: none !important; }
}
