/* ==========================================================================
   HALLOWEEN TWILIGHT — 2026 EDITION UPGRADE (MOBILE-FIRST)
   ========================================================================== */

:root {
  --tw-gold: #fb923c;
  --tw-fuchsia: #d946ef;
  --tw-violet: #8b5cf6;
  --tw-obsidian: #100c14;
  --tw-card-glass: rgba(20, 14, 28, 0.82);
}

/* 1. Touch-Reactive Twilight Embers Canvas */
.twilight-embers-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 25;
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  .twilight-embers-canvas {
    display: none !important;
  }
}

/* 2. Hero 2026 Countdown & Veil Thinness Widget (Mobile-First) */
.hero-2026-panel {
  margin-top: 2rem;
  margin-inline: auto;
  max-width: 38rem;
  padding: 1.15rem 1rem;
  border-radius: 1.25rem;
  background: linear-gradient(145deg, rgba(16, 12, 20, 0.82), rgba(46, 16, 68, 0.62));
  border: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.55),
    0 0 25px rgba(139, 92, 246, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: heroPanelFadeIn 0.9s ease-out both;
}

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

.hero-2026-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fde68a;
  background: rgba(249, 115, 22, 0.16);
  border: 1px solid rgba(251, 146, 60, 0.45);
  margin-bottom: 0.85rem;
}

.hero-2026-badge__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #fb923c;
  box-shadow: 0 0 8px #fb923c;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.6; }
}

.hero-countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.hero-countdown-cell {
  background: rgba(16, 12, 20, 0.72);
  border: 1px solid rgba(217, 70, 239, 0.22);
  border-radius: 0.85rem;
  padding: 0.55rem 0.25rem;
  text-align: center;
}

.hero-countdown-val {
  display: block;
  font-family: var(--font-heading), cursive;
  font-size: 1.65rem;
  line-height: 1.1;
  background: linear-gradient(to right, #fb923c, #f472b6, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (min-width: 768px) {
  .hero-2026-panel {
    padding: 1.35rem 1.6rem;
  }
  .hero-countdown-grid {
    gap: 0.85rem;
  }
  .hero-countdown-val {
    font-size: 2.15rem;
  }
}

.hero-countdown-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(229, 231, 235, 0.75);
  margin-top: 0.15rem;
}

/* Veil Thinness Progress Bar */
.veil-meter {
  margin-bottom: 1rem;
  text-align: left;
}

.veil-meter__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: #e9d5ff;
  margin-bottom: 0.35rem;
}

.veil-meter__track {
  width: 100%;
  height: 0.45rem;
  background: rgba(15, 10, 24, 0.85);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.veil-meter__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #fb923c 0%, #d946ef 55%, #8b5cf6 100%);
  box-shadow: 0 0 12px rgba(217, 70, 239, 0.7);
  transition: width 0.8s ease;
}

.hero-2026-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.tw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  font-family: var(--font-body), serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tw-btn--primary {
  background: linear-gradient(135deg, #ea580c 0%, #c026d3 55%, #7c3aed 100%);
  color: #ffffff;
  border: 1px solid rgba(253, 186, 116, 0.5);
  box-shadow: 0 4px 18px rgba(192, 38, 211, 0.35);
}

.tw-btn--primary:hover,
.tw-btn--primary:active {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 24px rgba(249, 115, 22, 0.5);
}

.tw-btn--ghost {
  background: rgba(30, 20, 45, 0.75);
  color: #f3e8ff;
  border: 1px solid rgba(167, 139, 250, 0.45);
}

.tw-btn--ghost:hover,
.tw-btn--ghost:active {
  background: rgba(88, 28, 135, 0.55);
  border-color: #fb923c;
  color: #ffedd5;
}

/* 3. THE TWILIGHT ORACLE SECTION (Mobile-First 3-Card Tarot) */
.oracle-section {
  position: relative;
  padding: 5rem 1rem 5.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.oracle-section__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.oracle-section__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.1) contrast(1.05);
}

.oracle-section__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 28%, rgba(139, 92, 246, 0.22), transparent 60%),
    linear-gradient(to bottom, #100c14 0%, rgba(16, 12, 20, 0.76) 25%, rgba(16, 12, 20, 0.84) 75%, #100c14 100%);
}

.oracle-container {
  position: relative;
  z-index: 10;
  max-width: 72rem;
  margin-inline: auto;
  width: 100%;
  text-align: center;
}

.oracle-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f0abfc;
  background: rgba(88, 28, 135, 0.45);
  border: 1px solid rgba(217, 70, 239, 0.4);
  margin-bottom: 0.85rem;
}

.oracle-title {
  font-family: var(--font-heading), cursive;
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  margin-bottom: 0.75rem;
  line-height: 1.15;
}

.oracle-subtitle {
  max-width: 44rem;
  margin: 0 auto 1.5rem;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: rgba(243, 244, 246, 0.88);
  line-height: 1.6;
}

.oracle-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

/* Mobile-First Swipeable / Grid Tarot Stage */
.oracle-stage {
  display: flex;
  gap: 1.1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.75rem 0.5rem 1.5rem;
  margin-inline: -0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.oracle-stage::-webkit-scrollbar {
  display: none;
}

@media (min-width: 768px) {
  .oracle-stage {
    display: grid;
    grid-template-columns: repeat(3, minmax(240px, 310px));
    justify-content: center;
    gap: 2rem;
    overflow-x: visible;
    padding: 1rem 0 2rem;
    margin-inline: auto;
  }
}

.oracle-slot {
  flex: 0 0 78vw;
  max-width: 300px;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (min-width: 480px) and (max-width: 767px) {
  .oracle-slot {
    flex: 0 0 260px;
  }
}

@media (min-width: 768px) {
  .oracle-slot {
    flex: initial;
    max-width: none;
  }
}

.oracle-slot__position {
  font-family: var(--font-heading), cursive;
  font-size: 1.15rem;
  color: #fdba74;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* 3D Flip Card */
.oracle-card {
  position: relative;
  width: 100%;
  height: 24.5rem;
  perspective: 1200px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.oracle-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.oracle-card.is-flipped .oracle-card__inner {
  transform: rotateY(180deg);
}

.oracle-card__face {
  position: absolute;
  inset: 0;
  border-radius: 1.15rem;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.7),
    0 0 22px rgba(139, 92, 246, 0.25);
}

/* Card Back (Unflipped) */
.oracle-card__back {
  background:
    radial-gradient(circle at 50% 50%, rgba(16, 12, 20, 0.2), rgba(16, 12, 20, 0.75) 90%),
    url('/images/oracle-card-back.jpg') center/cover no-repeat;
  border: 1.5px solid rgba(251, 146, 60, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 1.25rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.oracle-card:not(.is-flipped):hover .oracle-card__back {
  border-color: #f472b6;
  box-shadow: 0 0 32px rgba(217, 70, 239, 0.65);
}

.oracle-card__filigree {
  position: absolute;
  inset: 0.5rem;
  border: 1px solid rgba(251, 146, 60, 0.35);
  border-radius: 0.9rem;
  pointer-events: none;
}

.oracle-card__sigil {
  display: none;
}

@keyframes sigilFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(6deg); }
}

.oracle-card__tap-hint {
  position: relative;
  z-index: 2;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fde68a;
  background: rgba(16, 12, 20, 0.85);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 146, 60, 0.4);
}

/* Card Front (Revealed) */
.oracle-card__front {
  transform: rotateY(180deg);
  background: #140e1d;
  border: 1.5px solid rgba(167, 139, 250, 0.65);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: center;
}

.oracle-card__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.oracle-card:hover .oracle-card__art {
  transform: scale(1.06);
}

.oracle-card__front-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(16, 12, 20, 0.98) 0%,
    rgba(16, 12, 20, 0.82) 38%,
    rgba(16, 12, 20, 0.15) 72%,
    rgba(16, 12, 20, 0.55) 100%
  );
}

.oracle-card__arcana-badge {
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  background: rgba(16, 12, 20, 0.85);
  border: 1px solid rgba(251, 146, 60, 0.5);
  color: #fdba74;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}

.oracle-card__content {
  position: relative;
  z-index: 3;
  padding: 1rem 1rem 1.15rem;
}

.oracle-card__title {
  font-family: var(--font-heading), cursive;
  font-size: 1.45rem;
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.oracle-card__omen {
  font-size: 0.92rem;
  color: #e9d5ff;
  line-height: 1.4;
  margin-bottom: 0.6rem;
}

.oracle-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fb923c;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.oracle-card__link:hover {
  color: #f472b6;
}

.oracle-swipe-hint {
  display: block;
  font-size: 0.8rem;
  color: rgba(233, 213, 255, 0.65);
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .oracle-swipe-hint {
    display: none;
  }
}

/* Oracle Prophecy Scroll (Revealed when all 3 cards flip) */
.oracle-prophecy {
  max-width: 48rem;
  margin: 0.5rem auto 0;
  padding: 1.5rem 1.25rem;
  border-radius: 1.25rem;
  background: linear-gradient(160deg, rgba(28, 18, 42, 0.92), rgba(16, 12, 20, 0.95));
  border: 1px solid rgba(251, 146, 60, 0.45);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.75), 0 0 30px rgba(217, 70, 239, 0.22);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  padding-block: 0;
  border-width: 0;
  transition: all 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.oracle-prophecy.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  max-height: 800px;
  padding: 1.5rem 1.25rem;
  border-width: 1px;
  margin-top: 1.25rem;
}

@media (min-width: 768px) {
  .oracle-prophecy.is-visible {
    padding: 2rem 2.5rem;
  }
}

.oracle-prophecy__heading {
  font-family: var(--font-heading), cursive;
  font-size: 1.85rem;
  margin-bottom: 0.75rem;
}

.oracle-prophecy__text {
  font-size: 1.1rem;
  line-height: 1.65;
  color: #f3e8ff;
  margin-bottom: 1.25rem;
  font-style: italic;
}

.oracle-prophecy__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

/* 4. NEW 2026 Story Badges */
.story-badge-2026 {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 10;
  background: linear-gradient(135deg, #ea580c, #c026d3);
  color: #fff;
  font-family: var(--font-body), serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(254, 215, 170, 0.6);
  box-shadow: 0 4px 14px rgba(192, 38, 211, 0.5);
}

/* 5. Per-Story Audio Narrator & Procedural Soundscape Player */
.story-audio-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: -0.75rem auto 1.5rem;
  padding: 0.55rem 0.85rem;
  max-width: 34rem;
  border-radius: 999px;
  background: rgba(22, 15, 34, 0.78);
  border: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 5;
}

.story-audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-family: var(--font-body), serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #f3e8ff;
  background: rgba(88, 28, 135, 0.45);
  border: 1px solid rgba(167, 139, 250, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.story-audio-btn:hover,
.story-audio-btn:active {
  background: rgba(126, 34, 206, 0.65);
  border-color: #fb923c;
  color: #fff;
}

.story-audio-btn.is-playing {
  background: linear-gradient(135deg, #ea580c, #c026d3);
  border-color: #fde68a;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(217, 70, 239, 0.6);
}

/* Animated Equalizer Bars inside Audio Button */
.eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.eq-bars span {
  width: 2.5px;
  height: 4px;
  background: currentColor;
  border-radius: 1px;
  transition: height 0.15s ease;
}

.is-playing .eq-bars span:nth-child(1) {
  animation: eqBounce 0.6s ease-in-out infinite;
}
.is-playing .eq-bars span:nth-child(2) {
  animation: eqBounce 0.6s ease-in-out 0.18s infinite;
}
.is-playing .eq-bars span:nth-child(3) {
  animation: eqBounce 0.6s ease-in-out 0.34s infinite;
}

@keyframes eqBounce {
  0%, 100% { height: 3px; }
  50% { height: 12px; }
}

/* 6. Interactive "Whisper Beyond the Veil" (Per-Story Choice Epilogue) */
.story-whisper-box {
  margin-top: 1.75rem;
  padding: 1.15rem 1.1rem;
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(24, 16, 36, 0.78), rgba(45, 20, 66, 0.48));
  border: 1px solid rgba(167, 139, 250, 0.28);
  text-align: center;
  position: relative;
  z-index: 5;
}

.story-whisper-prompt {
  font-family: var(--font-heading), cursive;
  font-size: 1.25rem;
  color: #fdba74;
  margin-bottom: 0.75rem;
}

.story-whisper-choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.story-whisper-choice {
  min-height: 42px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: rgba(16, 12, 20, 0.75);
  border: 1px solid rgba(217, 70, 239, 0.4);
  color: #e9d5ff;
  font-family: var(--font-body), serif;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.22s ease;
  -webkit-tap-highlight-color: transparent;
}

.story-whisper-choice:hover,
.story-whisper-choice.is-selected {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.85), rgba(192, 38, 211, 0.85));
  border-color: #fde68a;
  color: #fff;
  transform: translateY(-1px);
}

.story-whisper-outcome {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(167, 139, 250, 0.3);
  font-size: 1rem;
  line-height: 1.55;
  color: #fde68a;
  font-style: italic;
  display: none;
  animation: heroPanelFadeIn 0.4s ease-out both;
}

.story-whisper-outcome.is-visible {
  display: block;
}

/* 7. Mobile-First Floating Bottom Companion Dock */
.twilight-dock {
  position: fixed;
  bottom: 0.9rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  background: rgba(16, 12, 20, 0.88);
  border: 1px solid rgba(167, 139, 250, 0.42);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.75),
    0 0 20px rgba(139, 92, 246, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: 94vw;
}

.twilight-dock__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 40px;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-family: var(--font-body), serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #e5e7eb;
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.twilight-dock__btn:hover,
.twilight-dock__btn:active {
  color: #fb923c;
  background: rgba(139, 92, 246, 0.18);
}

.twilight-dock__btn.is-active {
  background: linear-gradient(135deg, #ea580c, #c026d3);
  color: #ffffff;
  border-color: rgba(254, 215, 170, 0.5);
  box-shadow: 0 0 14px rgba(217, 70, 239, 0.5);
}

.twilight-dock__divider {
  width: 1px;
  height: 1.25rem;
  background: rgba(167, 139, 250, 0.28);
}

/* Give footer extra bottom padding on mobile so floating dock never covers copyright */
@media (max-width: 767px) {
  .footer {
    padding-bottom: 5.5rem !important;
  }
}
