/* MaloFull WebGL template v3. Colours match the Info Hotspots panel (#10141A, teal #2BB3A3).
   The accent can be changed per project with "branding": { "accent": "#RRGGBB" } in intro.json. */

:root {
  --accent: #2bb3a3;
  --accent-ink: #0c1f1c;    /* text on the accent colour (set automatically from the accent) */
  --panel: rgba(16, 20, 26, 0.82);
}

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;
  opacity: 0;                   /* shown once intro.json has decided whose logo leads */
  transition: opacity 0.3s ease;
}
#loader.logo-ready #loader-logo { opacity: 1; }
/* A client's logo leading the loading screen sits on a white tile (most logos are dark-on-white) */
#loader-logo.partner {
  box-sizing: content-box;
  padding: 10px 16px;
  border-radius: 10px;
  background: #fff;
}

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

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

/* ---- Partner logos under the title ---- */

#intro-partners {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 18px;
}
#intro-partners[hidden] { display: none; }
#intro-partners .partner { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.partner-role {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #99a3b3;
}

.logo-tile {
  height: 44px;
  min-width: 44px;
  max-width: 150px;
  padding: 6px 10px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #fff;
}
.logo-tile img { max-height: 100%; max-width: 100%; display: block; }
.logo-tile.small { height: 40px; width: 72px; min-width: 72px; padding: 5px 7px; }
.logo-fallback {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  color: #10141a;
}

/* ---- 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-logo.partner { padding: 6px 10px; }
  #loader-title { font-size: 16px; }
  #intro-partners { margin-top: 8px; gap: 8px 12px; }
  #intro-partners .logo-tile { height: 32px; padding: 4px 8px; }
  #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: var(--accent);
}
#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: var(--accent);
  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, var(--accent) 0%, rgba(255, 255, 255, 0.75) 50%, var(--accent) 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: var(--accent-ink);
  background: var(--accent);
  cursor: pointer;
  animation: pulse 1.8s ease-in-out infinite;
}
#enter-btn[hidden] { display: none; }
#enter-btn:hover { filter: brightness(1.1); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35); }
  50% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 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; }

/* "Powered by" your logo, small, when the client's logo leads (Sales Suite) */
#loader-powered {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #7d8796;
}
#loader-powered[hidden] { display: none; }
#loader-powered img { max-height: 20px; max-width: 110px; opacity: 0.85; }

/* =========================================================================
   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; }

/* =========================================================================
   Branding corner (top-right): project name + lead logo, Enquire, Updated stamp
   ========================================================================= */

#brand-corner {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: calc(100vw - 32px);
  animation: fadeIn 0.5s ease 0.3s both;
}
#brand-corner.beside-fs { right: 64px; max-width: calc(100vw - 80px); }
#brand-corner[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

#brand-badge {
  position: relative;
  display: flex;
  align-items: stretch;
  max-width: 100%;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 10px;
  overflow: visible;
  font: inherit;
  color: #fff;
  background: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
#brand-badge[hidden] { display: none; }

#brand-title {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 16px 0 14px;
  border-radius: 10px 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--panel);
}
#brand-title[hidden] { display: none; }

#brand-logo-wrap {
  display: flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 0 10px 10px 0;
  background: #fff;
}
#brand-logo-wrap[hidden] { display: none; }
#brand-logo { max-height: 38px; max-width: 160px; display: block; }

/* Rounded corners when only one half is shown */
#brand-title[hidden] + #brand-logo-wrap { border-radius: 10px; }
#brand-badge.no-logo #brand-title { border-radius: 10px; }

/* Little "i" so people know it opens something */
#brand-info {
  position: absolute;
  bottom: -6px;
  left: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font: italic 700 12px/18px Georgia, serif;
  text-align: center;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
#brand-badge:hover #brand-title { background: rgba(16, 20, 26, 0.95); }

#enquire-btn {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
#enquire-btn[hidden] { display: none; }
#enquire-btn:hover { filter: brightness(1.1); }

#brand-updated {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: #d6dbe3;
  background: var(--panel);
}
#brand-updated[hidden] { display: none; }

/* Phones: logo only (the project name is in the About panel) */
@media (max-width: 640px) {
  #brand-title { display: none; }
  #brand-badge.no-logo #brand-title { display: flex; max-width: 60vw; font-size: 14px; }
  #brand-logo-wrap { border-radius: 10px; }
  #brand-badge { height: 40px; }
  #brand-logo { max-height: 30px; max-width: 110px; }
  #enquire-btn { padding: 8px 14px; font-size: 13px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  #brand-badge { height: 40px; }
  #brand-logo { max-height: 30px; }
}

/* =========================================================================
   About panel (opens from the corner badge)
   ========================================================================= */

#about { position: fixed; inset: 0; z-index: 15; }
#about[hidden] { display: none; }

#about-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}

#about-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100vw);
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 22px 22px calc(22px + env(safe-area-inset-bottom));
  color: #d6dbe3;
  background: #10141a;
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.4);
  transform: translateX(100%);
  transition: transform 0.2s ease;
}
#about.open #about-backdrop { opacity: 1; }
#about.open #about-panel { transform: none; }

#about-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  line-height: 34px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}
#about-close:hover { background: rgba(255, 255, 255, 0.16); }

#about-content h2 { margin: 4px 44px 4px 0; font-size: 20px; line-height: 1.3; color: #fff; }
.about-sub { font-size: 14px; color: #99a3b3; }
.about-updated {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
}
.about-desc { margin: 14px 0 0; font-size: 14px; line-height: 1.55; }

#about-content h3 {
  margin: 22px 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.credits { display: flex; flex-direction: column; gap: 10px; }
.credit {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}
.credit-text { min-width: 0; }
.credit-role { font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: #99a3b3; }
.credit-name { font-size: 15px; font-weight: 600; color: #fff; }

.contact-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.contact-links a {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.contact-links a:hover { background: rgba(255, 255, 255, 0.2); }

.about-enquire {
  display: block;
  margin-top: 20px;
  padding: 13px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: var(--accent-ink);
  background: var(--accent);
}
.about-enquire:hover { filter: brightness(1.1); }

.about-powered {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 12px;
  color: #7d8796;
}
.about-powered img { max-height: 28px; max-width: 140px; }
.about-powered.small img { max-height: 20px; max-width: 100px; }
.pw-text { flex-basis: 100%; }
.pw-name { font-size: 13px; font-weight: 600; color: #d6dbe3; }
.pw-tag { margin-top: 2px; }

/* =========================================================================
   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; }
