:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, sans-serif;
  color: #fff;
  background: #111;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }

#ar-stage {
  position: fixed;
  inset: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  touch-action: manipulation;
}

a-scene { width: 100%; height: 100%; }
/* 映像の拡大・切り抜きはMindARに任せ、ARの座標と一致させる。 */
#ar-stage video { pointer-events: none; }

#start-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: #111;
}

.start-content { width: 100%; max-width: 360px; }
h1 { margin: 0 0 16px; font-size: 1.4rem; }
p { margin: 8px 0; line-height: 1.6; }

button {
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  border: 0;
  border-radius: 6px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 600;
  color: #111;
  background: #fff;
  touch-action: manipulation;
}

button:disabled { opacity: 0.5; }
#start-note { font-size: 0.875rem; color: #ccc; }
#error-message { color: #ffb4b4; overflow-wrap: anywhere; }

#hud, #tap-hint {
  position: fixed;
  z-index: 5;
  margin: 0;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.875rem;
  background: rgb(0 0 0 / 70%);
  pointer-events: none;
}

#hud { top: calc(8px + env(safe-area-inset-top)); left: calc(8px + env(safe-area-inset-left)); }
#hud p { margin: 0; }
#tap-hint { bottom: calc(12px + env(safe-area-inset-bottom)); left: calc(8px + env(safe-area-inset-left)); right: calc(8px + env(safe-area-inset-right)); text-align: center; }
