/* ============================================
   Quest Website — Romantic Theme
   Three Comrades × Tiberias
   ============================================ */

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

:root {
  --bg-deep: #0a1225;
  --bg-card: rgba(15, 25, 50, 0.85);
  --gold: #d4a853;
  --gold-light: #f0d48a;
  --gold-dark: #a07830;
  --cream: #f5e6c8;
  --cream-soft: #e8d5b0;
  --text: #ddd5c4;
  --text-dim: #9a917f;
  --error: #e07070;
  --success: #70c490;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Stars background canvas */
#stars-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  pointer-events: none;
}

/* ---- Stages ---- */
.stage {
  display: none;
  min-height: 100vh;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
  align-items: center;
  justify-content: center;
}

.stage.active {
  display: flex;
  animation: fadeIn 1.2s ease-out;
}

.stage-inner {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid rgba(212, 168, 83, 0.2);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  backdrop-filter: blur(20px);
  box-shadow:
    0 0 60px rgba(212, 168, 83, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.5);
}

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

@keyframes shimmer {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes glow {
  0%, 100% { text-shadow: 0 0 10px rgba(212, 168, 83, 0.3); }
  50% { text-shadow: 0 0 25px rgba(212, 168, 83, 0.6), 0 0 50px rgba(212, 168, 83, 0.2); }
}

/* ---- Typography ---- */
.ornament {
  text-align: center;
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 1rem;
  animation: shimmer 3s ease-in-out infinite;
}

.title-main {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  letter-spacing: 0.02em;
  animation: glow 4s ease-in-out infinite;
}

.subtitle {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 300;
  font-style: italic;
  color: var(--cream-soft);
  text-align: center;
  margin-top: 0.5rem;
}

.stage-number {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gold);
  text-align: center;
  letter-spacing: 0.3em;
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.stage-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--gold-light);
  text-align: center;
  margin-bottom: 0.5rem;
}

/* ---- Divider ---- */
.divider {
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 1.5rem auto;
}

.divider.gold {
  height: 2px;
  width: 120px;
  background: linear-gradient(90deg, transparent, var(--gold-light), var(--gold), var(--gold-light), transparent);
}

/* ---- Content text ---- */
.intro-text,
.clue-text,
.reveal-text {
  font-size: 1.15rem;
  line-height: 1.85;
  color: var(--text);
  text-align: center;
  margin: 1.5rem 0;
}

/* ---- Book quote ---- */
.book-quote {
  background: rgba(212, 168, 83, 0.06);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 1.5rem;
  margin: 1.5rem 0;
  position: relative;
}

.quote-mark {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  color: var(--gold);
  opacity: 0.5;
  line-height: 1;
}

.book-quote .quote-mark:first-child {
  position: absolute;
  top: 8px;
  left: 12px;
}

.book-quote {
  font-style: italic;
  font-size: 1.1rem;
  color: var(--cream-soft);
  padding-left: 2.5rem;
}

.quote-author {
  font-style: normal;
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: 0.75rem;
  text-align: right;
}

.book-link {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px dotted var(--gold-dark);
  transition: color 0.3s;
}

.book-link:hover {
  color: var(--gold-light);
}

/* ---- Answer box ---- */
.answer-box {
  margin-top: 2rem;
  text-align: center;
}

.answer-input {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.2rem;
  width: 100%;
  max-width: 360px;
  padding: 0.9rem 1.2rem;
  border: 1px solid rgba(212, 168, 83, 0.3);
  border-radius: 8px;
  background: rgba(10, 18, 37, 0.8);
  color: var(--cream);
  text-align: center;
  outline: none;
  transition: all 0.3s ease;
}

.answer-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(212, 168, 83, 0.15);
}

.answer-input::placeholder {
  color: var(--text-dim);
  font-style: italic;
}

/* ---- Hint & Error ---- */
.hint,
.error-msg {
  font-size: 0.95rem;
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

.hint {
  background: rgba(212, 168, 83, 0.1);
  color: var(--gold-light);
  border: 1px solid rgba(212, 168, 83, 0.2);
}

.hint-icon {
  margin-right: 0.3rem;
}

.error-msg {
  background: rgba(224, 112, 112, 0.1);
  color: var(--error);
  border: 1px solid rgba(224, 112, 112, 0.2);
}

.hidden {
  display: none !important;
}

/* ---- Buttons ---- */
.btn-quest {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.9rem 2.5rem;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(212, 168, 83, 0.15), rgba(212, 168, 83, 0.05));
  color: var(--gold);
  cursor: pointer;
  transition: all 0.4s ease;
  display: inline-block;
  margin-top: 1.5rem;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.btn-quest:hover {
  background: linear-gradient(135deg, rgba(212, 168, 83, 0.3), rgba(212, 168, 83, 0.1));
  box-shadow: 0 0 30px rgba(212, 168, 83, 0.2);
  transform: translateY(-2px);
}

.btn-quest:active {
  transform: translateY(0);
}

.btn-map {
  font-size: 1rem;
  padding: 0.8rem 2rem;
}

/* ---- Hint & Reveal Buttons ---- */
.btn-hint {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 1.5rem;
  border: 1px solid rgba(212, 168, 83, 0.25);
  border-radius: 20px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
  letter-spacing: 0.03em;
}

.btn-hint:hover {
  color: var(--gold-light);
  border-color: rgba(212, 168, 83, 0.5);
  background: rgba(212, 168, 83, 0.05);
}

.btn-reveal {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.9rem;
  font-style: italic;
  padding: 0.45rem 1.2rem;
  border: 1px dashed rgba(212, 168, 83, 0.2);
  border-radius: 20px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 0.75rem;
  opacity: 0.7;
  animation: fadeIn 1s ease-out;
}

.btn-reveal:hover {
  opacity: 1;
  color: var(--cream-soft);
  border-color: rgba(212, 168, 83, 0.35);
}

/* ---- Reveal Stage ---- */
.reveal-stage {
  text-align: center;
}

.reveal-icon {
  font-size: 3rem;
  animation: float 3s ease-in-out infinite;
  margin-bottom: 0.5rem;
}

.reveal-title {
  font-size: 2.2rem;
  animation: glow 3s ease-in-out infinite;
}

/* ---- Hotel Card ---- */
.hotel-card {
  background: linear-gradient(135deg, rgba(212, 168, 83, 0.12), rgba(212, 168, 83, 0.04));
  border: 1px solid rgba(212, 168, 83, 0.3);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  margin: 2rem 0;
  text-align: center;
}

.hotel-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.03em;
}

.hotel-sub {
  font-size: 1rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
}

.hotel-divider {
  width: 50px;
  height: 1px;
  background: var(--gold);
  margin: 1.2rem auto;
}

.hotel-desc {
  font-size: 1.05rem;
  color: var(--cream-soft);
  line-height: 1.8;
  max-width: 440px;
  margin: 0 auto;
}

.hotel-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.detail-item {
  padding: 0.8rem;
  border-radius: 8px;
  background: rgba(10, 18, 37, 0.5);
  border: 1px solid rgba(212, 168, 83, 0.1);
}

.detail-icon {
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
}

.detail-text {
  font-size: 0.9rem;
  color: var(--cream-soft);
  font-weight: 500;
}

.pack-msg {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--gold);
  margin: 2rem 0 1rem;
  animation: glow 3s ease-in-out infinite;
}

.final-quote {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-dim);
  margin: 1.5rem 0;
  padding: 0 1rem;
}

.final-quote .quote-mark {
  font-size: 1.5rem;
  vertical-align: text-top;
}

/* ---- Shake animation for wrong answer ---- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.shake {
  animation: shake 0.5s ease;
}

/* ---- Success glow ---- */
@keyframes successPulse {
  0% { box-shadow: 0 0 0 0 rgba(112, 196, 144, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(112, 196, 144, 0); }
  100% { box-shadow: 0 0 0 0 rgba(112, 196, 144, 0); }
}

.answer-input.success {
  border-color: var(--success);
  color: var(--success);
  animation: successPulse 1s ease;
}

/* ============================================
   VISUAL THEMES — Three Comrades / Little Prince / Tiberias
   ============================================ */

/* ---- Theme transition on body ---- */
body { transition: background-color 1.2s ease; }

/* ---- THREE COMRADES: 1920s Berlin noir ---- */
.stage[data-theme="comrades"] .stage-inner {
  background: rgba(30, 12, 18, 0.9);
  border-color: rgba(180, 120, 60, 0.25);
  box-shadow: 0 0 60px rgba(180, 100, 40, 0.08), 0 20px 60px rgba(0, 0, 0, 0.5);
}

.stage[data-theme="comrades"] .stage-number,
.stage[data-theme="comrades"] .stage-title {
  color: #d4a05a;
}

.stage[data-theme="comrades"] .divider {
  background: linear-gradient(90deg, transparent, #b47840, transparent);
}

.stage[data-theme="comrades"] .book-quote {
  background: rgba(180, 120, 60, 0.06);
  border-left-color: #b47840;
}

.stage[data-theme="comrades"] .answer-input {
  border-color: rgba(180, 120, 60, 0.3);
  background: rgba(30, 12, 18, 0.8);
}

.stage[data-theme="comrades"] .answer-input:focus {
  border-color: #d4a05a;
  box-shadow: 0 0 20px rgba(180, 120, 60, 0.2);
}

.stage[data-theme="comrades"] .btn-quest {
  border-color: #b47840;
  color: #d4a05a;
  background: linear-gradient(135deg, rgba(180, 120, 60, 0.15), rgba(180, 120, 60, 0.05));
}

.stage[data-theme="comrades"] .btn-quest:hover {
  background: linear-gradient(135deg, rgba(180, 120, 60, 0.3), rgba(180, 120, 60, 0.1));
  box-shadow: 0 0 30px rgba(180, 120, 60, 0.2);
}

.stage[data-theme="comrades"] .hint {
  background: rgba(180, 120, 60, 0.1);
  color: #d4a05a;
  border-color: rgba(180, 120, 60, 0.2);
}

/* ---- LITTLE PRINCE: Celestial/starry ---- */
.stage[data-theme="prince"] .stage-inner {
  background: rgba(8, 15, 40, 0.9);
  border-color: rgba(240, 200, 80, 0.2);
  box-shadow: 0 0 80px rgba(240, 200, 80, 0.06), 0 20px 60px rgba(0, 0, 0, 0.5);
}

.stage[data-theme="prince"] .stage-number,
.stage[data-theme="prince"] .stage-title {
  color: #f0c850;
}

.stage[data-theme="prince"] .divider {
  background: linear-gradient(90deg, transparent, #f0c850, transparent);
}

.stage[data-theme="prince"] .book-quote {
  background: rgba(240, 200, 80, 0.04);
  border-left-color: #f0c850;
}

.stage[data-theme="prince"] .quote-mark {
  color: #f0c850;
}

.stage[data-theme="prince"] .answer-input {
  border-color: rgba(240, 200, 80, 0.3);
  background: rgba(8, 12, 35, 0.8);
}

.stage[data-theme="prince"] .answer-input:focus {
  border-color: #f0c850;
  box-shadow: 0 0 20px rgba(240, 200, 80, 0.15);
}

.stage[data-theme="prince"] .btn-quest {
  border-color: #c8a840;
  color: #f0c850;
  background: linear-gradient(135deg, rgba(240, 200, 80, 0.12), rgba(240, 200, 80, 0.04));
}

.stage[data-theme="prince"] .btn-quest:hover {
  background: linear-gradient(135deg, rgba(240, 200, 80, 0.25), rgba(240, 200, 80, 0.08));
  box-shadow: 0 0 30px rgba(240, 200, 80, 0.15);
}

.stage[data-theme="prince"] .hint {
  background: rgba(240, 200, 80, 0.08);
  color: #f0c850;
  border-color: rgba(240, 200, 80, 0.2);
}

/* ---- TIBERIAS: Ancient Mediterranean ---- */
.stage[data-theme="tiberias"] .stage-inner {
  background: rgba(18, 15, 8, 0.9);
  border-color: rgba(196, 136, 90, 0.25);
  box-shadow: 0 0 60px rgba(196, 136, 90, 0.06), 0 20px 60px rgba(0, 0, 0, 0.5);
}

.stage[data-theme="tiberias"] .stage-number,
.stage[data-theme="tiberias"] .stage-title {
  color: #d4a870;
}

.stage[data-theme="tiberias"] .divider {
  background: linear-gradient(90deg, transparent, #c4885a, transparent);
}

.stage[data-theme="tiberias"] .book-quote {
  background: rgba(196, 136, 90, 0.06);
  border-left-color: #c4885a;
}

.stage[data-theme="tiberias"] .answer-input {
  border-color: rgba(196, 136, 90, 0.3);
  background: rgba(18, 15, 8, 0.8);
}

.stage[data-theme="tiberias"] .answer-input:focus {
  border-color: #d4a870;
  box-shadow: 0 0 20px rgba(196, 136, 90, 0.2);
}

.stage[data-theme="tiberias"] .btn-quest {
  border-color: #c4885a;
  color: #d4a870;
  background: linear-gradient(135deg, rgba(196, 136, 90, 0.15), rgba(196, 136, 90, 0.05));
}

.stage[data-theme="tiberias"] .btn-quest:hover {
  background: linear-gradient(135deg, rgba(196, 136, 90, 0.3), rgba(196, 136, 90, 0.1));
  box-shadow: 0 0 30px rgba(196, 136, 90, 0.15);
}

.stage[data-theme="tiberias"] .hint {
  background: rgba(196, 136, 90, 0.1);
  color: #d4a870;
  border-color: rgba(196, 136, 90, 0.2);
}

/* ---- REVEAL: Grand gold ---- */
.stage[data-theme="reveal"] .stage-inner {
  background: rgba(10, 12, 25, 0.92);
  border-color: rgba(212, 168, 83, 0.35);
  box-shadow: 0 0 80px rgba(212, 168, 83, 0.12), 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .stage {
    padding: 1.5rem 0.75rem;
  }

  .stage-inner {
    padding: 2rem 1.25rem;
    border-radius: 12px;
  }

  .title-main {
    font-size: 2rem;
  }

  .stage-title {
    font-size: 1.6rem;
  }

  .reveal-title {
    font-size: 1.8rem;
  }

  .intro-text,
  .clue-text,
  .reveal-text {
    font-size: 1.05rem;
  }

  .hotel-name {
    font-size: 1.5rem;
  }

  .hotel-details {
    gap: 0.6rem;
  }

  .btn-quest {
    padding: 0.8rem 2rem;
    font-size: 1rem;
  }

  .pack-msg {
    font-size: 1.2rem;
  }
}

@media (max-width: 380px) {
  .stage-inner {
    padding: 1.5rem 1rem;
  }

  .title-main {
    font-size: 1.7rem;
  }

  .hotel-details {
    grid-template-columns: 1fr;
  }
}
