/* 第8作専用。通常ROOMのレイアウトは変更しない。 */
.investigation-overlay {
  position: fixed; inset: 0; z-index: 1000; background: #030b18b8;
  color: #f5f4ef; padding: 10px; height: 100vh; height: 100dvh;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.investigation-shell {
  width: min(940px,100%); height: 100%; margin: auto;
  display: grid; grid-template-rows: auto minmax(0,1fr) auto; gap: 10px;
}
.inspection-heading { border: 0; padding: 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.inspection-heading h2 { margin: 0; font-size: 20px; }
#inspection-close { min-height: 44px; background: #112138e8; color: white; white-space: nowrap; }
.inspection-stage { position: relative; min-height: 0; display: grid; place-items: center; overflow: auto; }
#inspection-visual { width: 100%; height: 100%; min-height: 0; display: flex; justify-content: center; align-items: center; }
#inspection-visual img { display: block; width: 100%; height: 100%; object-fit: contain; max-width: 700px; }
.object-closeup { width: min(650px,90%); height: 100%; min-height: 0; }
.object-closeup svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.exit-key-art { width: min(500px,90%); }
.exit-key-art svg { width: 100%; display: block; }
#inspection-text, #message { background: #101d32ed; color: #f4f6fa; }
#inspection-text { border: 1px solid #8595aa; border-radius: 6px; padding: 12px 18px; max-height: 32dvh; overflow: auto; cursor: pointer; }
#inspection-message { white-space: pre-line; margin: 0 0 4px; min-height: 3em; line-height: 1.5; }
#inspection-text small { font-size: 12px; color: #bac8d8; }
#message { cursor: pointer; }
#inspection-text:focus-visible, #message:focus-visible { outline: 2px solid #e5c47e; }
/* 箱のアップと操作盤を同じ位置に重ねる。 */
#code-controls { position: absolute; align-self: center; justify-self: center; width: min(280px,90%); background: #172437f0; border: 3px solid #bca579; border-radius: 12px; padding: 10px; box-shadow: 0 6px 20px #0006; }
#code-controls label { font-size: 12px; color: #d7c9a5; }
#code { margin: 4px 0 8px; padding: 4px 8px; min-height: 44px; height: 44px; background: #07111f; color: #fff0b3; font-size: 28px; }
#code-pad { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
#code-pad button { min-height: 44px; padding: 4px; background: #30445a; color: white; }
#code-pad button[type=submit] { background: #796241; }
@media (max-width: 600px) {
  .investigation-overlay { padding: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .investigation-shell { gap: 6px; }
  .inspection-heading h2 { font-size: 17px; }
  #inspection-text { padding: 10px 12px; }
  #inspection-message { font-size: 15px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .investigation-shell { gap: 4px; }
  #inspection-text { padding: 6px 12px; }
  #inspection-message { min-height: 1.5em; font-size: 14px; }
  #code-controls { width: min(460px,90%); padding: 6px; }
  #code-pad { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 4px; }
  #code-controls label { display: none; }
}

/* 観測室の扉だけに追加するカード使用ボタン。 */
.door-card-action { position: absolute; bottom: 8px; right: 8px; min-height: 44px; background: #173247; color: #fff; border-color: #cab77d; }
