/* シンギュラリティ — Singularity */

:root {
  --ink: #eef0f4;
  --ink-2: rgba(238, 240, 244, 0.72);
  --ink-3: rgba(238, 240, 244, 0.46);
  --line: rgba(255, 255, 255, 0.14);
  --glass: rgba(9, 12, 22, 0.74);
  --gold: #f2d6a2;
  --cold: #bcdcff;
  --bg: #070a12;
  --serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --serif-en: "EB Garamond", "Shippori Mincho", Georgia, serif;
  --gothic: "Zen Kaku Gothic New", "Hiragino Sans", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Zen Kaku Gothic New", monospace;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
html[lang="en"] { --serif: var(--serif-en); }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--gothic);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  word-break: keep-all; overflow-wrap: anywhere; line-break: strict;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
.mono { font-family: var(--mono); font-weight: 300; letter-spacing: 0.02em; }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.p { display: inline-block; white-space: nowrap; }
:focus-visible { outline: 1px solid rgba(255, 255, 255, 0.7); outline-offset: 3px; }
.nos { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; font-family: var(--serif); }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#veil {
  position: fixed; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(4, 6, 12, 0.55), rgba(4, 6, 12, 0) 26%),
    linear-gradient(to top, rgba(4, 6, 12, 0.6), rgba(4, 6, 12, 0) 30%);
}

/* ───────── タイトル ───────── */
#title {
  position: fixed; inset: 0; z-index: 20;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: calc(18px + var(--safe-t)) 24px calc(18px + var(--safe-b));
  background: radial-gradient(120% 80% at 50% 40%, rgba(5, 7, 14, 0.35), rgba(5, 7, 14, 0.78));
  transition: opacity 1.4s ease, filter 1.4s ease;
  overflow-y: auto;
}
#title.gone { opacity: 0; filter: blur(6px); pointer-events: none; }
/* 読み込みのあいだ：文字や風景が欠けた画面は見せず、暗いままで待つ。長引いたときだけ細い光を出す */
#scene { transition: opacity 1.6s ease; }
body.boot #scene, body.boot #title { opacity: 0; pointer-events: none; }
#boot { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; pointer-events: none; transition: opacity 0.5s ease; }
body:not(.boot) #boot { opacity: 0; }
#boot span { display: block; width: 72px; height: 1px; background: linear-gradient(to right, transparent, var(--gold), transparent); opacity: 0; animation: bootIn 0.8s ease 0.7s forwards, bootPulse 1.8s ease-in-out 1.5s infinite; }
@keyframes bootIn { to { opacity: 0.7; } }
@keyframes bootPulse { 0%, 100% { opacity: 0.7; transform: scaleX(1); } 50% { opacity: 0.25; transform: scaleX(0.55); } }
@media (prefers-reduced-motion: reduce) { #boot span { animation: bootIn 0.8s ease 0.7s forwards; } }
.t-top { display: flex; justify-content: space-between; align-items: center; }
.brand { font-size: 11px; text-decoration: none; color: var(--ink-2); letter-spacing: 0.08em; }
.t-ctrl { display: flex; gap: 6px; }
.t-main { align-self: center; justify-self: center; width: min(560px, 100%); text-align: center; padding: 24px 0; }
.t-years { font-size: 12px; color: var(--ink-3); letter-spacing: 0.3em; margin: 0 0 18px; }
#tTitle { font-family: var(--serif); font-weight: 500; font-size: clamp(38px, 8vw, 72px); letter-spacing: 0.12em; margin: 0; line-height: 1.2; text-shadow: 0 0 40px rgba(180, 200, 255, 0.25); }
html[lang="en"] #tTitle { letter-spacing: 0.04em; font-weight: 400; }
.t-sub { font-family: var(--serif-en); font-style: italic; color: var(--ink-2); font-size: 18px; margin: 6px 0 26px; letter-spacing: 0.06em; }
html[lang="en"] .t-sub { font-family: var(--serif); font-style: normal; font-size: 15px; letter-spacing: 0.3em; }
.t-lead { font-family: var(--serif); font-size: clamp(15px, 2.2vw, 18px); line-height: 2; color: var(--ink); margin: 0 0 30px; letter-spacing: 0.08em; }
.t-shared { border: 1px solid var(--line); padding: 14px 16px; margin: -8px auto 26px; font-family: var(--serif); line-height: 1.9; font-size: 14px; background: rgba(255, 255, 255, 0.04); }
.t-shared p { margin: 0; }
.t-shared .small { color: var(--gold); margin-top: 6px; }
.t-age { margin: 0 auto 26px; width: min(380px, 100%); }
.t-age label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 10px; letter-spacing: 0.1em; }
.t-age-row { display: flex; align-items: center; gap: 16px; }
.t-age-row output { font-family: var(--serif); min-width: 3.6em; text-align: right; font-size: 26px; }
.t-age-row output b { font-weight: 500; }
.t-age-n { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin: 8px 0 0; }
input[type="range"] { flex: 1; -webkit-appearance: none; appearance: none; height: 28px; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: rgba(255, 255, 255, 0.4); }
input[type="range"]::-moz-range-track { height: 1px; background: rgba(255, 255, 255, 0.4); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); margin-top: -9px; box-shadow: 0 0 16px rgba(242, 214, 162, 0.6); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--gold); box-shadow: 0 0 16px rgba(242, 214, 162, 0.6); }
.t-btns { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.primary {
  font-family: var(--serif); font-size: 17px; letter-spacing: 0.2em;
  padding: 15px 40px; border: 1px solid rgba(242, 214, 162, 0.7); color: var(--gold);
  background: rgba(242, 214, 162, 0.06); transition: background 0.3s, color 0.3s;
}
html[lang="en"] .primary { letter-spacing: 0.06em; }
.primary:hover { background: var(--gold); color: #10131c; }
.ghost { font-size: 13px; color: var(--ink-2); padding: 8px 14px; border-bottom: 1px solid var(--line); }
.t-hint { font-size: 12px; color: var(--ink-3); margin: 16px 0 0; letter-spacing: 0.12em; }
.t-foot { text-align: center; }
.link { font-size: 12px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255, 255, 255, 0.3); }
.t-disc { font-size: 11px; color: var(--ink-3); margin: 8px auto 0; max-width: 32em; line-height: 1.7; }

.icon {
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: 17px;
  display: inline-grid; place-items: center; font-size: 13px;
  color: var(--ink-2); border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(6, 9, 18, 0.35);
  transition: color 0.2s, border-color 0.2s;
}
.icon:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.4); }
.icon.off { opacity: 0.45; text-decoration: line-through; }
.bInfo { font-family: var(--serif-en); font-style: italic; font-size: 15px; }

/* ───────── 見出し ───────── */
#hud {
  position: fixed; left: 0; right: 0; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: calc(14px + var(--safe-t)) 18px 0; pointer-events: none;
}
#hud > * { pointer-events: auto; }
#year { font-size: clamp(30px, 4.4vw, 46px); line-height: 1; font-weight: 300; letter-spacing: 0.02em; }
/* 年齢の行は、年の下に置き、操作ボタンとは重ならない（ボタンの列を押し出さない） */
#me { position: absolute; left: 0; top: 100%; font-size: 12px; color: var(--ink-2); margin-top: 6px; letter-spacing: 0.08em; white-space: pre; line-height: 1.5; }
.hud-l { position: relative; flex: 0 0 auto; padding-right: 10px; }
#year { white-space: nowrap; }
.hud-r { flex: 0 0 auto; }
.ctrls > * { flex-shrink: 0; }
.hud-r { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.ctrls { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-top: 2px; }
body.gone #me { color: var(--ink-3, rgba(255, 255, 255, 0.45)); }
.pill { white-space: nowrap; height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(6, 9, 18, 0.35); font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; letter-spacing: 0.06em; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid currentColor; }
.pill[aria-pressed="true"] { color: var(--cold); border-color: rgba(188, 220, 255, 0.6); }
.pill[aria-pressed="true"] .dot { background: var(--cold); box-shadow: 0 0 8px var(--cold); }

#paused-mark { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 28px; color: rgba(255, 255, 255, 0.5); pointer-events: none; opacity: 0; transition: opacity 0.3s; z-index: 5; }
body.paused #paused-mark { opacity: 1; }

/* ───────── 窓の外の言葉 ───────── */
/* 見出しのすぐ下から、下へ向かって置く（行数が変わっても上端は動かない） */
#say { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + clamp(104px, 16vh, 150px)); height: 0; z-index: 6; pointer-events: none; }
.say {
  position: absolute; left: 50%; top: 0; width: min(36em, calc(100vw - 44px)); text-align: center;
  --dy: 6px; translate: -50% var(--dy);
  font-family: var(--serif); font-size: clamp(16px, 1.1vw + 11px, 22px); line-height: 2.05; letter-spacing: 0.12em;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 0.6);
  opacity: 0; filter: blur(4px);
  transition: opacity 1.3s ease, filter 1.3s ease, translate 1.3s ease;
}
html[lang="en"] .say { letter-spacing: 0.02em; font-size: clamp(18px, 1.1vw + 13px, 24px); line-height: 1.7; }
.say p { margin: 0; }
.say.on { opacity: 1; filter: none; --dy: 0px; }
.say.off { opacity: 0; filter: blur(4px); }
.say.event p { color: #fff; }
.say.personal p { color: var(--gold); }
.say.auto { font-size: clamp(14px, 0.8vw + 11px, 18px); }
.say .auto-note { font-family: var(--gothic); font-size: 12px; color: var(--cold); letter-spacing: 0.12em; margin-bottom: 4px; }
.say .auto-res { font-family: var(--gothic); font-size: 14px; color: var(--gold); margin-top: 6px; }
.say .after { color: var(--ink-2); font-size: 0.9em; margin-top: 4px; }
/* 伏線の回収：どの年の選択から来たか（目立たせない） */
.say p.echo { font-family: var(--gothic); font-size: 12px; color: rgba(236, 222, 196, 0.78); letter-spacing: 0.14em; margin-top: 10px; }

.tag {
  display: inline-block; font-family: var(--gothic); font-size: 10.5px; letter-spacing: 0.1em; line-height: 1;
  padding: 5px 8px 4px; border: 1px solid currentColor; border-radius: 10px; opacity: 0.85;
}
.tag:hover { opacity: 1; }
.tag-real { color: #c7e7c0; }
.tag-debate { color: #ffd9a6; }
.tag-assume { color: #bcd6ff; }
.tag-fiction { color: #e5c2ef; }

/* ───────── 決断のカード ───────── */
#card {
  position: fixed; z-index: 12; left: 50%; bottom: calc(66px + var(--safe-b));
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 150px); overflow-y: auto;
  transform: translate(-50%, 16px); opacity: 0;
  background: rgba(8, 11, 20, 0.86);
  border: 1px solid var(--line); border-radius: 3px;
  padding: 20px 22px 16px;
  transition: opacity 0.5s ease, transform 0.5s ease;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
#card.on { opacity: 1; transform: translate(-50%, 0); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head .kind { font-size: 11px; letter-spacing: 0.16em; color: var(--gold); }
.card-head .cyear { font-size: 11px; color: var(--ink-3); }
.card-head .tag { margin-left: auto; }
.card-text { font-family: var(--serif); font-size: clamp(16px, 0.6vw + 13px, 19px); line-height: 1.95; letter-spacing: 0.08em; margin-bottom: 16px; }
html[lang="en"] .card-text { letter-spacing: 0.01em; line-height: 1.6; font-size: clamp(18px, 0.6vw + 15px, 21px); }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opts.vote { flex-direction: row; flex-wrap: wrap; }
.opts.vote .opt { flex: 1 1 30%; justify-content: center; }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 2px;
  font-family: var(--serif); font-size: 15px; line-height: 1.6; letter-spacing: 0.05em;
  transition: background 0.2s, border-color 0.2s, opacity 0.3s, color 0.2s;
}
html[lang="en"] .opt { font-size: 16.5px; letter-spacing: 0; }
.opt .k { font-size: 10px; color: var(--ink-3); flex: none; }
.opt:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.45); }
.opt:disabled { opacity: 0.32; cursor: default; }
.opt.picked { opacity: 1; border-color: var(--gold); color: var(--gold); background: rgba(242, 214, 162, 0.08); }
#card.result .opts { display: none; }
#card.result .opts:has(.picked) { display: flex; }
#card.result .opt:not(.picked) { display: none; }
.card-foot { display: flex; justify-content: flex-end; align-items: center; margin-top: 12px; min-height: 26px; }
.delegate { font-size: 12px; color: var(--cold); letter-spacing: 0.08em; padding: 4px 0; border-bottom: 1px dashed rgba(188, 220, 255, 0.5); }
.ai-picked { margin: 0; font-size: 12px; color: var(--cold); letter-spacing: 0.08em; }
.cont { font-family: var(--serif); font-size: 15px; letter-spacing: 0.12em; padding: 8px 16px; border: 1px solid rgba(255, 255, 255, 0.35); }
.cont:hover { background: rgba(255, 255, 255, 0.1); }
.res { margin-top: 14px; animation: rise 0.6s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bar { position: relative; height: 6px; background: rgba(168, 212, 255, 0.35); margin: 6px 0 8px; }
.bar-y { position: absolute; left: 0; top: 0; bottom: 0; background: var(--gold); transition: width 1.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.bar-mid { position: absolute; left: 50%; top: -5px; bottom: -5px; width: 1px; background: rgba(255, 255, 255, 0.7); }
.bar-l { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); }
.bar-l b { font-weight: 400; color: var(--ink); }
.verdict { font-family: var(--serif); text-align: center; font-size: 20px; letter-spacing: 0.3em; margin: 10px 0 4px; }
.wbars { display: flex; flex-direction: column; gap: 6px; }
.wb { position: relative; display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 6px 8px; color: var(--ink-2); }
.wb i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, 0.08); transition: width 1.6s cubic-bezier(0.2, 0.8, 0.2, 1); z-index: -1; }
.wb { z-index: 0; }
.wb.win { color: var(--ink); }
.wb.win i { background: rgba(242, 214, 162, 0.25); }
.wb.mine .wl::before { content: '● '; color: var(--gold); font-size: 9px; vertical-align: 2px; }
.share-note { font-size: 12px; color: var(--ink-2); margin: 0 0 6px; letter-spacing: 0.06em; }
.res .after { font-family: var(--serif); font-size: 15px; line-height: 1.95; color: var(--ink); margin-top: 10px; letter-spacing: 0.06em; }
html[lang="en"] .res .after { letter-spacing: 0; font-size: 17px; line-height: 1.55; }
.pace-note { font-family: var(--gothic); font-size: 12px; letter-spacing: 0.08em; margin: 10px 0 0; color: var(--ink-2); }
.pace-note span { font-size: 9px; margin-right: 2px; vertical-align: 1px; }
.pace-note.up span { color: #ffc9a8; }
.pace-note.down span { color: #a8d4ff; }
.say .pace-note { margin-top: 8px; }

/* ───────── 世界線 ───────── */
#strip { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; height: calc(54px + var(--safe-b)); padding-bottom: var(--safe-b); pointer-events: none; }
#wl { width: 100%; height: 54px; display: block; }

/* ───────── 大きな瞬間 ───────── */
#overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; text-align: center; padding: 24px; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
#overlay.on { opacity: 1; }
#overlay.dark { background: rgba(3, 4, 8, 0.6); }
#overlay .sing { color: #0b0e16; transition: color 2.4s ease; }
#overlay.reveal .sing { color: #fff; text-shadow: 0 0 30px rgba(0, 0, 0, 0.6); }
#overlay.dim { background: rgba(3, 4, 8, 0.55); }
#overlay.black { background: rgba(3, 4, 8, 0.97); }
#overlay.lapsing { place-items: end center; padding-bottom: calc(9vh + var(--safe-b)); transition-duration: 0.6s; }
#overlay .lapse .ly { font-size: clamp(30px, 5vw, 46px); letter-spacing: 0.18em; color: #fff; margin: 0; text-shadow: 0 0 24px rgba(0, 0, 0, 0.8); font-variant-numeric: tabular-nums; }
#overlay .lapse .lh { font-size: 11px; letter-spacing: 0.2em; color: var(--ink-3); margin: 10px 0 0; text-shadow: 0 0 12px #000; }
#overlay .sing.retro { color: rgba(255, 255, 255, 0.18); }
#overlay.reveal .sing.retro { color: #fff; }
.sing.retro .sy { font-weight: 300; letter-spacing: 0.1em; }
.sing .sy { font-size: clamp(48px, 10vw, 110px); margin: 0; line-height: 1; letter-spacing: 0.04em; }
.sing h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 5vw, 48px); letter-spacing: 0.3em; margin: 14px 0 22px; }
html[lang="en"] .sing h2 { letter-spacing: 0.08em; }
.sing .sl, .sing .sf { font-family: var(--serif); font-size: clamp(15px, 2vw, 19px); letter-spacing: 0.1em; margin: 6px 0; opacity: 0; transition: opacity 1.6s ease 1s; }
#overlay.reveal .sing .sl, #overlay.reveal .sing .sf { opacity: 1; }
.death p { font-family: var(--serif); font-size: clamp(18px, 2.4vw, 24px); line-height: 2.1; letter-spacing: 0.14em; margin: 0; text-shadow: 0 0 20px #000; }
.death .dc { font-size: clamp(14px, 1.8vw, 17px); color: var(--gold); margin-bottom: 10px; opacity: 0.9; }
.death .da { color: var(--ink-2); font-size: clamp(14px, 1.8vw, 17px); margin-top: 18px; opacity: 0; animation: fadein 1.6s ease 2.2s forwards; }
@keyframes fadein { to { opacity: 1; } }
.final .fy { font-size: 13px; letter-spacing: 0.5em; color: var(--ink-2); margin: 0 0 18px; }
.final .fl { font-family: var(--serif); color: var(--ink-2); margin: 0 0 10px; letter-spacing: 0.2em; opacity: 0; transition: opacity 1.4s ease; }
.final h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(40px, 8vw, 84px); letter-spacing: 0.14em; margin: 0; text-shadow: 0 0 40px rgba(0, 0, 0, 0.7); opacity: 0; filter: blur(8px); transition: opacity 2s ease 0.3s, filter 2s ease 0.3s; }
html[lang="en"] .final h2 { letter-spacing: 0.02em; }
.final .fs { font-family: var(--serif); font-size: clamp(15px, 2vw, 20px); letter-spacing: 0.12em; margin: 18px 0 0; opacity: 0; transition: opacity 1.6s ease 1.6s; text-shadow: 0 0 20px #000; }
#overlay.reveal .final .fl, #overlay.reveal .final h2, #overlay.reveal .final .fs { opacity: 1; filter: none; }

/* ───────── 終章 ───────── */
#end {
  position: fixed; inset: 0; z-index: 25; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: linear-gradient(to bottom, rgba(5, 7, 13, 0) 0, rgba(5, 7, 13, 0.55) 34vh, rgba(5, 7, 13, 0.94) 70vh);
  opacity: 0; transition: opacity 1.2s ease;
}
#end.on { opacity: 1; }
.end-in { width: min(640px, 100%); margin: 0 auto; padding: 38vh 22px calc(60px + var(--safe-b)); }
.end-head { text-align: center; margin-bottom: 30px; }
.end-head .eyebrow { font-size: 11px; color: var(--ink-3); letter-spacing: 0.3em; margin: 0 0 22px; }
.end-head .fl { font-family: var(--serif); color: var(--ink-2); margin: 0 0 6px; letter-spacing: 0.2em; }
.end-head h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(40px, 9vw, 68px); letter-spacing: 0.14em; margin: 0; line-height: 1.3; text-shadow: 0 0 40px rgba(0, 0, 0, 0.7); }
html[lang="en"] .end-head h1 { letter-spacing: 0.01em; }
.end-head .sub { font-family: var(--serif); font-size: 17px; letter-spacing: 0.12em; margin: 12px 0 0; }
.end-head .sing-y { font-size: 12px; color: var(--ink-2); letter-spacing: 0.1em; margin: 18px 0 0; }
#end .body { font-family: var(--serif); font-size: 16px; line-height: 2.15; letter-spacing: 0.1em; text-align: center; margin: 0 0 34px; }
html[lang="en"] #end .body { letter-spacing: 0.01em; line-height: 1.7; font-size: 18px; }
.gl { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 44px; }
.gl > div { background: rgba(7, 10, 18, 0.9); padding: 16px 18px; }
.gl h3 { font-size: 11px; font-weight: 400; letter-spacing: 0.2em; color: var(--ink-3); margin: 0 0 10px; }
.gl ul { list-style: none; padding: 0; margin: 0; font-family: var(--serif); font-size: 16px; line-height: 2; }
.gl ul.lost { color: var(--ink-2); }
#end h2 { font-size: 12px; font-weight: 400; letter-spacing: 0.24em; color: var(--gold); margin: 0 0 14px; text-transform: uppercase; }
#end section { margin-bottom: 52px; }
#end .lead { font-family: var(--serif); color: var(--ink-2); font-size: 14px; letter-spacing: 0.08em; margin: -6px 0 16px; line-height: 1.9; }
.letter { font-family: var(--serif); border-left: 1px solid rgba(242, 214, 162, 0.5); padding: 4px 0 4px 22px; }
.letter .lh { color: var(--ink-2); font-size: 14px; letter-spacing: 0.1em; margin: 0 0 14px; }
.letter .lb { font-size: 17px; line-height: 2.2; letter-spacing: 0.1em; }
html[lang="en"] .letter .lb { letter-spacing: 0; line-height: 1.7; font-size: 19px; }
.letter .ls { text-align: right; color: var(--ink-2); font-size: 14px; margin: 18px 0 0; letter-spacing: 0.1em; }
.cardimg { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); aspect-ratio: 4 / 5; display: grid; place-items: center; margin-bottom: 14px; overflow: hidden; }
.cardimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cardimg .ph { width: 30px; height: 30px; border: 1px solid rgba(255, 255, 255, 0.3); border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sbtns > * { text-align: center; text-decoration: none; padding: 13px 8px; border: 1px solid rgba(255, 255, 255, 0.25); font-size: 13px; letter-spacing: 0.08em; }
.sbtns .primary { grid-column: 1 / -1; border-color: var(--gold); color: var(--gold); font-family: var(--serif); font-size: 16px; letter-spacing: 0.16em; }
.sbtns.phone .b-copy { grid-column: 1 / -1; }
.sbtns > *:hover { background: rgba(255, 255, 255, 0.08); }
.wl-big { width: 100%; height: 110px; display: block; margin-bottom: 14px; }
.tl ol { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.tl li { display: grid; grid-template-columns: 3.4em 1fr; gap: 2px 12px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.tl li .y { color: var(--ink-3); font-size: 12px; padding-top: 2px; }
.tl li .t { font-family: var(--serif); font-size: 14.5px; }
.tl li .r { grid-column: 2; color: var(--ink-2); font-size: 12.5px; }
.tl li .r small { margin-left: 8px; color: var(--cold); font-size: 11px; }
.tl li .r small.pv { color: var(--gold); }
.tl li.ev .t { color: var(--ink-2); font-style: normal; }
.tl li.ev .t::before { content: '— '; color: var(--ink-3); }
.tl li.sg .t { color: #fff; }
.tl li.sg .t small { color: var(--ink-2); margin-left: 6px; }
.tl li.dt .t { color: var(--ink-2); }
.tl li.ps .t { color: rgba(242, 214, 162, 0.75); }
.tl li .t small.bk { margin-left: 8px; color: var(--ink-3); font-size: 11px; }
/* あなたの50年を分けた瞬間 */
.turning ol { list-style: none; padding: 0; margin: 0; }
.turning li { padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.turning .th { margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.turning .th .y { color: var(--ink-3); font-size: 12px; }
.turning .th .tt { font-family: var(--serif); font-size: 16px; }
.turning .th .tc { color: var(--gold); font-size: 13px; }
.turning .te { margin: 2px 0 0 3.2em; font-family: var(--serif); font-size: 14px; color: var(--ink-2); }
.turning .te .mono { color: var(--ink-3); font-size: 12px; }
.turning .tn { margin: 6px 0 0 3.2em; font-size: 12.5px; color: var(--cold); letter-spacing: 0.06em; }
.tl li.au { opacity: 0.75; }
.cos ul { list-style: none; padding: 0; margin: 0; font-family: var(--serif); font-size: 16px; line-height: 2.2; letter-spacing: 0.08em; }
.cos li::before { content: '◇ '; color: var(--gold); font-size: 12px; }
.cfs { display: grid; gap: 22px; }
.scrub-hint { margin: -6px 0 14px; color: var(--ink-3); text-align: center; }
.wl-big { touch-action: none; cursor: ew-resize; }
#end { transition: opacity 1.2s ease, background-color 0.5s ease; }
#end.peek { background: rgba(5, 7, 13, 0.1); }
#end .end-in > * { transition: opacity 0.5s ease; }
#end.peek .end-in > *:not(.tl) { opacity: 0.06; }
#end .tl li { transition: opacity 0.4s ease; }
#end.peek .tl li { opacity: 0.2; }
#end.peek .tl li.on { opacity: 1; }
.peek-y { position: fixed; left: 0; right: 0; top: calc(14px + var(--safe-t, 0px)); margin: 0; text-align: center; font-size: 30px; letter-spacing: 0.2em; color: #fff; text-shadow: 0 0 20px rgba(0, 0, 0, 0.9); pointer-events: none; z-index: 2; }
.found ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.found li { font-family: var(--serif); font-size: 13px; letter-spacing: 0.08em; padding: 6px 12px; border: 1px solid color-mix(in srgb, var(--a, #fff) 45%, transparent); color: var(--a, var(--ink)); border-radius: 2px; }
.found li.now { background: color-mix(in srgb, var(--a, #fff) 14%, transparent); }
.found li.un { color: var(--ink-3); border: 1px dashed rgba(255, 255, 255, 0.14); }
.found h2 .mono { color: var(--ink-2); letter-spacing: 0.1em; margin-left: 6px; }
.cf { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: center; }
.cf canvas { width: 100%; height: auto; aspect-ratio: 8 / 5; display: block; border: 1px solid var(--line); }
.cf .cfq { font-family: var(--serif); font-size: 13.5px; line-height: 1.85; color: var(--ink-2); margin: 0 0 8px; }
.cf .cfc { font-family: var(--serif); font-size: 22px; margin: 0; letter-spacing: 0.1em; }
.cf .cfs { font-size: 11px; color: var(--ink-3); margin: 4px 0 0; display: block; }
.same { font-family: var(--serif); color: var(--ink-2); line-height: 2; text-align: center; }
.part ul { list-style: none; padding: 0; margin: 0 0 12px; font-size: 14px; line-height: 2.1; }
.part li::before { content: '・'; color: var(--ink-3); }
.fine { font-size: 11.5px; color: var(--ink-3); line-height: 1.8; }
.again { text-align: center; }
.again > button { display: block; width: 100%; margin: 0 0 10px; padding: 15px; border: 1px solid rgba(255, 255, 255, 0.3); font-family: var(--serif); font-size: 16px; letter-spacing: 0.14em; }
.again > button.b-same { border-color: rgba(188, 220, 255, 0.5); color: var(--cold); }
.again > button:hover { background: rgba(255, 255, 255, 0.08); }
.links { font-size: 12px; color: var(--ink-2); margin-top: 22px; }
.links a, .links button { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, 0.3); font-size: 12px; }

/* ───────── モーダル・通知 ───────── */
#modal { position: fixed; inset: 0; z-index: 50; background: rgba(3, 4, 8, 0.6); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity 0.3s; }
#modal.on { opacity: 1; }
.modal-box { position: relative; width: min(600px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: #0b0f1a; border: 1px solid var(--line); padding: 28px 26px 22px; font-size: 14px; line-height: 1.9; color: var(--ink-2); }
.modal-box h2 { font-family: var(--serif); font-weight: 500; color: var(--ink); font-size: 20px; letter-spacing: 0.1em; margin: 0 0 14px; }
.modal-box h3 { font-size: 12px; letter-spacing: 0.16em; color: var(--gold); font-weight: 400; margin: 22px 0 6px; }
.modal-box p { margin: 0 0 10px; }
.modal-box ul { padding-left: 1.2em; margin: 0 0 10px; }
.modal-box b { color: var(--ink); font-weight: 500; }
.modal-close { position: absolute; right: 10px; top: 8px; font-size: 22px; width: 36px; height: 36px; color: var(--ink-2); }
.note-tag { display: flex; gap: 10px; align-items: center; color: var(--ink); }

#toast { position: fixed; left: 50%; bottom: calc(80px + var(--safe-b)); transform: translate(-50%, 10px); z-index: 40; background: rgba(9, 12, 22, 0.86); border: 1px solid var(--line); padding: 10px 16px; font-size: 13px; opacity: 0; transition: opacity 0.4s, transform 0.4s; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; line-height: 1.6; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ───────── スマートフォン ───────── */
@media (max-width: 640px) {
  #hud { padding: calc(10px + var(--safe-t)) 14px 0; }
  .ctrls { margin-top: 12px; gap: 5px; }
  .icon { min-width: 30px; height: 30px; font-size: 12px; padding: 0 6px; }
  .pill { height: 30px; padding: 0 9px; gap: 5px; letter-spacing: 0.02em; }
  .ctrls { margin-top: 0; flex-wrap: nowrap; }
}
@media (max-width: 370px) {
  .ctrls { gap: 4px; }
  .icon { min-width: 28px; height: 28px; }
  .pill { height: 28px; padding: 0 8px; }
  #say { top: calc(var(--safe-t) + 92px); }
  #card { bottom: calc(58px + var(--safe-b)); padding: 16px 16px 12px; max-height: calc(100vh - 210px); }
  .card-text { margin-bottom: 12px; }
  .opt { padding: 10px 12px; font-size: 14.5px; }
  .cf { grid-template-columns: 1fr; }
  .opts.n4 { display: grid; grid-template-columns: 1fr 1fr; }
  .opts.n4 .opt { font-size: 13.5px; padding: 9px 10px; }
  .end-in { padding-top: 30vh; }
}
@media (max-height: 560px) and (orientation: landscape) {
  #card { bottom: 50px; max-height: calc(100vh - 70px); }
  #say { top: calc(var(--safe-t) + 74px); }
}
@media (prefers-reduced-motion: reduce) {
  .say, #card, #overlay, #end { transition-duration: 0.01s !important; }
}

/* 横長の画面：カードは空に置き、町を隠さない */
@media (min-aspect-ratio: 11/10) and (min-width: 760px) {
  #card { bottom: auto; top: calc(116px + var(--safe-t)); width: min(820px, calc(100vw - 48px)); max-height: calc(100vh - 184px); transform: translate(-50%, -10px); padding: 16px 22px 14px; }
  #card.on { transform: translate(-50%, 0); }
  .card-text { line-height: 1.8; margin-bottom: 12px; }
  .opts { flex-direction: row; flex-wrap: wrap; }
  .opts .opt { flex: 1 1 0; min-width: 0; }
  #card.result .opts .opt.picked { flex: 0 1 auto; }
  .res { margin-top: 10px; }
  .res .after { margin-top: 6px; line-height: 1.8; }
  .card-foot { margin-top: 8px; }
}

/* PLAYGROUND の文字（一覧ページと同じ書体と色） */
.pg {
  font-family: 'Fraunces', serif; font-weight: 560; letter-spacing: 0.05em; font-style: normal;
  background: linear-gradient(120deg, #ffffff 0%, #eef0f7 45%, #ffd27a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
a.pg { text-decoration: none !important; border-bottom: 1px solid rgba(255, 210, 122, 0.35); }
a.pg:hover { border-bottom-color: rgba(255, 210, 122, 0.8); }
.about-links { display: flex; flex-wrap: wrap; gap: 0.8em 1.6em; align-items: baseline; margin-top: 1.6em; }
.about-links a { font-size: 15px; letter-spacing: 0.08em; }
.about-links .copy { font-size: 13px; letter-spacing: 0.06em; color: var(--ink-2); }
.about-links a:not(.pg) { color: var(--ink); text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.3); }
.links a.pg { font-size: 14px; }

/* ───────── 肖像 ───────── */
#room { position: fixed; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; z-index: 3; opacity: 0; }
.prints { display: flex; justify-content: center; gap: 22px; margin: 0 0 26px; }
.prints figure { margin: 0; text-align: center; }
.prints canvas { display: block; width: 132px; height: auto; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55); }
.prints figure:nth-child(1) canvas { transform: rotate(-1.6deg); }
.prints figure:nth-child(2) canvas { transform: rotate(1.2deg); }
.prints.n1 canvas { width: 150px; transform: none; }
.prints figcaption { font-size: 11px; color: var(--ink-3); margin-top: 10px; letter-spacing: 0.1em; }
