/* --- Canvas Background --- */
#stars-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.screen__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: env(safe-area-inset-top, 1.5rem) 1.5rem env(safe-area-inset-bottom, 1.5rem);
  text-align: center;
}

/* --- Landing staggered entrance --- */
.landing__title,
.landing__moon.moon-svg,
.landing__text,
.start-btn {
  opacity: 0;
  transform: translateY(8px);
}

.landing--reveal .landing__title {
  animation: fadeInUp 0.7s ease forwards;
  animation-delay: 0s;
}

.landing--reveal .landing__moon.moon-svg {
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 0.4s;
}

.landing--reveal .landing__text {
  animation: fadeInUp 0.7s ease forwards;
  animation-delay: 0.9s;
}

.landing--reveal .start-btn {
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 1.3s;
}

.landing__title {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: 0.06em;
}

.landing__moon.moon-svg {
  margin-bottom: 1.5rem;
}

.landing--reveal .landing__moon.visible {
  animation: fadeInUp 0.8s ease forwards, idle-glow 4s ease-in-out 1.2s infinite;
  animation-delay: 0.4s;
}

.moon-svg {
  border-radius: 50%;
  box-shadow: 0 0 40px var(--color-glow), 0 0 80px rgba(240, 230, 211, 0.15);
}

.landing__moon {
  width: 140px;
  height: 140px;
}

.ritual__moon {
  width: 160px;
  height: 160px;
}

@keyframes idle-glow {
  0%, 100% { box-shadow: 0 0 40px var(--color-glow), 0 0 80px rgba(240, 230, 211, 0.15); }
  50% { box-shadow: 0 0 50px var(--color-glow), 0 0 100px rgba(240, 230, 211, 0.22); }
}

.landing__text {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.85;
  line-height: 1.6;
  max-width: 280px;
}

.start-btn {
  border: 1px solid rgba(240, 230, 211, 0.4);
  background: rgba(240, 230, 211, 0.1);
  color: var(--color-text);
  padding: 0.9rem 2.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.05rem;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: background 0.3s ease;
}

.start-btn:active {
  background: rgba(240, 230, 211, 0.18);
}

.ritual__text {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  line-height: 1.7;
  font-style: italic;
}

.ritual__hint {
  font-size: 0.85rem;
  opacity: 0.6;
  margin-top: 1.5rem;
  letter-spacing: 0.05em;
  transition: opacity 0.4s ease;
}

.ritual__moon {
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  animation: idle-glow 4s ease-in-out infinite;
}

.ritual__moon.touching {
  animation: moon-pulse 1.5s ease-in-out infinite;
}

@keyframes moon-pulse {
  0%, 100% {
    box-shadow: 0 0 40px var(--color-glow), 0 0 80px rgba(240, 230, 211, 0.15);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 60px var(--color-glow), 0 0 120px rgba(240, 230, 211, 0.3);
    transform: scale(1.05);
  }
}

.ritual__moon.complete {
  animation: none;
  box-shadow: 0 0 80px var(--color-glow), 0 0 160px rgba(240, 230, 211, 0.4);
  transform: scale(1.1);
  transition: all 0.5s ease;
}

/* --- Questions --- */

.question__number {
  font-size: 0.85rem;
  opacity: 0.6;
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.question__text {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 2rem;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 0.2s;
}

.question__answers {
  width: 100%;
  max-width: 320px;
}

.answer-btn {
  display: block;
  width: 100%;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  min-height: 48px;
  border: 1px solid rgba(240, 230, 211, 0.25);
  background: rgba(240, 230, 211, 0.07);
  color: var(--color-text);
  font-family: inherit;
  font-size: 1.05rem;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.6s ease forwards;
}

.answer-btn:nth-child(1) { animation-delay: 0.6s; }
.answer-btn:nth-child(2) { animation-delay: 0.75s; }
.answer-btn:nth-child(3) { animation-delay: 0.9s; }
.answer-btn:nth-child(4) { animation-delay: 1.05s; }

.answer-btn:active,
.answer-btn.selected {
  background: rgba(240, 230, 211, 0.15);
  border-color: var(--color-moon);
}

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

/* Background variations per question */
#screen-questions {
  transition: background 1.2s ease;
}

#screen-questions.q1 {
  background: linear-gradient(180deg, #121220 0%, #161428 100%);
}

#screen-questions.q2 {
  background: linear-gradient(180deg, #121220 0%, #121825 100%);
}

#screen-questions.q3 {
  background: linear-gradient(180deg, #121220 0%, #1a1812 100%);
}

/* --- Prophecy --- */

.prophecy__label {
  font-size: 0.85rem;
  opacity: 0.5;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.prophecy__text {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.7;
  max-width: 340px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0 0.25rem;
}

.prophecy__text::-webkit-scrollbar {
  width: 0;
}

.prophecy-word {
  display: inline;
  opacity: 0;
  animation: word-reveal 0.6s ease-out forwards;
}

@keyframes word-reveal {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.replay-btn {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  padding: 0.8rem 2rem;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 2rem;
  font-size: 0.9rem;
  font-family: inherit;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

.replay-btn:active {
  background: rgba(255, 255, 255, 0.1);
}

/* --- Loading --- */

.loading__text {
  font-size: 1.2rem;
  animation: pulse-text 2s ease-in-out infinite;
}

.loading__moon {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  box-shadow: 0 0 40px var(--color-glow), 0 0 80px rgba(240, 230, 211, 0.15);
  margin-top: 2rem;
  animation: moon-pulse 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* --- Ritual Progress Ring --- */

.ritual__moon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ritual__progress {
  position: absolute;
  width: 190px;
  height: 190px;
  pointer-events: none;
}

.ritual__progress-ring {
  transition: stroke-dashoffset 0.1s linear;
}

/* --- Bridge text after ritual --- */

.ritual__bridge {
  font-size: 1.2rem;
  opacity: 0;
  font-style: italic;
  animation: fadeInUp 0.6s ease forwards;
}

/* --- Question fade transition --- */

.screen__content.fading {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.screen__content {
  transition: opacity 0.3s ease;
}

/* --- Landscape Overlay --- */

.landscape-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--color-bg);
  color: var(--color-text);
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.1rem;
  padding: 2rem;
  line-height: 1.6;
}

@media (orientation: landscape) and (max-height: 500px) {
  .landscape-overlay {
    display: flex;
  }
}
