/* MaloFull WebGL template v2. Colours match the Info Hotspots panel (#10141A, teal #2BB3A3). */

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #10141a;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#unity-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #10141a;
  outline: none;
  touch-action: none;
}

/* =========================================================================
   Loading screen
   ========================================================================= */

#loader {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  color: #fff;
  background: radial-gradient(ellipse at center, #1b222c 0%, #10141a 70%);
  transition: opacity 0.5s ease;
}
#loader.done { opacity: 0; pointer-events: none; }

#intro {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;      /* plain loader: everything centred */
  padding: 24px 24px 8px;
  box-sizing: border-box;
}
#loader.has-intro #intro { justify-content: flex-start; }

#intro-head { text-align: center; }

#loader-logo {
  display: block;
  max-width: 220px;
  max-height: 64px;
  margin: 0 auto 20px;
}

#loader-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

#intro-subtitle {
  margin-top: 6px;
  font-size: 14px;
  color: #99a3b3;
}

/* ---- Intro body: stacked on phones, two columns on wide screens ---- */

#intro-body {
  width: 100%;
  max-width: 1100px;
  margin-top: 20px;
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
#intro-body[hidden] { display: none; }

@media (min-width: 900px) and (min-height: 520px) {
  #loader.has-intro #intro { justify-content: center; }
  #intro-body { grid-template-columns: 1.35fr 1fr; align-items: start; margin-top: 28px; }
}

/* Landscape phones: pictures and text side by side, smaller header */
@media (max-height: 520px) and (orientation: landscape) {
  #intro { padding: 12px 20px 4px; }
  #loader-logo { max-height: 36px; margin-bottom: 8px; }
  #loader-title { font-size: 16px; }
  #intro-body { grid-template-columns: 1.2fr 1fr; margin-top: 12px; gap: 16px; }
}

/* ---- Slideshow ---- */

#slides {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}
#slides[hidden] { display: none; }

#slides-track { position: absolute; inset: 0; touch-action: pan-y; }

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.slide.active { opacity: 1; z-index: 1; }
.slide img, .slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0c1015;
}
.slide.broken::after {
  content: "Picture unavailable";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #99a3b3;
}

#slides-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 28px 14px 30px;
  font-size: 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  pointer-events: none;
}
#slides-caption:empty { display: none; }

#slides-prev, #slides-next {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 36px;
  height: 36px;
  margin-top: -18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  line-height: 34px;
  color: #fff;
  background: rgba(16, 20, 26, 0.6);
  cursor: pointer;
}
#slides-prev { left: 10px; }
#slides-next { right: 10px; }
#slides-prev[hidden], #slides-next[hidden] { display: none; }

#slides-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 6px;
}
#slides-dots[hidden] { display: none; }
#slides-dots .dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
}
#slides-dots .dot.active { background: #fff; }

/* ---- Text ---- */

#intro-text { font-size: 15px; line-height: 1.55; color: #d6dbe3; }
#intro-desc p { margin: 0 0 12px; }

#intro-facts {
  margin: 4px 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#intro-facts[hidden] { display: none; }
.fact {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}
.fact dt {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #99a3b3;
}
.fact dd { margin: 2px 0 0; font-size: 14px; color: #fff; }

#intro-tips[hidden] { display: none; }
#intro-tips h2 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #2bb3a3;
}
#intro-tips ul { margin: 0; padding-left: 18px; }
#intro-tips li { margin-bottom: 4px; }

/* ---- Footer: progress always visible at the bottom ---- */

#loader-footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 24px calc(18px + env(safe-area-inset-bottom));
  text-align: center;
}
#loader:not(.has-intro) #loader-footer { position: absolute; left: 0; right: 0; top: 58%; }
#loader.has-intro #loader-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(16, 20, 26, 0.85);
}

#loader-bar {
  width: min(340px, 72vw);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

#loader-fill {
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: #2bb3a3;
  transition: width 0.3s ease;
}

/* Second stage (download finished, Unity starting): moving shimmer so it never looks stuck */
#loader.preparing #loader-fill {
  background: linear-gradient(90deg, #2bb3a3 0%, #7fe0d4 50%, #2bb3a3 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: 0 0; } }

#loader-status {
  margin-top: 10px;
  font-size: 14px;
  color: #99a3b3;
  font-variant-numeric: tabular-nums;
}

#loader-hint {
  margin-top: 6px;
  min-height: 1.2em;
  max-width: 420px;
  font-size: 13px;
  color: #e0a030;
}
#loader-hint:empty { min-height: 0; margin: 0; }

#enter-btn {
  margin-top: 10px;
  padding: 12px 26px;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #0c1f1c;
  background: #2bb3a3;
  cursor: pointer;
  animation: pulse 1.8s ease-in-out infinite;
}
#enter-btn[hidden] { display: none; }
#enter-btn:hover { background: #3cc9b8; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(43, 179, 163, 0.5); }
  50% { box-shadow: 0 0 0 10px rgba(43, 179, 163, 0); }
}
#loader.ready #loader-bar { display: none; }

#loader.error #loader-fill { background: #c94a4a; animation: none; }
#loader.error #loader-status { color: #fff; }
#loader.error #loader-hint { color: #c9a0a0; }

/* =========================================================================
   Fullscreen button (top-right, clear of the hotspot filter bar and card)
   ========================================================================= */

#fullscreen-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 8px;
  color: #fff;
  background: rgba(16, 20, 26, 0.72);
  cursor: pointer;
  transition: background 0.15s ease;
}
#fullscreen-btn[hidden] { display: none; }
#fullscreen-btn:hover { background: rgba(16, 20, 26, 0.92); }
#fullscreen-btn .icon-exit { display: none; }
#fullscreen-btn.is-fullscreen .icon-enter { display: none; }
#fullscreen-btn.is-fullscreen .icon-exit { display: block; }

/* =========================================================================
   Unity warnings / errors
   ========================================================================= */

#banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 90vw;
}
.banner {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: #10141a;
  background: #e0a030;
}
.banner.error { color: #fff; background: #c94a4a; }
