* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #14120f;
}

#stage, #debug {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}

#debug { pointer-events: none; }

#camera { display: none; }

#hud {
  position: fixed;
  left: 12px;
  bottom: 12px;
  width: min(360px, calc(100vw - 24px));
  padding: 8px 12px;
  font: 12px/1.6 "Consolas", monospace;
  color: rgba(40, 35, 28, 0.85);
  background: rgba(245, 240, 232, 0.72);
  border-radius: 4px;
  pointer-events: auto;
}

#debugStats {
  margin: 0 0 8px;
  white-space: pre;
}

#camPreview {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  border-radius: 3px;
  /* mirror to match the installation's mirrored view */
  transform: scaleX(-1);
  background: #000;
}

#debugControls {
  display: grid;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid rgba(40, 35, 28, 0.22);
}

#debugHint {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 2;
  font: 11px/1.4 "Consolas", monospace;
  letter-spacing: 0.04em;
  color: rgba(216, 210, 196, 0.62);
  text-shadow: 0 1px 4px rgba(20, 18, 15, 0.8);
  pointer-events: none;
}

#debugHint kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 5px;
  color: rgba(235, 230, 220, 0.82);
  background: rgba(216, 210, 196, 0.1);
  border: 1px solid rgba(216, 210, 196, 0.3);
  border-radius: 3px;
  font: inherit;
  text-align: center;
}

#debugLicense {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(40, 35, 28, 0.22);
}

#debugLicense > summary {
  color: rgba(40, 35, 28, 0.72);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(40, 35, 28, 0.3);
  text-underline-offset: 3px;
}

#debugLicense > summary:hover {
  color: rgba(40, 35, 28, 1);
}

#debugVersion {
  margin-top: 8px;
  color: rgba(40, 35, 28, 0.55);
  font-size: 11px;
  text-align: right;
}

.license-panel {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 30;
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 24px;
  overflow: auto;
  color: #d8d2c4;
  background: rgba(20, 18, 15, 0.96);
  border: 1px solid rgba(216, 210, 196, 0.35);
  border-radius: 4px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  text-shadow: none;
  transform: translate(-50%, -50%);
}

.license-panel h2 {
  margin-bottom: 16px;
  font: 18px/1.4 "Consolas", monospace;
}

.license-note {
  margin-bottom: 16px;
  color: rgba(216, 210, 196, 0.7);
  font: 11px/1.5 "Consolas", monospace;
}

.license-entry {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(216, 210, 196, 0.2);
}

.license-entry summary,
.license-entry a {
  color: #d8d2c4;
}

.license-entry p {
  margin: 8px 0;
  color: rgba(216, 210, 196, 0.72);
  font: 11px/1.5 "Consolas", monospace;
}

.license-entry iframe {
  width: 100%;
  height: min(48vh, 420px);
  margin-top: 10px;
  background: #f5f0e8;
  border: 0;
  border-radius: 2px;
}

.debug-control {
  display: grid;
  grid-template-columns: 142px 1fr 52px;
  gap: 7px;
  align-items: center;
}

.debug-control input {
  width: 100%;
  accent-color: #514a3c;
}

.debug-control output {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#boot {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #14120f;
  color: #d8d2c4;
  transition: opacity 1.2s ease;
  z-index: 10;
}

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

.boot-inner { text-align: center; }

.boot-inner h1 {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 56px;
  font-weight: 400;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  margin-bottom: 24px;
}

.boot-inner p {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 14px;
  letter-spacing: 0.2em;
  opacity: 0.75;
}

#startBtn {
  margin-top: 28px;
  padding: 12px 36px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 15px;
  letter-spacing: 0.25em;
  text-indent: 0.25em;
  color: #d8d2c4;
  background: transparent;
  border: 1px solid rgba(216, 210, 196, 0.5);
  border-radius: 2px;
  cursor: pointer;
}

#startBtn:hover { background: rgba(216, 210, 196, 0.12); }

body.immersive { cursor: none; }
