/* 古書店からの脱出 — セピアの古書店、深紅の革と真鍮 */
:root {
  --d0: #160f0a;
  --d1: #241911;
  --d2: #33241a;
  --d3: #4a3626;
  --paper: #efe2c6;
  --paper2: #e3d0a8;
  --ink: #2b1d12;
  --ink2: #5a4532;
  --crimson: #8e2430;
  --crimson-hi: #c9484f;
  --brass: #c9a35a;
  --brass-hi: #ead096;
  --brass-d: #8a6a2e;
  --cream: #f3e8d0;
  --muted: #d0bd98;
  --f-head: 'Kaisei Decol', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --f-body: 'Zen Kaku Gothic Antique', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --f-hand: 'Klee One', 'Zen Kaku Gothic Antique', sans-serif;
  --f-lat: 'IM Fell English', 'Kaisei Decol', serif;
  --r: 6px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--d0); color: var(--cream); font-family: var(--f-body); font-size: 15px; line-height: 1.65; line-break: strict; overflow: hidden; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { width: 1em; height: 1em; flex: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4, .bar__h, .look__t { font-feature-settings: "palt"; word-break: keep-all; }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 2px; }

.app { position: fixed; inset: 0; overflow: hidden; background: var(--d0); }
@media (min-width: 600px) {
  body { background: #0d0805 radial-gradient(ellipse at 50% 30%, #2a1a10, #0d0805 70%); }
  .app { left: 50%; width: 430px; transform: translateX(-50%); box-shadow: 0 0 0 1px #c9a35a33, 0 30px 80px #000c; }
}
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; visibility: hidden; opacity: 0; pointer-events: none; background: var(--d0); }
.screen.is-active { visibility: visible; opacity: 1; pointer-events: auto; }
.screen.is-enter { animation: fadein .4s var(--ease); }
@keyframes fadein { from { opacity: 0; } }
.scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px calc(28px + var(--safe-b)); }

/* ===== バー ===== */
.bar { flex: none; display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 10px 8px; background: var(--d1); border-bottom: 1px solid #c9a35a40; position: relative; z-index: 5; }
.bar__title { flex: 1; text-align: center; min-width: 0; }
.bar__kicker { font-family: var(--f-lat); font-style: italic; font-size: 13px; color: var(--brass); line-height: 1.2; }
.bar__h { font-family: var(--f-head); font-weight: 700; font-size: 18px; line-height: 1.35; color: var(--cream); }
.bar__pad { width: 44px; flex: none; }
.u-btn { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 22px; color: var(--brass-hi); background: var(--d2); box-shadow: inset 0 0 0 1px #c9a35a55; transition: transform .15s var(--spring); }
.u-btn:active { transform: scale(.9); }
.u-btn--hint { color: #ffd9d4; background: var(--crimson); box-shadow: inset 0 0 0 1px #e4747b88; }

/* ===== 札（タグ）ボタン ===== */
.tag { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px 10px 26px; border-radius: var(--r);
  font-family: var(--f-head); font-weight: 700; font-size: 16px; line-height: 1.35; transition: transform .15s var(--spring), filter .15s; word-break: keep-all; text-align: center; }
.tag::before { content: ""; position: absolute; left: 10px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--d0); box-shadow: 0 0 0 1.5px currentColor; opacity: .7; }
.tag::after { content: ""; position: absolute; inset: 3px; border-radius: 4px; border: 1px dashed currentColor; opacity: .32; pointer-events: none; }
.tag svg { font-size: 18px; }
.tag:active { transform: scale(.96); filter: brightness(1.1); }
.tag:disabled { cursor: default; background: var(--d2); color: #a8987c; box-shadow: none; }
.tag--crimson { background: var(--crimson); color: var(--cream); box-shadow: 0 3px 0 #5a141b, 0 6px 16px #0008; }
.tag--brass { background: var(--brass); color: #22170c; box-shadow: 0 3px 0 #7a5a24, 0 6px 16px #0008; }
.tag--ink { background: var(--d2); color: var(--brass-hi); box-shadow: inset 0 0 0 1px #c9a35a55; }
.tag--xl { min-height: 58px; font-size: 19px; }
.tag--wide { display: flex; width: 100%; }

/* ===== タイトル ===== */
.screen--title { background: var(--d0) url(/app-development/apps/a015/img/title.webp) center / cover no-repeat; }
.screen--title::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #160f0acc 0%, #160f0a33 34%, #160f0a00 48%, #160f0acc 70%, #160f0a 88%); pointer-events: none; }
.title__top { position: relative; z-index: 2; display: flex; justify-content: flex-end; padding: calc(10px + var(--safe-t)) 12px 0; }
.title__logo { position: relative; z-index: 1; text-align: center; padding: 3vh 16px 0; }
.title__kicker { font-family: var(--f-lat); font-style: italic; font-size: 15px; color: var(--brass-hi); }
.logo { font-family: var(--f-head); font-weight: 700; color: var(--cream); display: flex; flex-direction: column; align-items: center; line-height: 1.15; margin-top: 6px; text-shadow: 0 3px 0 #5a141b, 0 0 30px #160f0a; }
.logo__sm { font-size: 26px; letter-spacing: .3em; padding-left: .3em; color: var(--brass-hi); }
.logo__lg { font-size: 46px; letter-spacing: .06em; }
.title__shop { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 4px 14px; border: 1px solid #c9a35a88; border-radius: 3px; background: #160f0acc; font-size: 14px; color: var(--muted); }
.title__shop b { font-family: var(--f-head); font-size: 17px; color: var(--brass-hi); }
.title__bottom { position: relative; z-index: 1; margin-top: auto; padding: 0 20px calc(22px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px; }
.title__lead { font-family: var(--f-hand); font-weight: 600; font-size: 16px; line-height: 1.8; text-align: center; color: var(--cream); word-break: keep-all; background: #160f0ab3; border-radius: 6px; padding: 6px 10px; }
.title__sub { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.title__sub .tag { white-space: nowrap; font-size: 15px; padding-left: 22px; padding-right: 10px; }

/* ===== 探索 ===== */
.screen--room { background: var(--d0); }
.stagewrap { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, #33241a, #160f0a 75%); }
.scene { position: relative; width: 100%; aspect-ratio: 2 / 3; overflow: hidden; touch-action: pan-y; }
.scene__track { position: absolute; inset: 0; }
.wall { position: absolute; inset: 0; background: var(--d1) center / 100% 100% no-repeat; transition: transform .42s var(--ease), opacity .42s; will-change: transform; }
.spot { position: absolute; border-radius: 10px; overflow: hidden; }
.spot:active { background: #f3e8d01f; }
.scene.is-glow .spot { box-shadow: inset 0 0 0 1.5px #ead09699; background: #ead09612; }
.ripple { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 2px solid var(--brass-hi); animation: rip .55s ease-out forwards; pointer-events: none; }
@keyframes rip { to { transform: scale(9); opacity: 0; } }
.moon { position: absolute; width: 4.6%; height: auto; aspect-ratio: 1; transform: translate(-50%, -50%) rotate(-28deg); color: #e2bf6c; filter: drop-shadow(0 0 3px #ffd98a) drop-shadow(0 1px 1px #000); pointer-events: none; transition: opacity .8s; animation: glint 5s ease-in-out infinite; }
.moon:nth-of-type(2n) { animation-delay: -2.4s; }
@keyframes glint { 0%, 85%, 100% { filter: drop-shadow(0 0 3px #ffd98a) drop-shadow(0 1px 1px #000); } 92% { filter: drop-shadow(0 0 9px #fff2c8) drop-shadow(0 1px 1px #000); } }
.moon.is-hidden { opacity: 0; }
.shade { position: absolute; background: #0a0603; opacity: .9; filter: blur(4px); transition: opacity 1.2s; pointer-events: none; }
.shade.is-off { opacity: 0; }
.glow { position: absolute; width: 60%; aspect-ratio: 2; transform: translate(-50%, -50%); background: radial-gradient(closest-side, #ffcf7a55, transparent); mix-blend-mode: screen; pointer-events: none; animation: flicker 2.6s ease-in-out infinite; }
@keyframes flicker { 50% { opacity: .7; } 70% { opacity: .95; } }
.patch { position: absolute; background: #3a2615; filter: blur(3px); border-radius: 40%; pointer-events: none; }
.turn { position: absolute; top: 46%; z-index: 3; display: flex; align-items: center; gap: 0; height: 56px; min-width: 44px; padding: 0 6px; border-radius: 28px; background: #160f0ad9; color: var(--brass-hi); font-family: var(--f-head); font-weight: 700; font-size: 13px; box-shadow: inset 0 0 0 1px #c9a35a66; transition: transform .15s var(--spring); }
.turn svg { font-size: 22px; }
.turn--l { left: 6px; } .turn--r { right: 6px; }
.turn:active { transform: scale(.92); }
.say { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 6; padding: 12px 16px; border-radius: 8px; background: var(--paper); color: var(--ink); font-family: var(--f-hand); font-weight: 600; font-size: 15.5px; line-height: 1.7; box-shadow: 0 0 0 1px #8a6a2e, 0 10px 30px #000b; opacity: 0; transform: translateY(12px); transition: opacity .25s, transform .3s var(--spring); pointer-events: none; min-height: 52px; }
.say.is-on { opacity: 1; transform: none; pointer-events: auto; }
.dock { flex: none; background: var(--d1); border-top: 1px solid #c9a35a55; padding: 6px 10px calc(8px + var(--safe-b)); position: relative; z-index: 5; }
.dock::before { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; border-top: 1px dashed #c9a35a44; }
.compass { display: flex; justify-content: center; gap: 4px; margin: 2px 0 6px; }
.cdir { min-width: 52px; min-height: 30px; border-radius: 15px; font-family: var(--f-head); font-weight: 700; font-size: 14px; color: var(--muted); }
.cdir.is-on { background: var(--brass); color: #22170c; }
.inv { display: flex; align-items: center; gap: 8px; }
.inv__list { flex: 1; display: flex; gap: 6px; overflow-x: auto; min-height: 54px; align-items: center; scrollbar-width: none; }
.inv__list::-webkit-scrollbar { display: none; }
.inv__empty { font-family: var(--f-hand); font-weight: 600; font-size: 14px; color: var(--muted); padding-left: 6px; }
.slot { position: relative; flex: none; width: 52px; height: 52px; border-radius: 8px; display: grid; place-items: center; font-size: 36px; color: var(--brass-hi); background: var(--d0); box-shadow: inset 0 2px 6px #000a, inset 0 0 0 1px #c9a35a44; transition: transform .2s var(--spring), box-shadow .2s; }
.slot:active { transform: scale(.92); }
.slot.is-sel { box-shadow: inset 0 0 0 2px var(--crimson-hi), 0 0 14px #c9484f88; transform: translateY(-4px); background: #3a1a1c; }
.inv__all { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 56px; height: 54px; border-radius: 8px; background: var(--d2); color: var(--brass-hi); font-size: 12px; font-weight: 700; box-shadow: inset 0 0 0 1px #c9a35a55; }
.inv__all svg { font-size: 22px; }

/* ===== 拡大 ===== */
.look { position: absolute; inset: 0; z-index: 8; background: var(--d0); opacity: 0; transform: scale(1.04); pointer-events: none; transition: opacity .25s, transform .3s var(--ease); overflow-y: auto; overscroll-behavior: contain; }
.look.is-on { opacity: 1; transform: none; pointer-events: auto; }
.look__panel { min-height: 100%; padding: 0 16px 20px; display: flex; flex-direction: column; gap: 14px; background: radial-gradient(ellipse at 50% 0%, #3b2a1e, #160f0a 70%); }
.look__bar { display: flex; align-items: center; gap: 8px; padding: 10px 0 0; position: sticky; top: 0; z-index: 3; }
.look__t { flex: 1; text-align: center; font-family: var(--f-head); font-weight: 700; font-size: 18px; color: var(--brass-hi); }
.look__note { font-family: var(--f-hand); font-weight: 600; font-size: 15px; line-height: 1.75; color: var(--cream); background: var(--d1); border-radius: 8px; padding: 10px 14px; box-shadow: inset 0 0 0 1px #c9a35a33; word-break: normal; }
.look__note b { color: var(--brass-hi); font-family: var(--f-body); }
.zoom { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; background-repeat: no-repeat; background-color: var(--d1); box-shadow: 0 0 0 1px #8a6a2e, 0 0 0 4px var(--d1), 0 0 0 5px #c9a35a55, 0 12px 30px #000a; overflow: hidden; }
.glass-sign { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; padding: 10px 18px; background: #160f0ad0; border-radius: 4px; box-shadow: inset 0 0 0 1px #ead09666; }
.glass-sign__shop { font-family: var(--f-head); font-weight: 700; font-size: 22px; color: var(--brass-hi); letter-spacing: .14em; }
.glass-sign__l { font-family: var(--f-head); font-size: 16px; color: var(--cream); white-space: nowrap; }
.glass-sign__s { font-size: 13px; color: var(--muted); }
.lock { position: relative; align-self: center; padding-top: 52px; transition: transform .3s; }
.lock__shackle { position: absolute; left: 50%; top: 0; width: 150px; height: 90px; margin-left: -75px; border: 16px solid #b48d45; border-bottom: 0; border-radius: 75px 75px 0 0; box-shadow: inset 0 3px 0 #e6c987, 0 2px 0 #6b5020; transition: transform .45s var(--spring); }
.lock.is-open .lock__shackle { transform: translateY(-26px); }
.lock__body { position: relative; z-index: 1; padding: 16px 16px 10px; border-radius: 18px 18px 26px 26px; background: #c9a35a; box-shadow: inset 0 4px 0 #ecd398, inset 0 -6px 0 #8a6a2e, 0 10px 24px #000b; }
.lock__hint { text-align: center; font-size: 13px; font-weight: 700; color: #2b1d12; margin-top: 6px; }
.lock.is-shake, .fbox.is-shake, .shelf.is-shake { animation: shake .36s; }
@keyframes shake { 20% { translate: -7px 0; } 40% { translate: 6px 0; } 60% { translate: -4px 0; } 80% { translate: 2px 0; } }
.dials { display: flex; gap: 8px; justify-content: center; }
.dial { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dial__btn { width: 52px; height: 36px; display: grid; place-items: center; font-size: 22px; color: #2b1d12; border-radius: 8px; }
.dial__btn:active { background: #00000018; }
.dial__win { width: 52px; height: 92px; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--paper); box-shadow: inset 0 10px 12px -6px #00000088, inset 0 -10px 12px -6px #00000088, 0 0 0 2px #6b5020; touch-action: none; cursor: ns-resize; }
.dial__face, .dial__ghost { height: 30px; display: grid; place-items: center; font-family: var(--f-head); font-weight: 700; font-size: 28px; line-height: 1; color: var(--ink); }
.dial__ghost { font-size: 22px; color: #6d5a44; opacity: .55; }
.dial__face svg { font-size: 28px; color: var(--crimson); }
.dial__ghost svg { font-size: 18px; color: #6d5a44; }
.dial.is-up .dial__win > div { animation: rollup .16s ease-out; }
.dial.is-down .dial__win > div { animation: rolldown .16s ease-out; }
@keyframes rollup { from { transform: translateY(14px); } }
@keyframes rolldown { from { transform: translateY(-14px); } }
.brass-plate { align-self: center; padding: 18px 30px; border-radius: 4px; background: #c9a35a; box-shadow: inset 0 3px 0 #ecd398, inset 0 -4px 0 #8a6a2e, 0 8px 20px #000a; text-align: center; }
.brass-plate__l { font-family: var(--f-head); font-weight: 700; font-size: 22px; line-height: 1.7; color: #2b1d12; letter-spacing: .2em; }
/* 本棚 */
.shelf { position: relative; padding: 26px 10px 0; border-radius: 8px; background: #241911; box-shadow: inset 0 0 0 1px #8a6a2e88, inset 0 20px 40px #000a; overflow: hidden; }
.shelf.is-lit { background: radial-gradient(ellipse at 50% 30%, #6e4a26 0%, #2a1c12 70%); }
.shelf__row { display: flex; justify-content: center; align-items: flex-end; gap: 6px; height: 214px; }
.spine { position: relative; width: 17%; max-width: 62px; height: 200px; border-radius: 4px 4px 2px 2px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 14px 0; box-shadow: inset 4px 0 6px #ffffff22, inset -6px 0 8px #00000066, 0 4px 6px #000a; transition: transform .2s var(--spring), filter .2s; }
.spine--0 { background: #5a1a20; height: 186px; } .spine--1 { background: #1f3b2c; height: 204px; } .spine--2 { background: #1d2a4a; height: 196px; } .spine--3 { background: #4a321c; height: 178px; } .spine--4 { background: #2a2420; height: 200px; }
.spine__band { width: 100%; height: 10px; border-top: 2px solid #c9a35a; border-bottom: 2px solid #c9a35a; opacity: .8; }
.spine__sym { font-size: 34px; color: #e2bf6c; filter: drop-shadow(0 0 4px #ffcf7a88); opacity: 0; transition: opacity .8s; }
.shelf.is-lit .spine__sym { opacity: 1; }
.spine:active { transform: scale(.96); }
.spine.is-in { transform: translateY(6px) scale(.92); filter: brightness(.7); }
.shelf__board { height: 16px; margin: 0 -10px; background: #3a2817; box-shadow: inset 0 3px 0 #5a4028, 0 -2px 6px #000a; }
.shelf__dark { position: absolute; inset: 0; display: grid; place-items: center; background: #0a0603e6; }
.shelf__dark p { font-family: var(--f-hand); font-weight: 600; font-size: 15px; color: var(--cream); padding: 6px 14px; background: #160f0a; border-radius: 6px; }
.shelf__cache { display: flex; justify-content: center; padding: 14px 0 16px; background: #120c07; box-shadow: inset 0 10px 18px #000; margin: 0 -10px; }
.cache-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 16px; border-radius: 8px; background: var(--d2); color: var(--brass-hi); box-shadow: inset 0 0 0 1px #c9a35a88, 0 0 18px #ead09655; animation: beckon 1.6s ease-in-out infinite; }
.cache-item svg { font-size: 44px; }
.cache-item span { font-size: 14px; font-weight: 700; color: var(--cream); }
@keyframes beckon { 50% { box-shadow: inset 0 0 0 1px #c9a35a88, 0 0 4px #ead09622; } }
.cache-empty { font-family: var(--f-hand); font-weight: 600; font-size: 14px; color: var(--muted); padding: 8px; }
.keyhole { position: absolute; left: 50%; bottom: 10%; transform: translateX(-50%); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: #160f0acc; box-shadow: inset 0 0 0 2px var(--brass), 0 0 18px #ead09666; }
.keyhole span { width: 18px; height: 18px; border-radius: 50%; background: #000; position: relative; }
.keyhole span::after { content: ""; position: absolute; left: 6px; top: 12px; width: 6px; height: 16px; background: #000; border-radius: 0 0 2px 2px; }
.drawer-open { padding: 12px; border-radius: 8px; background: var(--d1); box-shadow: inset 0 0 0 1px #c9a35a44; }
.drawer-open__t { font-family: var(--f-head); font-weight: 700; font-size: 15px; color: var(--brass-hi); margin-bottom: 8px; text-align: center; }
.drawer-open__items { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
/* 時計 */
.clockwrap { position: relative; width: 100%; aspect-ratio: 0.86; display: grid; place-items: center; border-radius: 8px; background-repeat: no-repeat; box-shadow: 0 0 0 1px #8a6a2e; overflow: hidden; }
.clockwrap::before { content: ""; position: absolute; inset: 0; background: #160f0aa6; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.clock { position: relative; width: 84%; height: auto; aspect-ratio: 1; touch-action: none; }
.clock__rim { fill: #8a6a2e; stroke: #e6c987; stroke-width: 2; }
.clock__face { fill: #efe2c6; }
.clock__ticks line { stroke: #2b1d12; stroke-width: 1.2; }
.clock__nums text { font-family: var(--f-lat); font-size: 15px; fill: #2b1d12; color: #2b1d12; }
.clock__h, .clock__m { transform-origin: 100px 100px; transition: transform .12s; }
.clock__h path, .clock__h circle { fill: #2b1d12; }
.clock__m path, .clock__m circle { fill: #5a141b; }
.clock__m { cursor: grab; }
.clock__m .clock__grab, .clock__grab { fill: transparent; }
.clock__pin { fill: #c9a35a; }
.clock.is-open .clock__face { fill: #f6ecd2; }
.clock-ctrl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.clock-ctrl .tag { padding: 8px 4px 8px 18px; font-size: 14px; min-height: 44px; }
.clock-ctrl .tag::before { left: 6px; }
.clock-now { white-space: nowrap; }
/* 文箱 */
.fbox { position: relative; align-self: center; width: 100%; max-width: 330px; padding: 0 0 18px; border-radius: 10px; background: #5a3a20; box-shadow: inset 0 0 0 2px #3a2614, inset 0 -10px 0 #3e2816, 0 14px 30px #000b; }
.fbox__lid { height: 70px; border-radius: 10px 10px 4px 4px; background: #6e4828; box-shadow: inset 0 3px 0 #8d6238, inset 0 -3px 0 #3a2614; display: grid; place-items: center; transition: transform .6s var(--ease); transform-origin: top; }
.fbox.is-open .fbox__lid { transform: perspective(500px) rotateX(70deg); }
.fbox__crest { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; color: #2b1d12; background: var(--brass); box-shadow: inset 0 2px 0 #ecd398; }
.fbox__lock { margin: 14px auto 0; width: max-content; padding: 10px 12px 6px; border-radius: 10px; background: #c9a35a; box-shadow: inset 0 3px 0 #ecd398, inset 0 -4px 0 #8a6a2e; }
.fbox__inside { margin: 14px 14px 0; padding: 14px; border-radius: 6px; background: #2a1a10; box-shadow: inset 0 8px 16px #000; display: flex; justify-content: center; }
/* 紙 */
.paper { position: relative; padding: 18px 18px 16px; border-radius: 4px; background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px #c8b080, 0 12px 26px #000a; }
.paper::after { content: ""; position: absolute; inset: 0; border-radius: 4px; box-shadow: inset 0 0 40px #b8986033; pointer-events: none; }
.paper__date { font-family: var(--f-head); font-size: 14px; color: var(--ink2); margin-bottom: 6px; }
.hand-l { font-family: var(--f-hand); font-weight: 600; font-size: 16.5px; line-height: 1.9; color: var(--ink); word-break: normal; }
.hand-l + .hand-l { margin-top: 8px; }
.hand-l--sub { color: #6b2a24; font-size: 15.5px; border-top: 1px dashed #8a6a2e88; padding-top: 8px; }
.hand-l--sign { text-align: right; }
.paper--ledger { background: #f2e6cb; }
.paper--receipt { max-width: 300px; align-self: center; width: 100%; font-size: 14.5px; }
.rc__shop { font-family: var(--f-head); font-weight: 700; font-size: 20px; text-align: center; letter-spacing: .2em; }
.rc__sub { text-align: center; font-size: 13px; color: var(--ink2); border-bottom: 1px dashed #8a6a2e; padding-bottom: 8px; }
.rc__list { list-style: decimal; padding-left: 1.6em; margin: 10px 0; }
.rc__list li { display: list-item; }
.rc__list li span:first-child { font-weight: 700; }
.rc__p { float: right; font-family: var(--f-lat); white-space: nowrap; }
.rc__sum { display: flex; justify-content: space-between; border-top: 1px dashed #8a6a2e; padding-top: 6px; font-weight: 700; }
.rc__foot { text-align: center; font-size: 13px; color: var(--ink2); margin-top: 8px; }
.map-svg { width: 100%; height: auto; display: block; }
.m-river { fill: none; stroke: #5a7a8a; stroke-width: 6; opacity: .6; }
.m-block { fill: #d9c49a; stroke: #8a6a2e; stroke-width: 1.5; }
.m-road { stroke: #b49a6a; stroke-width: 8; opacity: .5; }
.m-rose circle { fill: none; stroke: #8a6a2e; stroke-width: 1.5; }
.m-rose path { fill: #8e2430; }
.m-rose text { font-family: var(--f-lat); font-size: 14px; fill: #2b1d12; }
.m-x { stroke: #8e2430; stroke-width: 3; }
.map__margin { margin-top: 10px; font-family: var(--f-hand); font-weight: 600; font-size: 15px; line-height: 1.8; color: var(--ink); border-top: 1px dashed #8a6a2e88; padding-top: 8px; }
.map__margin:not(.is-read) { color: #4a3a2a; }

/* ===== 拾った ===== */
.got { position: absolute; inset: 0; z-index: 70; display: grid; place-items: center; pointer-events: none; background: #160f0a88; animation: fadein .2s; transition: opacity .4s; }
.got.is-out { opacity: 0; }
.got.is-out .got__card { transform: translateY(260px) scale(.4); }
.got__card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 30px 16px; border-radius: 12px; background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px #8a6a2e, 0 0 0 5px var(--d1), 0 0 0 6px #c9a35a77, 0 20px 50px #000c; animation: pop .4s var(--spring); transition: transform .5s cubic-bezier(.6, 0, .8, .4); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.got__card svg { font-size: 72px; color: var(--brass-d); }
.got__k { font-size: 13px; font-weight: 700; color: var(--crimson); letter-spacing: .2em; }
.got__n { font-family: var(--f-head); font-weight: 700; font-size: 20px; }

/* ===== 持ち物 ===== */
.sample-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; padding: 8px 12px; border-radius: 8px; background: #3a1a1c; box-shadow: inset 0 0 0 1px #c9484f88; font-size: 14px; color: #ffe1dc; }
.link { min-height: 44px; padding: 0 6px; font-weight: 700; color: var(--brass-hi); text-decoration: underline; text-underline-offset: 3px; }
.satchel { padding: 14px 12px 16px; border-radius: 12px; background: #3a2414; box-shadow: inset 0 0 0 2px #241508, inset 0 0 0 4px #5a3a20, 0 10px 24px #000a; position: relative; }
.satchel::before { content: ""; position: absolute; inset: 7px; border: 1px dashed #c9a35a55; border-radius: 9px; pointer-events: none; }
.satchel__count { display: flex; align-items: baseline; gap: 6px; font-family: var(--f-head); font-weight: 700; font-size: 15px; color: var(--muted); margin: 0 6px 10px; }
.satchel__count b { font-family: var(--f-head); font-size: 24px; color: var(--brass-hi); }
.satchel__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.slot--lg { min-width: 0; width: auto; height: auto; aspect-ratio: .82; flex-direction: column; display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 40px; padding: 6px 2px; }
.slot--lg span { font-size: 11.5px; font-weight: 700; line-height: 1.3; color: var(--cream); text-align: center; word-break: keep-all; }
.slot--empty { opacity: .5; }
.slot.is-comb { box-shadow: inset 0 0 0 2px var(--brass-hi), 0 0 14px #ead09688; }
.detail { margin-top: 16px; }
.detail__card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 16px; border-radius: 10px; background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px #c8b080, 0 10px 24px #000a; text-align: center; }
.detail__card.is-new { animation: pop .45s var(--spring); }
.detail__icon { font-size: 64px; color: var(--brass-d); }
.detail__n { font-family: var(--f-head); font-weight: 700; font-size: 19px; }
.detail__d { font-size: 14.5px; line-height: 1.7; word-break: normal; text-align: left; }
.detail__acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.detail__acts .tag { font-size: 15px; min-height: 46px; }
.detail__card--empty, .detail__card--comb { background: var(--d1); color: var(--cream); box-shadow: inset 0 0 0 1px #c9a35a44; }
.detail__card--comb .detail__icon { color: var(--brass-hi); }

/* ===== ヒント ===== */
.progress { padding: 14px; border-radius: 10px; background: var(--d1); box-shadow: inset 0 0 0 1px #c9a35a44; margin: 6px 0 14px; }
.progress__t { display: flex; align-items: baseline; gap: 6px; font-family: var(--f-head); font-weight: 700; color: var(--muted); }
.progress__t b { font-family: var(--f-head); font-size: 28px; color: var(--brass-hi); line-height: 1; }
.progress__bar { height: 8px; border-radius: 4px; background: var(--d0); margin: 8px 0; overflow: hidden; }
.progress__bar i { display: block; height: 100%; background: var(--brass); }
.progress__s { font-size: 14px; color: var(--muted); }
.progress__s b { color: var(--cream); }
.hint { padding: 16px; border-radius: 10px; background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px #c8b080, 0 10px 24px #000a; margin-bottom: 14px; }
.hint__k { font-size: 13px; font-weight: 700; color: var(--crimson); letter-spacing: .1em; }
.hint__t { font-family: var(--f-head); font-weight: 700; font-size: 20px; margin: 2px 0 10px; }
.hint__p { font-size: 15px; }
.hint__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hint__i { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; }
.hint__n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-head); font-weight: 700; font-size: 15px; color: var(--cream); background: var(--ink2); }
.hint__i.is-open .hint__n { background: var(--crimson); }
.hint__i p { font-family: var(--f-hand); font-weight: 600; font-size: 15.5px; line-height: 1.75; word-break: normal; }
.hint__i .tag { justify-self: start; }

/* ===== エンディング ===== */
.screen--ending .scroll { padding: 0 0 calc(28px + var(--safe-b)); }
.end-hero { position: relative; min-height: 58vh; display: flex; align-items: flex-end; background: var(--d0) center 30% / cover no-repeat; }
.end-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #160f0a00 45%, #160f0a 100%); }
.end-hero__band { position: relative; z-index: 1; width: 100%; padding: 16px; text-align: center; }
.end-kicker { font-family: var(--f-lat); font-style: italic; font-size: 16px; color: var(--brass-hi); background: #160f0acc; display: inline-block; padding: 0 10px; border-radius: 3px; }
.end-title { font-family: var(--f-head); font-weight: 700; font-size: 32px; line-height: 1.35; color: var(--cream); text-shadow: 0 2px 0 #5a141b, 0 0 20px #160f0a; margin-top: 6px; background: #160f0a99; border-radius: 6px; padding: 2px 8px; display: inline-block; }
.end-prev { margin-top: 8px; display: inline-block; font-size: 13px; font-weight: 700; color: #ffe1dc; background: var(--crimson); padding: 2px 10px; border-radius: 3px; }
.end-body { padding: 4px 16px 0; display: flex; flex-direction: column; gap: 16px; }
.end-text p { font-family: var(--f-hand); font-weight: 600; font-size: 16px; line-height: 2; color: var(--cream); word-break: normal; }
.end-stats, .rec-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: #c9a35a44; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px #c9a35a44; }
.rec-sum { grid-template-columns: 1fr 1fr; margin: 14px 0 6px; }
.es { background: var(--d1); padding: 10px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.es__k { font-size: 12px; color: var(--muted); word-break: keep-all; }
.es__v { font-family: var(--f-head); font-weight: 700; font-size: 20px; color: var(--cream); white-space: nowrap; }
.es__v small { font-family: var(--f-body); font-size: 13px; color: var(--muted); margin-left: 2px; }
.end-tip { font-family: var(--f-hand); font-weight: 600; font-size: 15px; line-height: 1.75; color: #ffd9d4; background: #3a1a1c; border-radius: 8px; padding: 10px 14px; word-break: normal; }
.end-acts { display: flex; flex-direction: column; gap: 10px; }

/* ===== 記録 ===== */
.ends { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.endcard { border-radius: 10px; overflow: hidden; background: var(--d1); box-shadow: inset 0 0 0 1px #c9a35a55; }
.endcard__img { aspect-ratio: 4 / 3; background: var(--d2) center 35% / cover no-repeat; }
.endcard.is-locked .endcard__img { background: repeating-linear-gradient(45deg, #241911 0 8px, #2c1f15 8px 16px); }
.endcard__k { font-family: var(--f-lat); font-style: italic; font-size: 13px; color: var(--brass); padding: 6px 10px 0; }
.endcard__t { font-family: var(--f-head); font-weight: 700; font-size: 15px; padding: 0 10px 10px; line-height: 1.4; }
.sec-h { font-family: var(--f-head); font-weight: 700; font-size: 17px; color: var(--brass-hi); margin: 20px 0 10px; display: flex; align-items: center; gap: 10px; }
.sec-h::after { content: ""; flex: 1; border-top: 1px dashed #c9a35a66; }
.recs { list-style: none; margin: 0 0 16px; padding: 0; }
.rec { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed #c9a35a33; }
.rec__end { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-head); font-weight: 700; font-size: 17px; background: var(--d2); color: var(--brass-hi); box-shadow: inset 0 0 0 1px #c9a35a66; }
.rec__end--b { background: var(--crimson); color: var(--cream); }
.rec__m { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.rec__t { font-family: var(--f-head); font-weight: 700; font-size: 15px; }
.rec__d { font-size: 13px; color: var(--muted); }
.rec__time { font-family: var(--f-head); font-weight: 700; font-size: 16px; color: var(--brass-hi); white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 20px 0; }

/* ===== 設定 ===== */
.howto { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.howto li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; }
.howto li svg { width: 34px; height: 34px; padding: 6px; border-radius: 50%; background: var(--d2); color: var(--brass-hi); box-shadow: inset 0 0 0 1px #c9a35a55; }
.howto p { font-size: 14.5px; line-height: 1.75; word-break: normal; }
.howto b { font-family: var(--f-head); color: var(--brass-hi); }
.rows { display: flex; flex-direction: column; background: var(--d1); border-radius: 10px; box-shadow: inset 0 0 0 1px #c9a35a44; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; border-bottom: 1px dashed #c9a35a33; text-align: left; }
.row:last-child { border-bottom: 0; }
.row__t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row__l { font-weight: 700; font-size: 15.5px; }
.row__l--danger { color: #ff9f9a; }
.row__d { font-size: 13px; color: var(--muted); line-height: 1.5; }
.row--link svg { font-size: 22px; color: var(--brass); }
.switch { position: relative; flex: none; width: 52px; height: 32px; border-radius: 999px; background: var(--d0); box-shadow: inset 0 0 0 1px #c9a35a66; transition: background .2s; }
.switch i { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--muted); transition: transform .25s var(--spring); }
.switch.is-on { background: var(--crimson); }
.switch.is-on i { transform: translateX(20px); background: var(--cream); }
.paper-note { font-size: 14px; line-height: 1.75; color: var(--ink); background: var(--paper); border-radius: 8px; padding: 12px 14px; word-break: normal; }
.paper-note--s { margin-top: 18px; font-size: 13.5px; }
.about { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 14px; }
.about__icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 0 0 1px #c9a35a66, 0 10px 30px #000a; }
.about__name { font-family: var(--f-head); font-weight: 700; font-size: 24px; }
.about__ver { font-family: var(--f-lat); font-size: 14px; color: var(--muted); }
.card-box { width: 100%; padding: 14px; border-radius: 10px; background: var(--d1); box-shadow: inset 0 0 0 1px #c9a35a44; }
.card-box__h { font-family: var(--f-head); font-weight: 700; font-size: 15px; color: var(--brass-hi); margin-bottom: 4px; }
.tech-list { margin: 0; padding-left: 1.2em; font-size: 14px; line-height: 1.8; }

/* ===== シート・トースト・案内 ===== */
.sheet { position: absolute; inset: 0; z-index: 90; pointer-events: none; }
.sheet__scrim { position: absolute; inset: 0; background: #0a0603aa; opacity: 0; transition: opacity .25s; }
.sheet__panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 86%; overflow-y: auto; overscroll-behavior: contain; padding: 18px 18px calc(18px + var(--safe-b)); background: var(--d1); border-radius: 16px 16px 0 0; box-shadow: 0 -1px 0 var(--brass), 0 -20px 50px #000b; transform: translateY(105%); transition: transform .32s var(--ease); }
.sheet.is-on { pointer-events: auto; }
.sheet.is-on .sheet__scrim { opacity: 1; }
.sheet.is-on .sheet__panel { transform: none; }
.sheet__body { display: flex; flex-direction: column; gap: 12px; }
.sheet__h { font-family: var(--f-head); font-weight: 700; font-size: 20px; color: var(--cream); }
.sheet__p { font-size: 14.5px; line-height: 1.75; color: var(--cream); word-break: normal; }
.sheet__btns { display: flex; flex-direction: column; gap: 10px; }
.toast { position: absolute; left: 50%; top: calc(74px + var(--safe-t)); z-index: 95; transform: translate(-50%, -10px); opacity: 0; width: max-content; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 8px; background: var(--paper); color: var(--ink); font-family: var(--f-hand); font-weight: 600; font-size: 15px; line-height: 1.5; box-shadow: 0 0 0 1px #8a6a2e, 0 10px 30px #000b; transition: opacity .2s, transform .25s var(--spring); pointer-events: none; text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.coach { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; padding: 22px; background: #0a0603d9; }
.coach__card { width: 100%; max-width: 340px; padding: 22px 20px 18px; border-radius: 12px; background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px #8a6a2e, 0 0 0 5px var(--d1), 0 0 0 6px #c9a35a66; display: flex; flex-direction: column; gap: 10px; }
.coach__k { font-size: 13px; font-weight: 700; color: var(--crimson); letter-spacing: .1em; }
.coach__h { font-family: var(--f-head); font-weight: 700; font-size: 20px; line-height: 1.45; word-break: keep-all; }
.coach__list { margin: 0; padding-left: 1.2em; font-size: 14.5px; line-height: 1.8; word-break: normal; }
.splash { position: absolute; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--d0); transition: opacity .4s; }
.splash img { width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 0 0 1px #c9a35a77, 0 0 40px #8e243066; animation: pop .7s var(--spring); }
.splash__name { font-family: var(--f-head); font-weight: 700; font-size: 22px; color: var(--cream); letter-spacing: .1em; }
.splash.is-out { opacity: 0; }
.noscript { padding: 40px 20px; text-align: center; font-size: 15px; }

@media (max-height: 700px) {
  .logo__lg { font-size: 38px; }
  .title__logo { padding-top: 1vh; }
  .shelf__row { height: 180px; }
  .spine { height: 168px !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
.zoom--door { aspect-ratio: 1.6; }

.stagewrap.is-look .scene { visibility: hidden; }
