/**
 * VINTAGE PINUP TRADING CARDS
 * Limited-run digital collectibles.
 * Palette: Aged paper, cream, soft pastels, sepia, muted warm tones.
 * Reference: 1940s–60s pinup trading cards, playing cards, pulp covers.
 *
 * SWAP: Colors in :root. Domain/brand in server/config.js.
 */

:root {
  /* Vintage playing card / pinup palette — strong contrast, readable */
  --bg: #e8e0d5;
  --bg-warm: #dfd6c8;
  --paper: #faf5ef;
  --paper-aged: #f0e8dc;
  --paper-dark: #d8cfc0;
  --card-red: #8b2942;
  --card-red-dim: #6b1f33;
  --card-red-bright: #a83d58;
  --burgundy: #8b2942;
  --burgundy-dim: #6b1f33;
  --burgundy-bright: #a83d58;
  --gold: #c9a227;
  --gold-dim: #9a7b1e;
  --gold-bright: #e6b82e;
  --sepia: #3d3028;
  --sepia-light: #5c4a3d;
  --pastel-pink: #f0e0e4;
  --pastel-blue: #e0e8f0;
  --pastel-cream: #f5efe6;
  --text: #1a1612;
  --text-dim: #4a4038;
  --grain: rgba(61, 48, 40, 0.04);
  --glow-gold: rgba(201, 162, 39, 0.2);
  --glow-subtle: rgba(139, 41, 66, 0.08);
  --glow-burgundy: rgba(139, 41, 66, 0.12);
  --card-border: #b8a898;
  --card-border-inner: #988878;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  display: flex;
  flex-direction: column;
  font-family: 'Barlow', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg) url('/img/pins-wall.jpg') center center / cover no-repeat fixed;
  color: var(--text);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(232,226,216,0.5) 0%, rgba(232,226,216,0.7) 100%);
  pointer-events: none;
  z-index: 0;
}

.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.25;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.demo-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: linear-gradient(90deg, var(--burgundy-dim), var(--burgundy));
  color: var(--paper);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 0.6rem 1rem;
  font-family: 'Bebas Neue', sans-serif;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.demo-banner.hidden { display: none; }

body:has(.demo-banner:not(.hidden)) .landing { padding-top: 3rem; }

/* Landing — flex-start so logo stays visible (no top cutoff on mobile/desktop) */
.landing {
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1.5rem;
  position: relative;
}

.landing::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, var(--pastel-pink) 0%, transparent 50%),
              radial-gradient(ellipse 60% 80% at 80% 20%, var(--pastel-blue) 0%, transparent 40%);
  pointer-events: none;
  opacity: 0.5;
}

.machine-frame {
  max-width: 420px;
  text-align: center;
  border: 2px solid var(--card-border);
  border-radius: 4px;
  padding: 3rem 2.5rem;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-aged) 100%);
  box-shadow:
    0 4px 24px rgba(92, 64, 51, 0.12),
    0 0 0 1px var(--card-border-inner),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -1px 0 rgba(0,0,0,0.04);
  opacity: 0;
  transform: translateY(16px);
  position: relative;
}

.machine-frame.animate-in {
  animation: machineReveal 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes machineReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.what-you-get {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--card-border);
  text-align: left;
}

.what-you-get .what-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--burgundy-dim);
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

.what-you-get ul {
  list-style: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-dim);
  line-height: 1.9;
}

.what-you-get li {
  padding-left: 0.25rem;
  transition: color 0.2s ease;
}

.what-you-get li:hover {
  color: var(--text);
}

/* Desktop: wider, more compact — logo stays visible */
@media (min-width: 768px) {
  .landing {
    justify-content: flex-start;
    padding-top: 2.5rem;
    padding-bottom: 2rem;
  }
  .machine-frame {
    max-width: 580px;
    padding: 2rem 2.5rem;
  }
  .landing-logo {
    max-width: 240px;
    margin-bottom: 1rem;
  }
  .landing-hook { margin-bottom: 0.75rem; }
  .tagline { margin-bottom: 1.25rem; }
  .slot-wrap { margin-bottom: 1.25rem; }
  .cta-hook { margin-bottom: 1rem; }
  .what-you-get {
    margin-top: 2rem;
    padding-top: 1.5rem;
  }
  .legal-footer {
    padding-right: 7rem;
  }
}

.what-you-get li::before {
  content: '—';
  color: var(--burgundy-dim);
  margin-right: 0.5rem;
  opacity: 0.8;
}

.sound-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  background: var(--paper);
  border: 2px solid var(--card-border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.sound-toggle:hover {
  color: var(--burgundy-bright);
  border-color: var(--burgundy-dim);
}

.sound-toggle.playing {
  color: var(--burgundy);
  border-color: var(--burgundy-dim);
  box-shadow: 0 2px 12px rgba(114, 47, 55, 0.15);
}

.sound-toggle .sound-icon {
  font-size: 0.9rem;
  opacity: 0.85;
}

.sound-toggle.playing .sound-icon {
  animation: soundPulse 2s ease-in-out infinite;
}

@keyframes soundPulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

.sound-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.landing-logo {
  display: block;
  max-width: 195px;
  height: auto;
  margin: 0 auto 1.25rem;
}

.landing-hook {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.2rem, 6vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 2px rgba(255,255,255,0.6);
}

.tagline {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.slot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.slot-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--burgundy-dim);
  text-transform: uppercase;
}

.cta-hook {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.slot {
  width: 70px;
  height: 10px;
  margin: 0;
  background: linear-gradient(180deg,
    rgba(114, 47, 55, 0.2) 0%,
    rgba(92, 37, 44, 0.5) 30%,
    rgba(92, 37, 44, 0.6) 50%,
    rgba(92, 37, 44, 0.5) 70%,
    rgba(114, 47, 55, 0.15) 100%
  );
  border-radius: 2px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5), 0 0 12px rgba(114, 47, 55, 0.15);
}

.consult-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  padding: 1.1rem 2rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  background: var(--burgundy);
  border: 2px solid var(--burgundy-dim);
  color: #fff;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 4px;
}

.consult-btn:hover:not(:disabled) {
  background: var(--burgundy-bright);
  box-shadow: 0 4px 16px rgba(114, 47, 55, 0.3);
  transform: translateY(-1px);
}

.consult-btn.demo-mode .btn-price { font-style: italic; }

.consult-btn.sold-out {
  background: var(--sepia-light);
  border-color: var(--card-border);
  color: var(--text-dim);
}

.consult-btn.sold-out:hover {
  background: var(--sepia-light);
  transform: none;
}

.consult-btn:active:not(:disabled) {
  transform: translateY(0);
}

.consult-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.consult-btn:focus-visible {
  outline: 2px solid var(--burgundy-bright);
  outline-offset: 2px;
}

.btn-price {
  font-family: 'Barlow', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
}

.disclaimer {
  margin-top: 1.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  line-height: 1.6;
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.85rem 1.6rem;
  background: var(--paper);
  border: 1px solid var(--card-border);
  color: var(--text);
  font-size: 0.9rem;
  box-shadow: 0 4px 24px rgba(92, 64, 51, 0.2);
  animation: fadeIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 3px;
}

.toast.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Reading phases */
.phase {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  padding-bottom: 1.5rem;
  transition: opacity 0.5s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.phase.hidden {
  display: none !important;
}

/* Enable sound phase (post-Stripe, before static) */
.enable-sound-phase {
  background: var(--bg);
}

.enable-sound-phase::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 50%, var(--pastel-pink) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.4;
}

.enable-sound-logo {
  display: block;
  max-width: 100px;
  height: auto;
  margin: 0 auto 1rem;
  position: relative;
  z-index: 1;
  opacity: 0.9;
}

.enable-sound-container {
  text-align: center;
  max-width: 340px;
  position: relative;
  z-index: 1;
}

.enable-sound-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.75rem;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-bottom: 0.85rem;
}

.enable-sound-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 1.75rem;
}

.enable-sound-btn {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.15em;
  padding: 1rem 2rem;
  background: var(--burgundy);
  border: 2px solid var(--burgundy-dim);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 4px;
}

.enable-sound-btn:hover,
.enable-sound-btn:focus {
  background: var(--burgundy-bright);
  box-shadow: 0 4px 16px rgba(114, 47, 55, 0.3);
  transform: translateY(-1px);
}

/* Fanned cards behind "Your card is ready" */
.enable-sound-cards {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.enable-sound-cards .enable-sound-card {
  position: absolute;
  width: 120px;
  height: auto;
  aspect-ratio: 200/280;
  object-fit: cover;
  opacity: 0;
  transition: opacity 2s ease;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(92, 64, 51, 0.25);
}

.enable-sound-cards .enable-sound-card.visible {
  opacity: 0.45;
}

.enable-sound-cards .enable-sound-card:nth-child(1) {
  transform: translate(-165px, -15px) rotate(-24deg);
}
.enable-sound-cards .enable-sound-card:nth-child(2) {
  transform: translate(-60px, -45px) rotate(-8deg);
}
.enable-sound-cards .enable-sound-card:nth-child(3) {
  transform: translate(60px, -45px) rotate(8deg);
}
.enable-sound-cards .enable-sound-card:nth-child(4) {
  transform: translate(165px, -15px) rotate(24deg);
}

/* Static phase — aged paper / film grain (not TV static) */
.static-phase {
  background: var(--bg-warm);
}

.static-phase .static-text {
  color: var(--text);
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

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

/* Fading card images behind static wait text */
.static-cards {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.static-card-img {
  position: absolute;
  width: 140px;
  height: auto;
  aspect-ratio: 200/280;
  object-fit: cover;
  opacity: 0;
  transition: opacity 2.5s ease;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(92, 64, 51, 0.2);
}

.static-card-img.visible {
  opacity: 0.35;
}

@media (max-width: 767px) {
  .static-card-img {
    width: 100px;
  }
}

/* Large card — centered, lingers, fades in/out */
.static-large-card {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.static-large-card img {
  max-width: 280px;
  width: 85%;
  max-height: 55vh;
  height: auto;
  aspect-ratio: 200/280;
  object-fit: cover;
  opacity: 0;
  transition: opacity 2.5s ease;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(92, 64, 51, 0.35);
}

.static-large-card img.visible {
  opacity: 0.85;
}

/* Random glyph preview — unformed elements before final talisman */
.static-glyph-preview {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.static-glyph-preview svg {
  position: absolute;
  width: 100px;
  height: 100px;
  opacity: 0;
  transition: opacity 1.8s ease;
}

.static-glyph-preview svg.visible {
  opacity: 0.55;
}

.static-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% 50%, transparent 35%, rgba(92,64,51,0.15) 70%, rgba(92,64,51,0.35) 100%);
  pointer-events: none;
}

.static-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(92, 64, 51, 0.03) 3px,
    rgba(92, 64, 51, 0.03) 6px
  );
  pointer-events: none;
}

.static-text {
  position: relative;
  z-index: 3;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  color: var(--text);
  animation: blink 1.5s ease-in-out infinite;
}

.sound-hint {
  position: relative;
  z-index: 3;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
}

.tap-to-reveal {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(232, 226, 216, 0.85);
}

.tap-to-reveal.hidden {
  display: none;
}

.tap-to-reveal-btn {
  padding: 1rem 2rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.12em;
  background: var(--burgundy);
  border: 2px solid var(--burgundy-dim);
  color: #fff;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(114, 47, 55, 0.25);
  transition: all 0.25s ease;
}

.tap-to-reveal-btn:hover,
.tap-to-reveal-btn:focus {
  background: var(--burgundy-bright);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(114, 47, 55, 0.35);
}

@keyframes static {
  0%, 100% { background-position: 0 0; }
  25% { background-position: 50px 50px; }
  50% { background-position: 100px 0; }
  75% { background-position: 0 100px; }
}

@keyframes blink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Reveal phase */
.reveal-logo {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90px;
  height: auto;
  opacity: 0.85;
  z-index: 2;
}

.reveal-phase {
  background: var(--bg);
  position: relative;
  justify-content: flex-start;
  padding-top: 2rem;
}

.reveal-phase::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 100% 80% at 50% 20%, var(--pastel-pink) 0%, transparent 50%);
  pointer-events: none;
  opacity: 0.3;
}

.reveal-phase .reveal-container {
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}

.glitch-brief {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
}

.glitch-brief.active {
  animation: glitchFlash 0.15s ease-out;
}

@keyframes glitchFlash {
  0% { opacity: 1; }
  50% { opacity: 0.3; }
  100% { opacity: 0; }
}

.reveal-container {
  max-width: 480px;
  text-align: center;
  animation: revealIn 1.3s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  position: relative;
  z-index: 2;
}

.rarity-badge {
  display: inline-block;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--gold-bright);
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(139, 41, 66, 0.5);
  box-shadow: 0 0 15px var(--glow-subtle);
}

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

.sigil-wrap {
  margin-bottom: 2rem;
  position: relative;
  padding: 1rem;
  background: var(--paper);
  border: 2px solid var(--card-border);
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(92, 64, 51, 0.15), inset 0 1px 0 rgba(255,255,255,0.5);
}

.sigil-wrap::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1px solid var(--card-border-inner);
  border-radius: 8px;
  pointer-events: none;
}

.sigil {
  width: 200px;
  height: 280px;
  margin: 0 auto;
  position: relative;
  filter: drop-shadow(0 2px 8px rgba(92, 64, 51, 0.2));
}

.sigil :global(svg) {
  width: 100%;
  height: 100%;
}

.sigil .card-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 2px;
}

/* Card badge glyph — below serial, line/arc + suit */
.card-badge-wrap {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

.card-badge-wrap.hidden {
  display: none !important;
}

.card-badge-wrap svg {
  width: 80px;
  height: 80px;
  display: block;
  filter: drop-shadow(0 1px 3px rgba(92, 64, 51, 0.2));
}

.mood-omen {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  color: var(--burgundy-bright);
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.card-traits {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 1rem;
  font-style: italic;
}

.card-persona {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.message {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.7;
  font-style: italic;
  margin-bottom: 1.75rem;
  white-space: pre-line;
  color: var(--text);
  max-width: 28em;
  margin-left: auto;
  margin-right: auto;
}

.message .line {
  display: block;
  animation: lineIn 0.9s ease-out backwards;
}

.message .line:nth-child(1) { animation-delay: 0.3s; }
.message .line:nth-child(2) { animation-delay: 0.65s; }
.message .line:nth-child(3) { animation-delay: 1s; }
.message .line:nth-child(4) { animation-delay: 1.35s; }
.message .line:nth-child(5) { animation-delay: 1.7s; }

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

.reading-number {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.actions {
  margin-top: 2.25rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  gap: 0.85rem;
  align-items: center;
}

.actions .share-btn.secondary {
  border-color: rgba(139, 41, 66, 0.5);
  font-size: 0.95rem;
}

.actions .share-btn.secondary:hover {
  border-color: var(--burgundy-bright);
  background: rgba(114, 47, 55, 0.1);
}

.share-btn {
  padding: 0.8rem 1.8rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.1em;
  background: transparent;
  border: 2px solid var(--burgundy-dim);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.share-btn:hover {
  border-color: var(--burgundy-bright);
  background: var(--burgundy);
  color: #fff;
  box-shadow: 0 0 20px var(--glow-burgundy);
}

.share-btn:focus-visible {
  outline: 2px solid var(--burgundy-bright);
  outline-offset: 2px;
}

.back-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.25s ease, opacity 0.25s ease;
}

.back-link:hover {
  color: var(--burgundy-bright);
}

.back-link:focus-visible {
  outline: 2px solid var(--burgundy-bright);
  outline-offset: 2px;
}

/* Rarity badges */
.rarity-mythic .mood-omen { color: #e8c547; }
.rarity-rare .mood-omen { color: #c9a227; }
.rarity-strange .mood-omen { color: var(--sepia-light); }
.rarity-common .mood-omen { color: var(--burgundy-dim); }

/* Already consulted (reload) */
.already-consulted-phase {
  background: var(--bg);
}

.already-consulted-phase::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 50%, var(--glow-burgundy) 0%, transparent 70%);
  pointer-events: none;
}

.already-consulted-container {
  max-width: 420px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.already-consulted-container .message {
  margin-bottom: 2.25rem;
}

.consult-again-btn {
  display: inline-block;
  padding: 1.1rem 2rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  background: transparent;
  border: 2px solid var(--burgundy-bright);
  color: var(--text);
  text-decoration: none;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.consult-again-btn:hover {
  background: var(--burgundy);
  color: #fff;
  box-shadow: 0 0 30px var(--glow-burgundy);
  transform: translateY(-1px);
}

.consult-again-btn:focus-visible {
  outline: 2px solid var(--burgundy-bright);
  outline-offset: 2px;
}

/* Error */
.error-phase {
  text-align: center;
}

.error-phase .back-link {
  transition: all 0.25s ease;
}

.error-text {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 1.75rem;
  color: var(--text);
  line-height: 1.6;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.hidden {
  display: none !important;
}

/* Legal footer — padding clears fixed sound-toggle, keeps logo visible */
.legal-footer {
  text-align: center;
  padding: 2rem 1.5rem 4rem;
  padding-right: 4rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  line-height: 1.6;
}

.legal-footer p {
  margin: 0.25rem 0;
}

.footer-logo {
  display: block;
  max-width: 72px;
  height: auto;
  margin: 0 auto 0.75rem;
  opacity: 0.7;
}

.footer-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem !important;
}

.footer-brand a {
  color: var(--burgundy-dim);
  text-decoration: none;
}

.footer-brand a:hover {
  color: var(--burgundy-bright);
  text-decoration: underline;
}

.legal-footer-fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(232,226,216,0.98));
  padding: 3rem 1.5rem 1.5rem;
}

.legal-footer-fixed .footer-brand {
  margin-bottom: 0.75rem !important;
}

.legal-footer-fixed .footer-lurking {
  margin-bottom: 2rem;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.9;
}

/* Footer in flow — reveal phase only, below content */
.legal-footer-flow {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--card-border);
  flex-shrink: 0;
}

.legal-footer-flow .footer-brand {
  margin-bottom: 0.75rem !important;
}

.legal-footer-flow .footer-lurking {
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.legal-links {
  margin-top: 0.5rem !important;
}

.legal-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  color: var(--burgundy-dim);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-link:hover {
  color: var(--burgundy-bright);
}

.legal-link:focus-visible {
  outline: 2px solid var(--burgundy-bright);
  outline-offset: 2px;
}

/* Checkout anticipation — ~7s delay before Stripe with audio + messages */
.checkout-anticipation {
  position: fixed;
  inset: 0;
  z-index: 2002;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.checkout-anticipation:not(.hidden) {
  pointer-events: auto;
}

.checkout-anticipation.hidden {
  display: none !important;
}

.checkout-anticipation-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 22, 18, 0.92);
  animation: checkout-fade-in 0.6s ease forwards;
}

.checkout-anticipation-cards {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.checkout-anticipation-cards .static-card-img {
  opacity: 0;
  transition: opacity 2.5s ease;
}

.checkout-anticipation-cards .static-card-img.visible {
  opacity: 0.25;
}

.checkout-anticipation-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
}

.checkout-anticipation-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.12em;
  color: var(--paper);
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  animation: checkout-pulse 2s ease-in-out infinite;
}

@keyframes checkout-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes checkout-pulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; }
}

/* Hero modal — centered, impactful, fanned card spread */
/* Override global .hidden: use opacity instead of display:none so transition runs */
.hero-modal {
  position: fixed;
  inset: 0;
  z-index: 2001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.5s ease;
}

.hero-modal.hidden {
  display: flex !important; /* override .hidden's display:none - stay in layout */
}

.hero-modal:not(.hidden) {
  pointer-events: auto;
  opacity: 1;
}

.hero-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  cursor: pointer;
}

.hero-modal-content {
  position: relative;
  max-width: 480px;
  background: linear-gradient(165deg, #2a1f1c 0%, #1a1210 40%, #0f0c0b 100%);
  border: 1px solid rgba(201, 162, 39, 0.3);
  padding: 2.5rem 2rem 2.5rem;
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6), 0 0 60px rgba(201, 162, 39, 0.08);
  text-align: center;
}

.hero-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: rgba(250, 245, 239, 0.5);
  cursor: pointer;
  line-height: 1;
}

.hero-modal-close:hover {
  color: var(--gold-bright);
}

.hero-modal-logo {
  display: block;
  max-width: 110px;
  height: auto;
  margin: 0 auto 1rem;
  opacity: 0.95;
}

/* Fanned card spread in hero modal */
.hero-modal-cards {
  position: relative;
  height: 200px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-modal-cards .hero-modal-card {
  position: absolute;
  width: 160px;
  height: auto;
  aspect-ratio: 200/280;
  object-fit: cover;
  opacity: 0;
  transition: opacity 2s ease;
  border-radius: 6px;
  box-shadow: 0 6px 24px rgba(92, 64, 51, 0.3), 0 0 20px rgba(201, 162, 39, 0.1);
}

.hero-modal-cards .hero-modal-card.visible {
  opacity: 1;
}

.hero-modal-cards .hero-modal-card:nth-child(1) {
  transform: translate(-200px, -20px) rotate(-22deg);
}
.hero-modal-cards .hero-modal-card:nth-child(2) {
  transform: translate(-75px, -50px) rotate(-8deg);
}
.hero-modal-cards .hero-modal-card:nth-child(3) {
  transform: translate(75px, -50px) rotate(8deg);
}
.hero-modal-cards .hero-modal-card:nth-child(4) {
  transform: translate(200px, -20px) rotate(22deg);
}

.hero-modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.75rem;
  letter-spacing: 0.12em;
  color: var(--paper);
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.hero-modal-text {
  font-size: 1.1rem;
  font-weight: 500;
  color: rgba(250, 245, 239, 0.9);
  margin-bottom: 1.5rem;
}

.hero-modal-cta {
  width: 100%;
  padding: 1rem 2rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.12em;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-dim) 100%);
  border: 1px solid rgba(201, 162, 39, 0.5);
  color: #1a1210;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(201, 162, 39, 0.3);
}

.hero-modal-cta:hover {
  background: linear-gradient(180deg, #e6b82e 0%, var(--gold-bright) 50%, var(--gold) 100%);
  box-shadow: 0 6px 24px rgba(201, 162, 39, 0.4);
}

/* Legal modal */
.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.legal-modal.hidden {
  display: none !important;
}

.legal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.legal-modal-content {
  position: relative;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-aged) 100%);
  border: 2px solid var(--card-border);
  padding: 2rem;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(92, 64, 51, 0.25);
}

.legal-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.legal-modal-close:hover {
  color: var(--gold);
}

.legal-modal-title {
  font-size: 1.1rem;
  color: var(--burgundy-bright);
  margin-bottom: 1rem;
  padding-right: 2rem;
}

.legal-modal-body {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-dim);
}

.legal-modal-body p {
  margin-bottom: 1rem;
}

.legal-modal-body p:last-child {
  margin-bottom: 0;
}

.legal-modal-body a {
  color: var(--burgundy-bright);
  text-decoration: underline;
}

.legal-modal-body a:hover {
  color: var(--gold);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .static-card-img,
  .static-large-card img,
  .static-glyph-preview svg,
  .enable-sound-cards .enable-sound-card,
  .hero-modal,
  .hero-modal-cards .hero-modal-card {
    transition: none;
  }
  .checkout-anticipation-overlay {
    animation: none;
  }
  .checkout-anticipation-text {
    animation: none;
  }
  .machine-frame,
  .machine-frame.animate-in {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .message .line { animation: none; opacity: 1; }
  .reveal-container { animation: none; }
  .consult-btn:hover:not(:disabled),
  .consult-again-btn:hover,
  .share-btn:hover,
  .enable-sound-btn:hover,
  .enable-sound-btn:focus {
    transform: none;
  }
  .sound-toggle.playing .sound-icon {
    animation: none;
  }
}
