/* escape.css — 部屋ページとハブ共通（レトロ調・モバイル縦優先） */
:root {
  --bg: #0f0d0c; --panel: #1c1815; --panel2: #26201b; --line: #4a3d31; --ink: #efe3cc; --mute: #b5a58a;
  --accent: #e0b25a; --accent-ink: #1c1206; --danger: #c8564a; --ok: #8fcf7a;
  --font: "DotGothic16", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.7; }
a { color: var(--accent); }
.wrap { max-width: 520px; margin: 0 auto; padding: 0 16px 48px; }
.page-h1 { font-size: 18px; margin: 12px 0 8px; font-weight: normal; letter-spacing: .04em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- ゲーム ---- */
.esc { max-width: min(480px, calc((100svh - 300px) * 0.8)); min-width: min(100%, 300px); margin: 0 auto; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.esc-top { display: flex; align-items: center; gap: 6px; padding: 6px 0; }
.esc-title { flex: 1; min-width: 0; font-size: 13px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.esc-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 14px; border: 2px solid var(--line); background: var(--panel2); color: var(--ink); font: inherit; font-size: 15px; border-radius: 4px; text-decoration: none; cursor: pointer; box-shadow: inset 0 -3px 0 rgba(0,0,0,.35); }
.esc-btn:active { transform: translateY(1px); box-shadow: none; }
.esc-btn.primary { background: var(--accent); border-color: #f3d38f; color: var(--accent-ink); }
.esc-btn.danger { background: var(--danger); border-color: #e8877c; color: #fff; }
.esc-btn.wide { display: flex; width: 100%; margin-top: 10px; }
.esc-hub { font-size: 14px; padding: 0 10px; }

.esc-stage { position: relative; width: 100%; aspect-ratio: 4 / 5; background: #000; border: 2px solid var(--line); border-radius: 4px; overflow: hidden; touch-action: manipulation; cursor: pointer; }
.esc-canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.esc-hots { position: absolute; inset: 0; pointer-events: none; }
.esc-hot { position: absolute; background: transparent; border: 0; padding: 0; pointer-events: none; opacity: 0; }
.esc-hot:focus-visible { opacity: 1; outline: 3px dashed var(--accent); outline-offset: -3px; }
.esc-nav { position: absolute; min-width: 48px; min-height: 56px; border: 2px solid rgba(255,255,255,.25); background: rgba(15,12,10,.55); color: #fff; font: inherit; font-size: 18px; border-radius: 4px; cursor: pointer; }
.esc-nav-l { left: 6px; top: 50%; transform: translateY(-50%); }
.esc-nav-r { right: 6px; top: 50%; transform: translateY(-50%); }
.esc-nav-b { left: 50%; bottom: 8px; transform: translateX(-50%); min-height: 48px; padding: 0 18px; font-size: 15px; }
.esc-nav[hidden] { display: none; }
.esc-fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .18s steps(4); }
.esc-fade.on { opacity: 1; transition: none; }
.esc-panel { position: absolute; left: 8px; right: 8px; top: 8px; pointer-events: none; }
.esc-panel[hidden] { display: none; }
.esc-panel.bottom { top: auto; bottom: 64px; }
.esc-panel-box { background: rgba(14,12,10,.86); border: 2px solid #c9b48f; padding: 8px 12px; border-radius: 3px; font-size: 16px; line-height: 1.5; text-align: center; }
.esc-panel-title { font-size: 12px; color: var(--mute); }
.esc-panel-line { letter-spacing: .06em; }
.esc-chip { font-weight: bold; }

.esc-msg { min-height: 4.6em; margin: 8px 0; padding: 8px 12px; background: var(--panel); border: 2px solid var(--line); border-radius: 4px; font-size: 15px; white-space: pre-line; }
.esc-items { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.esc-slot { aspect-ratio: 1; min-height: 48px; border: 2px solid var(--line); background: var(--panel2); border-radius: 4px; padding: 2px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.esc-slot img { width: 100%; height: 100%; image-rendering: pixelated; }
.esc-slot.empty { background: #15120f; cursor: default; }
.esc-slot.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; background: #3a2e1e; }

.esc-modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.66); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
.esc-modal[hidden] { display: none; }
.esc-sheet { width: 100%; max-width: 440px; max-height: 92svh; overflow: auto; background: var(--panel); border: 2px solid #c9b48f; border-radius: 6px; padding: 16px; box-shadow: 0 0 0 4px #000; }
.esc-h { font-size: 18px; font-weight: normal; margin: 0 0 8px; color: var(--accent); }
.esc-small { font-size: 13px; color: var(--mute); margin: 6px 0; }
.esc-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.esc-bigicon { display: block; margin: 6px auto; image-rendering: pixelated; background: #120f0c; border: 2px solid var(--line); }

.esc-dials { display: flex; justify-content: center; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.esc-dial { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.esc-dial.tap { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.esc-key { min-width: 52px; min-height: 44px; border: 2px solid var(--line); background: var(--panel2); color: var(--ink); font: inherit; font-size: 18px; border-radius: 4px; cursor: pointer; }
.esc-dialface { width: 56px; height: 64px; display: flex; align-items: center; justify-content: center; font-size: 30px; background: #0f1a12; color: var(--ok); border: 2px solid #000; box-shadow: inset 0 0 0 2px #2c3a2e; border-radius: 3px; }
.esc-dialface.sw { font-size: 16px; background: #2a2a2e; color: #999; }
.esc-dialface.sw.on { background: var(--ok); color: #102010; }
.esc-dialface.sl { background: linear-gradient(to top, var(--accent) calc(var(--lv) * 100%), #2a2a2e 0); color: #fff; font-size: 20px; }
.esc-seq { display: flex; justify-content: center; gap: 8px; margin: 12px 0; }
.esc-seqcell { width: 44px; height: 48px; display: flex; align-items: center; justify-content: center; font-size: 26px; background: #0f1a12; color: var(--ok); border-radius: 3px; }
.esc-dpad { display: grid; grid-template-columns: repeat(3, 60px); grid-template-rows: repeat(3, 52px); gap: 6px; justify-content: center; }
.esc-dpad .k-up { grid-area: 1 / 2; } .esc-dpad .k-left { grid-area: 2 / 1; } .esc-dpad .k-right { grid-area: 2 / 3; } .esc-dpad .k-down { grid-area: 3 / 2; }
.esc-lock.ng { animation: escShake .3s steps(4); }
@keyframes escShake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.esc-hint { background: var(--panel2); border-left: 4px solid var(--accent); padding: 8px 12px; margin: 8px 0; border-radius: 3px; }
.esc-hint p { margin: 4px 0 0; }
.esc-hint.ans { border-left-color: var(--danger); }

.esc-clear { text-align: center; }
.esc-clear-kicker { letter-spacing: .4em; color: var(--mute); margin: 0; font-size: 12px; }
.esc-rank { font-size: 88px; line-height: 1; color: var(--accent); text-shadow: 4px 4px 0 #000; margin: 8px 0; }
.esc-stats { display: grid; grid-template-columns: auto auto; gap: 2px 16px; justify-content: center; margin: 8px 0 4px; }
.esc-stats dt { color: var(--mute); text-align: right; } .esc-stats dd { margin: 0; text-align: left; }

@media (prefers-reduced-motion: reduce) { .esc-fade { transition: none; } .esc-lock.ng { animation: none; } }

/* ---- 説明文（部屋ページ下） ---- */
.about { margin-top: 28px; border-top: 2px solid var(--line); padding-top: 12px; font-size: 15px; }
.about h2 { font-size: 16px; font-weight: normal; color: var(--accent); margin: 18px 0 6px; }
.about dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.about dt { color: var(--mute); }
.about dd { margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 8px 0; list-style: none; }
.tags li { border: 1px solid var(--line); padding: 0 8px; border-radius: 3px; font-size: 13px; }
.foot { margin-top: 32px; font-size: 13px; color: var(--mute); }

/* ---- ハブ ---- */
.hub-lead { color: var(--mute); font-size: 15px; }
.cards { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 14px; }
.card { background: var(--panel); border: 2px solid var(--line); border-radius: 6px; overflow: hidden; }
.card a { display: block; color: inherit; text-decoration: none; }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; image-rendering: pixelated; background: #000; }
.card-body { padding: 10px 14px 14px; }
.card-title { font-size: 17px; margin: 0 0 4px; color: var(--ink); font-weight: normal; }
.card-meta { font-size: 13px; color: var(--mute); display: flex; gap: 12px; flex-wrap: wrap; }
.badge { display: inline-block; font-size: 12px; padding: 0 8px; border-radius: 3px; background: var(--ok); color: #102010; margin-left: 6px; }
.badge.todo { background: var(--panel2); color: var(--mute); border: 1px solid var(--line); }
