/* Borobudur 3D - base styles (lane A): full-screen canvas, loading screen, footer.
   Lane B owns css/ui.css for the overlay UI. */

:root {
  --gold: #E8B75A;
  --bg: #0c0a08;
  --text: #f4ede2;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  touch-action: none;
  outline: none;
}

/* ---- Loading screen ---- */

#loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity 0.6s ease;
}

#loading.is-done {
  opacity: 0;
  pointer-events: none;
}

.loading-title {
  font-size: 28px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
}

.loading-track {
  width: min(260px, 70vw);
  height: 3px;
  background: rgba(232, 183, 90, 0.22);
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar {
  width: 0%;
  height: 100%;
  background: var(--gold);
  transition: width 0.3s ease;
}

.loading-pct {
  font-size: 14px;
  color: rgba(244, 237, 226, 0.75);
  font-variant-numeric: tabular-nums;
}

/* Error state: message + Try again */
.loading-error { display: none; text-align: center; }

#loading.is-error .loading-error { display: block; }
#loading.is-error .loading-track,
#loading.is-error .loading-pct { display: none; }

.loading-error-msg {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--text);
}

.loading-retry {
  min-height: 44px;
  min-width: 140px;
  padding: 0 24px;
  font-size: 16px;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 6px;
  cursor: pointer;
}

.loading-retry:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---- Footer credit line ---- */

footer {
  position: fixed;
  left: 10px;
  bottom: 8px;
  z-index: 10;
  font-size: 11px;
  color: rgba(244, 237, 226, 0.55);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  #loading,
  .loading-bar { transition: none; }
}
