/* てのひら病棟 — 画面（第1弾・仮）2026-10-03 */
:root { --tn-bg: #050607; --tn-ink: #e9e4da; --tn-dim: #9aa0a6; --tn-amber: #e0a34a; --tn-line: rgba(233, 228, 218, 0.35); }
html, body.tnb { margin: 0; height: 100%; background: var(--tn-bg); color: var(--tn-ink); overscroll-behavior: none; }
body.tnb { font-family: "Zen Kurenaido", "DotGothic16", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; user-select: none; }
.tn { position: fixed; inset: 0; display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; }
.tn-boot { margin: auto; text-align: center; color: var(--tn-dim); }
.tn-boot b { display: block; font-size: 28px; color: var(--tn-ink); margin-bottom: 8px; }
.tn-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: #000; }
.tn-stage canvas { display: block; image-rendering: pixelated; }
.tn-hud { position: absolute; left: 8px; top: 8px; right: 8px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.tn-heart { display: flex; gap: 3px; }
.tn-heart i { width: 9px; height: 13px; border: 1px solid rgba(180, 200, 230, 0.6); border-radius: 1px 1px 4px 4px; background: transparent; }
.tn-heart i.f { background: rgba(140, 180, 230, 0.75); }
.tn-place { font-size: 13px; color: var(--tn-dim); text-shadow: 0 1px 2px #000; }
.tn-ring { display: none; position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; pointer-events: none;
	background: conic-gradient(rgba(140, 180, 230, 0.8) calc(var(--p, 0) * 360deg), rgba(255, 255, 255, 0.08) 0); -webkit-mask: radial-gradient(circle, transparent 20px, #000 21px); mask: radial-gradient(circle, transparent 20px, #000 21px); }
.tn-chase { display: none; position: absolute; top: 34px; left: 50%; transform: translateX(-50%); width: 60%; height: 22px; border: 1px solid var(--tn-line); background: rgba(0, 0, 0, 0.6); }
.tn-chase.on { display: block; }
.tn-chase i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(200, 80, 60, 0.55); }
.tn-chase span { position: relative; display: block; text-align: center; font-size: 13px; line-height: 22px; }
.tn-msg { display: none; position: absolute; left: 8px; right: 8px; bottom: 8px; min-height: 92px; padding: 14px 16px 18px; box-sizing: border-box;
	background: rgba(12, 16, 26, 0.9); border: 1px solid var(--tn-line); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.6), inset 0 0 0 4px rgba(224, 163, 74, 0.25); }
.tn-msg.on { display: block; }
.tn-name { position: absolute; top: -13px; left: 12px; padding: 2px 10px; font-size: 13px; background: #1a2030; border: 1px solid var(--tn-line); }
.tn-text { font-size: 17px; line-height: 1.75; white-space: pre-wrap; word-break: break-all; }
.tn-text.narr { color: #cfd3d8; }
.tn-text.inner { color: #b9c4d6; }
.tn-next { position: absolute; right: 12px; bottom: 4px; font-size: 11px; color: var(--tn-amber); animation: tnb 1s infinite; }
@keyframes tnb { 50% { opacity: 0.2; } }
.tn-choice { display: none; position: absolute; right: 8px; bottom: 112px; flex-direction: column; gap: 6px; max-width: 86%; }
.tn-choice.on { display: flex; }
.tn-choice button, .tn-ov button, .tn-btns button, .tn-dpad button { font: inherit; color: var(--tn-ink); background: rgba(16, 22, 34, 0.92); border: 1px solid var(--tn-line); padding: 10px 14px; cursor: pointer; }
.tn-choice button { text-align: left; font-size: 16px; }
.tn-choice button.sel, .tn-ov button.sel { border-color: var(--tn-amber); box-shadow: inset 0 -2px 0 rgba(224, 163, 74, 0.6); }
.tn-ov { display: none; position: absolute; inset: 0; background: rgba(3, 4, 6, 0.82); z-index: 5; overflow: auto; }
.tn-ov.on { display: flex; }
.tn-ov > div { margin: auto; padding: 16px; max-width: 560px; width: 100%; box-sizing: border-box; }
.tn-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.tn-col { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 22px; }
.tn-col button { min-width: 200px; font-size: 17px; }
.tn-cg { text-align: center; }
.tn-cg img, .tn-end img { max-width: 100%; max-height: 62vh; display: block; margin: 0 auto; }
.tn-cg p { font-size: 16px; line-height: 1.8; margin: 12px 0 0; }
.tn-cg-ph { margin: 0 auto; width: min(80vw, 360px); aspect-ratio: 4 / 5; border: 1px dashed var(--tn-line); display: flex; flex-direction: column; justify-content: center; gap: 8px; color: var(--tn-dim); background: repeating-linear-gradient(45deg, #0c0e12 0 8px, #0f1217 8px 16px); }
.tn-cg-ph b { color: var(--tn-ink); font-family: "DotGothic16", monospace; font-weight: normal; }
.tn-title-card { text-align: center; }
.tn-title-card span { display: inline-block; font-size: 24px; letter-spacing: 0.2em; padding: 14px 22px; border-top: 1px solid var(--tn-line); border-bottom: 1px solid var(--tn-line); }
.tn-titlebox { text-align: center; position: relative; }
.tn-titlebox .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.45; z-index: -1; }
.tn-titlebox h1 { font-size: 40px; letter-spacing: 0.25em; margin: 10px 0 6px; font-weight: normal; }
.tn-titlebox .sub { color: var(--tn-dim); font-size: 14px; margin: 0; }
.tn-titlebox .part { color: var(--tn-amber); font-size: 13px; margin: 8px 0 0; }
.tn-titlebox .note { color: #6c7178; font-size: 12px; margin-top: 18px; }
.tn-warn p, .tn-end p, .tn-hint p { line-height: 1.8; margin: 4px 0; text-align: center; }
.tn-end h2 { text-align: center; font-weight: normal; letter-spacing: 0.15em; margin: 14px 0 10px; }
.tn-end.bad h2 { color: #b9a6a6; }
.tn-help { font-size: 12px !important; color: var(--tn-dim); margin-top: 18px !important; text-align: left !important; border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 10px; }
.tn-hint .ttl { color: var(--tn-amber); }
.tn-hint .h2 { color: #f0e2c4; }
.tn-dial { text-align: center; }
.tn-digs { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.tn-digs span { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tn-digs b { font-size: 28px; width: 44px; padding: 6px 0; border: 1px solid var(--tn-line); font-family: "DotGothic16", monospace; font-weight: normal; }
.tn-digs span.cur b { border-color: var(--tn-amber); }
.tn-digs button { padding: 4px 12px !important; }
.tn-menu h3 { text-align: center; font-weight: normal; }
.tn-menu p { text-align: center; }
.tn-tabs { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-bottom: 12px; }
.tn-tabs button { padding: 8px 10px !important; font-size: 14px; }
.tn-it { border-bottom: 1px solid rgba(255, 255, 255, 0.08); padding: 8px 2px; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; }
.tn-it b { font-weight: normal; color: #f0e7d6; }
.tn-it span { grid-column: 1; font-size: 13px; color: var(--tn-dim); line-height: 1.6; }
.tn-it button { grid-row: 1 / span 2; grid-column: 2; }
.tn-small { font-size: 12px; color: var(--tn-dim); }
.tn-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 6; }
.tn-flash.go { animation: tnf 0.5s ease-out; }
@keyframes tnf { 0% { opacity: 0.85; } 100% { opacity: 0; } }
.tn-toast { position: absolute; left: 50%; top: 40px; transform: translateX(-50%); padding: 6px 14px; background: rgba(16, 22, 34, 0.9); border: 1px solid var(--tn-line); font-size: 14px; opacity: 0; transition: opacity 0.3s; pointer-events: none; z-index: 7; }
.tn-toast.on { opacity: 1; }
.tn-pad { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #08090c; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.tn-dpad { display: grid; grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(3, 44px); gap: 2px; }
.tn-dpad button { padding: 0 !important; font-size: 16px; touch-action: none; }
.tn-dpad [data-d="0"] { grid-column: 2; grid-row: 1; }
.tn-dpad [data-d="3"] { grid-column: 1; grid-row: 2; }
.tn-dpad [data-d="1"] { grid-column: 3; grid-row: 2; }
.tn-dpad [data-d="2"] { grid-column: 2; grid-row: 3; }
.tn-btns { display: flex; flex-direction: column; gap: 10px; }
.tn-btns button { min-width: 110px; font-size: 16px; padding: 12px 10px; touch-action: none; }
@media (max-height: 600px) { .tn-dpad { grid-template-columns: repeat(3, 42px); grid-template-rows: repeat(3, 36px); } .tn-btns button { padding: 8px 10px; } .tn-pad { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); } }
@media (hover: hover) and (pointer: fine) and (min-width: 900px) { .tn-pad { display: none; } }
/* 第4版: 澪の天気（体力）・音のメーター・もや・演出の canvas */
.tn-fxcv { position: absolute; left: 0; top: 0; pointer-events: none; }
.tn-hud { align-items: flex-start; }
.tn-tenki { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; background: #efebe1; color: #333; border-radius: 2px; box-shadow: 1px 2px 0 rgba(0,0,0,0.5);
	background-image: linear-gradient(rgba(120,140,170,0.18) 1px, transparent 1px), linear-gradient(90deg, rgba(120,140,170,0.18) 1px, transparent 1px); background-size: 8px 8px; transform: rotate(-1.5deg); }
.tn-tenki span { font-size: 14px; letter-spacing: 0.05em; }
.tn-tenki.redraw svg { animation: tnredraw 0.7s ease-out; }
@keyframes tnredraw { 0% { opacity: 0; filter: blur(2px); transform: translateX(-3px) rotate(-6deg); } 40% { opacity: 0.4; } 100% { opacity: 1; filter: none; transform: none; } }
.tn-noise { display: none; font-size: 12px; color: #d8d2c4; background: rgba(0,0,0,0.5); padding: 3px 8px; border: 1px solid var(--tn-line); }
.tn-noise i { display: inline-block; width: 14px; height: 8px; margin-left: 3px; border: 1px solid #aaa; vertical-align: middle; }
.tn-noise i.f { background: repeating-linear-gradient(45deg, #ccc 0 2px, #666 2px 4px); }
.tn-chase.still i { background: rgba(120,120,140,0.6); }
.tn-row2 { display: flex; gap: 6px; }
.tn-row2 button { min-width: 0; flex: 1; padding: 10px 8px; font-size: 14px; }
#tn-mist.sel { border-color: #a99ad0; box-shadow: inset 0 0 12px rgba(170,150,220,0.45); }
.tn-chase { top: 64px; }
.tn-row2 button { white-space: nowrap; font-size: 13px; padding: 10px 6px; }
/* 本物の絵: タイトルの絵を画面いっぱいに */
.tn-ov.title { background: #050607; }
.tn-ov.title > .tn-titlebox { position: static; }
.tn-titlebox .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.55; z-index: 0; }
.tn-titlebox > :not(.bg) { position: relative; z-index: 1; }
.tn-titlebox h1, .tn-titlebox .sub, .tn-titlebox .part { text-shadow: 0 2px 6px #000, 0 0 2px #000; }
.tn-tk { display: block; width: 40px; height: 40px; background-size: 600% 200%; background-repeat: no-repeat; }
@media (orientation: landscape) and (min-width: 900px) { .tn { max-width: none; } }
/* 届いた第4版の絵: 天気の台紙・音のメーター・持ち物の絵 */
.tn-tenki.art { background: none center / 100% 100% no-repeat; box-shadow: none; padding: 8px 14px 10px 8px; }
.tn-noise.art { display: flex; align-items: center; gap: 2px; background: rgba(0,0,0,0.45); padding: 2px 6px; }
.tn-noise.art i.ear { display: block; width: 28px; height: 28px; background-size: 112px 28px; background-position: 0 0; border: 0; margin: 0; }
.tn-noise.art i.bar { display: block; width: 72px; height: 24px; background-size: 384px 96px; border: 0; margin: 0; }
.tn-icon { display: block; width: 40px; height: 40px; grid-row: 1 / span 2; grid-column: 0; float: left; margin-right: 8px; background-repeat: no-repeat; }
.tn-it { grid-template-columns: auto 1fr auto; }
.tn-it .tn-icon { grid-column: 1; grid-row: 1 / span 2; }
.tn-it b, .tn-it span { grid-column: 2; }
.tn-it button { grid-column: 3; }
/* 10/5 本編（SEAMLESS）: タイトルは絵を隠さない（文字とボタンは下の帯だけ）・同調・長押し・エンドロール・筆跡・観戦 */
.tn-ov.title > .tn-titlebox { position: absolute; inset: 0; max-width: none; padding: 0; margin: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.tn-titlebox .bg { opacity: 1; object-fit: cover; object-position: center 30%; }
.tn-titlebox .logo { position: absolute !important; top: 4%; right: 6%; height: min(46vh, 340px); width: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.8)); }
.tn-titlebox.wide .logo { right: 4%; top: 6%; height: min(60vh, 420px); }
.tn-titlebox h1 { position: absolute !important; top: 6%; left: 0; right: 0; }
.tn-tband { padding: 26px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(3,4,6,0), rgba(3,4,6,.78) 38%, rgba(3,4,6,.9)); text-align: center; }
.tn-tband .sub { margin: 0 0 4px; font-size: 13px; color: #d9d4ca; }
.tn-tband .tn-col { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.tn-tband .tn-col button { min-width: 0; padding: 10px 16px; font-size: 15px; background: rgba(16, 22, 34, 0.7); }
.tn-tband .note { margin: 10px 0 0; font-size: 11px; color: #9aa0a6; }
.tn-titlebox.wide .tn-tband { background: linear-gradient(90deg, rgba(3,4,6,.85), rgba(3,4,6,.55) 40%, rgba(3,4,6,0) 70%); text-align: left; padding: 24px 32px 28px; max-width: 520px; }
.tn-titlebox.wide .tn-tband .tn-col { justify-content: flex-start; }
.tn-text.note { font-family: "Zen Kurenaido", cursive; font-size: 21px; color: #f2ecdc; letter-spacing: 0.08em; }
.tn-cg.noimg p { font-size: 18px; max-width: 30em; margin: 0 auto; }
.tn-sync, .tn-hold { text-align: center; }
.tn-orb { position: relative; width: 150px; height: 150px; margin: 18px auto 8px; border-radius: 50%; border: 1px solid var(--tn-line); }
.tn-orb i { position: absolute; inset: 18px; border-radius: 50%; background: radial-gradient(circle, rgba(255,225,170,.95), rgba(255,180,110,.35) 55%, rgba(255,180,110,0) 72%); background-size: cover; }
.tn-orb.ok { box-shadow: 0 0 0 4px rgba(150,220,170,.6); } .tn-orb.ng { box-shadow: 0 0 0 4px rgba(220,120,110,.6); }
.tn-sc { font-size: 15px; } .tn-sc b { font-size: 22px; color: var(--tn-amber); }
.tn-holdbar { width: 70%; height: 14px; margin: 20px auto 6px; border: 1px solid var(--tn-line); background: rgba(255,255,255,.05); }
.tn-holdbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, rgba(240,190,110,.5), rgba(255,225,170,.95)); }
.tn-hold [data-h] { min-width: 160px; padding: 14px 18px !important; touch-action: none; }
.tn-ov.roll { background: #000; }
.tn-roll { text-align: center; }
.tn-roll img { max-width: 100%; max-height: 60vh; opacity: 0; } .tn-roll img.in { animation: tnroll 2.6s ease-in-out; }
@keyframes tnroll { 0% { opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
.tn-roll .c1 { font-size: 22px; letter-spacing: .3em; margin: 14px 0 4px; } .tn-roll .c2 { font-size: 13px; color: var(--tn-dim); min-height: 1.6em; }
.tn-got { font-size: 13px !important; color: var(--tn-dim); } .tn-stamp { color: var(--tn-amber) !important; }
.tn-link { font-size: 13px !important; margin-top: 12px !important; } .tn-link a { color: #cfc4e6; }
.tn-help { white-space: pre-line; }
.tn-end.true h2 { color: #f6e3b4; } .tn-end.normal h2 { color: #d8d8d0; }
.tn-wtwait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #050607; color: var(--tn-dim); z-index: 4; }
.tn.is-wtview .tn-pad { display: none; }
.tn-wc:empty { display: none; }
.tn-end img { max-height: 36vh; }
.tn-orb i[style] { background-size: 400% 200%; background-position: 0 0; background-repeat: no-repeat; }

/* PORT1006 会話の窓の立ち絵（切れないように 高さで合わせて contain・小さい子は小さく低く） */
.tn-port { display: none; position: absolute; bottom: 120px; z-index: 2; pointer-events: none; height: calc(min(36vh, 330px) * var(--k, 1)); max-width: 46%; }
.tn-port.on { display: block; }
.tn-port.l { left: 6px; } .tn-port.r { right: 6px; }
.tn-port img, .tn-port canvas.tn-portc { height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 2px 6px rgba(0,0,0,.7)); }
.tn-port canvas.tn-portc { display: block; }   /* FIX10 余白を 切った 立ち絵（背丈を そろえる） */
.tn-port.spr img { image-rendering: pixelated; }
@media (max-height: 560px) { .tn-port { height: calc(min(28vh, 200px) * var(--k, 1)); } }
@media (orientation: landscape) and (min-width: 900px) { .tn-port { height: calc(min(46vh, 380px) * var(--k, 1)); } .tn-port.l { left: max(6px, calc(50% - 520px)); } .tn-port.r { right: max(6px, calc(50% - 520px)); } }
/* 10/6 タイトルの絵を切らない（contain・うしろに同じ絵をぼかして敷く） */
.tn-titlebox .bg { object-fit: contain !important; object-position: center top; }
.tn-titlebox .bgblur { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(18px) brightness(0.45); transform: scale(1.1); z-index: 0; }
.tn-cg img { object-fit: contain; }

/* UX1006 使いやすさ: 文字 14px 以上・ボタン 44px 以上・明るさ・調べられるときの「しらべる」・記録の印・ログ・低い画面 */
.tn-place { font-size: 14px; }
.tn-it span, .tn-small, .tn-chase span, .tn-row2 button, .tn-tband .note, .tn-help, .tn-got, .tn-link { font-size: 14px !important; }
.tn-tabs button, .tn-row2 button, .tn-digs button, .tn-menu button, .tn-row button { min-height: 44px; }
.tn-btns button { min-height: 44px; }
#tn-act.can { border-color: var(--tn-amber); box-shadow: 0 0 0 2px rgba(224, 163, 74, 0.35), inset 0 0 14px rgba(224, 163, 74, 0.35); color: #fff3d6; }
.tn-saved { position: absolute; right: 10px; top: 34px; padding: 3px 10px; font-size: 14px; color: #e9e1cf; background: rgba(16, 22, 34, 0.8); border: 1px solid var(--tn-line); opacity: 0; pointer-events: none; z-index: 3; }
.tn-saved.on { animation: tnsaved 1.8s ease-out; }
@keyframes tnsaved { 0% { opacity: 0; } 15% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
.tn-log { max-height: 52vh; overflow-y: auto; text-align: left; padding: 4px 6px; border: 1px solid rgba(255,255,255,0.08); }
.tn-log p { margin: 6px 0; line-height: 1.6; font-size: 15px; }
.tn-log b { display: inline-block; margin-right: 8px; color: var(--tn-amber); font-weight: normal; }
@media (max-height: 700px) { .tn-pad { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); } .tn-dpad { grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(3, 44px); } .tn-btns { gap: 6px; } .tn-btns button { padding: 8px 10px; } }

/* CHOICE1006 選択肢は いちばん手前・会話の窓のすぐ上に 全幅・不透明（立ち絵の裏に隠れない） */
.tn-choice { z-index: 6; left: 8px; right: 8px; max-width: none; }
.tn-choice button { width: 100%; background: #121a28; border-color: rgba(233, 228, 218, 0.55); font-size: 16px; min-height: 48px; }
.tn-choice.on ~ .tn-port, .tn-port { z-index: 2; }
.tn-msg { z-index: 3; }

/* PLACE1006 部屋の名前: 右上の札（はっきり）・入ったときの札（上の真ん中・2.6秒）・メニューの「いまいる所」 */
.tn-place { padding: 4px 10px; background: rgba(14, 18, 26, 0.82); border: 1px solid rgba(233, 200, 140, 0.5); color: #f2ead8 !important; font-size: 14px; text-shadow: none; border-radius: 2px; }
.tn-roomname { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); padding: 8px 22px; font-size: 19px; letter-spacing: 0.12em; color: #f6efdf; background: rgba(10, 13, 20, 0.88); border-top: 1px solid rgba(233, 200, 140, 0.7); border-bottom: 1px solid rgba(233, 200, 140, 0.7); white-space: nowrap; opacity: 0; pointer-events: none; z-index: 4; }
.tn-roomname.on { animation: tnroom 3.2s ease-out; }
@keyframes tnroom { 0% { opacity: 0; transform: translate(-50%, -6px); } 12% { opacity: 1; transform: translate(-50%, 0); } 75% { opacity: 1; } 100% { opacity: 0; } }
.tn-here { margin: 0 0 10px; font-size: 15px; color: var(--tn-dim); text-align: center; } .tn-here b { color: #f2ead8; font-weight: normal; }
/* WEATHER1006 天気の札: 10の目盛り・変わった理由の札・ゆれと色（下がる＝青灰・上がる＝金）・札を さわると説明 */
.tn-tenki { pointer-events: auto; cursor: pointer; flex-shrink: 0; }
.tn-tenki span { display: flex; flex-direction: column; gap: 3px; white-space: nowrap; }
.tn-pips { display: flex; gap: 2px; }
.tn-pips i { display: block; width: 6px; height: 6px; border: 1px solid rgba(60, 60, 70, 0.55); border-radius: 50%; background: transparent; }
.tn-pips i.f { background: #5a7fae; border-color: #3f5f8a; }
.tn-tenki.hit { animation: tnhit 0.6s ease-out; }
.tn-tenki.heal { animation: tnheal 1s ease-out; }
@keyframes tnhit { 0% { transform: rotate(-1.5deg); filter: none; } 15% { transform: translateX(-5px) rotate(-3deg); filter: sepia(0.6) hue-rotate(180deg) brightness(0.8); } 35% { transform: translateX(5px) rotate(0deg); } 55% { transform: translateX(-3px) rotate(-2deg); } 100% { transform: rotate(-1.5deg); filter: none; } }
@keyframes tnheal { 0% { filter: none; } 30% { filter: brightness(1.25) sepia(0.4) drop-shadow(0 0 8px rgba(255, 220, 140, 0.9)); } 100% { filter: none; } }
.tn-tnote { position: absolute; left: 8px; top: 76px; max-width: min(78%, 330px); padding: 6px 10px; background: rgba(14, 18, 26, 0.9); border-left: 3px solid #8fa8cf; color: #f2ead8; font-size: 14px; line-height: 1.45; opacity: 0; pointer-events: none; z-index: 5; transform: translateY(-4px); transition: opacity 0.3s, transform 0.3s; }
.tn-tnote.on { opacity: 1; transform: none; }
.tn-tnote span { display: block; }
.tn-tnote b { display: block; font-weight: normal; letter-spacing: 0.04em; }
.tn-tnote b.dn { color: #b8c8e6; }
.tn-tnote b.up { color: #f0d58c; }
/* 上の段: 天気の札（左）・部屋の名前（右）が 重ならない・折り返さない */
.tn-hud { gap: 8px; }
.tn-hud .tn-noise { flex-shrink: 0; }
.tn-hud .tn-place { flex-shrink: 1; min-width: 0; max-width: 48%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-chase { top: 84px; width: 56%; }
.tn-roomname { top: 84px; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; }
.tn-toast { top: 196px; max-width: calc(100% - 32px); text-align: center; }
.tn-saved { top: 46px; }
/* メニュー「てんき」 */
.tn-tenkihelp { text-align: left; font-size: 15px; line-height: 1.6; max-height: 52vh; overflow: auto; }
.tn-tenkihelp p { margin: 0 0 6px; }
.tn-tenkihelp .now { font-size: 16px; text-align: center; }
.tn-tenkihelp .now b { color: #f2ead8; font-weight: normal; }
.tn-tenkihelp .h { margin-top: 10px; color: #e9c88c; }
.tn-tenkihelp ul { margin: 0 0 4px; padding-left: 1.2em; }
.tn-tenkihelp li { margin: 2px 0; }

/* SCENE1006 一枚絵が まだ無い場面: 真っ黒にせず、うしろの地図を 暗く見せて 文を 帯で重ねる */
.tn-ov.cg:has(.tn-cg.noimg) { background: rgba(4, 5, 8, 0.42); }
.tn-cg.noimg p { background: rgba(10, 12, 18, 0.86); border-top: 1px solid rgba(233, 200, 140, 0.45); border-bottom: 1px solid rgba(233, 200, 140, 0.45); padding: 16px 18px; }

/* 上の段: 音のメーターは 部屋の名前の下（右）へ。部屋の名前が つぶれない */
.tn-hud { position: absolute; }
.tn-hud .tn-noise { position: absolute; right: 0; top: 38px; }
.tn-hud .tn-place { max-width: 52%; margin-left: auto; }
.tn-saved { top: 84px; }

/* SCENE1006 エンド: うしろの地図や上の札を 透かさない。エンドの絵を ぼかして 画面いっぱいに敷く */
.tn-ov:has(.tn-end) { background: #050607; }
.tn-endbg { position: absolute; inset: 0; background: center / cover no-repeat; filter: blur(14px) brightness(0.35) saturate(0.9); transform: scale(1.08); pointer-events: none; z-index: 0; }
.tn-ov > .tn-end { position: relative; z-index: 1; }
.tn-tnote { z-index: 4; }

/* QA1006 メニューの タブは 44px 角以上 */
.tn-tabs button { min-width: 48px; min-height: 44px; }

/* ECHO1008 残響の 一枚絵＋エピソード */
.tn-ov.echo { background: rgba(4, 4, 6, 0.94); }
.tn-echo { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 560px; width: 100%; padding: 12px 14px; box-sizing: border-box; }
.tn-echo .when { margin: 0; font-family: "Zen Kurenaido", "DotGothic16", sans-serif; font-size: 16px; color: #d9cfb8; letter-spacing: 0.08em; }
.tn-echo .pic { width: 100%; display: flex; justify-content: center; }
.tn-echo .pic img { max-width: 100%; max-height: 46vh; object-fit: contain; filter: saturate(0.55) sepia(0.15) contrast(0.95); animation: tnechozoom 9s ease-out forwards; box-shadow: 0 0 0 1px rgba(233, 200, 140, 0.25); }
@keyframes tnechozoom { from { transform: scale(1); } to { transform: scale(1.05); } }
.tn-echo .lines { width: 100%; min-height: 6.5em; max-height: 30vh; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; }
.tn-echo .lines p { margin: 0; font-size: 16px; line-height: 1.6; color: #efe7d6; animation: tnechoin 0.5s ease-out; }
.tn-echo .lines p.nar { color: #d8d0bf; }
.tn-echo .lines p.mio { color: #f6e3b4; }
.tn-echo .lines p b { font-weight: normal; color: #e9c88c; margin-right: 0.6em; font-size: 14px; }
@keyframes tnechoin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tn-echo .know { margin: 2px 0 0; padding: 6px 10px; font-size: 15px; color: #cfe0f6; border-left: 3px solid #8fa8cf; background: rgba(20, 28, 44, 0.7); align-self: stretch; }
.tn-echo .tap { margin: 0; font-size: 13px; color: rgba(220, 210, 190, 0.55); }
.tn-ebook .room { margin: 10px 0 4px; color: #e9c88c; font-size: 14px; }
.tn-ebook button[data-ek] { display: block; width: 100%; text-align: left; margin: 4px 0; min-height: 44px; font-size: 15px; }
/* ECHO1008 PC（横長の 広い 画面）: 一枚絵を 画面の 高さに 合わせて 大きく、文は 右に 18px（スマホと 同じ 見え方の 比率） */
@media (orientation: landscape) and (min-width: 900px) {
	.tn-ov.echo > .tn-echo { max-width: min(1280px, 96vw); width: 96vw; display: grid; grid-template-columns: auto minmax(300px, 420px); grid-template-rows: auto 1fr auto auto; column-gap: 28px; row-gap: 10px; align-items: end; justify-content: center; padding: 3vh 2vw; }
	.tn-echo .when { grid-column: 1 / 3; justify-self: center; font-size: 20px; }
	.tn-echo .pic { grid-column: 1; grid-row: 2 / 5; align-self: center; }
	.tn-echo .pic img { max-height: 80vh; max-width: 60vw; }
	.tn-echo .lines { grid-column: 2; grid-row: 2; max-height: 60vh; min-height: 10em; }
	.tn-echo .lines p { font-size: 18px; line-height: 1.75; }
	.tn-echo .lines p b { font-size: 16px; }
	.tn-echo .know { grid-column: 2; grid-row: 3; font-size: 17px; }
	.tn-echo .tap { grid-column: 2; grid-row: 4; font-size: 14px; }
	.tn-ov > .tn-ebook { max-width: 720px; }
	.tn-ebook .tn-here { font-size: 18px; }
	.tn-ebook .room { font-size: 17px; }
	.tn-ebook button[data-ek] { font-size: 18px; min-height: 52px; }
}
.tn-ov:has(.tn-ebook) { background: rgba(4, 5, 8, 0.94); }

/* CLIMAX1008 山場の 連打・あふれる 声・解放の 光 */
.tn-mash { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 16px; background: rgba(8, 10, 16, 0.72); border: 1px solid rgba(233, 200, 140, 0.5); }
.tn-mash p { margin: 0; font-size: 16px; color: #f2ead8; }
.tn-mashbar { width: 220px; height: 10px; background: rgba(255, 255, 255, 0.12); }
.tn-mashbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f0d58c, #f6a26a); transition: width 0.15s; }
.tn-mash button { min-width: 200px; min-height: 56px; font-size: 18px; }
.tn-burst { position: absolute; z-index: 5; pointer-events: none; font-size: clamp(22px, 6vw, 40px); font-weight: bold; text-shadow: 0 0 8px rgba(0, 0, 0, 0.8), 0 0 18px currentColor; white-space: nowrap; animation: tnburst 1.9s ease-out forwards; }
@keyframes tnburst { 0% { opacity: 0; transform: scale(0.6); } 12% { opacity: 1; transform: scale(1.15); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-40px) scale(1); } }
.tn-hareru { position: absolute; inset: 0; z-index: 5; pointer-events: none; background: radial-gradient(circle at 50% 55%, rgba(255, 244, 210, 0.95) 0%, rgba(255, 226, 160, 0.55) 30%, rgba(255, 220, 150, 0) 70%); animation: tnhareru 2.6s ease-out forwards; }
@keyframes tnhareru { 0% { opacity: 0; transform: scale(0.3); } 30% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1.6); } }

/* FIX9B 一枚絵を 出した まま 文を 流す（寝言など。地図で 小さい 人の 大事な 台詞） */
.tn-cgbg { display: none; position: absolute; inset: 0; z-index: 2; background: rgba(3, 4, 6, 0.9); pointer-events: none; }
.tn-cgbg.on { display: flex; align-items: flex-start; justify-content: center; padding-top: 6vh; box-sizing: border-box; animation: tnechoin 0.6s ease-out; }
.tn-cgbg img { max-width: 94%; max-height: calc(100% - 200px); object-fit: contain; filter: saturate(0.85); transition: transform 1.2s ease-out; }
.tn-cgbg.zoom img { animation: tncgzoom 1.4s ease-out forwards; }
@keyframes tncgzoom { 0% { transform: scale(1); } 30% { transform: scale(1.05) translateX(-4px); } 60% { transform: scale(1.06) translateX(3px); } 100% { transform: scale(1.06); } }

/* FIX9A 残響の 画面は 十字キーの 上（舞台の 高さ）に 必ず 収める。一枚絵が 縮み、文は スクロール */
.tn-ov.echo { background: #050608; z-index: 8; overflow: hidden; }
.tn-ov.echo > .tn-echo { margin: 0; height: 100%; max-height: 100%; box-sizing: border-box; padding: 8px 12px 6px; display: flex; flex-direction: column; justify-content: flex-start; gap: 6px; overflow: hidden; }
.tn-echo .when { flex: 0 0 auto; }
.tn-echo .pic { flex: 1 1 0; min-height: 60px; display: flex; justify-content: center; align-items: center; overflow: hidden; }
.tn-echo .pic img { max-height: 100%; max-width: 100%; animation: none; }
.tn-echo .lines { flex: 0 1 auto; min-height: 3.4em; max-height: 40%; overflow-y: auto; justify-content: flex-start; }
.tn-echo .know { flex: 0 0 auto; }
.tn-echo .tap { flex: 0 0 auto; font-size: 14px; }
.tn-ebook button[data-ek] b { font-weight: normal; color: #e9c88c; }
@media (orientation: landscape) and (min-width: 900px) {
	.tn-ov.echo > .tn-echo { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; }
	.tn-echo .pic { grid-row: 2 / 5; height: 100%; }
	.tn-echo .pic img { max-height: 100%; max-width: 60vw; }
	.tn-echo .lines { max-height: none; }
}

/* FIX9A 残響の 画面は 十字キーの 上（舞台の 高さ）に 必ず 収める。一枚絵が 縮み、文は スクロール */
.tn-ov.echo { background: #050608; z-index: 8; overflow: hidden; }
.tn-ov.echo > .tn-echo { margin: 0; height: 100%; max-height: 100%; box-sizing: border-box; padding: 8px 12px 6px; display: flex; flex-direction: column; justify-content: flex-start; gap: 6px; overflow: hidden; }
.tn-echo .when { flex: 0 0 auto; }
.tn-echo .pic { flex: 1 1 0; min-height: 60px; display: flex; justify-content: center; align-items: center; overflow: hidden; }
.tn-echo .pic img { max-height: 100%; max-width: 100%; animation: none; }
.tn-echo .lines { flex: 0 1 auto; min-height: 3.4em; max-height: 40%; overflow-y: auto; justify-content: flex-start; }
.tn-echo .know { flex: 0 0 auto; }
.tn-echo .tap { flex: 0 0 auto; font-size: 14px; }
.tn-ebook button[data-ek] b { font-weight: normal; color: #e9c88c; }
@media (orientation: landscape) and (min-width: 900px) {
	.tn-ov.echo > .tn-echo { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; }
	.tn-echo .pic { grid-row: 2 / 5; height: 100%; }
	.tn-echo .pic img { max-height: 100%; max-width: 60vw; }
	.tn-echo .lines { max-height: none; }
}
/* FIX9B 小さい 画面でも 残響の 文を 2行 出す（絵を すこし 縮める） */
@media (max-width: 700px) { .tn-ov.echo .tn-echo .lines { min-height: 7.4em; flex-shrink: 0; } }
/* QA9B あふれ文字は 折り返して 画面の 内側へ／ログは 十字キーの 帯より 上に／iOS の 長押しメニューと 拡大を 出さない */
.tn-burst { white-space: normal; max-width: 84%; line-height: 1.25; }
@media (max-height: 760px) { .tn-log { max-height: 30vh; } }
.tn-hold, .tn-hold *, .tn-mash, .tn-mash * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.tn-hold button, .tn-mash button, .tn-pad button { touch-action: manipulation; }
.tn-hold [data-h] { touch-action: none; }
.tn-holdkey { font-size: 13px; opacity: 0.75; margin: 4px 0 0; }
/* RW1010 長押しの 間の 一枚絵・終章の 6つの 品・操作の 帯 */
.tn-ov:has(.tn-hold.haspic) { background: rgba(3, 4, 6, 0.6); }
.tn-holdpic { margin: 0 auto 8px; }
.tn-holdpic img { display: block; margin: 0 auto; max-width: 92%; max-height: 46vh; object-fit: contain; border: 1px solid rgba(233, 200, 140, 0.25); }
.tn-gifts { display: none; position: absolute; left: 50%; top: 52px; transform: translateX(-50%); z-index: 4; gap: 6px; padding: 6px 8px; background: rgba(4, 5, 8, 0.6); border: 1px solid rgba(233, 200, 140, 0.25); pointer-events: none; }
.tn-gifts.on { display: flex; }
.tn-gifts span { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border: 1px dashed rgba(255, 255, 255, 0.18); transition: filter 0.8s, opacity 0.8s, box-shadow 0.8s; }
.tn-gifts span .tn-icon { width: 30px; height: 30px; display: block; float: none; margin: 0; }
.tn-gifts span.has { filter: grayscale(1) brightness(0.55); opacity: 0.7; }
.tn-gifts span.lit { border-style: solid; border-color: rgba(255, 220, 150, 0.8); box-shadow: 0 0 12px rgba(255, 210, 130, 0.65); }
.tn-gifts span.none { opacity: 0.35; }
.tn-tip { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 4; max-width: 86%; padding: 12px 16px; font-size: 17px; text-align: center; color: #fff4dc; background: rgba(10, 12, 18, 0.86); border: 1px solid rgba(240, 200, 120, 0.7); box-shadow: 0 0 18px rgba(240, 190, 110, 0.35); opacity: 0; pointer-events: none; transition: opacity 0.4s; }
.tn-tip.on { opacity: 1; }
/* RW1010 点検4 追跡の 帯は 品の 列より 下・天気の 知らせは 帯と 重ならない・保存の 知らせは 右上の 札と 重ならない */
.tn-stage:has(.tn-gifts.on) .tn-chase { top: 112px; }
.tn-stage:has(.tn-gifts.on) .tn-saved { top: 108px; }
.tn-saved { top: 70px; right: auto; left: 10px; z-index: 6; }
/* RW1010 点検2 謎の 4コマ */
.tn-panels { display: none; position: absolute; left: 50%; top: 52px; transform: translateX(-50%); width: min(96%, 560px); z-index: 4; gap: 6px; grid-template-columns: repeat(4, 1fr); pointer-events: none; }
.tn-panels.on { display: grid; }
.tn-panels figure { margin: 0; padding: 3px; background: rgba(12, 14, 20, 0.88); border: 1px solid rgba(233, 200, 140, 0.35); transition: box-shadow 0.4s, border-color 0.4s; }
.tn-panels figure img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: sepia(0.35) saturate(0.8); }
.tn-panels figure i { display: block; width: 100%; aspect-ratio: 4 / 5; background: #222; }
.tn-panels figcaption { font-size: 12px; text-align: center; color: #f2ead8; line-height: 1.5; white-space: nowrap; overflow: hidden; }
.tn-panels figure.hi { border-color: #ffd98a; box-shadow: 0 0 14px rgba(255, 210, 120, 0.85); animation: tnpanelhi 1.2s ease-in-out infinite alternate; }
.tn-panels figure.hi img { filter: none; }
@keyframes tnpanelhi { from { box-shadow: 0 0 6px rgba(255, 210, 120, 0.5); } to { box-shadow: 0 0 18px rgba(255, 220, 140, 0.95); } }
