/* ═══════════════════════════════════════════════════════════════
   DAS ERSTE WORT — GAME ENGINE CSS
   The visual layer of the quest system.
   ═══════════════════════════════════════════════════════════════ */

/* --- READING PROGRESS BAR (top of viewport) --- */
#ge-progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #e8a44a, #f4c67a, #e8a44a);
  z-index: 9999;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(232,164,74,0.4);
}

/* --- QUEST JOURNAL BUTTON --- */
#ge-journal-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(123,47,190,0.9), rgba(147,51,234,0.9));
  border: 2px solid rgba(192,132,252,0.4);
  color: #efe8db;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(123,47,190,0.4), 0 0 40px rgba(147,51,234,0.15);
  transition: all 0.3s ease;
  font-family: serif;
}
#ge-journal-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(123,47,190,0.6), 0 0 50px rgba(147,51,234,0.25);
}
#ge-journal-btn .notif-dot {
  position: absolute;
  top: -2px; right: -2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #e8a44a;
  border: 2px solid #080810;
  display: none;
}
#ge-journal-btn .notif-dot.show { display: block; }

/* --- QUEST JOURNAL PANEL --- */
#ge-journal {
  position: fixed;
  top: 0; right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: linear-gradient(180deg, #0c0c18 0%, #0a0a14 100%);
  border-left: 1px solid rgba(147,51,234,0.2);
  z-index: 8500;
  overflow-y: auto;
  transition: right 0.4s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -10px 0 40px rgba(0,0,0,0.5);
  font-family: 'Cormorant Garamond', Georgia, serif;
}
#ge-journal.open { right: 0; }
#ge-journal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 8400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#ge-journal-overlay.open { opacity: 1; pointer-events: all; }

.ge-j-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(232,164,74,0.1);
}
.ge-j-header h2 {
  font-size: 1.6rem;
  font-weight: 400;
  color: #efe8db;
  margin: 0 0 4px;
}
.ge-j-header .subtitle {
  font-size: 0.85rem;
  color: rgba(212,202,187,0.4);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.ge-j-close {
  position: absolute;
  top: 20px; right: 20px;
  background: none;
  border: none;
  color: rgba(212,202,187,0.4);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
}
.ge-j-close:hover { color: #efe8db; }

/* --- JOURNAL SECTIONS --- */
.ge-j-section {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(232,164,74,0.06);
}
.ge-j-section h3 {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(212,202,187,0.35);
  margin-bottom: 12px;
  font-weight: 500;
}

/* Continue Button */
.ge-continue-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, rgba(232,164,74,0.12), rgba(232,164,74,0.06));
  border: 1px solid rgba(232,164,74,0.25);
  border-radius: 10px;
  color: #e8a44a;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
}
.ge-continue-btn:hover {
  background: linear-gradient(135deg, rgba(232,164,74,0.2), rgba(232,164,74,0.1));
  border-color: #e8a44a;
  transform: translateY(-1px);
}
.ge-continue-btn .chapter-name {
  display: block;
  font-size: 0.85rem;
  color: rgba(212,202,187,0.5);
  margin-top: 2px;
}

/* Progress Rings */
.ge-progress-row {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}
.ge-progress-item {
  flex: 1;
  background: rgba(255,255,255,0.02);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.ge-progress-item .number {
  font-size: 2rem;
  font-weight: 600;
  color: #e8a44a;
  line-height: 1;
}
.ge-progress-item .label {
  font-size: 0.8rem;
  color: rgba(212,202,187,0.4);
  margin-top: 4px;
}
.ge-progress-item.patterns .number { color: #9b8ec4; }
.ge-progress-item.chapters .number { color: #8ed69e; }

/* Phase Progress */
.ge-phase {
  margin-bottom: 12px;
}
.ge-phase-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.ge-phase-label .name { color: rgba(212,202,187,0.7); }
.ge-phase-label .count { color: rgba(212,202,187,0.35); }
.ge-phase-bar {
  height: 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  overflow: hidden;
}
.ge-phase-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.ge-phase-bar-fill.fire { background: linear-gradient(90deg, #e8a44a, #f4c67a); }
.ge-phase-bar-fill.workshop { background: linear-gradient(90deg, #c47a4a, #e0a070); }
.ge-phase-bar-fill.architecture { background: linear-gradient(90deg, #9b8ec4, #b8aed8); }
.ge-phase-bar-fill.forge { background: linear-gradient(90deg, #c45d5d, #e08080); }

/* Achievements */
.ge-achievement {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  opacity: 0.3;
  transition: opacity 0.3s ease;
}
.ge-achievement.unlocked { opacity: 1; }
.ge-achievement .icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(232,164,74,0.08);
  border: 1px solid rgba(232,164,74,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.ge-achievement.unlocked .icon {
  background: rgba(232,164,74,0.15);
  border-color: rgba(232,164,74,0.4);
  box-shadow: 0 0 12px rgba(232,164,74,0.15);
}
.ge-achievement .info .name {
  font-size: 0.95rem;
  color: rgba(212,202,187,0.7);
}
.ge-achievement.unlocked .info .name { color: #efe8db; }
.ge-achievement .info .desc {
  font-size: 0.8rem;
  color: rgba(212,202,187,0.3);
}

/* --- TOAST NOTIFICATIONS --- */
#ge-toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}
.ge-toast {
  background: linear-gradient(135deg, rgba(15,20,35,0.97), rgba(10,14,26,0.97));
  border: 1px solid rgba(232,164,74,0.25);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: geToastIn 0.5s ease forwards, geToastOut 0.5s ease 3.5s forwards;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  pointer-events: all;
}
.ge-toast .icon { font-size: 1.4rem; flex-shrink: 0; }
.ge-toast .text { font-size: 0.95rem; color: #efe8db; line-height: 1.4; }
.ge-toast .text .sub {
  display: block;
  font-size: 0.8rem;
  color: rgba(212,202,187,0.5);
  margin-top: 2px;
}

@keyframes geToastIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes geToastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}

/* --- WORD LOOT BURST --- */
.ge-loot-burst {
  position: fixed;
  pointer-events: none;
  z-index: 9000;
}
.ge-loot-particle {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #e8a44a;
  animation: geLootFly 0.8s ease-out forwards;
}
@keyframes geLootFly {
  0% { opacity: 1; transform: translate(0,0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0); }
}

/* --- CHAPTER HEADER ADDITIONS --- */
.ge-reading-time {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(212,202,187,0.3);
  letter-spacing: 0.15em;
  margin-top: 8px;
  opacity: 0;
  animation: fadeUp 2s ease 1.8s forwards;
}

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
  #ge-journal { width: 100%; right: -100%; }
  #ge-journal-btn { bottom: 16px; right: 16px; width: 48px; height: 48px; font-size: 1.3rem; }
}
