/* Dark stage. The picture keeps its 320x240 buffer and is scaled by an
   integer CSS factor computed in js/main.js. */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Yu Gothic UI", "YuGothic", "Meiryo", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
}

#view {
  display: block;
  width: 320px;
  height: 240px;
  image-rendering: pixelated;
  touch-action: none;
  cursor: grab;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}

#view:active {
  cursor: grabbing;
}

/* The XR surface is always present: never display:none. */
#xr {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

/* The MR surface is always present too: a transparent passthrough draw. */
#mr-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#status {
  position: absolute;
  top: 12px;
  left: 14px;
  max-width: 74vw;
  color: #c9e0d6;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px #000;
}

/* Indeterminate indicator while the first bake has no progress to report. */
#status.busy::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 8px;
  border: 2px solid #29414b;
  border-top-color: #62e2ee;
  border-radius: 50%;
  vertical-align: -2px;
  animation: q3spin 1s linear infinite;
}

@keyframes q3spin {
  to { transform: rotate(360deg); }
}

#vr {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  pointer-events: auto;
  padding: 10px 26px;
  border: 1px solid #62e2ee;
  border-radius: 999px;
  background: #0a1016;
  color: #ecf7ee;
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

#vr:hover:not(:disabled) {
  background: #17252e;
}

#vr:disabled {
  opacity: 0.4;
  border-color: #29414b;
  cursor: default;
}

#vr-note {
  position: absolute;
  left: 50%;
  bottom: 72px;
  width: min(640px, 86vw);
  transform: translateX(-50%);
  margin: 0;
  color: #a6c6c0;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

#help {
  position: absolute;
  left: 14px;
  bottom: 12px;
  margin: 0;
  color: #557b7f;
  font-size: 11px;
  line-height: 1.7;
}

/* MR entry point: next to the VR button, so the VR layout is untouched. */
#mr {
  position: absolute;
  left: calc(50% + 78px);
  bottom: 20px;
  pointer-events: auto;
  padding: 10px 26px;
  border: 1px solid #62e2ee;
  border-radius: 999px;
  background: #0a1016;
  color: #ecf7ee;
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

#mr:hover:not(:disabled) {
  background: #17252e;
}

#mr:disabled {
  opacity: 0.4;
  border-color: #29414b;
  cursor: default;
}

#mr-note {
  position: absolute;
  left: 50%;
  bottom: 116px;
  width: min(640px, 86vw);
  transform: translateX(-50%);
  margin: 0;
  color: #a6c6c0;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 700px) {
  #mr-note { bottom: 104px; }
}

@media (max-width: 700px) {
  #help { display: none; }
  #vr-note { bottom: 66px; }
}
