* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #0e0c0a; color: #efe6d8;
  font-family: -apple-system, "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none;
}
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.hidden { display: none !important; }

.panel {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 32px; gap: 18px;
  background: radial-gradient(120% 90% at 50% 20%, #2a231b 0%, #0e0c0a 70%);
}
.panel h1 { font-size: 30px; font-weight: 600; letter-spacing: 0.06em; margin: 0; }
.panel p { margin: 0; line-height: 1.8; opacity: 0.85; font-size: 15px; }
.panel .note { font-size: 12px; opacity: 0.5; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  border: 1px solid rgba(239,230,216,0.25); border-radius: 999px; padding: 10px 18px;
  background: rgba(239,230,216,0.08); color: #efe6d8; font-size: 14px; backdrop-filter: blur(6px);
}
.btn.primary { background: #e8c98a; color: #1a1408; border-color: transparent; font-size: 17px; padding: 14px 32px; font-weight: 600; }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn input[type=file] { display: none; }

#hud {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px;
  display: flex; justify-content: space-between; gap: 8px; z-index: 5;
  opacity: 0.85;
}
#motion {
  position: fixed; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 6;
}
#hint {
  position: fixed; left: 50%; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 110px); transform: translateX(-50%);
  font-size: 13px; opacity: 0; padding: 8px 14px; border-radius: 999px; background: rgba(0,0,0,0.35);
  pointer-events: none; z-index: 4; transition: opacity 0.6s; white-space: nowrap;
}
#hint.show { opacity: 0.85; }

#pad {
  position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: 92px; height: 92px;
  border-radius: 50%; border: 1px solid rgba(239,230,216,0.3); background: rgba(0,0,0,0.3); z-index: 6; touch-action: none;
}
#padKnob {
  position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  background: #e8c98a; box-shadow: 0 2px 8px rgba(0,0,0,0.5); pointer-events: none;
}
