/* Tempelveggen — torch-lit stone relief (WebGL2). All rules scoped to .tempel-stage. */

.tempel-stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  background: #000;
  overflow: hidden;
  /* full-bleed even inside a constrained content column; no-op when already full width */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  font-family: Georgia, 'Times New Roman', serif;
}

.tempel-stage #tempel-gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: none;
  touch-action: pan-y;
}

/* ---------- loading ---------- */
.tempel-stage .tempel-load {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  transition: opacity 1.6s ease;
}
.tempel-stage .tempel-load.gone { opacity: 0; pointer-events: none; }

.tempel-stage .tempel-ember {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd9a0 0%, #ff7a1a 45%, rgba(255,60,0,0) 72%);
  box-shadow: 0 0 18px 6px rgba(255,120,20,.55), 0 0 60px 24px rgba(255,80,10,.18);
  animation: tempel-emberpulse 2.1s ease-in-out infinite;
}
@keyframes tempel-emberpulse {
  0%, 100% { transform: scale(1);    opacity: .75; }
  38%      { transform: scale(1.45); opacity: 1;   }
  62%      { transform: scale(1.15); opacity: .85; }
}
.tempel-stage .tempel-loadtxt {
  color: #8a755a;
  font-size: 12px;
  letter-spacing: .42em;
  text-transform: uppercase;
}
.tempel-stage .tempel-loadpct {
  color: #4c4033;
  font-size: 11px;
  letter-spacing: .3em;
}

/* ---------- title ---------- */
.tempel-stage .tempel-hdr {
  position: absolute;
  top: 5.5vh;
  left: 0;
  right: 0;
  z-index: 10;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.4s ease;
}
.tempel-stage .tempel-hdr.show { opacity: 1; }
.tempel-stage .tempel-hdr.dim  { opacity: .16; transition: opacity 3.5s ease; }
.tempel-stage .tempel-zh {
  color: #cdb28c;
  font-size: clamp(30px, 5vw, 44px);
  letter-spacing: .55em;
  margin-left: .55em;
  text-shadow: 0 0 22px rgba(255,150,50,.22);
}
.tempel-stage .tempel-en {
  color: #6d5c46;
  font-size: 11px;
  letter-spacing: .52em;
  margin-top: 10px;
  margin-left: .52em;
  text-transform: uppercase;
}
.tempel-stage .tempel-seal {
  display: inline-block;
  margin-top: 14px;
  padding: 3px 5px;
  color: #9c2c1e;
  border: 1px solid rgba(156,44,30,.65);
  font-size: 10px;
  letter-spacing: .18em;
  border-radius: 2px;
  opacity: .8;
}

/* ---------- hint ---------- */
.tempel-stage .tempel-hint {
  position: absolute;
  bottom: 6vh;
  left: 0;
  right: 0;
  z-index: 10;
  text-align: center;
  color: #5d4f3e;
  font-size: 11.5px;
  letter-spacing: .4em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2s ease;
}
.tempel-stage .tempel-hint.show { opacity: .85; }
.tempel-stage .tempel-hint.gone { opacity: 0; }
@media (max-width: 480px) {
  .tempel-stage .tempel-hint { font-size: 10px; letter-spacing: .22em; padding: 0 1em; }
}

/* ---------- sound toggle ---------- */
.tempel-stage .tempel-snd {
  position: absolute;
  right: 18px;
  bottom: 16px;
  z-index: 15;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  background: rgba(20,14,8,.5);
  border: 1px solid rgba(150,110,60,.28);
  color: #8a6f4d;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s ease;
  backdrop-filter: blur(3px);
}
.tempel-stage .tempel-snd:hover {
  border-color: rgba(220,160,80,.6);
  color: #d9a95f;
  background: rgba(20,14,8,.5);
}
.tempel-stage .tempel-snd.on {
  color: #ffb35c;
  border-color: rgba(255,170,80,.55);
  box-shadow: 0 0 14px rgba(255,140,40,.25);
}
.tempel-stage .tempel-snd svg { width: 19px; height: 19px; }

/* ---------- error ---------- */
.tempel-stage .tempel-err {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  background: #000;
  color: #a08560;
  font-size: 14px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2em;
}
