/* =============================================================
   ドパガキ UI
   絵と同じ世界の部品に見せる：紺の太線・クリームの地・7色パレット・ベタ塗り＋ずらし影
   ギャグの「うるささ」はカットインだけに集中させ、ふだんのUIは落ち着かせる
   ============================================================= */
:root {
  color-scheme: light;
  --ink: #2B2440;       /* 線・文字 */
  --cream: #FFF4E6;     /* 地 */
  --paper: #FFFBF5;     /* 窓の中 */
  --pink: #FF7A93;
  --mint: #6FD6C1;
  --sky: #8EC5FF;
  --yellow: #FFD35C;
  --lav: #B9A7D9;       /* 影 */
  --danger: #FF4D5E;
  --muted: #7B7394;
  --line: 3px solid var(--ink);
  --pop: 0 4px 0 var(--ink);
  --f-body: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic UI", system-ui, sans-serif;
  --f-disp: "Dela Gothic One", "M PLUS Rounded 1c", "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;   /* Dela にない漢字は丸ゴシックで補う */
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #1d1830; color: var(--ink); font-family: var(--f-body); font-weight: 700; }
button { font: inherit; color: inherit; touch-action: manipulation; cursor: pointer; }
button:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.hidden { display: none !important; }
@keyframes blink { to { opacity: 0.45; } }

#app {
  position: relative; margin: 0 auto; width: 100%; max-width: 440px; height: 100%;
  display: flex; flex-direction: column; overflow: hidden; background: var(--cream);
}
#bgLayer { position: absolute; inset: 0; z-index: 0; transition: filter .4s; }
#app.low #bgLayer, #app.low #chara { filter: grayscale(0.85) brightness(0.85); }
#app.high::after { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  box-shadow: inset 0 0 0 0 var(--danger); animation: pulse .8s infinite; }
@keyframes pulse { 50% { box-shadow: inset 0 0 48px 8px rgba(255, 77, 94, .6); } }

/* ───── HUD（上に浮かぶカード） */
#hud { position: relative; z-index: 2; margin: 8px 10px 0; padding: 8px 12px 6px; background: var(--paper);
  border: var(--line); border-radius: 14px; box-shadow: var(--pop); }
#hud .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; min-height: 22px; }
#areaName { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; }
#areaName b { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--ink); color: var(--cream); font-family: var(--f-disp); font-weight: 400; font-size: 11px; letter-spacing: .08em; }
#areaName .place { margin-left: 2px; color: var(--pink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#status { flex: none; font-size: 12px; color: var(--danger); }
.gaugeWrap { display: flex; align-items: center; gap: 6px; }
.gIcon { font-size: 18px; line-height: 1; }
.gauge { position: relative; flex: 1; height: 20px; border: var(--line); border-radius: 999px; overflow: hidden;
  background: linear-gradient(90deg, #dcebff 0 20%, #e3f7f1 20% 70%, #ffe3e8 70% 100%); }
.gauge::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent calc(20% - 1px), var(--ink) calc(20% - 1px) 20%, transparent 20% calc(70% - 1px), var(--ink) calc(70% - 1px) 70%, transparent 70%); opacity: .35; }
#gaugeFill { position: absolute; inset: 0 auto 0 0; width: 50%; background: var(--mint); border-right: 3px solid var(--ink); transition: background .2s; }
#gaugeFill.low { background: var(--sky); }
#gaugeFill.high { background: var(--pink); }
#gaugeMark { display: none; }
#gaugeNum { flex: none; min-width: 42px; padding: 0 6px; text-align: center; border: var(--line); border-radius: 8px; background: var(--yellow);
  font-family: var(--f-disp); font-weight: 400; font-size: 15px; line-height: 20px; font-variant-numeric: tabular-nums; }
#app.high #gaugeNum { background: var(--pink); color: #fff; }
#app.low #gaugeNum { background: var(--sky); }
.gaugeLabels { display: flex; justify-content: space-between; margin: 3px 48px 0 26px; font-size: 10px; color: var(--muted); }

/* ───── シーン（背景の上に選択肢） */
#scene { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; align-items: flex-start;
  justify-content: center; padding-top: 14%; cursor: pointer; }
#sceneEmoji { font-size: 84px; filter: drop-shadow(0 6px 12px rgba(0,0,0,.25)); }
#sceneLabel { position: absolute; left: 12px; top: 8px; font-size: 11px; color: var(--muted); }
#chara { position: absolute; left: 50%; top: 3%; height: 165%; transform: translateX(-50%); pointer-events: none; animation: charaIn .35s ease-out both; }
@keyframes charaIn { from { opacity: 0; transform: translate(-50%, 14px); } }

#choices { position: absolute; z-index: 2; left: 50%; bottom: 14px; transform: translateX(-50%);
  width: min(86%, 360px); display: flex; flex-direction: column; gap: 10px; }
#choices button { padding: 13px 16px; border: var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--pop);
  font-size: 16px; font-weight: 800; text-align: center; animation: choiceIn .22s both; }
#choices button:nth-child(2) { animation-delay: .05s; }
#choices button:nth-child(3) { animation-delay: .1s; }
#choices button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); background: var(--yellow); }
#choices button:disabled { opacity: .5; }
#choices button.mash { padding: 18px; background: var(--yellow); font-family: var(--f-disp); font-weight: 400; font-size: 20px; }
@keyframes choiceIn { from { opacity: 0; transform: translateY(10px); } }

#waitbar { position: absolute; z-index: 2; top: 10px; left: 12px; right: 12px; padding: 6px 10px 8px; border: var(--line);
  border-radius: 12px; background: var(--paper); box-shadow: var(--pop); }
#waitLabel { display: block; margin-bottom: 4px; font-size: 12px; font-variant-numeric: tabular-nums; }
#waitbar .track { height: 8px; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--cream); }
#waitbar i { display: block; height: 100%; width: 0; background: var(--yellow); }

/* 反射・予兆 */
#reflex { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 16px; text-align: center; background: rgba(43, 36, 64, .55); }
#reflexWarn { max-width: 320px; padding: 12px 16px; border: var(--line); border-radius: 14px; background: var(--yellow); box-shadow: var(--pop);
  font-size: 17px; font-weight: 800; animation: shakeX .35s infinite; }
@keyframes shakeX { 25% { transform: translateX(-3px) rotate(-1deg); } 75% { transform: translateX(3px) rotate(1deg); } }
.rbtns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
#reflexBtn, #reflexBtn2 { padding: 15px 26px; border: var(--line); border-radius: 16px; background: var(--pink); color: #fff; box-shadow: var(--pop);
  font-family: var(--f-disp); font-weight: 400; font-size: 20px; }
#reflexBtn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
#reflexTimer { width: 70%; height: 10px; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--paper); }
#reflexTimer i { display: block; height: 100%; background: var(--danger); }
/* 通知はスマホのプッシュ通知 */
#reflex.notify { justify-content: flex-start; padding-top: 12px; background: rgba(43, 36, 64, .35); }
#reflex.notify #reflexWarn { width: 100%; max-width: none; text-align: left; background: var(--paper); border-radius: 18px; font-size: 15px; animation: dropIn .25s ease-out both; }
#reflex.notify #reflexWarn::before { content: "🔔 通知 ・ いま"; display: block; margin-bottom: 4px; font-size: 11px; color: var(--muted); }
#reflex.notify #reflexBtn { background: var(--sky); }
@keyframes dropIn { from { transform: translateY(-30px); opacity: 0; } }

/* ───── テキスト窓（位置・高さ固定の浮かぶ窓） */
#panel { position: relative; z-index: 2; flex: 0 0 auto; height: 168px; margin: 0 10px 8px; padding: 12px 16px 22px;
  background: var(--paper); border: var(--line); border-radius: 16px; box-shadow: var(--pop); overflow-y: auto; cursor: pointer; }
#text { font-size: 15px; line-height: 1.75; font-weight: 700; }
#text p { margin: 0 0 4px; }
#text .say { margin-top: 6px; padding: 6px 10px; border-radius: 10px; background: #FFF0C7; border-left: 5px solid var(--yellow); }
#nextMark { position: sticky; float: right; bottom: 0; color: var(--pink); font-size: 16px; animation: bounce .6s infinite alternate; }
@keyframes bounce { to { transform: translateY(3px); } }

/* ───── アクションバー */
#actions { position: relative; z-index: 2; display: flex; gap: 8px; padding: 0 10px calc(10px + env(safe-area-inset-bottom)); }
#actions button { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 8px;
  border: var(--line); border-radius: 14px; box-shadow: var(--pop); font-size: 15px; font-weight: 800; overflow: hidden; }
#btnPhone { background: var(--sky); }
#btnBreath { background: var(--mint); }
#actions button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
#actions button:disabled { filter: grayscale(.6); opacity: .55; }
#actions .ico { font-size: 18px; }
#actions .bat { width: 26px; height: 12px; border: 2px solid var(--ink); border-radius: 3px; background: var(--paper); overflow: hidden; }
#actions .bat i { display: block; height: 100%; width: 0; background: var(--mint); }
#actions .bat i.low { background: var(--danger); }
#actions small { font-size: 11px; font-variant-numeric: tabular-nums; }
#actions .cd { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--ink); }

/* ───── 揺れ */
#app.shake { animation: shake 0.4s; }
#app.shakeBig { animation: shake 0.16s 4; }
@keyframes shake { 25% { transform: translate(-5px, 2px); } 50% { transform: translate(5px, -2px); } 75% { transform: translate(-3px, -1px); } }

/* =============================================================
   カットイン（ここだけは全力でうるさく。s < m < l < xl、minus は下降）
   ============================================================= */
#fx { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
#fx.blocking { pointer-events: auto; cursor: pointer; background: rgba(43, 36, 64, .3); }
.cutin { position: absolute; left: 0; right: 0; top: 22%; display: flex; flex-direction: column; align-items: center; }
.cutin .band { display: flex; align-items: baseline; justify-content: center; gap: 10px; white-space: nowrap; }
.cutin .name { font-weight: 800; }
.cutin .val { font-family: var(--f-disp); font-weight: 400; font-variant-numeric: tabular-nums; }
.cutin .tap { margin-top: 12px; padding: 2px 10px; border-radius: 999px; background: var(--ink); color: var(--cream); font-size: 11px; animation: blink .6s infinite alternate; }

/* s：小さなバッジ */
.cutin.s { top: 16%; }
.cutin.s .band { padding: 4px 14px; border: var(--line); border-radius: 999px; background: var(--paper); box-shadow: var(--pop); font-size: 13px; animation: cutS 2.6s forwards; }
.cutin.s .val { font-size: 22px; color: var(--pink); }
@keyframes cutS { 0% { opacity: 0; transform: translateY(10px) scale(.8); } 12%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-24px); } }

/* m：黄色い帯 */
.cutin.m .band { width: 100%; padding: 10px 12px; background: var(--yellow); border-block: 4px solid var(--ink); font-size: 16px; flex-wrap: wrap; white-space: normal; text-align: center; }
.cutin.m .val { font-size: 38px; color: #fff; }

/* l：斜めのピンク帯＋DOPAMINE */
.cutin.l { top: 18%; }
.cutin.l .band { position: relative; width: 130%; padding: 16px 0 12px; transform: rotate(-6deg); background: var(--pink); border-block: 5px solid var(--ink);
  font-size: 18px; color: #fff; }
.cutin.l .band::before { content: "DOPAMINE!!"; position: absolute; left: 50%; top: -18px; transform: translateX(-50%); padding: 0 10px;
  background: var(--yellow); border: 3px solid var(--ink); font-family: var(--f-disp); font-weight: 400; font-size: 14px; color: var(--ink); letter-spacing: .1em; }
.cutin.l .band { flex-direction: column; align-items: center; gap: 0; }
.cutin.l .name { max-width: 300px; white-space: normal; text-align: center; line-height: 1.35; }
.cutin.l .val { font-size: 54px; line-height: 1.1; color: var(--yellow); }

/* xl：集中線＋スターバースト */
.cutin.xl { inset: 0; top: 0; justify-content: center; }
.cutin.xl::before { content: ""; position: absolute; left: 50%; top: 44%; width: 1000px; height: 1000px; margin: -500px 0 0 -500px;
  background: repeating-conic-gradient(var(--yellow) 0 7deg, var(--pink) 7deg 14deg); }
.cutin.xl::after { content: ""; position: absolute; inset: 0; background: #fff; animation: xlFlash .45s forwards; }
@keyframes xlFlash { 0% { opacity: .9; } 100% { opacity: 0; } }
.cutin.xl .band { position: relative; z-index: 1; flex-direction: column; align-items: center; gap: 2px; margin-top: -14%; padding: 26px 28px 20px;
  background: var(--paper); border: 5px solid var(--ink); box-shadow: 0 8px 0 var(--ink);
  clip-path: polygon(50% 0, 60% 10%, 75% 4%, 78% 18%, 95% 18%, 88% 32%, 100% 45%, 88% 56%, 96% 72%, 78% 74%, 75% 92%, 60% 86%, 50% 100%, 40% 86%, 25% 92%, 22% 74%, 4% 72%, 12% 56%, 0 45%, 12% 32%, 5% 18%, 22% 18%, 25% 4%, 40% 10%);
  width: 330px; min-height: 260px; justify-content: center; }
.cutin.xl .band::before { content: "ドーパミン大放出"; font-family: var(--f-disp); font-weight: 400; font-size: 14px; color: var(--pink); letter-spacing: .08em; }
.cutin.xl .name { max-width: 220px; white-space: normal; text-align: center; font-size: 15px; line-height: 1.4; }
.cutin.xl .val { font-size: 76px; line-height: 1.05; color: var(--pink); }
.cutin.xl .tap { position: relative; z-index: 1; }

/* minus：静かな青 */
.cutin.minus { top: 18%; }
.cutin.minus .band { padding: 8px 18px; border: var(--line); border-radius: 14px; background: #dcebff; box-shadow: var(--pop); font-size: 15px; }
.cutin.minus .val { font-size: 28px; color: var(--sky); }

/* 入場アニメ（自動で消えるものは退場まで、タップ式は入場だけ） */
.cutin.m:not(.stay) .band { animation: cutM 2.6s forwards; }
.cutin.l:not(.stay) .band { animation: cutL 2.6s forwards; }
.cutin.minus:not(.stay) .band { animation: cutMinus 2.6s forwards; }
.cutin.stay.m .band { animation: stayM .22s ease-out both; }
.cutin.stay.l .band { animation: stayL .22s ease-out both; }
.cutin.stay.xl::before { animation: raysLoop 8s linear infinite; }
.cutin.stay.xl .band { animation: stayXL .4s cubic-bezier(.2, 1.6, .4, 1) both; }
.cutin.stay.minus .band { animation: stayMinus .3s ease-out both; }
@keyframes cutM { 0% { transform: translateX(100%); } 14%, 78% { transform: none; opacity: 1; } 100% { transform: translateX(-100%); opacity: 0; } }
@keyframes cutL { 0% { transform: rotate(-6deg) translateX(-110%); } 12%, 78% { transform: rotate(-6deg); opacity: 1; } 100% { transform: rotate(-6deg) translateX(110%); opacity: 0; } }
@keyframes cutMinus { 0% { opacity: 0; transform: translateY(-14px); } 18%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(18px); } }
@keyframes stayM { from { transform: translateX(100%); } }
@keyframes stayL { from { transform: rotate(-6deg) translateX(-110%); } }
@keyframes stayXL { from { transform: scale(2.4) rotate(-10deg); opacity: 0; } }
@keyframes stayMinus { from { opacity: 0; transform: translateY(-14px); } }
@keyframes raysLoop { to { transform: rotate(360deg); } }
.cutin.out { transition: opacity .2s; opacity: 0; }

/* エリア開始 */
.areaBanner { position: absolute; left: 0; right: 0; top: 28%; padding: 16px 0 14px; text-align: center; background: var(--yellow);
  border-block: 5px solid var(--ink); animation: areaIn 2.6s forwards; }
.areaBanner .no { display: inline-block; padding: 1px 12px; border-radius: 999px; background: var(--ink); color: var(--cream);
  font-family: var(--f-disp); font-weight: 400; font-size: 12px; letter-spacing: .3em; }
.areaBanner .nm { font-family: var(--f-disp); font-weight: 400; font-size: 38px; line-height: 1.35; color: #fff; }
.areaBanner .cp { display: inline-block; padding: 2px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--mint); font-size: 12px; }
@keyframes areaIn { 0% { opacity: 0; transform: scaleY(0); } 12%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-10px); } }

/* =============================================================
   オーバーレイ（タイトル・死亡・エンディング・図鑑）
   ============================================================= */
.overlay { position: absolute; inset: 0; z-index: 10; display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px 20px; text-align: center; overflow-y: auto; }
.overlay.show { display: flex; }
.overlay button { min-width: 200px; padding: 12px 22px; border: var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--pop); font-size: 16px; font-weight: 800; }
.overlay button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.overlay button.big { background: var(--pink); color: #fff; font-family: var(--f-disp); font-weight: 400; font-size: 24px; }

/* タイトル */
#title { background: linear-gradient(rgba(255, 244, 230, .25), rgba(255, 244, 230, .6)), url("img/bg/west.webp") center top / cover, var(--cream); justify-content: space-between; }
#title .logo { margin-top: 8%; }
#title .kicker { display: inline-block; padding: 2px 12px; border-radius: 999px; background: var(--ink); color: var(--cream); font-family: var(--f-disp); font-weight: 400; font-size: 11px; letter-spacing: .2em; }
#title h1 { margin: 6px 0 0; font-family: var(--f-disp); font-weight: 400; font-size: 72px; line-height: 1.1; color: var(--pink); letter-spacing: .02em;
  transform: rotate(-4deg); text-shadow: 0 8px 0 var(--ink); }
#title .sub { display: inline-block; margin: 14px 0 0; padding: 4px 14px; border: var(--line); border-radius: 999px; background: var(--yellow); font-size: 15px; }
.rules { width: 100%; max-width: 330px; padding: 12px 14px; border: var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--pop); font-size: 14px; line-height: 1.7; }
.rules p { margin: 6px 0 0; }
.rules .meter { display: flex; border: var(--line); border-radius: 999px; overflow: hidden; font-size: 12px; }
.rules .z { padding: 2px 0; }
.rules .z.blue { flex: 2; background: var(--sky); } .rules .z.green { flex: 5; background: var(--mint); } .rules .z.red { flex: 3; background: var(--pink); color: #fff; }
.tbtns { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 4%; }
.tbtns #btnStart { min-width: 240px; }

/* 死亡（ここは暗く静かに。落差で笑わせる） */
#death { background: #0c0a14; color: #eee; }
#death .beeps { font-size: 18px; letter-spacing: .05em; color: var(--danger); animation: blink .15s infinite alternate; }
#death.bored .beeps { color: var(--sky); animation-duration: .9s; }
#death .bp { font-family: var(--f-disp); font-weight: 400; font-size: 28px; font-variant-numeric: tabular-nums; }
#death .ecg { width: 90%; height: 60px; }
#death .ecg polyline { fill: none; stroke: var(--mint); stroke-width: 2.5; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 2.2s linear forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
#death .died { font-family: Georgia, "Yu Mincho", serif; font-size: 46px; font-weight: 900; letter-spacing: .12em; color: var(--danger); opacity: 0; animation: appear .8s 2s forwards; }
#death.bored .died { color: #b8c4d8; }
#death .cause { padding: 6px 14px; border: 2px solid #eee; border-radius: 10px; font-size: 17px; opacity: 0; animation: appear .6s 2.4s forwards; }
#death .new { color: var(--yellow); font-size: 13px; opacity: 0; animation: appear .6s 2.6s forwards; }
#death .btns, #ending .btns { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; opacity: 0; pointer-events: none; animation: appear .4s 2.8s forwards; }
#death button { color: var(--ink); }
@keyframes appear { to { opacity: 1; pointer-events: auto; } }

/* エンディング */
#ending { background: linear-gradient(rgba(43, 36, 64, .55), rgba(43, 36, 64, .8)), url("img/bg/cafe.webp") center / cover; color: var(--cream); }
#ending .etitle { padding: 2px 14px; border-radius: 999px; background: var(--ink); font-family: var(--f-disp); font-weight: 400; font-size: 14px; letter-spacing: .2em; }
#ending .ebig { font-family: var(--f-disp); font-weight: 400; font-size: 34px; line-height: 1.4; color: #fff; }
#ending.true .ebig { color: var(--yellow); }
#ending.bad .ebig, #ending.phone .ebig { color: var(--pink); }
#ending .enote { max-width: 320px; font-size: 14px; line-height: 1.8; }
#ending .stats { padding: 8px 16px; border: 2px solid var(--cream); border-radius: 12px; font-size: 14px; line-height: 1.8; }
#ending .btns { animation-delay: 1.5s; }
#ending button { color: var(--ink); }

/* 図鑑・チャプター */
#zukan { justify-content: flex-start; background: var(--cream); }
#zukan h2 { margin: 8px 0 0; font-family: var(--f-disp); font-weight: 400; font-size: 28px; }
#zukan h3 { align-self: flex-start; margin: 14px 0 0; font-size: 15px; }
#zukan ul { width: 100%; margin: 0; padding: 6px 12px; list-style: none; text-align: left; font-size: 14px; background: var(--paper); border: var(--line); border-radius: 14px; }
#zukan li { padding: 7px 4px; border-bottom: 2px dashed #e6dccb; }
#zukan li:last-child { border-bottom: 0; }
#zukan li.unk { color: #b9b0c8; }
#zukan li.end-true b { color: #d9a400; } #zukan li.end-bad b { color: var(--pink); }
#zukan .chapters { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }
#zukan .chapters button { text-align: left; }
#zukan .chapters button:disabled { opacity: .45; }

@media (prefers-reduced-motion: reduce) {
  #app.shake, #app.shakeBig, #reflexWarn { animation: none; }
  .cutin.xl::before, .cutin.xl::after { animation: none; }
}

/* =============================================================
   v0.16：文字のフチ（iPhone の Safari でも読めるよう text-shadow で描く）
   ============================================================= */
:root {
  --ol-2: 2px 0 var(--ink), -2px 0 var(--ink), 0 2px var(--ink), 0 -2px var(--ink), 1.5px 1.5px var(--ink), -1.5px 1.5px var(--ink), 1.5px -1.5px var(--ink), -1.5px -1.5px var(--ink);
  --ol-3: 3px 0 var(--ink), -3px 0 var(--ink), 0 3px var(--ink), 0 -3px var(--ink), 2px 2px var(--ink), -2px 2px var(--ink), 2px -2px var(--ink), -2px -2px var(--ink);
  --ol-4: 4px 0 var(--ink), -4px 0 var(--ink), 0 4px var(--ink), 0 -4px var(--ink), 3px 3px var(--ink), -3px 3px var(--ink), 3px -3px var(--ink), -3px -3px var(--ink),
          4px 2px var(--ink), -4px 2px var(--ink), 4px -2px var(--ink), -4px -2px var(--ink), 2px 4px var(--ink), -2px 4px var(--ink), 2px -4px var(--ink), -2px -4px var(--ink);
  --ol-5: 5px 0 var(--ink), -5px 0 var(--ink), 0 5px var(--ink), 0 -5px var(--ink), 3.5px 3.5px var(--ink), -3.5px 3.5px var(--ink), 3.5px -3.5px var(--ink), -3.5px -3.5px var(--ink),
          5px 2px var(--ink), -5px 2px var(--ink), 5px -2px var(--ink), -5px -2px var(--ink), 2px 5px var(--ink), -2px 5px var(--ink), 2px -5px var(--ink), -2px -5px var(--ink);
}
#reflexBtn, #reflexBtn2, .overlay button.big { text-shadow: var(--ol-2); }
.cutin.s .val, .cutin.minus .val, .cutin.l .band { text-shadow: var(--ol-2); }
.cutin.l .band::before { text-shadow: none; }
.cutin.m .val { text-shadow: var(--ol-3); }
.cutin.l .val, .areaBanner .nm, #ending .ebig { text-shadow: var(--ol-4); }
.cutin.xl .val { text-shadow: var(--ol-5), 0 6px 0 var(--ink); }
#title h1 { text-shadow: var(--ol-5), 0 9px 0 var(--ink); }

/* =============================================================
   v0.16：窓ごとに少しずつ違う形（同じトンマナの中で）
   ============================================================= */

/* テキスト窓：2行固定・ページ送り。二重線の便箋っぽい窓 */
#panel { height: auto; min-height: 0; padding: 14px 18px 16px; overflow: hidden; border-radius: 20px;
  box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 7px #E7DDF3, var(--pop); }
#text { height: calc(16px * 1.8 * 2); font-size: 16px; line-height: 1.8; overflow: hidden; }
#nextMark { position: absolute; right: 14px; bottom: 6px; float: none; }

/* 選択肢：丸いピル＋色つきの絵文字バッジ（上から ピンク・ミント・空色） */
#choices button { display: flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; border-radius: 999px; text-align: left; }
#choices .ci { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: var(--line); border-radius: 50%; background: var(--pink); font-size: 18px; }
#choices button:nth-child(3n+2) .ci { background: var(--mint); }
#choices button:nth-child(3n+3) .ci { background: var(--sky); }
#choices .ct { flex: 1; min-width: 0; }
#choices button.mash { justify-content: center; border-radius: 16px; padding: 18px; }

/* 待ち時間：暗いタイマー。数字を大きく、しましまのバーが流れる */
#waitbar { left: 50%; right: auto; width: min(88%, 340px); transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
  padding: 8px 14px 10px; background: var(--ink); color: var(--cream); border-radius: 16px; border: 3px solid var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.25); }
#waitLabel { flex: 1; margin: 0; font-size: 13px; color: var(--cream); }
#waitLabel::before { content: "⏱ "; }
#waitLabel b { font-family: var(--f-disp); font-weight: 400; font-size: 22px; color: var(--yellow); margin: 0 2px; font-variant-numeric: tabular-nums; }
#waitbar .track { flex-basis: 100%; height: 10px; border: 2px solid var(--cream); background: #3b3354; }
#waitbar i { background: repeating-linear-gradient(-45deg, var(--yellow) 0 8px, #ffe28f 8px 16px); background-size: 22px 22px; animation: stripes .6s linear infinite; }
@keyframes stripes { to { background-position: 22px 0; } }

/* 予兆：斜めの黄色い看板 */
#reflexWarn { border-radius: 6px; transform: skewX(-6deg); }
#reflexWarn::after { content: "!!"; position: absolute; right: -12px; top: -14px; padding: 0 6px; border: 3px solid var(--ink); border-radius: 50%;
  background: var(--danger); color: #fff; font-family: var(--f-disp); font-weight: 400; font-size: 14px; }
#reflexWarn { position: relative; }

/* 通知：本物のスマホのプッシュ通知（ここだけ細い線・すりガラス） */
#reflex.notify #reflexWarn { transform: none; border: 1.5px solid rgba(43, 36, 64, .35); border-radius: 20px; background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px); box-shadow: 0 8px 24px rgba(20, 14, 40, .35); padding: 10px 14px 12px; font-weight: 500; }
#reflex.notify #reflexWarn::before, #reflex.notify #reflexWarn::after { content: none; }
#reflex.notify .nh { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 12px; color: var(--muted); }
#reflex.notify .nicon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--mint); font-size: 12px; }
#reflex.notify .nh b { color: var(--ink); font-weight: 800; }
#reflex.notify .nt { margin-left: auto; }
#reflex.notify .nb { font-size: 15px; font-weight: 700; color: var(--ink); }

/* カットインのアイコン（何が起きたか一目でわかるように） */
.cutin .icn { display: inline-grid; place-items: center; flex: none; line-height: 1; }
.cutin.s .icn { font-size: 18px; }
.cutin.m .icn { width: 46px; height: 46px; border: var(--line); border-radius: 50%; background: var(--paper); font-size: 26px; align-self: center; }
.cutin.l .icn { width: 60px; height: 60px; margin-bottom: 4px; border: 4px solid var(--ink); border-radius: 50%; background: var(--paper); font-size: 34px; }
.cutin.xl .icn { width: 84px; height: 84px; margin: 4px 0; border: 4px solid var(--ink); border-radius: 50%; background: var(--yellow); font-size: 50px; }
.cutin.minus .icn { font-size: 22px; align-self: center; }
.cutin.xl .band { min-height: 320px; width: 340px; }
.cutin.m .band { align-items: center; }

/* =============================================================
   v0.17：タイトル画面（アプリゲーム風）
   ============================================================= */
#title { justify-content: flex-start; gap: 0; padding: 0; cursor: pointer; overflow: hidden;
  background: linear-gradient(rgba(255, 244, 230, 0) 40%, rgba(255, 244, 230, .55)), url("img/bg/west.webp") center top / cover, var(--cream); }
#title .tLogo { position: relative; z-index: 2; margin-top: 12%; animation: logoIn .7s cubic-bezier(.2, 1.5, .4, 1) both; }
#title .kicker { display: inline-block; padding: 2px 12px; border-radius: 999px; background: var(--ink); color: var(--cream); font-family: var(--f-disp); font-weight: 400; font-size: 11px; letter-spacing: .2em; }
#title h1 { margin: 6px 0 0; font-family: var(--f-disp); font-weight: 400; font-size: 76px; line-height: 1.1; color: var(--pink); transform: rotate(-4deg); }
#title .tSub { display: inline-block; max-width: 300px; margin: 16px 0 0; padding: 6px 16px; border: var(--line); border-radius: 12px; background: var(--paper);
  box-shadow: var(--pop); font-size: 14px; line-height: 1.5; transform: rotate(-1.5deg); }
@keyframes logoIn { from { transform: scale(.6) translateY(-20px); opacity: 0; } }
#title .tChara { position: absolute; z-index: 1; left: 50%; bottom: -34%; height: 92%; transform: translateX(-50%); pointer-events: none;
  animation: charaUp .6s .15s ease-out both; filter: drop-shadow(0 6px 0 rgba(43, 36, 64, .25)); }
@keyframes charaUp { from { transform: translate(-50%, 40px); opacity: 0; } }
#title .tStart { position: absolute; z-index: 2; left: 50%; bottom: 128px; transform: translateX(-50%); padding: 6px 22px; border: var(--line); border-radius: 999px;
  background: var(--yellow); box-shadow: var(--pop); font-family: var(--f-disp); font-weight: 400; font-size: 20px; letter-spacing: .12em; white-space: nowrap;
  animation: tapPulse 1.1s ease-in-out infinite; }
@keyframes tapPulse { 50% { transform: translateX(-50%) scale(1.07); } }
#title .tMenu { position: absolute; z-index: 2; left: 0; right: 0; bottom: 34px; display: flex; justify-content: center; gap: 10px; }
#title .tMenu button { min-width: 0; width: 96px; padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; border-radius: 16px; }
#title .tMenu button span { font-size: 22px; line-height: 1; }
#title .tFoot { position: absolute; z-index: 2; right: 12px; bottom: 8px; font-size: 10px; color: var(--ink); opacity: .6; }

/* =============================================================
   v0.17：チュートリアル（スポットライト＋吹き出し）
   ============================================================= */
#tut { position: absolute; inset: 0; z-index: 30; cursor: pointer; }
#tut .hole { position: absolute; border: 3px solid var(--yellow); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(20, 14, 40, .72);
  transition: all .3s ease; pointer-events: none; }
#tut .bubble { position: absolute; left: 16px; right: 16px; padding: 14px 16px 12px; border: var(--line); border-radius: 16px; background: var(--paper);
  box-shadow: var(--pop); font-size: 15px; line-height: 1.7; animation: bubbleIn .25s ease-out both; }
#tut .bubble p { margin: 0 0 8px; }
#tut .bubble b { color: var(--ink); background: #FFE9A6; padding: 0 3px; border-radius: 4px; }
#tut .bubble .c-blue { background: #d4e6ff; } #tut .bubble .c-red { background: #ffd3dc; } #tut .bubble .c-green { background: #cff3ea; }
#tut .tnext { display: block; text-align: right; font-size: 12px; color: var(--pink); animation: blink .7s infinite alternate; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(8px); } }

/* v0.18：タイトル「ドパガキ危機一髪」（ロゴ画像ができるまでの仮組み） */
#title h1 { display: flex; flex-direction: column; align-items: center; font-size: 68px; line-height: 1.05; }
#title h1 .l2 { margin-top: 6px; padding: 0 14px 4px; font-size: 46px; color: var(--yellow); transform: rotate(3deg); }
#title .tSub { margin-top: 18px; }

/* v0.18：シェアボタン */
.overlay .share { display: block; min-width: 200px; padding: 12px 22px; border: var(--line); border-radius: 14px; background: var(--ink); color: #fff;
  box-shadow: 0 4px 0 #000; font-size: 16px; font-weight: 800; text-decoration: none; text-align: center; }
.overlay .share:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.overlay .copy { font-size: 14px; }
.overlay .shareText { display: none; width: 100%; max-width: 300px; height: 96px; padding: 8px; border: 2px solid var(--ink); border-radius: 10px;
  font: 13px/1.5 var(--f-body); color: var(--ink); background: var(--paper); resize: none; }
.overlay .shareText.show { display: block; }
#death .share { border-color: #eee; }
#death button.big, #ending button.big { color: #fff; }
#ending .ebig { font-size: 28px; }

/* v0.20：ロゴ画像 */
#title .tLogo { margin-top: 6%; }
#title h1 { transform: none; margin: 0; line-height: 0; text-shadow: none; }
#title h1 img { display: block; width: min(96vw, 420px); max-width: 100%; height: auto; margin: -4px auto -10px;
  filter: drop-shadow(0 6px 0 rgba(43, 36, 64, .25)); }
#title .kicker { position: relative; z-index: 1; }

/* v0.22：タイトルの一枚絵（キービジュアル）を画面全体に */
#title { background: url("img/title/key_story.webp") center bottom / cover no-repeat, var(--cream); }
#title .tLogo { margin-top: 4%; }
#title .tStart { bottom: 118px; box-shadow: 0 4px 0 var(--ink), 0 0 0 6px rgba(255, 251, 245, .6); }
#title .tMenu { bottom: 30px; }
#title .tMenu button { background: rgba(255, 251, 245, .94); }
#title .tFoot { color: var(--paper); opacity: .85; text-shadow: var(--ol-2); }

/* v0.23：サブタイトルは「ふと冷静になる一言」。ロゴの勢いから一段落として、静かに置く */
#title .tSub { margin-top: 14px; padding: 5px 18px; border: 0; border-radius: 999px; box-shadow: none; transform: none;
  background: rgba(43, 36, 64, .78); color: var(--cream); font-size: 14px; font-weight: 700; letter-spacing: .12em; }

/* v0.24：手書きのサブタイトル（画像）。やわらかいクリームの帯に静かに置く */
#title .tSub { padding: 2px 14px; background: rgba(255, 251, 245, .88); color: var(--ink); letter-spacing: 0; line-height: 0; }
#title .tSub img { display: block; width: 270px; height: 44px; object-fit: cover; object-position: center 52%; }

/* v0.26：まぶた（起床前は真っ暗。テキスト窓とHUDは上に出る） */
#lids { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#lids i { position: absolute; left: -15%; right: -15%; height: 52%; background: #0b0912; }
#lids .top { top: 0; border-radius: 0 0 50% 50% / 0 0 22% 22%; }
#lids .bot { bottom: 0; border-radius: 50% 50% 0 0 / 22% 22% 0 0; }
/* 2回まばたきして、3回目でぱっちり開く */
#lids.opening .top { animation: lidTop 2.6s ease-in-out forwards; }
#lids.opening .bot { animation: lidBot 2.6s ease-in-out forwards; }
@keyframes lidTop { 0% { transform: none; } 18% { transform: translateY(-18%); } 30% { transform: none; }
  52% { transform: translateY(-45%); } 64% { transform: translateY(-8%); } 100% { transform: translateY(-105%); } }
@keyframes lidBot { 0% { transform: none; } 18% { transform: translateY(18%); } 30% { transform: none; }
  52% { transform: translateY(45%); } 64% { transform: translateY(8%); } 100% { transform: translateY(105%); } }
/* 目覚めた直後は景色がぼやけていて、だんだんはっきりする */
#app.waking #bgLayer { animation: wakeBlur 2.6s ease-out forwards; }
@keyframes wakeBlur { 0% { filter: blur(10px) brightness(.8); } 60% { filter: blur(4px); } 100% { filter: none; } }

/* v0.26：TAP TO START を確実に中央へ（transform をアニメに使わない置き方） */
#title .tStart { left: 0; right: 0; width: max-content; margin: 0 auto; transform: none; animation: tapPulse2 1.1s ease-in-out infinite; }
@keyframes tapPulse2 { 50% { transform: scale(1.07); } }
#lids i { left: -45%; right: -45%; height: 54%; }

/* =============================================================
   v0.27：アイコン画像（絵文字の置き換え）
   白いフチで「ステッカー」っぽく見せる
   ============================================================= */
img.ic, img.ii { display: inline-block; object-fit: contain; }
.sticker, .ci img.ic, .icn img.ic, #actions img.ii, .tMenu img.ii {
  filter: drop-shadow(1.5px 0 0 #fff) drop-shadow(-1.5px 0 0 #fff) drop-shadow(0 1.5px 0 #fff) drop-shadow(0 -1.5px 0 #fff); }
img.ii { width: 1.35em; height: 1.35em; vertical-align: -0.32em; margin: 0 1px; }
.sym { font-family: var(--f-disp); font-weight: 400; }

/* 選択肢のバッジ：アイコンを大きく、丸の中に */
#choices .ci { width: 42px; height: 42px; overflow: visible; }
#choices .ci img.ic { width: 34px; height: 34px; }
#choices .ci .sym { font-size: 20px; color: var(--ink); }

/* カットインのアイコン（丸い台座の中に） */
.cutin .icn img.ic { width: 100%; height: 100%; padding: 4px; }
.cutin.s .icn { width: 26px; height: 26px; }
.cutin.minus .icn { width: 30px; height: 30px; }
.cutin.m .icn { width: 50px; height: 50px; }
.cutin.l .icn { width: 66px; height: 66px; }
.cutin.xl .icn { width: 96px; height: 96px; }

/* 通知のアプリアイコン */
#reflex.notify .nicon { width: 22px; height: 22px; background: transparent; }
#reflex.notify .nicon img.ic { width: 22px; height: 22px; }

/* 下のボタン・タイトルのメニュー・ゲージ */
#actions .ico img.ii { width: 26px; height: 26px; vertical-align: middle; }
#title .tMenu button span img.ii { width: 32px; height: 32px; vertical-align: middle; }
.gIcon img.ii { width: 24px; height: 24px; vertical-align: middle; }
/* タイマーの時計アイコン */
#waitLabel::before { content: ""; display: inline-block; width: 18px; height: 18px; margin-right: 6px; vertical-align: -4px;
  background: url("img/icons/stopwatch.png") center / contain no-repeat; }

/* v0.28：サブタイトル「生きて、デートにたどり着きたい。」（ロゴと同じ熱量で、目的を宣言する） */
#title .tSub { display: flex; flex-direction: column; align-items: center; gap: 0; margin-top: 6px; padding: 8px 20px 10px; border: var(--line);
  border-radius: 14px; background: var(--pink); box-shadow: var(--pop); transform: rotate(-2deg); line-height: 1.25; letter-spacing: .02em; }
#title .tSub span { color: #fff; font-family: var(--f-disp); font-weight: 400; text-shadow: var(--ol-3); }
#title .tSub .s1 { font-size: 17px; }
#title .tSub .s2 { font-size: 22px; color: var(--yellow); }

/* v0.29：サブタイトルを画像に（ロゴと同じ作りの文字） */
#title .tSub { display: block; margin: -6px 0 0; padding: 0; border: 0; background: none; box-shadow: none; transform: none; line-height: 0; }
#title .tSub img { display: block; width: min(92vw, 360px); height: auto; margin: 0 auto; }

/* v0.29：チュートリアル冒頭の「状況の説明」は、暗いカードで語りかける */
#tut .bubble.story { background: var(--ink); color: var(--cream); border-color: var(--ink); box-shadow: 0 4px 0 #000; font-size: 16px; line-height: 1.8; }
#tut .bubble.story b { background: none; color: var(--yellow); padding: 0; }
#tut .bubble.story .c-red { color: var(--pink); } #tut .bubble.story .c-blue { color: var(--sky); }
#tut .bubble.story .tnext { color: var(--yellow); }

/* v0.30：ドーパミン／クールダウンのマーク（どの段階のカットインにも共通で出す） */
.cutin .mark { position: relative; z-index: 2; display: block; height: auto; pointer-events: none;
  filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(0 4px 0 rgba(43,36,64,.35)); }
.cutin.s .mark { width: 128px; margin-bottom: -6px; }
.cutin.m .mark { width: 210px; margin-bottom: -16px; }
.cutin.l .mark { width: 250px; margin-bottom: -18px; transform: rotate(-6deg); }
.cutin.minus .mark { width: 190px; margin-bottom: -10px; }
.cutin.xl .band .mark { width: 230px; margin: -6px 0 2px; filter: none; }
.cutin.l .band::before, .cutin.xl .band::before { content: none; }
/* 登場：ポンと弾む。自動で消えるものは帯と一緒に消える */
.cutin .mark { animation: markPop .38s cubic-bezier(.2, 1.7, .4, 1) both; }
.cutin.l .mark { animation-name: markPopL; }
.cutin:not(.stay) .mark { animation: markPop .38s cubic-bezier(.2, 1.7, .4, 1) both, markOut 2.6s forwards; }
.cutin.l:not(.stay) .mark { animation: markPopL .38s cubic-bezier(.2, 1.7, .4, 1) both, markOut 2.6s forwards; }
.cutin.stay.xl .band .mark { animation: markWobble .9s .4s ease-in-out infinite alternate; }
@keyframes markPop { from { transform: scale(0); } }
@keyframes markPopL { from { transform: rotate(-6deg) scale(0); } }
@keyframes markOut { 0%, 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes markWobble { from { transform: rotate(-3deg) scale(1); } to { transform: rotate(3deg) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .cutin .mark, .cutin.stay.xl .band .mark { animation: none; } }
/* v0.30：サブタイトルの箱に昔の max-width:300px が残り、画像が右へはみ出して中心が左にずれていた */
#title .tSub { max-width: none; width: 100%; }
/* v0.31：サブタイトルをロゴに寄せる（下がりすぎていた） */
#title .tSub { margin-top: -38px; }

/* v0.31：エピローグ（暗い画面に1行ずつ） */
#ending.epi { justify-content: center; padding: 32px 28px; background: #0c0a14; cursor: pointer; }
#ending.epi.true { background: linear-gradient(rgba(20, 14, 10, .82), rgba(20, 14, 10, .9)), url("img/bg/cafe.webp") center / cover; }
#ending.epi.phone { background: radial-gradient(circle at 50% 70%, rgba(142, 197, 255, .18), transparent 55%), #0c0a14; }
#ending .epiLines { max-width: 330px; text-align: left; }
#ending .epiLines p { margin: 0 0 16px; font-size: 16px; line-height: 1.85; color: var(--cream); opacity: 0; animation: epiIn 1.2s forwards; }
#ending.epi.true .epiLines p:last-child { color: var(--yellow); }
#ending.epi.bad .epiLines p:last-child { color: var(--pink); }
#ending.epi .epiNext { position: absolute; right: 24px; bottom: 28px; color: var(--cream); animation: blink .6s infinite alternate; }
@keyframes epiIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* v0.31：エンドロール（TRUE END のみ） */
#ending.roll { display: block; padding: 0; overflow: hidden; background: linear-gradient(rgba(12, 10, 20, .78), rgba(12, 10, 20, .9)), url("img/bg/cafe.webp") center / cover; }
#ending .rollIn { position: absolute; left: 0; right: 0; top: 0; padding: 0 20px; text-align: center; transform: translateY(var(--from, 100vh)); }
#ending .rollIn.go { animation: rollUp linear forwards; }
@keyframes rollUp { from { transform: translateY(var(--from)); } to { transform: translateY(var(--to)); } }
#ending .rLogo { display: block; width: min(80vw, 300px); margin: 0 auto 8px; }
#ending .rollIn h4 { margin: 56px 0 14px; font-family: var(--f-disp); font-weight: 400; font-size: 16px; letter-spacing: .12em; color: var(--yellow); }
#ending .cr { display: flex; justify-content: center; gap: 14px; font-size: 15px; line-height: 2.1; }
#ending .cr span { flex: 1; text-align: right; color: #b9b0c8; }
#ending .cr b { flex: 1.3; text-align: left; }
#ending .cl { font-size: 15px; line-height: 2.3; }
#ending .rEnd { margin-top: 120px; font-family: var(--f-disp); font-weight: 400; font-size: 32px; line-height: 1.3; color: #fff; text-shadow: var(--ol-3); }
#ending .rSkip { position: absolute; right: 12px; bottom: 16px; z-index: 2; padding: 6px 14px; border: 2px solid rgba(255, 255, 255, .5); border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 12px; box-shadow: none; }

/* v0.31：TRUE END の結果画面はおめでたく（回る光＋紙吹雪＋トロフィー） */
#ending.result.true { overflow: hidden; background: var(--yellow); color: var(--ink); isolation: isolate; }
#ending.result.true::before { content: ""; position: absolute; left: 50%; top: 32%; width: 1200px; height: 1200px; margin: -600px 0 0 -600px; z-index: -1;
  background: repeating-conic-gradient(#FFE38F 0 9deg, #FFC94A 9deg 18deg); animation: raysLoop 30s linear infinite; }
#ending.result.true .congrats { font-family: var(--f-disp); font-weight: 400; font-size: 22px; letter-spacing: .06em; color: var(--pink); text-shadow: var(--ol-3); animation: stayXL .5s cubic-bezier(.2, 1.6, .4, 1) both; }
#ending.result.true .trophy { width: 110px; height: 110px; filter: drop-shadow(0 6px 0 rgba(43, 36, 64, .25)); animation: markPop .5s .15s cubic-bezier(.2, 1.7, .4, 1) both, trophyBob 1.6s .7s ease-in-out infinite alternate; }
@keyframes trophyBob { to { transform: translateY(-8px) rotate(3deg); } }
#ending.result.true .etitle { background: var(--pink); color: #fff; border: 3px solid var(--ink); }
#ending.result.true .ebig { color: #fff; }
#ending.result.true .stats { border-color: var(--ink); background: var(--paper); color: var(--ink); }
#ending .confetti { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
#ending .confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border: 1.5px solid var(--ink); border-radius: 2px; animation: confetti linear infinite; }
@keyframes confetti { 0% { transform: translateY(0) rotate(0); } 100% { transform: translateY(110vh) rotate(720deg); } }
#ending.phone .ebig { color: var(--sky); }
#zukan li.end-phone b { color: #4d8fd6; }
@media (prefers-reduced-motion: reduce) { #ending.result.true::before, #ending .confetti { animation: none; display: none; } }
#ending .cl img.ii { width: 1.9em; height: 1.9em; vertical-align: -0.6em; margin-right: 4px; }
#death .died { font-size: 40px; letter-spacing: .06em; white-space: nowrap; }   /* v0.32：GAME OVER を1行に */
/* v0.32：最大演出（xl）の数字が枠の下すぼまりで見切れないよう、枠を大きく・中身を小さく */
.cutin.xl .band { width: 350px; min-height: 390px; padding: 44px 40px 64px; gap: 0; }
.cutin.xl .band .mark { width: 190px; margin: 0 0 2px; }
.cutin.xl .icn { width: 72px; height: 72px; margin: 2px 0; }
.cutin.xl .val { font-size: 62px; }

/* v0.34：東口の「それらしい人」はシルエット。本文の reveal で正体が見える */
#chara.silhouette { filter: brightness(0) !important; }
#chara { transition: filter .8s ease, opacity .8s ease; }

/* v0.34：xl のギザギザ枠。縁取りは外側（.burst）に付けて、切り抜きの端に黒が残らないように */
.cutin.xl .burst { position: relative; z-index: 1; margin-top: -14%;
  filter: drop-shadow(4px 0 0 var(--ink)) drop-shadow(-4px 0 0 var(--ink)) drop-shadow(0 4px 0 var(--ink)) drop-shadow(0 -4px 0 var(--ink)) drop-shadow(0 7px 0 var(--ink)); }
.cutin.xl .burst .band { margin-top: 0; border: 0; box-shadow: none; }

/* v0.34：エピローグは全行の位置を先に確保し、1行ずつ見せる */
#ending .epiLines p { opacity: 0; animation: none; }
#ending .epiLines p.on { animation: epiIn 1.2s forwards; }
#ending.epi.true .epiLines p:last-child, #ending.epi.bad .epiLines p:last-child { color: var(--cream); }
#ending.epi.true .epiLines p.last { color: var(--yellow); }
#ending.epi.bad .epiLines p.last { color: var(--pink); }

/* v0.34：エンディング・ゲームオーバーの結果画面を、画面幅に合わせて広く */
#ending.result .btns, #death .btns { align-self: stretch; width: auto; max-width: 340px; margin-inline: auto; width: 100%; }
#ending.result .btns > *, #death .btns > * { width: 100%; min-width: 0; box-sizing: border-box; }
#ending.result .ebig { max-width: 340px; font-size: 26px; text-wrap: balance; }
#ending.result .stats { width: 100%; max-width: 340px; box-sizing: border-box; }

/* v0.34：2回目以降の BAD / NORMAL END のヒント */
#ending .hintBtn { background: var(--yellow); color: var(--ink); }
#ending .hintWin { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(12, 10, 20, .6); }
#ending .hintWin.hidden { display: none; }
#ending .hintCard { width: 100%; max-width: 330px; padding: 18px 18px 16px; border: var(--line); border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: var(--pop); animation: stayMinus .25s ease-out both; }
#ending .hintHead { font-family: var(--f-disp); font-weight: 400; font-size: 18px; margin-bottom: 8px; }
#ending .hintCard p { margin: 0 0 14px; font-size: 15px; line-height: 1.8; text-align: left; }
#ending .hintCard button { width: 100%; min-width: 0; }
/* v0.35：TAP TO START とメニューを持ち上げて、下に余白をとる（画面の高さに合わせて%で） */
#title .tStart { bottom: 24%; }
#title .tMenu { bottom: 11%; }

/* v0.38：結果画面は中身だけスクロールできる箱に入れる（小さい画面でもボタンが押せるように） */
#ending.result { padding: 0; }
#ending .resBody { position: absolute; inset: 0; z-index: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 12px; padding: 24px 20px 32px; }
#ending.result.true .trophy { width: 84px; height: 84px; }
#ending.result.true .congrats { font-size: 20px; }
/* NORMAL END も BAD END と同じ演出（最後の一文・見出しをピンクで） */
#ending.epi.phone .epiLines p.last { color: var(--pink); }
#ending.result.phone .ebig { color: var(--pink); }
/* エンドロールのスキップは小さく（文字にかぶらないように） */
#ending .rSkip { min-width: 0; width: auto; }
#ending .rSub { display: block; width: min(76vw, 300px); height: auto; margin: -6px auto 8px; }

/* v0.41：ゲームの最後の控えめなリンク（小さな文字だけ。枠・色・動きは付けない） */
.outLinks { margin-top: 6px; font-size: 12px; line-height: 1.8; opacity: .75; text-align: center; }
.outLinks a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.outLinks span { margin: 0 6px; }
/* v0.42：エンディング後の「ほかのゲームで遊ぶ」ボタン（ほかのボタンと同じ見た目） */
.overlay a.moreGames { display: block; padding: 12px 22px; border: var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--pop);
  color: var(--ink); font-size: 16px; font-weight: 800; text-align: center; text-decoration: none; }
.overlay a.moreGames:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
