* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: var(--app-h);   /* 100% / 100vh ではなく、本当に見えている高さ（スマホのアドレスバーの分ずれない。mobile-guard） */
  background: #000;
  color: #eee;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
}
button { font-family: inherit; cursor: pointer; }

#stage {
  position: relative;
  width: min(var(--app-w), calc(var(--app-h) * 16 / 9));
  height: min(var(--app-h), calc(var(--app-w) * 9 / 16));
  margin: 0 auto;
  top: 50%;
  transform: translateY(-50%);
  overflow: hidden;
  user-select: none;
  touch-action: manipulation;   /* タップで進める。2回タップで拡大しない */
}

/* ---------- 背景（仮） ---------- */
.bg { position: absolute; inset: 0; transition: background 0.8s; background-size: cover; background-position: center; }

/* 場面写真（画面いっぱい、切り替え時にふわっと入れ替える） */
#shot { position: absolute; inset: 0; pointer-events: none; }
#shot img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 0.6s;
}
#shot img.on { opacity: 1; animation: kenburns 26s ease-in-out infinite alternate; }

/* ---------- 画面の動き ---------- */
#view { position: absolute; inset: 0; overflow: hidden; }
#cam { position: absolute; inset: 0; }
.bg.drift { animation: kenburns 30s ease-in-out infinite alternate; }
@keyframes kenburns {
  from { transform: scale(1.0) translate(0, 0); }
  to   { transform: scale(1.07) translate(-1.2%, -0.8%); }
}

#view.shake { animation: shake 0.35s linear; }
#view.quake { animation: quake 0.8s linear; }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-1.2%, 0.6%); }
  40% { transform: translate(1%, -0.8%); }
  60% { transform: translate(-0.8%, 0.4%); }
  80% { transform: translate(0.5%, -0.3%); }
}
@keyframes quake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  10% { transform: translate(-2.5%, 1.5%) rotate(-0.6deg); }
  25% { transform: translate(2.2%, -1.8%) rotate(0.5deg); }
  40% { transform: translate(-2%, 1%) rotate(-0.4deg); }
  55% { transform: translate(1.6%, -1%) rotate(0.3deg); }
  70% { transform: translate(-1%, 0.6%); }
  85% { transform: translate(0.5%, -0.3%); }
}
#cam.zoom { animation: zoompunch 0.9s cubic-bezier(.2,.9,.3,1) forwards; }
@keyframes zoompunch {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); }
  100% { transform: scale(1.12); }
}
#cam.zoomout { animation: zoomback 0.6s ease-out forwards; }
#cam.zoomto { transform-origin: 0 0; animation: zoomto 1.1s cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes zoomto {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(var(--tx), var(--ty)) scale(var(--s)); }
}
@keyframes zoomback { from { transform: scale(1.12); } to { transform: scale(1); } }

#flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 3; }
#flash.white { background: #fff; animation: flash 0.5s ease-out; }
#flash.red { background: #b00010; animation: flash 0.7s ease-out; }
#flash.black { background: #000; animation: blackout 1.6s ease-in-out; }
@keyframes flash { 0% { opacity: 0.9; } 100% { opacity: 0; } }
@keyframes blackout { 0% { opacity: 0; } 40%, 60% { opacity: 1; } 100% { opacity: 0; } }

/* ピンクの画面（ボノボ流の「挨拶」の場面） */
#pink {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden;
  background: radial-gradient(ellipse at center, rgba(255,120,190,0.25) 0%, rgba(255,60,150,0.55) 70%, rgba(180,0,90,0.75) 100%);
  opacity: 0; transition: opacity 1.8s;
}
#stage.pinkmode #pink { opacity: 1; animation: pinkpulse 2.8s ease-in-out infinite alternate; }
#stage.pinkmode #cam { filter: blur(3px) saturate(1.4) brightness(1.08); transition: filter 1.8s; }
#cam { transition: filter 1.2s; }
@keyframes pinkpulse { from { filter: brightness(1); } to { filter: brightness(1.18); } }
#pink span {
  position: absolute; bottom: -10%; color: rgba(255,230,245,0.85);
  font-size: clamp(18px, 4vw, 44px); text-shadow: 0 0 12px rgba(255,80,170,0.9);
  opacity: 0;
}
#stage.pinkmode #pink span { animation: heartup 6s linear infinite; }
#pink span:nth-child(1) { left: 8%;  animation-delay: 0s; }
#pink span:nth-child(2) { left: 22%; animation-delay: 1.7s; font-size: clamp(12px, 2.5vw, 28px); }
#pink span:nth-child(3) { left: 37%; animation-delay: 3.1s; }
#pink span:nth-child(4) { left: 52%; animation-delay: 0.9s; font-size: clamp(14px, 3vw, 34px); }
#pink span:nth-child(5) { left: 66%; animation-delay: 2.4s; }
#pink span:nth-child(6) { left: 80%; animation-delay: 4.2s; font-size: clamp(12px, 2.5vw, 28px); }
#pink span:nth-child(7) { left: 92%; animation-delay: 1.2s; }
@keyframes heartup {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-120vh) scale(1.2) rotate(15deg); opacity: 0; }
}
.bg-black { background: #000; }
.bg-jungle-morning { background: linear-gradient(#a9d695, #3f7d45 55%, #1b3d22); }
.bg-jungle-noon { background: linear-gradient(#eef3b0, #5c9640 50%, #24481f); }
.bg-jungle-night { background: linear-gradient(#08142a, #0d2416 70%, #040a05); }
.bg-river-dawn { background: linear-gradient(#f6b98d, #c98a7a 35%, #3d6b6b 62%, #1f3a2e); }
.bg-kabukicho { background: radial-gradient(circle at 30% 30%, #ff2fa0 0, transparent 25%), radial-gradient(circle at 75% 40%, #2fd0ff 0, transparent 20%), linear-gradient(#1a0826, #3a0f4a 50%, #0a0a12); }
.bg-travel-agency { background: linear-gradient(#eef2f5, #b8c4cc); }
.bg-hotel-lounge { background: radial-gradient(circle at 70% 25%, #f3e2b8 0, transparent 35%), linear-gradient(#3a3226, #6b5a40 55%, #1e1912); }
.bg-hospital { background: radial-gradient(circle at 50% 30%, #d9f0ee 0, transparent 30%), linear-gradient(#1b2628, #2f4446 55%, #0c1213); }
.bg-club { background: radial-gradient(circle at 50% 20%, #d8b25a 0, transparent 30%), linear-gradient(#120a14, #2a1530 55%, #08050a); }
.bg-flashback-club { background: radial-gradient(circle at 50% 30%, #c89a3a 0, transparent 40%), linear-gradient(#2a1a08, #5a3a10 50%, #1a0f05); filter: sepia(0.6); }
#bg-label {
  position: absolute; top: 8px; right: 12px;
  font-size: 12px; color: rgba(255,255,255,0.55);
  text-shadow: 0 0 4px #000;
}

/* ---------- 上：日付の焼き込み＋メニュー ---------- */
#hud {
  position: absolute; top: 2.5%; left: 3%; right: 3%;
  display: flex; justify-content: space-between; align-items: center;
  z-index: 5; pointer-events: none;
}
#hud[hidden] { display: none; }
#hud > * { pointer-events: auto; }
/* フィルムカメラが写真の隅に焼き込む、橙色の日付 */
#hud-time {
  font-family: "OCR A Std", "Consolas", "Courier New", monospace;
  font-size: clamp(13px, 1.8vw, 18px); letter-spacing: 0.18em;
  color: #ff9b3d;
  text-shadow: 0 0 6px rgba(255, 110, 0, 0.75), 0 0 1px #7a2a00;
  opacity: 0.92;
}
/* 明るい写真の上でも見えるように、黒い丸を敷く */
#btn-menu {
  width: clamp(32px, 4vw, 42px); height: clamp(32px, 4vw, 42px);
  border-radius: 50%; border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.62); color: #fff;
  font-size: clamp(16px, 2vw, 21px); line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
#btn-menu:hover { background: rgba(0,0,0,0.8); border-color: rgba(240,198,116,0.7); }

#menu {
  position: absolute; top: 9%; right: 3%; z-index: 9;
  width: min(260px, 60%);
  background: rgba(8, 10, 8, 0.94); border: 1px solid #444; border-radius: 6px;
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
  font-size: 13px; animation: fadein 0.2s;
}
#menu[hidden] { display: none; }
.meter { display: flex; align-items: center; gap: 8px; }
.m-label { width: 4.5em; }
.m-bar { flex: 1; height: 6px; background: #333; border-radius: 3px; overflow: hidden; }
.m-fill { height: 100%; transition: width 0.4s; }
.m-fill.pride { background: #d9a441; }
.m-fill.trust { background: #6fbf73; }
.m-val { width: 2.2em; text-align: right; font-variant-numeric: tabular-nums; }
.menu-note { font-size: 11px; opacity: 0.5; margin: -2px 0 4px; }
.menu-btn {
  background: none; color: #eee; text-align: left;
  border: none; border-left: 2px solid #555; padding: 6px 10px; font-size: 14px;
}
.menu-btn:hover { border-left-color: #f0c674; background: rgba(255,255,255,0.05); }

/* ---------- 立ち絵（仮） ---------- */
#chars {
  position: absolute; left: 0; right: 0; top: 10%; bottom: 30%; z-index: 1;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  pointer-events: none;
}
.slot { display: flex; align-items: flex-end; justify-content: center; }
.portrait {
  width: 72%; height: 92%;
  border: 2px dashed rgba(255,255,255,0.6);
  border-radius: 10px;
  background: rgba(0,0,0,0.45);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 10px;
  animation: fadein 0.4s;
}
.portrait.bonobo { border-color: rgba(150,220,150,0.7); }
.portrait.human { border-color: rgba(230,180,120,0.7); }
.p-kind { font-size: 12px; opacity: 0.7; }
.p-name { font-size: 22px; font-weight: bold; margin: 6px 0; }
.p-desc { font-size: 13px; line-height: 1.5; opacity: 0.9; }
.p-note { font-size: 11px; opacity: 0.5; margin-top: 10px; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 下：字幕のような帯 ---------- */
#textbox {
  position: absolute; left: 0; right: 0; bottom: 0; height: 32%;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.78) 50%, rgba(0,0,0,0) 100%);
  display: flex; align-items: flex-end; gap: clamp(12px, 2.5vw, 28px);
  padding: 0 8% 3.2%;
  z-index: 4;
  animation: fadein 0.25s;
}
#textbox[hidden] { display: none; }
/* ポラロイド風の顔写真 */
#face {
  flex: 0 0 auto; width: clamp(64px, 10%, 112px);
  background: #f2efe6; padding: 4px 4px 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.6);
  transform: rotate(-3deg); margin-bottom: 2px;
}
#face.off, #face.other { display: none; }
#face-img {
  aspect-ratio: 1;
  background-size: 750%; background-position: 51% 24%;
  filter: sepia(0.15) contrast(1.05);
  transition: background-image 0.5s;
}
#tb-main { flex: 1; min-width: 0; padding-bottom: 2px; }
#name {
  display: inline-block; min-height: 1.3em; margin-bottom: 6px; padding-bottom: 2px;
  font-size: clamp(12px, 1.6vw, 15px); letter-spacing: 0.15em; color: #f0c674;
  border-bottom: 1px solid rgba(240,198,116,0.45);
}
#name:empty { border-bottom-color: transparent; }
#text {
  font-size: clamp(15px, 2.25vw, 21px); line-height: 1.85; white-space: pre-wrap;
  min-height: 3.7em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}
#text.thought { color: #bcd9f5; }
/* 次へ進める合図：小さな三角 */
#next, #pic-hint {
  position: absolute; right: 4%; bottom: 4%;
  width: 0; height: 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 9px solid rgba(255,255,255,0.85);
  animation: nudge 1s ease-in-out infinite;
}
@keyframes nudge { 50% { transform: translateY(4px); opacity: 0.5; } }
@keyframes blink { 50% { opacity: 0.2; } }

/* 新しい写真が出た直後：文字を出さずに絵だけ見せる */
#pic-hint { z-index: 4; display: none; filter: drop-shadow(0 0 3px #000); }
#stage.picmode #pic-hint { display: block; }

/* 右クリック / H：文字を全部消して写真を眺める */
#stage.peek #textbox, #stage.peek #choices, #stage.peek #hud, #stage.peek #menu,
#stage.peek #pic-hint, #stage.peek #toasts { visibility: hidden; }

/* ---------- 選択肢 ---------- */
#choices {
  position: absolute; left: 14%; right: 14%; top: 22%;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 6;
}
.choice {
  display: flex; align-items: center; gap: 10px;
  text-align: left; color: #eee;
  background: linear-gradient(90deg, rgba(0,0,0,0.78), rgba(0,0,0,0.5) 70%, rgba(0,0,0,0.15));
  border: none; border-left: 2px solid rgba(255,255,255,0.45); border-radius: 0;
  padding: 11px 16px;
  font-size: clamp(14px, 1.9vw, 17px);
  text-shadow: 0 1px 2px #000;
  animation: fadein 0.3s;
}
.choice:hover { border-left-color: #f0c674; background: linear-gradient(90deg, rgba(40,32,10,0.9), rgba(0,0,0,0.6) 70%, rgba(0,0,0,0.2)); }
.c-num { opacity: 0.5; font-size: 12px; }
/* 前の周回で選んだことのある選択肢 */
.choice.picked { color: #bbb; }
.c-done { margin-left: 4px; color: #f0c674; font-size: 13px; opacity: 0.85; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 10px; white-space: nowrap; }
.tag-人間 { background: #7a2e2e; }
.tag-ボノボ { background: #2e6b35; }
.tag-ホスト { background: #7a6420; }
.tag-レン流 { background: #6a2a5e; }
.tag-素直 { background: #2a4f7a; }

/* ---------- カード（タイトル・自主規制） ---------- */
#card {
  position: absolute; inset: 0; z-index: 7;
  display: flex; align-items: center; justify-content: center;
  background: #000; text-align: center; padding: 0 10%;
  font-size: clamp(28px, 6vw, 64px); letter-spacing: 0.2em;
  animation: fadein 1s;
}
#card[hidden] { display: none; }
#card.censor {
  font-size: clamp(14px, 2.2vw, 20px); letter-spacing: 0.05em;
  background: radial-gradient(circle, #fff 0, #ffe0f0 25%, #ff9fd0 50%, #e0408f 80%);
  color: #5a0030;
  animation: glow 1.2s ease-in-out infinite alternate;
}
@keyframes glow { from { filter: brightness(1); } to { filter: brightness(1.15); } }

/* ---------- オーバーレイ（ミニゲーム） ---------- */
#overlay, #modal, #end {
  position: absolute; inset: 0; z-index: 8;
  background: rgba(0,0,0,0.78);
  display: flex; align-items: center; justify-content: center;
}
#overlay[hidden], #modal[hidden], #end[hidden] { display: none; }
.mini, .panel {
  background: #10140f; border: 1px solid #555; border-radius: 10px;
  padding: 18px 22px; width: min(92%, 640px); max-height: 92%; overflow: auto;
  text-align: center;
}
.mini h2, .panel h2 { margin: 0 0 6px; letter-spacing: 0.15em; }
.mini-help { font-size: 13px; opacity: 0.8; margin: 4px 0 12px; }
.mini button, .panel button, #end button {
  background: #2a3a28; color: #eee; border: 1px solid #7a9a76;
  border-radius: 6px; padding: 8px 18px; font-size: 15px; margin: 6px;
}
.mini button:hover, .panel button:hover, #end button:hover { background: #3a5236; }
.mini button:disabled { opacity: 0.35; cursor: default; }

/* 毛づくろい */
.g-bar { position: relative; height: 26px; background: #2a2a2a; border-radius: 13px; margin: 16px 0; overflow: hidden; }
.g-zone { position: absolute; top: 0; bottom: 0; background: rgba(240,200,90,0.75); box-shadow: 0 0 12px #f0c85a; }
.g-marker { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; background: #fff; }
.g-round { font-size: 13px; opacity: 0.8; }
.g-msg { min-height: 3em; margin: 8px 0; line-height: 1.5; }

/* TIPS */
.tip {
  color: #ffcf6e; text-decoration: underline dotted; text-underline-offset: 4px;
  cursor: pointer;
}
.tip:hover { color: #ffe4ab; }
.panel h3 { margin: 8px 0; color: #ffcf6e; }
.tip-body { line-height: 1.8; }
.tip-link { color: #ffcf6e; }
.toast.tipnew { border-color: #ffcf6e; color: #ffe4ab; }
/* 押せる知らせ（TIPS）。右の › で「押すと開く」と分かるように */
.toast.click { pointer-events: auto; cursor: pointer; font-family: inherit; animation-duration: 4.9s; }
.toast.click::after { content: " ›"; opacity: 0.7; }
.toast.click:hover { background: rgba(30,24,10,0.9); }

/* 容疑者メモ */
.panel:has(.sus-grid) { width: min(96%, 980px); }
.sus-lead { text-align: center; opacity: 0.7; margin: 0 0 12px; }
.sus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sus-card {
  background: #0b0f0a; border: 1px solid #333; border-radius: 6px; padding: 8px;
  font-size: 12px; line-height: 1.5;
}
.sus-photo {
  aspect-ratio: 1; border-radius: 4px; margin-bottom: 6px;
  position: relative; overflow: hidden; background: #000;
}
.sus-img { position: absolute; inset: 0; filter: grayscale(0.85) brightness(0.75); }
.sus-card.got .sus-img { filter: none; }
/* まだ浮かび上がっていない人：暗くぼやけた影に「？」 */
.sus-card.hidden .sus-img { inset: -10px; filter: grayscale(1) brightness(0.22) blur(5px); }
.sus-q {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 54px; font-weight: bold; color: rgba(255,255,255,0.85);
}
.sus-card.hidden .sus-name { opacity: 0.6; }
.sus-card.got { border-color: #b8873a; }
.sus-name { font-size: 15px; font-weight: bold; }
.sus-role { opacity: 0.7; margin-bottom: 4px; }
.sus-about { opacity: 0.85; }
.sus-note { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #444; opacity: 0.6; }
.sus-card.got .sus-note { opacity: 1; color: #ffcf6e; }
.sus-lie { margin-top: 6px; font-size: 0.92em; color: #9fc3e8; }   /* ユウトが東京で聞いた言葉（嘘かもしれない） */

/* パネル */
.panel { text-align: left; }
.panel h2 { text-align: center; }
.panel ul { padding-left: 1.2em; line-height: 1.7; }
.panel .muted { opacity: 0.5; }
.panel .close-row { text-align: center; }

/* ログ（画面全体を覆う） */
#backlog {
  position: absolute; inset: 0; z-index: 12; display: flex; flex-direction: column;
  background: rgba(4, 6, 4, 0.9); animation: fadein 0.2s;
}
.bl-head { padding: 16px 8% 8px; font-size: 13px; letter-spacing: 0.4em; color: #ff9b3d; }
.bl-close {
  position: absolute; top: 10px; right: 14px; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.3); color: #eee; font-size: 22px; line-height: 1;
}
.bl-close:hover { border-color: #f0c674; color: #f0c674; }
.bl-list { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 4px 8% 28px; }
.bl-list li { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.07); font-size: clamp(15px, 2vw, 19px); line-height: 1.75; }
.bl-list .log-name { font-size: 12px; margin-bottom: 2px; }
.bl-list .log-sep { font-size: 12px; border-bottom: none; padding-top: 18px; }

/* ログ */
.panel .log-list { list-style: none; padding: 0 6px 0 0; margin: 8px 0 12px; max-height: 52vh; overflow-y: auto; line-height: 1.7; }
.log-list li { padding: 7px 0; border-bottom: 1px dashed #2c332a; }
.log-name { font-size: 12px; color: #ff9b3d; letter-spacing: 0.1em; }
.log-text.thought { color: #bcd9f5; }
.log-pick { color: #f0c674; }
.log-sep { text-align: center; font-size: 12px; opacity: 0.55; letter-spacing: 0.1em; }

/* エンディング */
#modal { z-index: 11; }   /* エンディング画面やタイトルの上にも開けるように */
#end { background: rgba(0,0,0,0.82); animation: fadein 1.2s; }
.end-card { text-align: center; padding: 0 8%; max-width: 760px; }
.end-no {
  font-family: "OCR A Std", "Consolas", "Courier New", monospace;
  color: #ff9b3d; letter-spacing: 0.3em; font-size: clamp(12px, 1.6vw, 15px);
  text-shadow: 0 0 6px rgba(255,110,0,0.6);
}
.end-name { font-size: clamp(26px, 5vw, 46px); letter-spacing: 0.12em; margin: 14px 0 18px; }
.end-text { line-height: 1.9; font-size: clamp(14px, 2vw, 18px); opacity: 0.9; }
.end-mark { margin: 26px 0 10px; letter-spacing: 0.3em; font-size: clamp(13px, 1.8vw, 16px); opacity: 0.8; }
#end.bad .end-mark {
  color: #f0c674; letter-spacing: 0.15em; font-style: italic;
  font-size: clamp(16px, 2.4vw, 22px);
}
.end-note { font-size: 13px; opacity: 0.6; }
.end-stats { font-size: 12px; opacity: 0.5; margin: 18px 0 14px; }
#end .end-btns button {
  background: none; color: #eee; border: 1px solid rgba(255,255,255,0.35);
  border-radius: 3px; padding: 8px 16px; margin: 4px; font-size: 14px;
}
#end .end-btns button:hover { border-color: #f0c674; color: #f0c674; }

/* スタッフロール */
#end.rolling { background: #000; }
.credits { position: absolute; inset: 0; overflow: hidden; }
.credits-inner {
  position: absolute; left: 0; right: 0; top: 100%;
  text-align: center; animation: roll 30s linear forwards;
}
@keyframes roll { to { transform: translateY(calc(-100% - var(--app-h))); } }
.cr-item { margin: 0 0 9vh; }
.cr-role { font-size: clamp(11px, 1.4vw, 13px); opacity: 0.55; letter-spacing: 0.2em; margin-bottom: 6px; }
.cr-name { font-size: clamp(14px, 2vw, 19px); line-height: 1.7; }

/* エンディング一覧 */
.end-list { list-style: none; padding: 0; }
.end-list li { padding: 6px 0; border-bottom: 1px dashed #333; }
.el-no { font-family: "Consolas", "Courier New", monospace; color: #ff9b3d; margin-right: 12px; }
.el-bad { font-size: 11px; margin-left: 8px; padding: 1px 6px; border: 1px solid #7a2e2e; color: #e08a8a; border-radius: 3px; }

/* エンディング一覧のフローチャート：通った道は実線、まだの道は点線の ？？？ */
.flow { position: relative; padding-left: 14px; border-left: 2px solid #ff9b3d55; margin: 8px 0 4px; }
.fl-node { position: relative; margin: 0 0 16px; }
.fl-node::before { content: ""; position: absolute; left: -21px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: #ff9b3d; }
.fl-node.q::before { background: #444; }
.fl-when { font-size: 11px; letter-spacing: 0.15em; color: #ff9b3d; opacity: 0.85; }
.fl-title { font-size: 14px; margin: 2px 0 6px; }
.fl-node.q .fl-title { opacity: 0.4; }
.fl-opts { padding-left: 16px; border-left: 1px solid #555; }
.fl-opt { position: relative; padding: 3px 0; }
.fl-opt::before { content: ""; position: absolute; left: -16px; top: 15px; width: 13px; border-top: 1px dashed #555; }
.fl-opt.on::before { border-top: 2px solid #ff9b3d; }
.fl-box { display: inline-block; padding: 4px 10px; border: 1px solid rgba(255,255,255,0.35); border-radius: 3px; font-size: 13px; line-height: 1.5; }
.fl-box.q { border-style: dashed; border-color: #555; color: #777; }
.fl-sub { margin: 6px 0 4px 18px; }
.fl-sub .fl-title { font-size: 12px; opacity: 0.7; }
.fl-end .el-no { margin-right: 6px; }
.fl-end.bad { color: #e08a8a; }
.fl-end.q { color: #777; }

/* スマホの画面（トークとロック画面の通知） */
#card.phone { padding: 0; letter-spacing: 0; font-size: 14px; text-align: left; background: rgba(0,0,0,0.62); backdrop-filter: blur(3px); animation: fadein 0.4s; }
.ph {
  position: relative; display: flex; flex-direction: column;
  height: min(94%, 680px); aspect-ratio: 9 / 16.5; max-width: 92%;
  font-family: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;   /* スマホの中はゴシック（地の文の明朝と分ける） */
  background: #12151b; border: 6px solid #2a2a2e; border-radius: 30px; overflow: hidden;
  box-shadow: 0 0 0 1px #555, 0 18px 50px rgba(0,0,0,0.8);
}
.ph::before { content: ""; position: absolute; top: 7px; left: 50%; width: 70px; height: 18px; margin-left: -35px; background: #000; border-radius: 10px; z-index: 2; }
.ph-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 18px 4px; font-size: 11px; color: #ddd; min-height: 26px; }
.ph-bat { width: 20px; height: 10px; border: 1px solid #ccc; border-radius: 2px; padding: 1px; }
.ph-bat i { display: block; height: 100%; width: 70%; background: #ccc; }
.ph-bat.low { border-color: #e05a4a; }
.ph-bat.low i { width: 10%; background: #e05a4a; }
.ph-head { display: flex; align-items: center; gap: 10px; padding: 6px 12px 8px; border-bottom: 1px solid #262a33; background: #181c24; }
.ph-head b { display: block; font-size: 15px; color: #f2f2f2; }
.ph-head small { display: block; font-size: 10px; color: #8a8f99; margin-top: 1px; }
.ph-back { font-size: 24px; line-height: 1; color: #8a8f99; }
.ph-talk { flex: 1; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; position: relative; padding: 12px 10px; background: #1d2330; }
.ph-day { align-self: center; font-size: 10px; color: #cfd3da; background: rgba(0,0,0,0.3); padding: 2px 10px; border-radius: 10px; }
.ph-row { display: flex; align-items: flex-end; gap: 6px; }
.ph-row.out { justify-content: flex-end; }
.ph-msg { max-width: 88%; padding: 7px 10px; border-radius: 16px; line-height: 1.5; font-size: 12.5px; word-break: break-word; }
.ph-row.in .ph-msg { background: #f1f1f1; color: #111; border-bottom-left-radius: 4px; }
.ph-row.out .ph-msg { background: #79d16a; color: #0d1f0a; border-bottom-right-radius: 4px; }
.ph-meta { font-size: 9px; color: #9aa0aa; line-height: 1.3; white-space: nowrap; }
.ph-row.out .ph-meta { text-align: right; }
.ph-divider { align-self: stretch; text-align: center; font-size: 10px; color: #cfd3da; border-top: 1px solid #3a4150; padding-top: 4px; margin-top: 2px; }
.ph-talk .old { filter: blur(3px); opacity: 0.35; }
.ph-scroll { display: flex; flex-direction: column; gap: 10px; }
.ph-below { align-self: center; font-size: 12px; color: #fff; background: rgba(255,255,255,0.18); width: 26px; height: 26px; line-height: 26px; text-align: center; border-radius: 50%; }
.ph-input { margin: 8px 10px 14px; padding: 7px 12px; border-radius: 16px; background: #262b36; font-size: 11px; color: #6c7280; }
.ph.lock { background: radial-gradient(ellipse at 50% 20%, #2b3550, #0c0e14 75%); }
.ph-clock { text-align: center; font-size: 54px; font-weight: 200; color: #f4f4f4; margin: 28px 0 22px; letter-spacing: 0.02em; }
.ph-notice { margin: 0 10px; padding: 10px 12px; border-radius: 14px; background: rgba(235,238,245,0.16); color: #f2f2f2; font-size: 12px; line-height: 1.5; backdrop-filter: blur(6px); }
.ph-notice b { display: block; font-size: 13px; margin-bottom: 2px; }
.ph-app { display: flex; justify-content: space-between; font-size: 10px; color: #c7ccd6; margin-bottom: 4px; letter-spacing: 0.05em; }

/* スマホの写真ビューア（横向き。字幕の上に出したまま文章を送る） */
#photobox { position: absolute; left: 0; right: 0; top: 4%; height: 62%; z-index: 3; display: flex; justify-content: center; pointer-events: none; animation: fadein 0.5s; }
.pv {
  position: relative; height: 100%; aspect-ratio: 2 / 1; max-width: 88%; overflow: hidden;
  background: #000; border: 6px solid #2a2a2e; border-radius: 26px;
  box-shadow: 0 0 0 1px #555, 0 18px 50px rgba(0,0,0,0.8);
  font-family: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;
}
.pv-img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.pv-bar { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 6px 16px; color: #ddd; font-size: 18px; background: linear-gradient(rgba(0,0,0,0.55), transparent); }
.pv-zoom { position: absolute; right: 3%; top: 10%; height: 56%; aspect-ratio: 1; border: 3px solid #f2f2f2; border-radius: 6px; overflow: hidden; box-shadow: 0 6px 24px rgba(0,0,0,0.7); background: #111; }
.pv-zoom[hidden], .pv-spot[hidden] { display: none; }
.pv-spot { position: absolute; border: 2px solid rgba(255,255,255,0.9); border-radius: 3px; box-shadow: 0 0 0 9999px rgba(0,0,0,0.25); animation: fadein 0.3s; }
.pv-zoom.pop { animation: pvpop 0.35s ease-out; }
@keyframes pvpop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pv-zoom-face { width: 100%; height: 100%; background-repeat: no-repeat; }
.pv-zoom-face, .pv-thumb { filter: brightness(0.72) contrast(1.08) saturate(0.7) sepia(0.18); }   /* 夜の店の写真から引き伸ばしたように */
.pv-spot { transition: left 0.35s, top 0.35s, width 0.35s, height 0.35s; }
.pv-zoom-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 0; text-align: center; font-size: 13px; color: #fff; background: rgba(0,0,0,0.6); }
.pv-strip { position: absolute; left: 4%; bottom: 6%; display: flex; gap: 6px; }
.pv-thumb { width: 44px; height: 44px; border: 2px solid #f2f2f2; border-radius: 4px; background-repeat: no-repeat; box-shadow: 0 2px 8px rgba(0,0,0,0.7); }
.pv.all .pv-strip { left: 50%; transform: translateX(-50%); bottom: 8%; gap: 10px; }
.pv.all .pv-thumb { width: 76px; height: 76px; }
#stage.peek #photobox, #stage.picmode #photobox { display: none; }

/* 知らない番号からのメッセージ（カード） */
#card.message {
  font-size: clamp(14px, 2.2vw, 20px); letter-spacing: 0.05em; white-space: pre-wrap;
  background: #000;
}
#card.message::before {
  content: ""; position: absolute; width: min(70%, 420px); height: 40%;
  border-radius: 14px; background: rgba(40,40,46,0.95); border: 1px solid #555;
  z-index: -1;
}

/* 森と東京の切り替え（場所と、誰の話か） */
#card.zap {
  font-size: clamp(18px, 3vw, 30px); letter-spacing: 0.35em; line-height: 1.8; white-space: pre-wrap;
  background: #000;
}

/* タイトルのエンディング一覧ボタン */
.t-sub-btn {
  background: none; border: none; color: rgba(255,255,255,0.6);
  font-size: 13px; letter-spacing: 0.2em; text-decoration: underline; text-underline-offset: 4px;
}
.t-sub-btn:hover { color: #fff; }

/* ---------- トースト ---------- */
#toasts {
  position: absolute; right: 12px; top: 48px; z-index: 9;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  background: rgba(0,0,0,0.8); border: 1px solid #666; border-radius: 4px;
  padding: 4px 10px; font-size: 13px;
  animation: toast 2.4s forwards;
}
.toast.up { border-color: #6fbf73; color: #bfe8c1; }
.toast.down { border-color: #d9534f; color: #f4b6b4; }
.toast.info { border-color: #f0c674; color: #f7e2b0; }
@keyframes toast { 0% { opacity: 0; transform: translateX(10px); } 10%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
/* 容疑者メモが増えた知らせ：顔写真と名前。押すとその人のメモへ */
.toast.memo {
  pointer-events: auto; cursor: pointer;
  display: flex; align-items: center; gap: 9px; padding: 6px 12px 6px 6px;
  border-color: #b98a3e; color: #eee; font-family: inherit; text-align: left;
  animation: toast 4.9s forwards;
}
.toast.memo:hover { border-color: #f0c674; background: rgba(30,24,10,0.9); }
.mt-photo { position: relative; width: 42px; height: 42px; flex: none; overflow: hidden; border-radius: 3px; border: 1px solid #555; }
.mt-photo .sus-img { position: absolute; inset: 0; filter: grayscale(0.85) brightness(0.85); }
.toast.memo.got .mt-photo .sus-img { filter: none; }
.mt-body { display: flex; flex-direction: column; line-height: 1.35; }
.mt-head { font-size: 10px; letter-spacing: 0.15em; color: #f0c674; }
.mt-body b { font-size: 14px; font-weight: normal; letter-spacing: 0.08em; }
.mt-what { font-size: 11px; opacity: 0.75; }

/* ---------- タイトル ---------- */
#title-screen {
  position: absolute; inset: 0; z-index: 10;
  /* 霧の森に、片方だけの革靴。文字とボタンは左の暗い木立の側に寄せて、右下の靴を見せる */
  background: linear-gradient(90deg, rgba(0,0,0,0.72), rgba(0,0,0,0.35) 45%, rgba(0,0,0,0) 70%), url(art/img/title.jpg) center 70% / cover, #000;
  text-shadow: 0 2px 10px rgba(0,0,0,0.85);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 14px;
  padding-left: 8%;
}
#title-screen[hidden] { display: none; }
.t-main { font-size: clamp(40px, 9vw, 96px); letter-spacing: 0.25em; }
.t-sub { opacity: 0.7; letter-spacing: 0.2em; }
#btn-start {
  margin-top: 20px; background: transparent; color: #eee;
  border: 1px solid #aaa; border-radius: 4px; padding: 10px 36px; font-size: 18px; letter-spacing: 0.3em;
}
#btn-start:hover { background: rgba(255,255,255,0.1); }
.t-btn2 {
  background: transparent; color: #ccc;
  border: 1px solid #666; border-radius: 4px; padding: 7px 28px; font-size: 15px; letter-spacing: 0.3em;
}
.t-btn2:hover { background: rgba(255,255,255,0.08); color: #fff; }
.t-btn2[hidden], .t-sub-btn[hidden] { display: none; }
/* 日付からの一覧 */
.day-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.day-list button { width: 100%; text-align: left; padding: 10px 14px; background: rgba(255,255,255,0.05); color: #eee; border: 1px solid #555; border-radius: 4px; }
.day-list button:hover { background: rgba(255,255,255,0.12); }
.day-list .dl-when { float: right; opacity: 0.5; font-size: 12px; }
.t-help { font-size: 12px; opacity: 0.6; margin-top: 10px; line-height: 1.8; }   /* 項目ごとに改行（index.html の <br>） */
#title-screen #btn-start, #title-screen .t-btn2 { min-width: 200px; }

/* 容疑者メモ：一覧の数と、詳細 */
.sus-card.open { cursor: pointer; }
.sus-card.open:hover { border-color: #888; }
.sus-card.got.open:hover { border-color: #e0a84a; }
.sus-count { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #444; font-size: 0.9em; }
.sus-more { margin-top: 4px; font-size: 0.8em; opacity: 0.5; }
.c-clue { color: #ffcf6e; }
.c-lie { color: #9fc3e8; }
.c-sin { color: #e8a0a0; }
.panel:has(.sus-detail) { width: min(96%, 860px); }
.sus-detail { display: flex; gap: 18px; align-items: flex-start; }
.sd-photo { position: relative; flex: 0 0 34%; aspect-ratio: 3 / 4; overflow: hidden; border: 1px solid #555; border-radius: 4px; }
.sd-photo .sus-img { filter: grayscale(0.85) brightness(0.8); }
.sd-photo.got .sus-img { filter: none; }
.sd-body { flex: 1; min-width: 0; }
.sd-body h2 { margin: 0 0 2px; text-align: left; }
.sd-about { margin: 8px 0 4px; opacity: 0.9; }
.sd-h { font-size: 14px; margin: 14px 0 4px; padding-bottom: 3px; border-bottom: 1px dashed #444; }
.sd-list { margin: 0; padding-left: 1.2em; line-height: 1.7; }
.sd-list li { margin-bottom: 4px; }
.sd-empty { margin: 0; opacity: 0.45; font-size: 0.92em; }
.sd-back { text-align: center; margin-top: 12px; }
@media (max-width: 600px) { .sus-detail { flex-direction: column; } .sd-photo { width: 60%; flex: none; } }

/* スクロールバー（メモや一覧の中）。ブラウザ標準のバーを、暗い画面になじむ細い線に */
* { scrollbar-width: thin; scrollbar-color: #5a5348 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #4a453d; border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #b8873a; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- スマホの横持ち（高さが低い画面）：字と余白を詰める ---------- */
/* 横持ちのスマホは、見えている高さが 330〜430px しかない。PC の大きさのままだと、帯や選択肢がはみ出す */
@media (max-height: 520px) {
  #textbox { height: 38%; padding: 0 6% 2.4%; gap: 12px; }
  #face { width: 54px; padding: 3px 3px 9px; }
  #name { font-size: 11px; min-height: 1.2em; margin-bottom: 2px; }
  #text { font-size: 15px; line-height: 1.6; min-height: 3.2em; }
  #choices { top: 12%; left: 10%; right: 10%; gap: 5px; }
  .choice { padding: 6px 12px; font-size: 14px; }
  .c-num { font-size: 11px; }
  #hud-time { font-size: 11px; }
  #btn-menu { width: 30px; height: 30px; font-size: 15px; }
  #menu { top: 13%; padding: 10px; gap: 4px; max-height: 84%; overflow: auto; }
  .menu-btn { padding: 4px 10px; font-size: 13px; }
  #card { font-size: 26px; }
  .mini, .panel { padding: 10px 14px; max-height: 96%; }
  .mini h2, .panel h2 { font-size: 18px; }
  .mini button, .panel button, #end button { padding: 6px 14px; font-size: 14px; margin: 4px; }
  .g-bar { margin: 8px 0; }
  .g-msg { min-height: 2em; margin: 4px 0; }
  .end-name { font-size: 26px; margin: 6px 0 8px; }
  .end-text { font-size: 13px; line-height: 1.6; }
  .end-mark { margin: 10px 0 6px; }
  .end-stats { margin: 8px 0 6px; }
  .bl-head { padding: 10px 8% 4px; }
  .bl-list li { font-size: 15px; padding: 6px 0; line-height: 1.6; }
  /* タイトル */
  #title-screen { gap: 6px; }
  .t-main { font-size: 40px; }
  .t-sub { font-size: 12px; }
  #btn-start { margin-top: 6px; padding: 6px 28px; font-size: 15px; }
  .t-btn2 { padding: 7px 22px; font-size: 13px; }
  .t-sub-btn { min-height: 34px; }   /* 指で押せる大きさ */
  #title-screen #btn-start, #title-screen .t-btn2 { min-width: 170px; }
  .t-help { display: none; }   /* キーボードの操作説明（スマホでは使わない。入りきらない） */
}

/* スマホを縦に持っているとき：絵が小さくなるので、横持ちをすすめる（遊べなくはしない） */
@media (orientation: portrait) and (pointer: coarse) {
  body::before {
    content: "スマホを横にすると、大きな画面で遊べます";
    position: fixed; left: 0; right: 0; top: calc(16px + var(--safe-t));
    text-align: center; font-size: 13px; letter-spacing: 0.1em; color: #999;
  }
}

/* 縦持ちのスマホ：画面の高さが 200px ほどしかない。横持ちをすすめつつ、そのままでも遊べる大きさに詰める */
@media (orientation: portrait) and (max-width: 520px) {
  #title-screen { gap: 3px; }
  .t-main { font-size: 28px; }
  .t-sub { font-size: 10px; }
  #btn-start { margin-top: 2px; padding: 4px 20px; font-size: 13px; }
  .t-btn2 { padding: 4px 18px; font-size: 12px; }
  #title-screen #btn-start, #title-screen .t-btn2 { min-width: 130px; }
  .t-sub-btn { min-height: 28px; font-size: 12px; }
  #textbox { height: 44%; padding: 0 4% 2%; gap: 8px; }
  #face { width: 40px; padding: 2px 2px 7px; }
  #name { font-size: 10px; }
  #text { font-size: 12px; line-height: 1.5; min-height: 3em; }
  #choices { top: 8%; left: 6%; right: 6%; gap: 3px; }
  .choice { padding: 4px 8px; font-size: 12px; }
  #hud-time { font-size: 9px; }
  #btn-menu { width: 26px; height: 26px; font-size: 13px; }
  #card { font-size: 18px; }
}
/* タッチの端末では、キーボードの操作説明を出さない（タップで進むだけ。入りきらない） */
@media (pointer: coarse) { .t-help { display: none; } }
