/* Rephobia Fire Escape Climb Demo - styles
   Brand: beige #F4F5EB, dark green #406F09, accent green #8AC349, ink #1E1E1E */

:root {
  --rephobia-beige: #F4F5EB;
  --rephobia-green: #406F09;
  --rephobia-accent: #8AC349;
  --rephobia-ink: #1E1E1E;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter Tight', system-ui, sans-serif;
}

/* ======================= Splash screen ======================= */

#splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: var(--rephobia-beige);
  transition: opacity 0.4s ease;
}

#splash.hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-title {
  font-family: 'Bree Serif', serif;
  font-weight: 400;
  color: var(--rephobia-green);
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  margin: 0 0 12px;
  max-width: 18ch;
}

.splash-tagline {
  color: var(--rephobia-ink);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  margin: 0 0 40px;
}

#start-btn {
  font-family: 'Inter Tight', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  background: var(--rephobia-green);
  border: none;
  border-radius: 8px;
  padding: 14px 48px;
  cursor: pointer;
  transition: background 0.15s ease;
}

#start-btn:hover:not(:disabled) {
  background: var(--rephobia-accent);
}

#start-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.splash-error {
  color: #b3261e;
  margin-top: 24px;
  max-width: 50ch;
}

/* ---- Rephobia logotype (generic splash) ---- */

#splash-rephobia-logo {
  width: min(340px, 72vw);
  margin-bottom: 24px;
}

#splash-rephobia-logo[hidden] {
  display: none;
}

/* ---- Provider branding (branded links /{slug}/{code}) ---- */

#splash-logo {
  max-height: 96px;
  max-width: min(320px, 70vw);
  object-fit: contain;
  margin-bottom: 20px;
}

#splash-prepared {
  font-family: 'Bree Serif', serif;
  color: var(--rephobia-ink);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  margin: 0 0 8px;
}

.splash-powered {
  color: #6a6a6a;
  font-size: 0.85rem;
  margin-top: 36px;
}

.splash-powered .powered-logo {
  height: 16px;
  vertical-align: -3px;
}

/* Provider accent colour on the Start button (set via --provider-accent) */
#start-btn.provider-accent {
  background: var(--provider-accent, var(--rephobia-green));
}

#start-btn.provider-accent:hover:not(:disabled) {
  filter: brightness(1.2);
}

/* ======================= End card ======================= */

#endcard {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 20, 0.75);
  padding: 24px;
}

#endcard[hidden] {
  display: none;
}

.endcard-inner {
  background: var(--rephobia-beige);
  border-radius: 16px;
  padding: 40px 36px;
  max-width: 460px;
  width: 100%;
  text-align: center;
}

.endcard-brand-logo {
  width: min(200px, 55%);
  margin: 0 0 10px;
}

.endcard-headline {
  font-family: 'Bree Serif', serif;
  font-weight: 400;
  color: var(--rephobia-ink);
  font-size: 1.25rem;
  margin: 0 0 16px;
}

.endcard-text {
  color: var(--rephobia-ink);
  font-size: 0.98rem;
  line-height: 1.55;
  margin: 0 0 28px;
}

.endcard-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.endcard-btn {
  display: block;
  font-family: 'Inter Tight', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 13px 24px;
  cursor: pointer;
  text-decoration: none;
  border: none;
}

.endcard-primary {
  background: var(--rephobia-green);
  color: #fff;
}

.endcard-primary:hover {
  background: var(--rephobia-accent);
}

.endcard-secondary {
  background: transparent;
  color: var(--rephobia-green);
  border: 2px solid var(--rephobia-green);
}

.endcard-secondary:hover:not(:disabled) {
  background: rgba(64, 111, 9, 0.08);
}

.endcard-secondary:disabled {
  opacity: 0.55;
  cursor: default;
}

.endcard-thanks {
  color: var(--rephobia-green);
  font-weight: 600;
  margin: 4px 0 0;
}

.endcard-restart {
  background: none;
  border: none;
  color: #6a6a6a;
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 16px;
  text-decoration: underline;
}

.endcard-restart:hover {
  color: var(--rephobia-ink);
}

/* ======================= HUD ======================= */

#hud[hidden] {
  display: none;
}

#hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 12px 16px;
  pointer-events: none; /* only the button itself is interactive */
}

#hud-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

#level-indicator {
  background: rgba(20, 20, 20, 0.65);
  color: #fff;
  border-left: 3px solid var(--rephobia-green);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
}

#powered-badge {
  background: rgba(20, 20, 20, 0.5);
  color: rgba(255, 255, 255, 0.75);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
}

#mute-btn {
  pointer-events: auto;
  margin-right: 68px; /* keep clear of A-Frame's Enter VR button (bottom-right) */
  background: rgba(20, 20, 20, 0.65);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 1.1rem;
  cursor: pointer;
}

#mute-btn:hover {
  background: rgba(20, 20, 20, 0.85);
}

/* ======================= Error banner ======================= */

#error-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: #b3261e;
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 0.95rem;
  max-width: 90vw;
}

/* ======================= Admin UI ======================= */

#admin-badge {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 60;
  background: #b3261e;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
}

#admin-panel {
  position: fixed;
  top: 48px;
  left: 12px;
  z-index: 60;
  background: rgba(20, 20, 20, 0.85);
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  width: 260px;
  font-size: 0.85rem;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.admin-row label {
  width: 52px;
  flex-shrink: 0;
  color: #ccc;
}

.admin-row select,
.admin-row input {
  flex: 1;
  min-width: 0;
  background: #2c2c2c;
  color: #fff;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 0.85rem;
}

.admin-row button {
  background: var(--rephobia-green);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 0.85rem;
}

.admin-row button:hover {
  background: var(--rephobia-accent);
}

#admin-scene-label {
  flex: 1;
  text-align: center;
  font-weight: 600;
}

#admin-status.saved { color: var(--rephobia-accent); }
#admin-status.dirty { color: #f2b64a; }

.admin-hint {
  color: #aaa;
  font-size: 0.75rem;
  margin: 4px 0 0;
}
