/* ROOM CSS */

html, body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  outline: none; /* Remove blue focus outline */
}
canvas:active { cursor: grabbing; }

/* ===== Loader ===== */
#loaderBacking {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: #000;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
#loaderText {
  color: #ff0000;
  font-family: monospace;
  font-size: 13px;
  letter-spacing: 0.25em;
}
#loaderPct {
  color: #ff0000;
  font-family: monospace;
  font-size: 11px;
  opacity: 0.7;
  letter-spacing: 0.15em;
}

.hud {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 10;
  color: #fff;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  padding: 10px 12px;
  border-radius: 12px;
  font: 12px/1.3 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  user-select: none;
  pointer-events: none;
}
.hud b { display:block; font-size: 13px; margin-bottom: 4px; }
.hud .small { opacity: 0.85; }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop.is-open { display: flex; }

.modal {
  width: min(720px, 100%);
  max-height: min(80vh, 720px);
  overflow: auto;
  background: rgba(20,20,20,0.92);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.6);
  color: #fff;
  font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.modal-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  background: rgba(20,20,20,0.92);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(6px);
}

.modal-title { font-weight: 700; font-size: 15px; }

.modal-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: rgba(255,255,255,0.08); }

.modal-body { padding: 14px; }
.modal-body p { margin: 0 0 10px; opacity: 0.95; }
.modal-body code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
}