/* ============ COMPONENTS ============ */

/* === Progress bar === */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 38px;
  background: linear-gradient(180deg, #2a1a0c 0%, #1a0f08 100%);
  border-bottom: 1px solid var(--gold-rich);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 4px;
  z-index: 200;
  box-shadow: 0 4px 18px rgba(0,0,0,0.6);
}

.progress::before, .progress::after {
  content: "";
  flex: 0 0 auto;
  width: 30px;
  height: 22px;
  background: var(--gold-rich);
  opacity: 0.7;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 22'><path d='M2 11 Q 8 2, 15 11 T 28 11' stroke='black' stroke-width='1.5' fill='none'/><circle cx='15' cy='11' r='2' fill='black'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 22'><path d='M2 11 Q 8 2, 15 11 T 28 11' stroke='black' stroke-width='1.5' fill='none'/><circle cx='15' cy='11' r='2' fill='black'/></svg>") center/contain no-repeat;
}

.progress-track {
  flex: 1;
  display: flex;
  gap: 6px;
  height: 8px;
  align-items: center;
}

.progress-cell {
  flex: 1;
  height: 4px;
  background: rgba(184, 134, 11, 0.25);
  border: 1px solid rgba(184, 134, 11, 0.35);
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
}

.progress-cell:hover { background: rgba(224, 200, 112, 0.5); transform: scaleY(2); }
.progress-cell.done { background: var(--gold-soft); }
.progress-cell.current { background: var(--gold-bright); box-shadow: 0 0 12px var(--gold-bright); transform: scaleY(2.2); }

.progress-cell .tooltip {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--parchment-light);
  color: var(--ink-black);
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  padding: 0.4rem 0.7rem;
  white-space: nowrap;
  border: 1px solid var(--gold-rich);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  text-transform: uppercase;
}

.progress-cell:hover .tooltip { opacity: 1; }

.progress-counter {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--gold-soft);
  margin: 0 0.6rem;
  min-width: 60px;
  text-align: center;
}

/* === Nav arrows === */
.nav-arrows {
  position: fixed;
  bottom: 28px;
  right: 32px;
  display: flex;
  gap: 14px;
  z-index: 150;
}

.nav-btn {
  width: 56px;
  height: 56px;
  background: radial-gradient(circle at 35% 30%, var(--parchment-light) 0%, var(--parchment-dark) 90%);
  border: 2px solid var(--ink-brown);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-brown);
  font-size: 1.4rem;
  font-family: var(--font-display);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.nav-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.7); color: var(--burgundy-dark); }
.nav-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* === Side controls (audio, map, erb) === */
.side-controls {
  position: fixed;
  bottom: 28px;
  left: 32px;
  display: flex;
  gap: 12px;
  z-index: 150;
}

.icon-btn {
  width: 46px;
  height: 46px;
  background: radial-gradient(circle at 35% 30%, var(--parchment-light) 0%, var(--parchment-dark) 90%);
  border: 2px solid var(--ink-brown);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-brown);
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
  transition: transform 0.2s;
  position: relative;
}

.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { transform: translateY(-2px) rotate(-3deg); }
.icon-btn.muted::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-top: 2px solid var(--burgundy-dark);
  transform: rotate(-45deg);
  transform-origin: center;
}

/* === Erb (Luxembourg coat of arms) === */
.erb-corner {
  position: fixed;
  top: 56px;
  right: 32px;
  width: 70px;
  height: 84px;
  z-index: 140;
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(.5,1.5,.5,1);
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
}

.erb-corner:hover { transform: rotateY(360deg) scale(1.08); }

/* === Loading screen === */
.loading {
  position: fixed;
  inset: 0;
  background: #0d0703;
  z-index: 9999;
  display: grid;
  place-items: center;
  transition: opacity 1s;
}
.loading.hidden { opacity: 0; pointer-events: none; }
.loading-book {
  width: 220px;
  height: 160px;
  position: relative;
}
.loading-text {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.4em;
  color: var(--gold-soft);
  margin-top: 2.5rem;
  text-align: center;
}
.loading-sub {
  font-family: var(--font-script);
  font-style: italic;
  color: var(--ink-pale);
  margin-top: 0.6rem;
  letter-spacing: 0.05em;
  text-align: center;
}

/* === Latin pop quote === */
.latin-quote {
  position: fixed;
  bottom: 90px;
  right: 32px;
  font-family: var(--font-script);
  font-style: italic;
  font-size: 1rem;
  color: var(--gold-soft);
  background: rgba(15, 8, 4, 0.8);
  padding: 0.5rem 1rem;
  border-left: 2px solid var(--gold-rich);
  max-width: 280px;
  opacity: 0;
  pointer-events: none;
  z-index: 140;
  transition: opacity 0.8s;
  letter-spacing: 0.05em;
}
.latin-quote.show { opacity: 1; }

/* === 1437 secret === */
.secret {
  position: fixed;
  inset: 0;
  background: rgba(20, 10, 5, 0.94);
  z-index: 600;
  display: none;
  place-items: center;
  padding: 4rem;
}
.secret.open { display: grid; }
.secret-paper {
  background: var(--parchment-light);
  background-image: url("../assets/svg/parchment-noise.svg");
  border: 4px double var(--gold-rich);
  padding: 3rem;
  max-width: 640px;
  text-align: center;
  position: relative;
  transform: rotate(-1.2deg);
  box-shadow: 0 20px 80px rgba(0,0,0,0.8);
}

/* === Custom cursor === */
.custom-cursor {
  position: fixed;
  width: 28px;
  height: 28px;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-2px, -24px);
  transition: transform 0.05s;
  mix-blend-mode: multiply;
}

.ink-trail {
  position: fixed;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, var(--ink-black) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  opacity: 0.5;
}

/* === Image attribution === */
.img-credit {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-style: italic;
  color: rgba(58, 40, 23, 0.55);
  background: rgba(244, 234, 213, 0.5);
  padding: 1px 6px;
  pointer-events: none;
}

.heraldic-frame {
  position: relative;
  padding: 14px;
  background:
    linear-gradient(135deg, var(--gold-rich), var(--gold-pale), var(--gold-rich));
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  max-width: 92%;
}

.heraldic-frame::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(26, 15, 8, 0.3);
  pointer-events: none;
  z-index: 2;
}

.heraldic-frame img,
.heraldic-frame .img-placeholder {
  display: block;
  width: 100%;
  filter: sepia(0.25) contrast(1.05);
}

.img-placeholder {
  background: linear-gradient(135deg, var(--parchment-mid), var(--parchment-dark));
  display: grid;
  place-items: center;
  font-family: var(--font-script);
  font-style: italic;
  color: var(--ink-faded);
  aspect-ratio: 3/4;
  text-align: center;
  padding: 2rem;
}

/* === Mobile warning === */
.mobile-warn {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--ink-black);
  color: var(--gold-soft);
  z-index: 10000;
  place-items: center;
  text-align: center;
  padding: 2rem;
  font-family: var(--font-display);
  letter-spacing: 0.2em;
}

@media (max-width: 768px) {
  .mobile-warn { display: grid; }
}
