/* 脱出ゲーム 固有の見た目（共通は ../common/base.css）。部屋の絵の中の色は、ダーク表示でも同じ（固定色） */
[hidden] { display: none !important; }

.game { max-width: 640px; margin: 0 auto; }
.scene-wrap { position: relative; margin: 0 auto; width: min(100%, 640px, calc(58vh * 800 / 540)); min-width: min(100%, 300px); }
svg.scene { display: block; width: 100%; height: auto; aspect-ratio: 800 / 540; border-radius: var(--radius); border: 1px solid var(--line);
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
svg.scene text { pointer-events: none; font-family: var(--font); }
svg.scene.fade { animation: sc-fade .18s ease-out; }
@keyframes sc-fade { from { opacity: .35; } to { opacity: 1; } }

/* 調べられる所（見た目は出さない。キーボードで選んだときだけ枠） */
.spot { fill: transparent; cursor: pointer; outline: none; }
.spot:focus-visible { fill: rgba(242, 193, 78, .22); stroke: #9A6415; stroke-width: 6; stroke-dasharray: 14 8; }
g.spot.book:focus-visible > rect:first-child { stroke: #9A6415; stroke-width: 7; }
.drop { animation: sc-drop .45s cubic-bezier(.5, 0, .9, .6); }
@keyframes sc-drop { from { transform: translateY(-300px); } to { transform: translateY(0); } }
.arm { transition: transform .5s ease-out; transform-box: view-box; }
@media (prefers-reduced-motion: reduce) { svg.scene.fade, .drop { animation: none; } .arm { transition: none; } }

/* 錠（ダイヤル）: 場面の上に重ねる */
.lock { position: absolute; transform: translate(-50%, -50%); background: #C9CFD3; border: 3px solid #5A3A28; border-radius: 10px;
  padding: 6px 8px 8px; color: #1F2328; max-width: calc(100% - 8px); }
.lock-title { text-align: center; font-size: 14px; font-weight: 700; margin: 0 0 4px; line-height: 1.3; }
.dials { display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.dial { display: flex; flex-direction: column; align-items: center; min-width: 50px; }
.dial-label { font-size: 14px; font-weight: 700; line-height: 1.25; min-height: 1.25em; white-space: nowrap; margin-bottom: 2px; }
.dial-label rt { font-size: 10px; }
.dial button { width: 50px; height: 40px; border: 2px solid #5A3A28; background: #EEF1F2; border-radius: 6px; cursor: pointer; display: grid; place-items: center; padding: 0; color: #1F2328; }
.dial button svg { width: 22px; height: 22px; fill: none; stroke: #5A3A28; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.dial button:active { transform: translateY(1px); }
.dial button:focus-visible, .dial-val:focus-visible { outline: 3px solid var(--warn); outline-offset: 1px; }
.dial-val { width: 50px; height: 46px; margin: 3px 0; display: grid; place-items: center; font-size: 28px; font-weight: 800; background: #FFFFFF;
  border: 2px solid #5A3A28; border-radius: 6px; font-variant-numeric: tabular-nums; cursor: ns-resize; }
.dial-mark { font-size: 24px; font-weight: 800; align-self: center; padding: 0 1px; margin-top: 18px; }
.lock.ok { animation: lk-ok .35s ease-out; }
@keyframes lk-ok { 50% { transform: translate(-50%, -50%) scale(1.06); } }

/* 見回すボタン・もどる */
.nav { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.navbtn { min-width: 92px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 12px; }
.navbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.viewname { flex: 1; text-align: center; font-weight: 700; line-height: 1.3; }
.viewname small { display: block; font-weight: 400; color: var(--ink-sub); font-size: 14px; }
.nav .spacer-btn { visibility: hidden; }

/* 近づいた所のボタン（てこの位置・つなぎ方） */
.vbtns { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 8px; }
.vbtns .lab { width: 100%; text-align: center; color: var(--ink-sub); font-size: 15px; }
.vbtns .btn { min-width: 48px; padding: 0 12px; }

/* 持ち物 */
.inv { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.inv-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.inv-title { font-weight: 700; }
.selbar { font-size: 15px; color: var(--ink-sub); display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.selbar .btn { min-height: 36px; font-size: 15px; padding: 0 10px; }
.slots { display: flex; gap: 8px; flex-wrap: wrap; }
.slot { width: 58px; height: 58px; border: 2px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); display: grid; place-items: center; padding: 0; cursor: pointer; position: relative; }
.slot svg { width: 46px; height: 46px; }
.slot.empty { border-style: dashed; border-color: var(--line); cursor: default; }
.slot.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.slot.new { animation: sl-new .5s ease-out; }
@keyframes sl-new { 0% { transform: scale(.6); } 70% { transform: scale(1.1); } }
.slot:focus-visible { outline: 3px solid var(--warn); outline-offset: 2px; }
.slot .num { position: absolute; left: 3px; top: 1px; font-size: 12px; color: var(--ink-sub); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .slot.new, .lock.ok { animation: none; } }

/* 持ち物をよく見る */
.itemview { position: absolute; inset: 0; background: rgba(31, 35, 40, .5); display: grid; place-items: center; border-radius: var(--radius); z-index: 4; }
.iv-card { background: var(--surface); color: var(--ink); border: 2px solid var(--line-strong); border-radius: 8px; padding: 12px 16px; width: min(92%, 440px); text-align: center; max-height: 96%; overflow: auto; }
.iv-card svg { display: block; width: 64px; height: 64px; margin: 0 auto; }
.iv-name { font-weight: 700; font-size: 18px; margin: 0; }
.iv-desc { font-size: 15px; color: var(--ink-sub); margin: 2px 0 6px; }
.iv-lines { background: #FFF6D8; color: #1F2328; border: 2px solid #5A3A28; border-radius: 6px; padding: 8px 10px; margin: 0 0 8px; font-size: clamp(17px, 4.6vw, 22px); font-weight: 700; line-height: 1.5; }
.iv-card .btn { min-height: 44px; }

/* ヒント */
.hintbox { margin-top: 10px; border: 2px solid var(--warn); border-radius: var(--radius); padding: 10px 14px; background: var(--surface); }
.hb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; }
.hintbox ol { margin: 6px 0 8px; padding-left: 1.6em; }
.hintbox li { margin: 4px 0; }
.hintbox li::marker { font-weight: 700; color: var(--warn); }
.hb-note { color: var(--ink-sub); font-size: 15px; margin: 0 0 8px; }
.hb-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* 手番のバー: 部屋・時間・ヒント */
.status { flex-wrap: wrap; column-gap: 14px; row-gap: 0; }
.counter { font-variant-numeric: tabular-nums; white-space: nowrap; }
.counter.sub { font-weight: 400; color: var(--ink-sub); }
.message ruby rt, .hintbox ruby rt, .viewname ruby rt { font-weight: 400; }

/* 部屋の選択の印 */
.choice .ck { width: 14px; height: 14px; margin-left: 4px; }
.choice .ck path { fill: none; stroke: var(--ok); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.linkbtn { display: inline-flex; align-items: center; text-decoration: none; }
.result-box { position: static; margin: 10px auto 0; padding: 16px 20px; max-width: 560px; }
.result-box h2 { font-size: 1.4rem; margin-bottom: 4px; }
.result-box .big { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.result-box ul { list-style: none; padding: 0; margin: 0 0 8px; }
.callout { z-index: 5; font-size: clamp(17px, 4vw, 22px); padding: 4px 18px; }

@media (max-width: 480px) {
  .stage { padding: 8px; }
  .navbtn { min-width: 76px; }
  .controls .btn.icon { padding: 0 10px; }
  .slot { width: 52px; height: 52px; }
  .slot svg { width: 40px; height: 40px; }
  .dial { min-width: 46px; }
  .dial button, .dial-val { width: 46px; }
  .dial button { height: 38px; }
  .dial-val { height: 40px; font-size: 24px; }
}
/* 上のバーの高さを一定に（No.93。数字は一番長い文が画面の幅（360px・375px 以上・641px 以上）で何行になるか。--tb-rt はふりがなの分。base.css・turnbar.js） */
.turnbar { --tb-msg-lines: 2; --tb-st-lines: 1; --tb-rt: 11px; --tb-st-rt: 11px; }
@media (min-width: 375px) { .turnbar { --tb-msg-lines: 2; --tb-st-lines: 1; } }
@media (min-width: 641px) { .turnbar { --tb-msg-lines: 1; --tb-st-lines: 1; } }
/* 上のバーの高さ ここまで */
