/* ================================================================
   MatheLand — css/sanctuary.css
   "Die Lichtung" (Begehbares Camp), Hades-II-Dialogbühne & Chronik
   ================================================================ */

/* ==================== SANCTUARY MODAL ==================== */
#sanctuary-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 5, 16, 0.88);
  z-index: 99998;
  backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.sanctuary-shell {
  background: radial-gradient(circle at top, #271542 0%, #120d22 70%, #090612 100%);
  border: 2.5px solid #f4a020;
  border-radius: 28px;
  padding: 24px 26px;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85), 0 0 40px rgba(244, 160, 32, 0.2);
  color: #f8fafc;
}

.sanctuary-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.35rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.sanctuary-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.06);
}

.sanctuary-header {
  text-align: center;
  margin-bottom: 16px;
}
.sanctuary-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4af2d4;
}
.sanctuary-title {
  font-family: var(--f-board, 'Fredoka One', cursive);
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  color: #ffd166;
  margin: 4px 0 6px;
  text-shadow: 0 0 18px rgba(244, 160, 32, 0.45);
}
.sanctuary-sub {
  font-size: 0.94rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.sanctuary-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 20px;
  flex-wrap: wrap;
}
.sanctuary-tab-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  padding: 9px 20px;
  font-family: var(--f-board, 'Fredoka One', cursive);
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.2s;
}
.sanctuary-tab-btn.active {
  background: linear-gradient(135deg, rgba(244, 160, 32, 0.28), rgba(167, 139, 250, 0.25));
  border-color: #f4a020;
  color: #ffd166;
  box-shadow: 0 0 18px rgba(244, 160, 32, 0.35);
}

/* ==================== EXPLORABLE PLACES GRID ==================== */
.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.place-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 10, 28, 0.85);
  text-align: left;
  color: #fff;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
}
.place-card:hover:not(.locked) {
  transform: translateY(-4px);
  border-color: #f4a020;
  box-shadow: 0 14px 32px rgba(244, 160, 32, 0.28);
}
.place-card.locked {
  filter: grayscale(85%) opacity(0.55);
  cursor: not-allowed;
}
.place-card.has-news {
  border-color: #4af2d4;
  box-shadow: 0 0 22px rgba(74, 242, 212, 0.28);
}

.place-banner {
  position: relative;
  height: 112px;
  overflow: hidden;
  background: linear-gradient(135deg, #2d1b4e, #120d22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.place-banner-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.38;
  pointer-events: none;
}
.place-host-portrait {
  position: relative;
  z-index: 2;
  width: 78px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.65));
}
.place-news-badge {
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, #f4a020, #ef4444);
  color: #fff;
  font-family: var(--f-board, 'Fredoka One', cursive);
  font-size: 0.85rem;
  padding: 5px 11px;
  border-radius: 999px;
  box-shadow: 0 0 14px rgba(244, 160, 32, 0.7);
  animation: sanctuaryPulse 1.6s ease-in-out infinite;
}

@keyframes sanctuaryPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

.place-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.place-name {
  font-family: var(--f-board, 'Fredoka One', cursive);
  font-size: 1.12rem;
  color: #ffd166;
}
.place-sub {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.35;
}
.place-footer {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #4af2d4;
}

/* ==================== HADES-II DIALOGUE STAGE ==================== */
#sanctuary-dialogue-stage {
  display: none;
  margin-top: 4px;
  background: linear-gradient(155deg, rgba(38, 20, 66, 0.96), rgba(14, 11, 28, 0.98));
  border: 2px solid #a78bfa;
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65);
}

.dlg-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.dlg-place-pill {
  font-size: 0.82rem;
  font-weight: 800;
  color: #4af2d4;
  background: rgba(74, 242, 212, 0.12);
  border: 1px solid rgba(74, 242, 212, 0.35);
  padding: 4px 12px;
  border-radius: 999px;
}
.dlg-atmosphere {
  font-size: 0.86rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 14px;
  line-height: 1.45;
}

.dlg-stage-body {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.dlg-portrait-wrap {
  flex-shrink: 0;
  text-align: center;
}
.dlg-portrait {
  width: 112px;
  height: 112px;
  object-fit: contain;
  border-radius: 20px;
  background: radial-gradient(circle, rgba(244, 160, 32, 0.22), rgba(0, 0, 0, 0.45));
  border: 2px solid rgba(244, 160, 32, 0.6);
  padding: 6px;
}
.dlg-bond-hearts {
  margin-top: 6px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.dlg-bubble {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 16px 18px;
}
.dlg-speaker {
  font-family: var(--f-board, 'Fredoka One', cursive);
  color: #ffd166;
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.dlg-text {
  font-size: 1rem;
  line-height: 1.55;
  color: #f8fafc;
  margin: 0 0 14px;
}
.dlg-replies {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dlg-reply-btn {
  background: rgba(244, 160, 32, 0.14);
  border: 1.5px solid rgba(244, 160, 32, 0.55);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  text-align: left;
  font-family: var(--f-text, 'Nunito', sans-serif);
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.dlg-reply-btn:hover {
  background: rgba(244, 160, 32, 0.28);
  transform: translateX(4px);
}
.dlg-reward-banner {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(74, 242, 212, 0.14);
  border: 1px solid rgba(74, 242, 212, 0.45);
  color: #ccfbf1;
  font-size: 0.88rem;
  font-weight: 800;
}

/* ==================== CHRONIK / WELT-KODEX ==================== */
.chronicle-progress-wrap {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.chronicle-bar-track {
  flex: 1;
  min-width: 160px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.chronicle-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4af2d4, #f4a020);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.chronicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 12px;
}
.chronicle-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(244, 160, 32, 0.35);
  border-radius: 16px;
  padding: 14px 16px;
  text-align: left;
}
.chronicle-card.locked {
  border-color: rgba(255, 255, 255, 0.1);
  opacity: 0.55;
}
.chronicle-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.chronicle-card-title {
  font-family: var(--f-board, 'Fredoka One', cursive);
  font-size: 1rem;
  color: #ffd166;
}
.chronicle-card-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #4af2d4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.chronicle-card-text {
  font-size: 0.86rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
  margin: 0;
}

/* ==================== IN-RUN HADES DIALOGUE BANNER (ROGUE) ==================== */
#rogue-dialogue-banner {
  display: none;
  position: fixed;
  top: 112px;
  left: 50%;
  transform: translateX(-50%);
  width: min(680px, calc(100vw - 28px));
  background: linear-gradient(145deg, rgba(30, 14, 52, 0.96), rgba(11, 8, 22, 0.98));
  border: 2px solid #a78bfa;
  border-radius: 18px;
  padding: 12px 16px;
  z-index: 650;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7), 0 0 24px rgba(167, 139, 250, 0.3);
  align-items: center;
  gap: 14px;
  cursor: pointer;
}
#rogue-dialogue-banner img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px;
}

@media (max-width: 640px) {
  .dlg-stage-body {
    flex-direction: column;
    align-items: center;
  }
  .sanctuary-shell {
    padding: 18px 14px;
  }
}
