/*
 * インターホン ― 事故物件31日生存記録 ―
 * 画面の部品はすべて「その場にある物」として描く：
 *   夜＝玄関の室内モニター（親機）／朝＝自分のスマホ／上部＝配信ソフトのオーバーレイ
 * 文字は三系統：物語＝明朝、操作＝UDゴシック、機械の表示＝等幅数字。強調色は録画ランプの赤だけ。
 */
:root {
  --ink: #0a0b0c;
  --ink-2: #131517;
  --ink-3: #1c1f22;
  --line: #2a2e31;
  --text: #e8e4da;
  --dim: #a2a69f;
  --faint: #7c817a;
  --red: #c9261d;
  --red-glow: #ff3b2f;
  --amber: #e0a648;
  --lcd: #b9cdb0;
  --plastic: #e4e0d5;
  --plastic-2: #cdc8bb;
  --plastic-ink: #3a3832;
  --phone: #0f1011;
  --paper: #f3f0e8;
  --paper-ink: #1d1d1b;
  --mincho: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  --gothic: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --mono: "Share Tech Mono", "SFMono-Regular", "Menlo", "Consolas", monospace;
  --hand: "Yomogi", "Klee One", "Hiragino Maru Gothic ProN", cursive;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body {
  margin: 0;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  background: var(--ink);
  color: var(--text);
  font-family: var(--gothic);
  font-size: 15px;
  line-height: 1.7;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt";
}
/* ホーム画面から全画面で起動したとき、時計やノッチの裏に文字が潜らないように */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--ink); z-index: 60; pointer-events: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: none; }
#app {
  max-width: 480px;
  margin: 0 auto;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  padding-block: env(safe-area-inset-top, 0px) calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 1px solid var(--red-glow); outline-offset: 3px; }
.muted { color: var(--dim); }
.small { font-size: 12px; }

/* ───── 文字メニュー（家庭用ゲーム機の選択肢） ───── */
.menu { display: flex; flex-direction: column; gap: 2px; }
.mi {
  position: relative; display: flex; align-items: baseline; gap: 14px; width: 100%; text-align: left;
  padding: 11px 0 11px 26px; font-family: var(--mincho); font-weight: 700; font-size: 19px; letter-spacing: .12em; color: var(--text);
  transition: color .15s, padding-left .2s ease;
}
.mi::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 14px; height: 1px; background: var(--red-glow);
  transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.mi:hover, .mi:focus-visible, .mi.first { padding-left: 32px; }
.mi:hover::before, .mi:focus-visible::before, .mi.first::before { transform: scaleX(1); }
.mi small { font-family: var(--gothic); font-weight: 400; font-size: 12px; letter-spacing: .04em; color: var(--dim); }
.mi.sub { font-size: 15px; color: var(--dim); padding-block: 8px; }
.mi.danger { color: var(--red-glow); }

/* 決定ボタン（画面の主操作）は一本の帯 */
.go {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 16px 4px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-family: var(--mincho); font-weight: 700; font-size: 18px; letter-spacing: .2em;
}
.go::after { content: ""; width: 9px; height: 9px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); margin-right: 6px; }
.go:hover, .go:focus-visible { color: #fff; border-color: var(--red); }
.link { font-size: 12px; color: var(--faint); letter-spacing: .08em; align-self: center; padding: 8px; }
.link:hover { color: var(--dim); }

/* ───── 配信オーバーレイ（上部バー） ───── */
.stream-bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  margin-inline: -16px; padding: 10px 16px 8px;
  background: linear-gradient(var(--ink) 70%, rgba(10, 11, 12, 0));
  font-family: var(--mono); font-size: 13px; letter-spacing: .06em;
}
.sb-live { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.sb-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--red-glow); box-shadow: 0 0 6px var(--red-glow); animation: rec 1.6s steps(1) infinite; }
.sb-live b { font-weight: 400; color: var(--dim); }
.sb-day { justify-self: center; color: var(--dim); }
.sb-day b { color: var(--text); font-weight: 400; font-size: 15px; }
.sb-trust { display: inline-flex; align-items: flex-end; gap: 3px; height: 14px; }
.sb-trust em { font-style: normal; font-family: var(--gothic); font-size: 11px; color: var(--dim); margin-right: 5px; align-self: center; }
.sb-trust i { width: 4px; background: var(--text); border-radius: 1px; }
.sb-trust i:nth-of-type(1) { height: 5px; } .sb-trust i:nth-of-type(2) { height: 7px; } .sb-trust i:nth-of-type(3) { height: 9px; }
.sb-trust i:nth-of-type(4) { height: 11px; } .sb-trust i:nth-of-type(5) { height: 14px; }
.sb-trust i.lost { background: var(--line); }
.sb-trust.low i:not(.lost) { background: var(--red-glow); }

/* ───── 章タイトル（場面転換） ───── */
.chapter {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  display: grid; place-content: center; justify-items: center; gap: 12px; background: var(--ink);
  animation: chapter-bg 2.4s ease forwards;
}
/* 文字が消えきってから幕が上がる（下の画面と文字が重なって見えないように） */
.chapter > * { animation: chapter-text 2.4s ease forwards; }
.chapter b { font-family: var(--mincho); font-weight: 800; font-size: clamp(40px, 13vw, 64px); letter-spacing: .3em; margin-right: -.3em; white-space: nowrap; }
.chapter.long b { font-size: clamp(34px, 10.5vw, 52px); letter-spacing: .16em; margin-right: -.16em; }
.chapter span { font-family: var(--mono); font-size: 13px; letter-spacing: .4em; color: var(--dim); margin-right: -.4em; }
.chapter i { width: 40px; height: 1px; background: var(--red); }
@keyframes chapter-bg { 0%, 72% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@keyframes chapter-text { 0% { opacity: 0; transform: translateY(6px); } 14%, 52% { opacity: 1; transform: none; } 66%, 100% { opacity: 0; } }

/* ───── ロード画面 ───── */
.screen-loading { min-height: 100%; }
.loading-bg { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.screen-loading::before { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10,11,12,0) 45%, rgba(10,11,12,.9) 78%, var(--ink) 100%); }
.loading-wrap { position: fixed; inset: 0; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; justify-content: flex-end; gap: 22px; padding: 0 22px calc(36px + env(safe-area-inset-bottom, 0px)); }
.loading-tip { margin: 0; font-family: var(--mincho); font-size: 15px; line-height: 1.9; color: var(--text); }
.loading-label { margin: 0 0 8px; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; letter-spacing: .3em; color: var(--dim); }
.loading-bar { height: 1px; background: var(--line); }
.loading-bar i { display: block; height: 100%; width: 0; background: var(--text); transition: width .2s; }
.tap-start { width: 100%; padding: 18px 0 4px; text-align: center; display: grid; gap: 6px; }
.tap-start b { font-family: var(--mincho); font-weight: 700; font-size: 17px; letter-spacing: .3em; animation: breathe 2.4s ease-in-out infinite; }
.tap-start small { font-size: 12px; color: var(--dim); letter-spacing: .1em; }
.screen-loading:has(.tap-start), .screen-title:has(.tap-start) { cursor: pointer; }
@keyframes breathe { 50% { opacity: .35; } }

/* ───── タイトル ───── */
.screen-title { min-height: 100%; }
.title-bg { position: fixed; inset: 0; z-index: -1; }
.title-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 50%; display: block; }
.title-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,11,12,.92) 0%, rgba(10,11,12,.35) 30%, rgba(10,11,12,0) 44%, rgba(10,11,12,0) 56%, rgba(10,11,12,.8) 72%, var(--ink) 100%); }
.title-wrap { display: flex; flex-direction: column; min-height: calc(100dvh - 28px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); padding-top: 9vh; }
.title-logo {
  margin: 0; font-family: var(--mincho); font-weight: 800; font-size: clamp(38px, 12.2vw, 64px); line-height: 1;
  letter-spacing: .06em; white-space: nowrap; color: var(--text);
  text-shadow: 1px 0 0 rgba(255, 59, 47, .55), -1px 0 0 rgba(120, 200, 190, .35);
}
.title-sub { margin: 18px 0 0; font-family: var(--mincho); font-weight: 500; font-size: 13px; letter-spacing: .5em; color: var(--dim); }
.title-sub::before { content: ""; display: inline-block; width: 24px; height: 1px; background: var(--red); vertical-align: middle; margin-right: 12px; }
.title-wrap .menu { margin-top: auto; }
.title-foot { margin: 22px 0 0; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--faint); }

/* ───── 名前入力 ───── */
.entry { display: flex; flex-direction: column; gap: 28px; padding-top: 18vh; }
.entry h2 { margin: 0; font-family: var(--mincho); font-weight: 700; font-size: clamp(19px, 5.6vw, 24px); letter-spacing: .1em; line-height: 1.7; word-break: keep-all; }
.entry p { margin: 0; font-size: 13px; color: var(--dim); }
.entry form { display: flex; flex-direction: column; gap: 28px; }
.entry input {
  font-family: var(--mincho); font-weight: 700; font-size: 26px; letter-spacing: .08em; color: var(--text);
  background: transparent; border: 0; border-bottom: 1px solid var(--dim); padding: 6px 2px; border-radius: 0; width: 100%;
}
.entry input:focus { outline: none; border-bottom-color: var(--red-glow); }
.entry input::placeholder { color: var(--faint); }

/* ───── 朝：スマホ実機 ───── */
.morning-head { display: flex; align-items: baseline; justify-content: space-between; padding-top: 4px; }
.morning-head h2 { margin: 0; font-family: var(--mincho); font-weight: 800; font-size: 26px; letter-spacing: .12em; }
.morning-head span { font-family: var(--mincho); font-size: 13px; color: var(--dim); letter-spacing: .1em; }
.coach { margin: 0; font-family: var(--mincho); font-size: 14px; line-height: 1.9; color: var(--dim); }
.phone {
  background: var(--phone); border-radius: 34px; padding: 10px;
  box-shadow: 0 0 0 1px #2b2d30, 0 0 0 4px #0a0a0b, 0 24px 60px rgba(0, 0, 0, .7);
}
.phone-screen { background: #f6f5f1; color: var(--paper-ink); border-radius: 26px; overflow: hidden; display: flex; flex-direction: column; min-height: 420px; }
.phone-status { display: flex; justify-content: space-between; align-items: center; padding: 8px 20px 4px; font-family: var(--mono); font-size: 12px; color: #222; }
.phone-status i { display: inline-flex; gap: 2px; align-items: flex-end; height: 9px; }
.phone-status i b { width: 3px; background: #222; border-radius: 1px; }
.phone-app-title { padding: 6px 18px 10px; font-family: var(--gothic); font-weight: 700; font-size: 20px; border-bottom: 1px solid #e3e1da; display: flex; justify-content: space-between; align-items: baseline; }
.phone-app-title small { font-weight: 400; font-size: 12px; color: #8a877e; }
.phone-body { flex: 1; padding: 14px 14px 18px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 50vh; }
.phone-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid #e3e1da; background: #fbfaf7; padding: 6px 4px calc(6px + 2px); }
.ptab { display: grid; justify-items: center; gap: 2px; padding: 4px 0; font-size: 11px; color: #9a978e; position: relative; }
.ptab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ptab.on { color: #111; }
.ptab .dot { position: absolute; top: 2px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 1.5px solid #fbfaf7; }
.phone mark { background: linear-gradient(transparent 55%, rgba(224, 166, 72, .45) 55%); color: inherit; padding: 0 1px; font-weight: 700; }
.phone mark.c { background: linear-gradient(transparent 55%, rgba(110, 160, 210, .4) 55%); }
.phone mark.q { background: none; font-weight: 700; }
.bubble { display: grid; grid-template-columns: 30px 1fr; gap: 8px; max-width: 92%; }
.bubble .av { width: 30px; height: 30px; border-radius: 50%; background: #d8d4c8; color: #55524a; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.bubble .who { font-size: 11px; color: #8a877e; display: block; margin-bottom: 2px; }
.bubble p { margin: 0; background: #fff; border: 1px solid #e6e3dc; padding: 8px 11px; border-radius: 4px 14px 14px 14px; font-size: 14px; line-height: 1.6; }
.memo { background: #fbf7e6; border-radius: 2px; padding: 12px 14px; background-image: repeating-linear-gradient(transparent 0 27px, #e6dcb4 27px 28px); box-shadow: 0 1px 0 #e6dcb4; }
.memo p { margin: 0 0 1px; font-family: var(--hand); font-size: 16px; line-height: 28px; color: #2b2a26; }
.news { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid #e6e3dc; }
.news:first-child { padding-top: 0; }
.news small { font-size: 11px; color: #8a877e; letter-spacing: .06em; }
.news p { margin: 0; font-size: 14px; line-height: 1.6; }
.receipt { background: #fff; padding: 14px 16px; font-family: var(--mono); font-size: 13px; line-height: 1.8; box-shadow: 0 1px 3px rgba(0,0,0,.12); position: relative; }
.receipt::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px; background: radial-gradient(circle at 5px -1px, transparent 5px, #fff 5px) repeat-x; background-size: 10px 6px; }
.receipt p { margin: 0; }
.empty { color: #9a978e; text-align: center; padding: 48px 0; font-size: 13px; }

/* ───── 夜：配信コメント（オーバーレイ） ───── */
.chat { position: relative; margin-top: -4px; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--faint); padding-bottom: 2px; }
.chat-head > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head.hijacked > span { color: var(--red-glow); animation: rec 1s steps(1) infinite; }
/* 有識者を呼ぶ（ヒント）。広告がある環境では「広告」と明記する */
.hint-call {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px;
  font-family: var(--gothic); font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--amber);
  border: 1px solid rgba(224, 166, 72, .55); border-radius: 3px;
}
.hint-call small { font-size: 11px; font-weight: 400; color: var(--ink); background: var(--amber); padding: 0 4px; border-radius: 2px; letter-spacing: .04em; }
.hint-call:disabled { color: var(--faint); border-color: var(--line); cursor: default; }
.chat-list {
  height: 62px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  font-size: 12.5px; line-height: 1.55;
  -webkit-mask-image: linear-gradient(transparent 0, #000 45%); mask-image: linear-gradient(transparent 0, #000 45%);
}
.chat-list p { margin: 0; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: chatin .22s ease-out; text-shadow: 0 1px 2px #000; }
.chat-list b { font-weight: 700; margin-right: 8px; color: var(--uc, #9aa39a); }
.chat-list .garbled { color: #ff6b5a; font-family: var(--mono); }
.chat-list .chat-sys { color: var(--dim); font-size: 12px; }
.chat-list .mod, .chat-list .mod b { color: var(--red-glow); }
.chat-list .mod b::before { content: "固定"; font-size: 11px; border: 1px solid currentColor; padding: 0 3px; margin-right: 5px; vertical-align: 1px; }
.chat-list .deleted { color: var(--faint); font-size: 12px; }
.chat-list .superchat { color: #fff; background: linear-gradient(90deg, rgba(224, 166, 72, .28), rgba(224, 166, 72, 0)); padding-left: 6px; }
.chat-list .expert, .chat-list .expert b { color: var(--amber); }
.chat-list .sc-amt { color: var(--amber); font-family: var(--mono); margin-right: 8px; }

/* ───── 夜：インターホン親機 ───── */
.unit {
  background: linear-gradient(180deg, #ece8de 0%, var(--plastic) 40%, #d7d2c5 100%);
  border-radius: 22px; padding: 12px 12px 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), inset 0 -2px 0 rgba(0,0,0,.08), 0 18px 40px rgba(0,0,0,.65), 0 0 0 1px #b9b4a6;
  color: var(--plastic-ink); display: flex; flex-direction: column; gap: 10px;
}
.unit-top { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.unit-top .ap { margin-left: auto; }
.unit-brand { font-family: var(--mono); font-size: 11px; letter-spacing: .3em; color: #8e897b; }
.unit-led { width: 7px; height: 7px; border-radius: 50%; background: #3fd06a; box-shadow: 0 0 6px #3fd06a; }
.unit-led.off { background: #8d887a; box-shadow: none; }
.ap { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #7d786b; letter-spacing: .06em; }
.ap-leds { display: inline-flex; gap: 4px; }
.ap-leds i { width: 7px; height: 7px; border-radius: 50%; background: #bdb7a8; box-shadow: inset 0 1px 1px rgba(0,0,0,.25); }
.ap-leds i.on { background: var(--amber); box-shadow: 0 0 5px rgba(224,166,72,.9); }
.visitor-count { font-family: var(--mono); font-size: 12px; color: var(--red); letter-spacing: .1em; }
.unit-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.key {
  display: grid; justify-items: center; align-content: center; gap: 1px; min-height: 50px; padding: 6px 2px;
  background: linear-gradient(180deg, #f5f2ea, #dcd7ca); border-radius: 10px; color: var(--plastic-ink);
  box-shadow: 0 2px 0 #a9a394, 0 3px 6px rgba(0,0,0,.25), inset 0 1px 0 #fff;
  font-weight: 700; font-size: 14px; letter-spacing: .1em; transition: transform .06s, box-shadow .06s;
}
.key small { font-size: 11px; font-weight: 400; color: #8e897b; letter-spacing: .04em; }
.key:active { transform: translateY(2px); box-shadow: 0 0 0 #a9a394, 0 1px 2px rgba(0,0,0,.25), inset 0 1px 0 #fff; }
.key:disabled { opacity: .45; cursor: not-allowed; }
.key.call { color: var(--red); }
.key-free small { color: #6f8b72; }
.unit-decide { display: grid; grid-template-columns: 1fr .82fr 1fr; gap: 8px; }
.key-big { min-height: 62px; font-family: var(--mincho); font-size: 22px; font-weight: 800; letter-spacing: .3em; }
.key-big small { font-family: var(--gothic); letter-spacing: .1em; }
.key-big::before { content: ""; width: 14px; height: 3px; border-radius: 2px; margin-bottom: 3px; }
.key-refuse::before { background: var(--red); box-shadow: 0 0 6px var(--red-glow); }
.key-open::before { background: #3fd06a; box-shadow: 0 0 6px #3fd06a; }
.key-chain { font-size: 15px; letter-spacing: .12em; color: #8a3a2c; }
.key-chain { line-height: 37px; }
.key-chain small { letter-spacing: .02em; line-height: 1.7; }
.key-chain::before { background: var(--amber); box-shadow: 0 0 6px rgba(224,166,72,.9); }

/* 親機の通話窓（訪問者の声と、自分の操作の記録）。モニターとボタンの間に置き、スクロールせずに読める */
.talk {
  flex: 1 1 0; min-height: 84px; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 7px;
  margin: 2px 2px 0; padding: 10px 12px; border-radius: 8px;
  background: #0e100f; color: #e9e5da;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.8), 0 1px 0 rgba(255,255,255,.7);
}
.talk > :first-child { margin-top: auto; }

/* モニター（親機の画面） */
.monitor {
  position: relative; aspect-ratio: 4 / 3; max-width: 100%;
  border-radius: 6px; overflow: hidden; background: #000;
  box-shadow: 0 0 0 6px #17181a, 0 0 0 7px #8f8a7c, inset 0 0 30px rgba(0,0,0,.8);
  margin: 6px auto; flex: none;
  width: min(calc(100% - 12px), calc(var(--mon-h, 34dvh) * 4 / 3));
}
.monitor.wide { width: min(calc(100% - 12px), calc(var(--mon-h, 34dvh) * 16 / 9)); }
.monitor.zooming { touch-action: none; }
.monitor.wide { aspect-ratio: 16 / 9; }
.scene { position: absolute; inset: 0; transition: transform .45s ease; filter: sepia(.25) hue-rotate(60deg) saturate(.7) contrast(1.05); }
.monitor.wide .scene, .monitor.wide.zooming .scene { filter: contrast(1.05); }
.scene svg, .scene .visitor-img { width: 100%; height: 100%; display: block; object-fit: cover; }
.scene .arrive { position: absolute; inset: 0; animation: arrive 1.6s ease-in .5s both; }
@keyframes arrive { from { opacity: 0; } }
.scene .blink-frame { position: absolute; inset: 0; opacity: 0; animation: imgblink 4.2s steps(1) infinite; }
@keyframes imgblink { 95% { opacity: 1; } 98% { opacity: 0; } }
.monitor.thermal .scene, .monitor.wide.thermal .scene { filter: none; }
.visitor-img.thermal-human { filter: grayscale(1) sepia(1) saturate(9) hue-rotate(-25deg) contrast(1.4); }
.visitor-img.thermal-cold { filter: grayscale(1) brightness(.35) sepia(1) hue-rotate(190deg) saturate(4); }
.noise { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .08; mix-blend-mode: screen; pointer-events: none; image-rendering: pixelated; }
.scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px); }
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.85) 100%); }
.osd { position: absolute; inset: 7px 10px auto; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: #f2f2ea; text-shadow: 0 0 2px #000, 0 0 4px #000; pointer-events: none; }
.osd .rec { color: var(--red-glow); }
.osd .rec::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 5px; vertical-align: 1px; animation: rec 1.4s steps(1) infinite; }
.osd-date { position: absolute; left: 10px; bottom: 7px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: rgba(242,242,234,.8); text-shadow: 0 0 3px #000; pointer-events: none; }
.monitor.blackout .scene { visibility: hidden; }
.monitor.blackout .noise { opacity: .55; }
.nosignal { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 20px; letter-spacing: .4em; color: #f2f2ea; text-shadow: 0 0 8px #000; pointer-events: none; }
.thermo-badge { position: absolute; right: 10px; bottom: 7px; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--red-glow); text-shadow: 0 0 3px #000; }
.zoom-exit { position: absolute; top: 26px; left: 10px; z-index: 2; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: #f2f2ea; background: rgba(0,0,0,.55); padding: 4px 8px; border: 1px solid rgba(242,242,234,.35); }
.monitor.zooming { cursor: zoom-in; }
.monitor.zooming .scene { filter: sepia(.25) hue-rotate(60deg) saturate(.7) contrast(1.15); }
.monitor.wide.zooming .scene { filter: contrast(1.1); }
.monitor.zooming::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(242,242,234,.25); background: radial-gradient(circle, transparent 62%, rgba(0,0,0,.55) 63%); }
.monitor.shake { animation: shake .35s linear 2; }
.blink { animation: eyeblink 4.2s infinite; transform-origin: 200px 97px; }
.jitter { animation: jitter .18s steps(2) infinite; }
.rush-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0,0,0,.6); z-index: 1; }
.rush-bar i { display: block; height: 100%; width: 100%; background: var(--red-glow); transition: width .2s linear; }
.rush-sec { position: absolute; top: 26px; right: 10px; font-family: var(--mono); font-size: 16px; letter-spacing: .1em; color: #f2f2ea; text-shadow: 0 0 4px #000; pointer-events: none; font-variant-numeric: tabular-nums; }
.rush-sec.hurry { color: var(--red-glow); animation: rec .5s steps(1) infinite; }

/* 21日目：内側の手形とヒビ */
.cracks { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.cracks svg { width: 100%; height: 100%; display: block; }
.cracks .handprint { fill: rgba(190, 215, 210, .22); stroke: rgba(230, 240, 235, .35); stroke-width: .8; animation: handin 1.2s ease-out both; }
.cracks .handprint .drip { fill: none; stroke: rgba(200, 225, 220, .4); stroke-width: 2.5; stroke-linecap: round; }
.cracks .crack path { fill: none; stroke: rgba(235, 240, 235, .75); stroke-width: 1.2; }
.cracks .crack circle { fill: rgba(235, 240, 235, .6); }
@keyframes handin { from { opacity: 0; } }

/* ───── 夜：字幕（会話ログ） ───── */
.talk p { margin: 0; animation: chatin .3s ease-out; }
.l-say { font-family: var(--mincho); font-weight: 500; font-size: 16px; line-height: 1.7; color: #f6f2e7; }
.l-me { font-size: 13px; color: #b9bcb4; }
.l-me::before { content: "あなた"; font-size: 11px; letter-spacing: .1em; color: #7f837c; margin-right: 8px; }
.l-hint { font-family: var(--mincho); font-size: 14.5px; color: var(--amber); }
.l-hint::before { content: "有識者"; font-family: var(--gothic); font-size: 11px; letter-spacing: .08em; border: 1px solid currentColor; padding: 0 4px; margin-right: 8px; vertical-align: 2px; }
.l-sys { font-size: 12.5px; color: #a3a69e; letter-spacing: .03em; line-height: 1.65; }
.l-look { font-family: var(--mincho); font-size: 14px; color: var(--amber); }

/* ───── 選択肢・確認（画面下のウィンドウ） ───── */
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .72); z-index: 20; animation: fade .2s ease-out; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(480px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--ink-2); border-top: 1px solid var(--line);
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; z-index: 21;
  animation: upsheet .22s ease-out;
}
.sheet h3 { margin: 0; font-family: var(--mincho); font-weight: 700; font-size: 18px; letter-spacing: .1em; }
.sheet h3 small { display: block; font-family: var(--gothic); font-weight: 400; font-size: 12px; color: var(--dim); letter-spacing: .04em; margin-top: 4px; }
.sheet .warn { margin: 0; font-family: var(--mincho); font-size: 14px; line-height: 1.9; color: var(--dim); }
.sheet .warn b { color: var(--red-glow); font-weight: 700; }
.choice { display: flex; flex-direction: column; }
.choice .mi { font-size: 16px; padding-block: 12px; border-bottom: 1px solid var(--line); }
.choice .mi.asked { color: var(--dim); }
.choice .mi.asked::after { content: "済"; margin-left: auto; font-family: var(--gothic); font-size: 11px; color: var(--faint); border: 1px solid var(--line); padding: 0 4px; }
.yn { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.yn button { padding: 16px 0; font-family: var(--mincho); font-weight: 700; font-size: 17px; letter-spacing: .2em; }
.yn button + button { border-left: 1px solid var(--line); }
.yn .yes { color: var(--red-glow); }
.yn .yes.ok { color: #7fe39b; }
.sheet .phone { margin-inline: -6px; }
.sheet .phone-screen { min-height: 0; }

/* ───── 判定・結果 ───── */
.result-head { padding-top: 8vh; display: grid; gap: 6px; }
.result-head span { font-family: var(--mono); font-size: 12px; letter-spacing: .3em; color: var(--dim); }
.result-head h2 { margin: 0; font-family: var(--mincho); font-weight: 800; font-size: 34px; letter-spacing: .16em; }
.res { padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; }
.res:first-of-type { border-top: 1px solid var(--line); }
.res h3 { margin: 0; font-family: var(--mincho); font-weight: 700; font-size: 18px; letter-spacing: .06em; }
.res h3 small { display: block; font-family: var(--gothic); font-weight: 400; font-size: 12px; color: var(--dim); letter-spacing: .04em; margin-top: 2px; }
.res p { margin: 0; grid-column: 1 / -1; font-family: var(--mincho); font-size: 14px; line-height: 1.9; color: #d6d1c5; }
.stamp {
  align-self: center; font-family: var(--mincho); font-weight: 800; font-size: 14px; letter-spacing: .1em;
  border: 2px solid currentColor; padding: 4px 8px 3px; transform: rotate(-6deg); color: var(--red-glow); opacity: .9;
}
.res.good .stamp { color: #d9dccf; }
.delta { grid-column: 1 / -1; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--dim); }
.delta.down { color: var(--red-glow); }

/* ───── ゲームオーバー・エンディング ───── */
.screen-over, .screen-end { justify-content: flex-start; }
.over { display: flex; flex-direction: column; gap: 22px; padding-block: 12vh 4vh; position: relative; }
.over h2 { margin: 0; font-family: var(--mincho); font-weight: 800; font-size: clamp(30px, 9.4vw, 46px); line-height: 1.35; letter-spacing: .1em; word-break: keep-all; overflow-wrap: anywhere; }
.over.dead h2 { color: var(--red-glow); }
.over-kicker { margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: .3em; color: var(--dim); }
.over-msg { margin: 0; font-family: var(--mincho); font-size: 16px; line-height: 2; color: #e2ddd0; }
.ending .over-msg { animation: textin 1.4s ease both; }
.ending .over-msg:nth-of-type(2) { animation-delay: .6s; } .ending .over-msg:nth-of-type(3) { animation-delay: 1.2s; }
.ending .over-msg:nth-of-type(4) { animation-delay: 1.8s; } .ending .over-msg:nth-of-type(5) { animation-delay: 2.4s; } .ending .over-msg:nth-of-type(6) { animation-delay: 3s; }
.over-stats { display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--dim); }
.over-stats span b { color: var(--text); font-weight: 400; }
.clues { display: grid; gap: 6px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.clues h3 { margin: 0 0 4px; font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: .3em; color: var(--dim); }
.clues p { margin: 0; font-family: var(--mincho); font-size: 14px; color: var(--faint); display: flex; gap: 10px; }
.clues p::before { content: ""; flex: none; width: 9px; height: 9px; margin-top: 8px; border: 1px solid currentColor; }
.clues p.got { color: var(--text); }
.clues p.got::before { background: var(--red); border-color: var(--red); }

/* ───── ジャンプスケア ───── */
.scare { position: fixed; inset: 0; z-index: 70; background: #000; }
.scare svg, .scare .scare-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scare.shaking svg, .scare.shaking .scare-img { animation: scarezoom 1.7s ease-out forwards, shake .09s linear infinite; }
.scare.flash::after { content: ""; position: absolute; inset: 0; animation: flash .5s steps(2) 3; pointer-events: none; }

/* ───── 切り抜き風の死亡記録 ───── */
.clip { margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.clip-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.clip-scene { position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); aspect-ratio: 4 / 3; height: 100%; }
.clip-scene.wide { aspect-ratio: 16 / 9; width: 100%; }
.clip-scene img, .clip-scene svg { width: 100%; height: 100%; display: block; object-fit: cover; filter: contrast(1.15) saturate(1.2); }
.clip-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.65) 0%, rgba(0,0,0,0) 45%); pointer-events: none; }
.clip-ring { position: absolute; border: 3px solid #ff2a2a; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.6), 0 0 12px rgba(255,42,42,.7); }
.clip-cap {
  position: absolute; left: 6%; top: 50%; transform: translateY(-50%) rotate(-4deg); z-index: 1;
  font-family: var(--gothic); font-weight: 700; font-size: clamp(16px, 6.5vw, 30px); line-height: 1.1; color: #ffe14a;
  -webkit-text-stroke: 1.5px #000; paint-order: stroke fill; text-shadow: 3px 3px 0 #000; max-width: 62%; word-break: keep-all;
}
.clip.burn .clip-cap { color: #ff5a3c; }
.clip-tag { position: absolute; left: 6px; top: 6px; z-index: 1; background: #e0141e; color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; }
.clip-len { position: absolute; right: 6px; bottom: 6px; z-index: 1; background: rgba(0,0,0,.8); color: #fff; font-family: var(--mono); font-size: 11px; padding: 1px 5px; }
.clip figcaption { display: flex; flex-direction: column; gap: 3px; }
.clip figcaption b { font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clip figcaption small { font-size: 12px; color: var(--dim); }
.clip.big figcaption b { font-size: 14px; }
.clip-new { display: flex; flex-direction: column; gap: 10px; }
.clip-new h3 { margin: 0; font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: .3em; color: var(--dim); }
.clips { display: flex; flex-direction: column; gap: 10px; }
.clip-row { display: grid; grid-auto-flow: column; grid-auto-columns: 74%; gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.clip-row .clip { scroll-snap-align: start; }
.clip-row .clip-cap { font-size: clamp(14px, 4.5vw, 22px); }

/* ───── 図鑑（怪異調書） ───── */
.file-head { padding-top: 6vh; display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.file-head h2 { margin: 0; font-family: var(--mincho); font-weight: 800; font-size: 28px; letter-spacing: .16em; }
.file-head span { font-family: var(--mono); font-size: 13px; color: var(--dim); letter-spacing: .1em; }
.sec-title { margin: 0; font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: .3em; color: var(--dim); display: flex; justify-content: space-between; }
.zukan { display: flex; flex-direction: column; }
.zk { padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 92px 1fr; gap: 4px 14px; align-items: start; }
.zk-no { margin: 0; grid-column: 1 / -1; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--faint); display: flex; justify-content: space-between; }
.zk-no span { font-family: var(--gothic); letter-spacing: .04em; color: var(--dim); }
.zk.danger .zk-no span { color: #e0776e; }
.zk-photo { grid-row: span 2; aspect-ratio: 3 / 4; overflow: hidden; background: #000; filter: grayscale(.4) contrast(1.1); }
.zk-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transform: scale(1.9); transform-origin: 50% 30%; display: block; }
.zk-photo.none { display: grid; place-items: center; font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: .2em; background: var(--ink-2); }
.zk h3 { margin: 0; font-family: var(--mincho); font-weight: 700; font-size: 17px; letter-spacing: .06em; align-self: end; }
.zk dl { margin: 0; display: grid; gap: 1px; grid-column: 2; }
.zk dt { font-size: 11px; color: var(--faint); letter-spacing: .1em; margin-top: 6px; }
.zk dd { margin: 0; font-family: var(--mincho); font-size: 13px; line-height: 1.75; color: #d6d1c5; }
.zk-count { margin: 6px 0 0; grid-column: 2; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--faint); }
.zk.locked { opacity: .5; padding: 12px 0; }
.zk.locked .zk-photo { aspect-ratio: auto; height: 28px; grid-row: auto; }
.zk.locked h3 { align-self: center; font-size: 13px; }
.zk.locked h3 { color: var(--faint); letter-spacing: .3em; }

/* ───── 設定 ───── */
.opt-head { padding-top: 6vh; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.opt-head h2 { margin: 0; font-family: var(--mincho); font-weight: 800; font-size: 28px; letter-spacing: .16em; }
.opt { display: grid; gap: 6px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.opt label { display: flex; justify-content: space-between; font-family: var(--mincho); font-weight: 700; font-size: 15px; letter-spacing: .08em; }
.opt output { font-family: var(--mono); font-weight: 400; color: var(--dim); }
.opt input[type="range"] { width: 100%; accent-color: var(--red); }
.opt p { margin: 0; font-size: 12px; color: var(--faint); line-height: 1.7; }
.opt .switch { justify-content: space-between; align-items: center; cursor: pointer; }
.opt .switch input { appearance: none; -webkit-appearance: none; width: 44px; height: 24px; border-radius: 12px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.opt .switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--dim); transition: transform .2s, background .2s; }
.opt .switch input:checked { background: var(--red); }
.opt .switch input:checked::after { transform: translateX(20px); background: #fff; }
.opt input[type="range"] { -webkit-appearance: none; appearance: none; height: 2px; background: var(--line); }
.opt input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 0; }
.opt input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 0; }

/* ───── 通知 ───── */
.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 40;
  background: rgba(10, 11, 12, .92); border-top: 1px solid var(--red); padding: 10px 18px; max-width: calc(100% - 32px);
  font-family: var(--mincho); font-size: 14px; letter-spacing: .06em; animation: up .2s ease-out; white-space: nowrap;
}
.fake-notice {
  position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  width: min(400px, calc(100% - 24px)); background: rgba(236, 236, 232, .97); color: #111;
  border-radius: 16px; padding: 10px 14px; z-index: 45; display: flex; flex-direction: column; font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5); animation: drop .3s ease-out; font-family: -apple-system, "Hiragino Sans", sans-serif;
}
.fake-notice b { font-size: 12px; color: #666; font-weight: 600; }

/* ───── 動き ───── */
@keyframes rec { 50% { opacity: .2; } }
@keyframes fade { from { opacity: 0; } }
@keyframes chatin { from { opacity: 0; transform: translateY(4px); } }
@keyframes textin { from { opacity: 0; transform: translateY(6px); } }
@keyframes up { from { transform: translate(-50%, 16px); opacity: 0; } }
@keyframes upsheet { from { transform: translate(-50%, 30px); opacity: 0; } }
@keyframes drop { from { transform: translate(-50%, -30px); opacity: 0; } }
@keyframes eyeblink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes jitter { 50% { transform: translateX(3px); } }
@keyframes shake { 25% { transform: translate(-4px, 2px); } 50% { transform: translate(3px, -3px); } 75% { transform: translate(-2px, -2px); } }
@keyframes scarezoom { from { transform: scale(.6); } to { transform: scale(1.25); } }
@keyframes flash { 0% { background: rgba(255, 255, 255, .9); } 100% { background: rgba(200, 0, 0, .5); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .blink { animation: eyeblink 4.2s infinite !important; }
  .scene .blink-frame { animation: imgblink 4.2s steps(1) infinite !important; }
  .chapter { animation: chapter 1.2s ease forwards !important; }
}
@media (max-width: 360px) {
  .key { font-size: 13px; }
  .key-big { font-size: 19px; }
}

/* ホーム画面に追加の案内 */
.title-install { align-self: flex-start; margin-top: 14px; padding: 6px 0; font-size: 12px; letter-spacing: .08em; color: var(--faint); border-bottom: 1px solid var(--line); }
.opt .install-steps { margin: 6px 0 0; padding-left: 1.4em; font-size: 12px; color: var(--dim); line-height: 1.9; }

/* 夜は画面の高さぴったりに収める（会話を読むのにスクロールしない） */
#app.screen-night {
  height: 100vh; height: 100dvh; min-height: 0; overflow-y: auto; gap: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
.screen-night .unit { flex: 1 0 auto; gap: 8px; padding: 10px 10px 12px; }
@media (max-height: 700px) { .screen-night { --mon-h: 30dvh; } }

/* タイトルの課金ボタン（広告を消す・購入を復元） */
.title-shop { display: flex; gap: 18px; margin-top: 10px; }
.title-shop button { padding: 6px 0; font-size: 12px; letter-spacing: .08em; color: var(--faint); border-bottom: 1px solid var(--line); }
.title-shop small { margin-left: 6px; font-family: var(--mono); }

/* ストア版：画面の上に広告バナー（高さは実測して --ad-banner-h に入る） */
:root { --ad-banner-h: 50px; }
body.has-ads::before { height: calc(env(safe-area-inset-top, 0px) + var(--ad-banner-h)); }
body.has-ads #app { padding-top: calc(env(safe-area-inset-top, 0px) + var(--ad-banner-h) + 4px); }
body.has-ads .stream-bar { top: calc(env(safe-area-inset-top, 0px) + var(--ad-banner-h)); }
body.has-ads .fake-notice { top: calc(10px + env(safe-area-inset-top, 0px) + var(--ad-banner-h)); }
body.has-ads .screen-night { --mon-h: 30dvh; }
body.has-ads .screen-night .chat-list { height: 42px; }
@media (max-height: 700px) { body.has-ads .screen-night { --mon-h: 25dvh; } }
/* 夜は #app 自体がスクロールするので、上部バーの貼り付き位置は #app の余白から数える（二重にずれない） */
body #app.screen-night .stream-bar { top: 0; }

/* ───── 怪異調書：ファイルの棚 ───── */
.zk-sum { display: flex; gap: 22px; font-size: 12px; color: var(--dim); letter-spacing: .08em; }
.zk-sum b { font-family: var(--mono); font-weight: 400; font-size: 18px; color: var(--text); margin: 0 4px 0 8px; }
.zk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.zk-tile {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--ink-2); border: 1px solid var(--line);
  display: flex; align-items: flex-end; padding: 8px; text-align: left; color: var(--text);
}
.zk-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 26%; transform: scale(2.3); transform-origin: 50% 26%; filter: grayscale(.35) contrast(1.1) brightness(.9); }
.zk-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(0,0,0,.85)); }
.zk-tile b { position: relative; z-index: 1; font-family: var(--mincho); font-weight: 700; font-size: 12px; line-height: 1.4; letter-spacing: .02em; }
.zk-tno { position: absolute; top: 6px; left: 7px; z-index: 1; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--dim); }
.zk-tile.real { border-color: #3d4a40; }
.zk-tile.danger { border-color: #5a2a26; }
.zk-tile.danger .zk-tno { color: #e0776e; }
.zk-tile.locked { display: grid; place-items: center; background: repeating-linear-gradient(135deg, var(--ink-2) 0 6px, #111315 6px 12px); }
.zk-q { font-family: var(--mincho); font-size: 30px; color: #2e3236; }
.zk-tile:active { transform: scale(.97); }
.screen-zukan .sheet .zk { border-bottom: 0; padding-top: 0; }

/* ───── 1日目の案内（通話窓の下の帯と、光るボタン） ───── */
.coach {
  display: grid; gap: 8px; padding: 10px 12px; border-radius: 8px;
  background: #1b1a14; border: 1px solid rgba(224, 166, 72, .6); color: #f1e6cf;
  box-shadow: 0 0 0 3px rgba(224, 166, 72, .12); animation: chatin .3s ease-out;
}
.coach p { margin: 0; font-size: 13.5px; line-height: 1.65; }
.coach-no { display: inline-block; margin-right: 8px; font-family: var(--mono); font-size: 11px; color: var(--amber); letter-spacing: .08em; }
.coach-acts { display: flex; justify-content: flex-end; gap: 14px; }
.coach-acts button { font-size: 12px; letter-spacing: .08em; color: var(--amber); padding: 4px 0; }
.coach-acts .coach-skip { color: #8f8a7c; }
.key.coach-on { animation: coach-pulse 1.3s ease-in-out infinite; position: relative; z-index: 1; }
@keyframes coach-pulse {
  0%, 100% { box-shadow: 0 2px 0 #a9a394, 0 3px 6px rgba(0,0,0,.25), inset 0 1px 0 #fff, 0 0 0 0 rgba(224,166,72,.0); }
  50% { box-shadow: 0 2px 0 #a9a394, 0 3px 6px rgba(0,0,0,.25), inset 0 1px 0 #fff, 0 0 0 4px rgba(224,166,72,.85); }
}
@media (prefers-reduced-motion: reduce) { .key.coach-on { animation: none; outline: 2px solid var(--amber); } }

/* ───── 結果：判子を1枚ずつ押す ───── */
.res { grid-template-columns: 56px 1fr auto; align-items: center; opacity: 0; animation: res-in .35s ease-out var(--d, 0s) forwards; }
.res-img { width: 56px; height: 56px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.res-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; transform: scale(2.4); transform-origin: 50% 25%; filter: grayscale(.4) contrast(1.1); }
.res .stamp { opacity: 0; animation: stamp-in .28s cubic-bezier(.2, 1.6, .4, 1) calc(var(--d, 0s) + .18s) forwards; }
.res .delta { grid-column: 1 / -1; }
.res-viewers { margin: 10px 0 0; display: flex; align-items: baseline; gap: 10px; font-size: 12px; color: var(--dim); letter-spacing: .08em; }
.res-viewers b { font-family: var(--mono); font-weight: 400; font-size: 30px; color: var(--text); letter-spacing: .02em; }
.res-viewers em { font-style: normal; font-family: var(--mono); font-size: 14px; }
.res-viewers em.up { color: #7fc48d; }
.res-viewers em.down { color: var(--red-glow); }
.res-go { opacity: 0; animation: res-in .3s ease-out var(--d, 0s) forwards; }
@keyframes res-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes stamp-in { from { opacity: 0; transform: scale(2.2) rotate(-14deg); } to { opacity: 1; transform: rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .res, .res .stamp, .res-go { animation: none; opacity: 1; } }

/* ───── 夜：モニターを主役に（親機を画面の端まで広げ、ボタンを詰める） ───── */
.screen-night .unit { margin-inline: -10px; padding: 8px 8px 10px; gap: 7px; border-radius: 18px; }
.screen-night .monitor { margin: 4px auto; width: min(calc(100% - 8px), calc(var(--mon-h, 36dvh) * 4 / 3)); }
.screen-night .monitor.wide { width: min(calc(100% - 8px), calc(var(--mon-h, 36dvh) * 16 / 9)); }
.screen-night .key { min-height: 46px; padding: 5px 2px; }
.screen-night .key-big { min-height: 56px; }
.screen-night .talk { min-height: 96px; }


/* ───── モニターの「生きている」感じ ───── */
/* 人物のまわりだけ、ゆっくり呼吸する（同じ画像を重ね、周りはぼかして継ぎ目を消す） */
.scene .breathe {
  position: absolute; inset: 0; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 20% 46% at 50% 50%, #000 65%, transparent 100%);
  mask-image: radial-gradient(ellipse 20% 46% at 50% 50%, #000 65%, transparent 100%);
  transform-origin: 50% 90%; animation: breathe-v 4.8s ease-in-out infinite;
}
.scene .breathe .visitor-img { position: absolute; inset: 0; }
@keyframes breathe-v { 0%, 100% { transform: none; } 45% { transform: scale(1.003, 1.008); } }
/* 廊下の蛍光灯が、ときどき瞬く */
.lamp { position: absolute; inset: 0; pointer-events: none; background: #000; opacity: 0; animation: lamp 9.7s steps(1) infinite; }
@keyframes lamp { 0%, 58% { opacity: 0; } 58.6% { opacity: .3; } 59.2% { opacity: 0; } 59.8% { opacity: .18; } 60.4%, 100% { opacity: 0; } }
/* 監視カメラの走査線のゆらぎ */
.roll { position: absolute; left: 0; right: 0; top: -20%; height: 16%; pointer-events: none; background: linear-gradient(transparent, rgba(235, 245, 235, .05), transparent); animation: roll 7.5s linear infinite; }
@keyframes roll { to { top: 110%; } }
.monitor.blackout .lamp, .monitor.blackout .roll, .monitor.thermal .lamp { display: none; }
@media (prefers-reduced-motion: reduce) { .scene .breathe, .lamp, .roll { animation: none; } .lamp, .roll { display: none; } }
