/* STAR ROAD — 黒と紺を土台に、ネオン（シアン・マゼンタ）・銀・金。スマホ縦向きが基本 */
:root {
  --bg: #05071a; --navy: #0c1033; --panel: rgba(12, 16, 48, .94); --panel2: rgba(22, 28, 74, .9);
  --line: rgba(201, 211, 230, .28); --silver: #c9d3e6; --text: #f1f4ff; --muted: #b4bdd8;
  --cyan: #3cf2ff; --pink: #ff4fd8; --gold: #ffd76a; --red: #ff6b81; --green: #7ee0b0;
  --r: 16px; --fs: 16px;
  --sans: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.fl { --fs: 18px; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: var(--fs); line-height: 1.7; overflow-x: hidden; transition: background 1.2s; }
button, input, a { font: inherit; }
[hidden] { display: none !important; }
.frame { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; overflow: clip; }
.screen { display: none; min-height: 100vh; min-height: 100dvh; }
.screen.on { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 有名になるほど、画面が明るく・にぎやかに ---------- */
body.lv1 { background: radial-gradient(120% 70% at 50% -10%, #12204a, var(--bg) 60%); }
body.lv2 { background: radial-gradient(120% 70% at 50% -10%, #1a2a66, var(--bg) 62%), var(--bg); }
body.lv2::before, body.lv3::before, body.lv4::before { content: ""; position: fixed; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(60, 242, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 79, 216, .05) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(transparent, #000 60%); -webkit-mask-image: linear-gradient(transparent, #000 60%); }
body.lv3 { background: radial-gradient(90% 60% at 15% 0%, rgba(60, 242, 255, .22), transparent 60%), radial-gradient(90% 60% at 85% 0%, rgba(255, 79, 216, .22), transparent 60%), #070a24; }
body.lv4 { background: radial-gradient(90% 60% at 15% 0%, rgba(60, 242, 255, .34), transparent 60%), radial-gradient(90% 60% at 85% 0%, rgba(255, 79, 216, .34), transparent 60%), radial-gradient(70% 40% at 50% 100%, rgba(255, 215, 106, .18), transparent 70%), #0a0d2c; }
body.lv4 .hud { box-shadow: 0 0 0 1px rgba(255, 215, 106, .5), 0 8px 30px rgba(255, 79, 216, .25); }
body.crisis { background: radial-gradient(100% 60% at 50% 0%, rgba(255, 60, 90, .3), transparent 65%), #12040a !important; }
body.crisis::before { background-image: repeating-linear-gradient(0deg, rgba(255, 80, 100, .05) 0 2px, transparent 2px 5px) !important; }
body.crisis .hud { border-color: rgba(255, 107, 129, .7); }
body.dawn { background: radial-gradient(120% 60% at 50% 110%, rgba(255, 170, 120, .4), transparent 70%), linear-gradient(#0d1440, #1a1f50 70%, #2a2350); }
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.fx i { position: absolute; bottom: -10px; width: 4px; height: 4px; border-radius: 50%; background: var(--cyan); opacity: .7; animation: rise linear infinite; }
.fx i:nth-child(3n) { background: var(--pink); } .fx i:nth-child(5n) { background: var(--gold); width: 6px; height: 6px; }
@keyframes rise { to { transform: translateY(-110vh); opacity: 0; } }

/* ---------- ボタン（指で押しやすい 48px 以上） ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 18px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--panel2); color: var(--text); font-weight: 700; text-align: center; text-decoration: none; cursor: pointer; line-height: 1.4; transition: transform .12s, border-color .2s, background .2s; overflow-wrap: anywhere; }
.btn:hover { border-color: var(--cyan); }
.btn:active { transform: scale(.98); }
.btn:focus-visible, .ch:focus-visible, .opt-btn:focus-visible, input:focus-visible, .ic-btn:focus-visible, [role=tab]:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn.pri { background: linear-gradient(110deg, #19c9e6, #b23cf0 55%, #ff4fd8); border-color: transparent; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); box-shadow: 0 6px 22px rgba(255, 79, 216, .3); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(255, 107, 129, .7); color: #ffd0d8; background: rgba(80, 10, 24, .5); }
.btn-x { background: #000; border-color: #8a93ad; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.ic-btn { flex: none; display: grid; place-items: center; min-width: 52px; min-height: 48px; padding: 2px 6px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer; line-height: 1; }
.ic-btn span { font-size: 22px; } .ic-btn small { font-size: 10px; margin-top: 2px; }
.h2 { margin: 0 0 12px; font-size: 1.25em; line-height: 1.4; }
.h3 { margin: 0 0 10px; font-size: 1.08em; color: var(--gold); }
.h4 { margin: 14px 0 8px; font-size: 1em; }
.hint { margin: 6px 0 12px; font-size: .82em; color: var(--muted); line-height: 1.6; }
.note { margin: 18px 0 0; font-size: .76em; color: var(--muted); line-height: 1.7; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

/* ---------- タイトル ---------- */
#s-title { position: relative; }
.t-art { position: absolute; inset: 0; z-index: 0; opacity: .9; }
.t-art svg { width: 100%; height: 100%; display: block; }
.t-in { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 48px 16px 32px; text-align: center; }
.t-eye { margin: 0; font-size: 11px; letter-spacing: .3em; color: var(--silver); }
.logo { margin: 12px 0 0; line-height: 1.15; }
.logo span { display: block; }
.logo .l1 { font-size: clamp(20px, 6vw, 28px); color: var(--silver); letter-spacing: .3em; }
.logo .l2 { margin-top: 6px; white-space: nowrap; font-size: clamp(25px, 8.6vw, 46px); font-weight: 900; letter-spacing: .02em; background: linear-gradient(100deg, #9ff8ff, #ffffff 35%, #ffb8f0 65%, #ffe39a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 14px rgba(255, 79, 216, .55)); }
.logo .l3 { margin-top: 10px; font-size: clamp(16px, 5vw, 24px); letter-spacing: .3em; color: var(--gold); text-shadow: 0 0 12px rgba(255, 215, 106, .6); }
.t-lead { margin: 20px 0 0; font-size: .98em; text-shadow: 0 1px 4px #000; }
.t-btns { display: grid; gap: 10px; margin: 24px auto 0; max-width: 360px; }
.t-info { margin: 10px 0 0; font-size: .82em; color: var(--muted); }
.t-from { margin: 18px auto 0; max-width: 380px; padding: 14px; border-radius: var(--r); border: 1.5px solid var(--gold); background: rgba(10, 12, 36, .88); }
.t-from p { margin: 0; } .t-from .k { font-size: .8em; color: var(--gold); } .t-from .n { font-weight: 800; font-size: 1.1em; } .t-from .q { font-size: .85em; color: var(--muted); margin-top: 4px; }

/* ---------- 準備 ---------- */
.box { max-width: 520px; margin: 0 auto; padding: 32px 16px; }
.fld { display: block; margin: 14px 0 6px; font-weight: 700; font-size: .92em; }
.inp { width: 100%; min-height: 52px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #0a0d28; color: var(--text); }
.looks { border: 0; margin: 0; padding: 0; }
.look-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.look { position: relative; display: block; border-radius: 14px; border: 2px solid var(--line); background: var(--panel2); cursor: pointer; overflow: hidden; text-align: center; padding-bottom: 6px; }
.look input { position: absolute; opacity: 0; }
.look svg { width: 100%; height: auto; aspect-ratio: 1; display: block; }
.look span { font-size: .85em; font-weight: 700; }
.look:has(input:checked) { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(60, 242, 255, .4); }
.look:has(input:checked) span::before { content: "✓ "; color: var(--cyan); }
.look:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- HUD ---------- */
.hud { position: sticky; top: 0; z-index: 20; padding: 8px 10px 6px; background: rgba(6, 8, 28, .92); border-bottom: 1.5px solid var(--line); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.hud-top { display: flex; align-items: center; gap: 8px; }
.road { flex: 1; min-width: 0; display: flex; align-items: center; margin: 0; padding: 0; list-style: none; }
.road li { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; font-size: 10px; color: var(--muted); line-height: 1.2; }
.road li::before { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: rgba(201, 211, 230, .25); z-index: 0; }
.road li:first-child::before { display: none; }
.road li.done::before, .road li.now::before { background: linear-gradient(90deg, var(--cyan), var(--pink)); }
.road b { position: relative; z-index: 1; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(201, 211, 230, .5); background: #0a0d28; font-size: 10px; color: var(--muted); }
.road li.done b { background: var(--cyan); border-color: var(--cyan); color: #04122a; }
.road li.now b { background: var(--gold); border-color: #fff; color: #2a1a00; box-shadow: 0 0 10px var(--gold); }
.road span { margin-top: 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.road li.now span { color: var(--text); font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.st { position: relative; min-width: 0; padding: 4px 4px 5px; border-radius: 10px; background: rgba(20, 26, 70, .8); border: 1px solid var(--line); text-align: center; }
.st .lab { display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 10px; line-height: 1.2; color: var(--muted); white-space: nowrap; }
.st .lab svg { width: 12px; height: 12px; flex: none; }
.st .val { display: block; font-size: 15px; font-weight: 800; line-height: 1.25; font-variant-numeric: tabular-nums; }
.st .bar { display: block; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.st .bar i { display: block; height: 100%; background: var(--c); transition: width .6s; }
.st.low { border-color: rgba(255, 107, 129, .8); } .st.low .val::after { content: "!"; color: var(--red); margin-left: 1px; }
.st .pop { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); padding: 0 5px; border-radius: 8px; font-size: 11px; font-weight: 800; white-space: nowrap; animation: pop 1.6s forwards; pointer-events: none; }
.pop.up { background: #0e3a2c; color: #a8ffd9; border: 1px solid #3ccf96; } .pop.dn { background: #3a0e18; color: #ffc4cf; border: 1px solid #ff6b81; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 6px); } 15% { opacity: 1; transform: translate(-50%, -6px); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -14px); } }
.fol { margin: 4px 0 0; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.4; }
.fol b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.fol .jump { display: inline-block; margin-left: 6px; color: var(--gold); font-weight: 800; animation: jump .9s; }
.fol .fall { display: inline-block; margin-left: 6px; color: var(--red); font-weight: 800; animation: fall .9s; }
@keyframes jump { 0% { transform: scale(.4); } 50% { transform: scale(1.4); } 100% { transform: scale(1); } }
@keyframes fall { 0% { transform: translateY(-8px); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ---------- 舞台と本文 ---------- */
.play-body { padding: 0 0 32px; }
.stage { position: relative; height: clamp(220px, 42vh, 380px); overflow: hidden; background: #000; }
.bgw, .bgw svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.actor { position: absolute; left: 50%; bottom: 0; width: min(78%, 330px); height: 100%; transform: translateX(-50%); transition: opacity .35s; }
.actor svg, .actor img { position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.actor.hoshi { display: grid; place-items: center; } .actor.hoshi svg { position: static; width: 46%; height: auto; filter: drop-shadow(0 0 16px rgba(255, 215, 106, .6)); }
.actor.enter { animation: aIn .45s ease-out; }
@keyframes aIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translateX(-50%); } }
.scene-tag { z-index: 5; position: absolute; left: 8px; top: 8px; margin: 0; max-width: calc(100% - 16px); padding: 3px 10px; border-radius: 999px; background: rgba(5, 7, 26, .82); border: 1px solid var(--line); font-size: 12px; font-weight: 700; line-height: 1.5; }
.stage-fx { position: absolute; inset: 0; pointer-events: none; }
.stage.flame { animation: shake .5s 3; } .stage.flame .stage-fx { background: radial-gradient(circle at 50% 100%, rgba(255, 70, 90, .55), transparent 60%); animation: flick .25s 8 alternate; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes flick { from { opacity: .35; } to { opacity: 1; } }
.stage.dawn .stage-fx { background: linear-gradient(100deg, transparent 30%, rgba(255, 226, 170, .55) 50%, transparent 70%); background-size: 300% 100%; animation: sweep 2.4s ease-out; }
@keyframes sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }
.stage.drop .stage-fx { background: rgba(80, 90, 120, .45); animation: fade 1.6s forwards; }
@keyframes fade { to { opacity: 0; } }
.stage.jump .stage-fx { background: radial-gradient(circle, rgba(255, 215, 106, .5), transparent 60%); animation: fade 1.6s forwards; }
.burst { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: var(--gold); animation: burst 1.1s ease-out forwards; }
@keyframes burst { to { transform: translate(var(--x), var(--y)) scale(.4); opacity: 0; } }
body.crisis .stage .bgw { animation: glitch 3s infinite steps(1); }
@keyframes glitch { 0%, 92% { transform: none; filter: none; } 93% { transform: translateX(3px); filter: hue-rotate(20deg); } 95% { transform: translateX(-3px); } 97% { transform: none; filter: saturate(2); } }

.panel { position: relative; max-width: 720px; margin: 0 auto; padding: 12px 12px 0; }
.ln { margin: 0 0 10px; animation: lnIn .3s ease-out; }
@keyframes lnIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ln.n p { margin: 0; padding: 2px 4px; color: #e6eaf8; }
.ln.sys p { margin: 0; padding: 8px 12px; border-radius: 12px; background: rgba(60, 242, 255, .08); border: 1px dashed rgba(60, 242, 255, .5); font-size: .9em; }
.ln.sys p::before { content: "通知　"; font-size: .75em; font-weight: 800; color: var(--cyan); }
.ln.say { display: flex; gap: 8px; align-items: flex-start; }
.ln.say .ic { flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; border: 2px solid var(--c, var(--silver)); background: #10143a; }
.ln.say .ic svg { width: 100%; height: 100%; display: block; }
.ln.say .bub { min-width: 0; flex: 1; padding: 8px 12px; border-radius: 4px 14px 14px 14px; background: var(--panel2); border: 1px solid var(--line); }
.ln.say .who { display: block; font-size: .75em; font-weight: 800; color: var(--c, var(--silver)); }
.ln.say .bub p { margin: 0; }
.ln.me { flex-direction: row-reverse; } .ln.me .bub { border-radius: 14px 4px 14px 14px; background: rgba(60, 40, 110, .85); }
.next { display: flex; width: 100%; min-height: 52px; margin: 6px 0 12px; align-items: center; justify-content: center; gap: 6px; border-radius: 14px; border: 1.5px dashed var(--line); background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.next:hover { color: var(--text); border-color: var(--cyan); }
.chs { display: grid; gap: 8px; margin: 8px 0 12px; }
.chs-h { margin: 6px 0 2px; font-size: .82em; font-weight: 800; color: var(--gold); }
.ch { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid rgba(60, 242, 255, .5); background: linear-gradient(90deg, rgba(20, 40, 90, .95), rgba(40, 20, 80, .95)); color: var(--text); text-align: left; cursor: pointer; line-height: 1.5; }
.ch:hover { border-color: var(--pink); }
.ch .no { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: rgba(255, 255, 255, .12); font-size: 13px; font-weight: 800; }
.ch .tx { min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.ch small { display: block; font-weight: 500; font-size: .8em; color: var(--muted); }
.res { margin: 8px 0 12px; padding: 12px; border-radius: var(--r); background: rgba(8, 10, 32, .92); border: 1.5px solid var(--line); animation: lnIn .3s; }
.res-h { margin: 0 0 6px; font-size: .8em; color: var(--muted); } .res-h b { color: var(--text); font-size: 1.15em; }
.dl { display: grid; gap: 6px; margin: 8px 0; padding: 0; list-style: none; }
.dl li { display: flex; align-items: baseline; gap: 8px; font-size: .9em; line-height: 1.5; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 3px; min-width: 92px; padding: 1px 8px; border-radius: 999px; font-size: .82em; font-weight: 800; white-space: nowrap; }
.chip.up { background: #0e3a2c; color: #a8ffd9; border: 1px solid #3ccf96; }
.chip.dn { background: #3a0e18; color: #ffc4cf; border: 1px solid #ff6b81; }
.chip.zero { background: #22263e; color: var(--muted); border: 1px solid var(--line); }
.dl .why { min-width: 0; color: #dfe4f6; overflow-wrap: anywhere; }

/* ---------- 投稿をつくる ---------- */
.phone { margin: 4px auto 12px; max-width: 460px; padding: 12px; border-radius: 26px; border: 2px solid var(--silver); background: linear-gradient(#0a0d28, #10153e); box-shadow: 0 0 0 6px #05071a, 0 0 30px rgba(60, 242, 255, .2); }
.ph-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 8px; font-size: .82em; color: var(--muted); }
.ph-h b { color: var(--text); font-size: 1.08em; }
.step { margin: 10px 0 0; } .step h4 { margin: 0 0 6px; font-size: .85em; color: var(--gold); }
.opts { display: grid; gap: 6px; }
.opts.c2 { grid-template-columns: 1fr 1fr; }
.opt-btn { display: block; width: 100%; min-height: 50px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(22, 28, 74, .9); color: var(--text); text-align: left; cursor: pointer; line-height: 1.4; }
.opt-btn small { display: block; font-size: .78em; color: var(--muted); }
.opt-btn[aria-pressed=true] { border-color: var(--cyan); background: rgba(20, 70, 110, .9); box-shadow: inset 0 0 0 1px var(--cyan); }
.opt-btn[aria-pressed=true]::before { content: "✓ "; color: var(--cyan); font-weight: 800; }
.tag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 6px; font-size: .72em; font-weight: 800; background: rgba(255, 255, 255, .1); color: var(--silver); white-space: nowrap; }
.tag.hot { background: #5a1040; color: #ffc6ef; border: 1px solid var(--pink); }
.post { margin: 12px 0 0; padding: 10px 12px; border-radius: 14px; background: #f4f6ff; color: #121630; }
.post .pu { display: flex; align-items: center; gap: 8px; font-size: .82em; font-weight: 800; }
.post .pu .av { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: #0c1033; flex: none; }
.post .pu .av svg { width: 100%; height: 100%; display: block; }
.post .pu small { display: block; font-weight: 500; color: #5a6080; }
.post .pt { margin: 6px 0 0; font-size: .95em; overflow-wrap: anywhere; } .post .pt.empty { color: #7a809a; }
.post-go { width: 100%; margin-top: 12px; }
.meters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 10px 0 0; }
.meter { padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); text-align: center; }
.meter span { display: block; font-size: .72em; color: var(--muted); }
.meter b { font-size: 1.1em; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; margin: 8px 0 0; padding: 2px 10px; border-radius: 999px; font-weight: 800; font-size: .82em; }
.badge.viral { background: linear-gradient(90deg, var(--gold), var(--pink)); color: #2a0a20; }
.badge.flame { background: #5a0e1c; color: #ffd0d8; border: 1px solid var(--red); }
.badge.calm { background: #1e2a4a; color: var(--silver); border: 1px solid var(--line); }
.cmts { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.cmts li { padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .06); font-size: .86em; line-height: 1.5; animation: lnIn .4s both; }
.cmts li b { display: block; font-size: .8em; color: var(--muted); }
.cmts li.neg { border-left: 3px solid var(--red); } .cmts li.neg b::after { content: "（批判）"; color: var(--red); }
.cmts li.pos { border-left: 3px solid var(--green); }
.cmts li.hs { border-left: 3px solid var(--gold); }
.post.spread { position: relative; }
.post.spread::after { content: ""; position: absolute; inset: -4px; border-radius: 18px; border: 2px solid var(--cyan); animation: ring 1.2s ease-out 3; pointer-events: none; }
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.12); opacity: 0; } }
.fic { margin: 8px 0 0; font-size: .72em; color: var(--muted); text-align: center; }

/* 章の終わり */
.chend { margin: 10px 0 14px; padding: 16px; border-radius: var(--r); border: 1.5px solid var(--gold); background: rgba(10, 12, 36, .94); text-align: center; }
.chend .k { margin: 0; font-size: .78em; letter-spacing: .2em; color: var(--gold); }
.chend h3 { margin: 4px 0 10px; font-size: 1.3em; }
.chend .dl { text-align: left; }

/* ---------- 結末 ---------- */
.end-wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 40px; }
.end-eye { margin: 0 0 10px; text-align: center; letter-spacing: .4em; color: var(--gold); font-weight: 800; }
.rcard { position: relative; display: grid; grid-template-columns: 1fr; overflow: hidden; border-radius: 22px; border: 2px solid var(--c, var(--gold)); background: radial-gradient(90% 70% at 50% 0%, rgba(60, 242, 255, .2), transparent 60%), linear-gradient(160deg, #10153e, #070920); box-shadow: 0 0 30px rgba(255, 79, 216, .2); }
.rc-art { height: 220px; background: radial-gradient(60% 70% at 50% 60%, var(--c, #3cf2ff), transparent 72%); opacity: .95; }
.rc-art svg { width: 100%; height: 100%; display: block; }
.rc-body { padding: 14px 16px 18px; text-align: center; }
.rc-type { display: inline-block; margin: 0; padding: 2px 14px; border-radius: 999px; background: var(--c, var(--gold)); color: #0a0c20; font-weight: 900; font-size: .9em; }
.rc-name { margin: 8px 0 0; font-size: clamp(22px, 6.6vw, 32px); line-height: 1.35; overflow-wrap: anywhere; }
.rc-one { margin: 8px 0 0; font-weight: 700; color: var(--silver); overflow-wrap: anywhere; }
.rc-one::before { content: "ひとこと："; font-size: .8em; color: var(--muted); }
.rc-stats { display: grid; gap: 4px; margin: 12px 0 0; padding: 0; list-style: none; text-align: left; }
.rc-stats li { display: grid; grid-template-columns: 6.5em 1fr 2.4em; align-items: center; gap: 8px; font-size: .82em; }
.rc-stats .bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; } .rc-stats .bar i { display: block; height: 100%; background: var(--c2); }
.rc-stats b { text-align: right; font-variant-numeric: tabular-nums; }
.rc-fol { margin: 10px 0 0; font-size: .82em; color: var(--muted); }
.rc-game { margin: 8px 0 0; font-size: .75em; letter-spacing: .05em; color: var(--silver); }
.end-desc { margin: 16px 0 0; }
.end-lines { margin: 12px 0 0; }
.end-sec { margin: 20px 0 0; padding: 16px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
.why { margin: 0; padding-left: 1.2em; } .why li { margin: 4px 0; overflow-wrap: anywhere; }
.sh-prev { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: #0a0d28; border: 1px solid var(--line); font-size: .85em; white-space: pre-wrap; overflow-wrap: anywhere; }
.sh-btns { display: grid; gap: 8px; }
.ig-img { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto 10px; border-radius: 14px; border: 1px solid var(--line); }
.ig-wait { color: var(--muted); font-size: .85em; }
.end-btns { display: grid; gap: 10px; margin: 22px 0 0; }

/* ---------- モーダル ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(2, 3, 12, .78); }
.m-box { width: 100%; max-width: 440px; max-height: calc(100dvh - 32px); overflow: auto; padding: 18px 16px; border-radius: 20px; background: #0c1036; border: 1.5px solid var(--line); }
.m-box.wide { max-width: 720px; }
.m-list { display: grid; gap: 8px; margin: 8px 0; }
.opt { margin: 0 0 14px; padding: 8px 12px 10px; border-radius: 12px; border: 1px solid var(--line); }
.opt legend { padding: 0 4px; font-weight: 700; font-size: .9em; }
.opt label { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.opt input { width: 20px; height: 20px; accent-color: var(--cyan); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 12px; }
.tabs [role=tab] { min-height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.tabs [role=tab][aria-selected=true] { color: var(--text); border-color: var(--cyan); background: rgba(20, 70, 110, .6); }
.ends-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.ecell { padding: 10px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(22, 28, 74, .6); min-height: 96px; }
.ecell.got { border-color: var(--c); background: linear-gradient(160deg, rgba(40, 50, 120, .8), rgba(12, 16, 48, .9)); }
.ecell p { margin: 0; font-size: .78em; color: var(--muted); line-height: 1.5; } .ecell b { display: block; margin: 2px 0; font-size: .92em; overflow-wrap: anywhere; }
.ecell .t { color: var(--c); font-weight: 800; }
.scene-list { margin-bottom: 12px; }
.scene-list h3 { margin: 12px 0 6px; font-size: .9em; color: var(--gold); }
.scene-list ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.scene-list button { width: 100%; min-height: 48px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(22, 28, 74, .8); color: var(--text); text-align: left; cursor: pointer; }
.scene-list .lock { padding: 8px 12px; border-radius: 10px; border: 1px dashed var(--line); color: var(--muted); font-size: .88em; }
.read-body { margin-bottom: 12px; }
.read-body .rch { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .05); font-size: .88em; }
.toast { position: fixed; left: 50%; bottom: 20px; z-index: 60; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: #1c2250; border: 1px solid var(--cyan); transform: translate(-50%, 140%); opacity: 0; visibility: hidden; transition: transform .3s, opacity .3s, visibility .3s; font-size: .9em; }
.toast.on { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* タイトル絵の動き */
.title-art .road { animation: glow 3s ease-in-out infinite alternate; } .title-art .bigstar { transform-origin: 300px 168px; animation: tw2 2.6s ease-in-out infinite alternate; }
@keyframes glow { from { opacity: .7; } to { opacity: 1; } }
@keyframes tw2 { from { transform: scale(.94); } to { transform: scale(1.06); } }
.tw { animation: tw 3s ease-in-out infinite alternate; } @keyframes tw { from { opacity: .2; } to { opacity: .9; } }
.blink { animation: blink 5.5s infinite; } @keyframes blink { 0%, 95%, 100% { opacity: 0; } 96%, 98% { opacity: 1; } }
.sway { transform-box: fill-box; transform-origin: top center; animation: sway 4s ease-in-out infinite alternate; } @keyframes sway { from { transform: rotate(-1.2deg); } to { transform: rotate(1.2deg); } }
svg [stroke-width="1"], svg [stroke-width="1.2"], svg [stroke-width="1.4"], svg [stroke-width="1.6"] { vector-effect: non-scaling-stroke; }

/* ---------- 広い画面：舞台を左、本文を右に ---------- */
@media (min-width: 900px) {
  .hud { padding: 10px 20px 8px; }
  .road li { font-size: 12px; }
  .stats { max-width: 760px; margin: 8px auto 0; gap: 8px; }
  .st .lab { font-size: 12px; } .st .val { font-size: 18px; }
  .play-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; padding: 16px 20px 40px; align-items: start; }
  .stage { position: sticky; top: 150px; height: min(68vh, 600px); border-radius: 20px; border: 1.5px solid var(--line); }
  .panel { padding: 0; max-width: none; margin: 0; width: 100%; }
  .t-in { padding-top: 72px; }
  .rcard { grid-template-columns: 2fr 3fr; } .rc-art { height: auto; min-height: 300px; } .rc-body { text-align: left; align-self: center; }
  .end-btns, .sh-btns { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 600px) and (max-width: 899px) { .stage { height: clamp(260px, 44vh, 420px); } .chs { gap: 10px; } }
@media (max-width: 359px) { .st .lab svg { display: none; } .st .val { font-size: 14px; } .ch { padding: 10px; } .chip { min-width: 84px; } }


/* ---------- 準備画面のカード ---------- */
.pick { border: 0; margin: 0; padding: 0; }
.card-row { display: grid; gap: 8px; }
.pcard { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel2); cursor: pointer; line-height: 1.5; }
.pcard input { position: absolute; opacity: 0; }
.pc-art { flex: none; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: #10143a; }
.pc-art svg { width: 100%; height: 100%; display: block; }
.pc-tx { min-width: 0; display: grid; gap: 2px; }
.pc-tx b { font-size: .95em; overflow-wrap: anywhere; } .pc-tx b small { font-weight: 500; color: var(--muted); }
.pc-tx span { font-size: .78em; color: var(--muted); overflow-wrap: anywhere; }
.pcard:has(input:checked) { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(60, 242, 255, .35); background: rgba(20, 60, 100, .7); }
.pcard:has(input:checked) b::before { content: "✓ "; color: var(--cyan); }
.pcard:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.sticky-go { position: sticky; bottom: 0; z-index: 5; margin: 16px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(5, 7, 26, .96) 30%); }
@media (min-width: 600px) { .card-row.c2 { grid-template-columns: 1fr 1fr; } .box { max-width: 760px; } }

/* ---------- ふたりの構図（距離と視線で関係を見せる） ---------- */
.actor.a2 { display: none; }
.stage.duo .actor { width: 50%; max-width: 300px; transition: left .9s ease, filter .4s, opacity .4s; }
.stage.duo .actor.a2 { display: block; }
.stage.d-far .actor.a2 { left: 24%; } .stage.d-far .actor:not(.a2) { left: 76%; }
.stage.d-mid .actor.a2 { left: 31%; } .stage.d-mid .actor:not(.a2) { left: 69%; }
.stage.d-near .actor.a2 { left: 37%; } .stage.d-near .actor:not(.a2) { left: 63%; }
.stage.duo .actor.dim { filter: brightness(.68) saturate(.8); }
.stage.duo .actor.spk { filter: none; z-index: 2; }
.actor svg { transition: transform .5s ease; transform-origin: 50% 100%; }
.actor.slump svg { transform: translateY(10px) rotate(-1.5deg); }
.actor.lift svg { transform: translateY(-6px); }
.stage.tense .stage-fx { background: radial-gradient(ellipse at 50% 55%, transparent 35%, rgba(20, 0, 10, .55) 100%); }
.stage.tense .bgw { filter: saturate(.6) brightness(.8); }

/* ---------- 物語の熱量を伝える演出（本文・選択肢の上には重ならない） ---------- */
.stage-fx { overflow: hidden; }
.nf { position: absolute; left: 100%; padding: 3px 10px; border-radius: 999px; background: rgba(10, 14, 44, .9); border: 1px solid var(--cyan); color: #dffcff; font-size: 12px; font-weight: 700; white-space: nowrap; animation: fly 2.8s cubic-bezier(.3, .6, .4, 1) both; box-shadow: 0 0 12px rgba(60, 242, 255, .45); }
.nf:nth-child(3n) { border-color: var(--pink); box-shadow: 0 0 12px rgba(255, 79, 216, .45); } .nf:nth-child(4n) { border-color: var(--gold); }
@keyframes fly { from { left: 100%; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } to { left: -70%; opacity: 0; } }
.chain { position: absolute; left: 50%; top: 40%; width: 54px; height: 38px; margin: -19px -27px; border-radius: 8px; background: #f4f6ff; box-shadow: 0 0 0 2px var(--cyan), 0 0 18px rgba(60, 242, 255, .6); animation: chain 1.8s ease-out both; animation-delay: calc(var(--d) * .3s); }
.chain::before { content: ""; position: absolute; left: 6px; right: 6px; top: 8px; height: 4px; border-radius: 2px; background: #c9d3e6; box-shadow: 0 9px 0 #c9d3e6, 0 18px 0 #dfe4f6; }
@keyframes chain { from { transform: scale(.2); opacity: 0; } 30% { opacity: 1; } to { transform: translate(calc((var(--d) - 1.5) * 80px), calc(var(--d) * -14px - 40px)) scale(1); opacity: 0; } }
.stage.buzz .bgw { animation: pulse 1.2s ease-in-out 3; }
@keyframes pulse { 50% { filter: brightness(1.35) saturate(1.3); } }
.frag { position: absolute; max-width: 58%; padding: 2px 8px; border-radius: 6px; background: rgba(60, 0, 14, .72); color: #ffd6de; font-size: 12px; line-height: 1.4; animation: fragIn .4s both, jit .18s steps(2) infinite; opacity: .85; }
.frag:nth-child(2n) { filter: blur(.6px); font-size: 14px; } .frag:nth-child(3n) { opacity: .55; }
@keyframes fragIn { from { opacity: 0; transform: scale(1.3); } }
@keyframes jit { 50% { transform: translate(1px, -1px); } }
.stage.confuse .bgw { filter: hue-rotate(-20deg) saturate(1.3) contrast(1.1); }
.lan { position: absolute; max-width: 46%; padding: 4px 10px; border-radius: 12px; background: rgba(255, 215, 106, .16); border: 1px solid rgba(255, 215, 106, .8); color: #fff6d8; font-size: 12px; line-height: 1.45; box-shadow: 0 0 16px rgba(255, 215, 106, .55); animation: lanIn 1.2s ease-out both, flt 3.2s ease-in-out 1.2s infinite alternate; }
@keyframes lanIn { from { opacity: 0; transform: translateY(14px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes flt { to { transform: translateY(-6px); } }
.stage.glow .stage-fx { background: radial-gradient(circle at 50% 80%, rgba(255, 215, 106, .28), transparent 60%); }
.stage.restore .actor { animation: restoreA 3.2s ease-out both; }
.stage.restore .bgw { animation: restoreA 3.2s ease-out both, cam 4s ease-out both; }
@keyframes cam { from { transform: scale(1.08) translateY(10px); } to { transform: none; } }
@keyframes restoreA { 0% { filter: grayscale(1) brightness(.55); } 35% { filter: grayscale(.65) brightness(.72); } 70% { filter: grayscale(.25) brightness(.9); } 100% { filter: none; } }
.stage.restore .stage-fx { background: linear-gradient(100deg, transparent 30%, rgba(255, 226, 170, .45) 50%, transparent 70%); background-size: 300% 100%; animation: sweep 3s ease-out .6s both; }
body.quiet { background: #05060f !important; }
body.quiet::before { opacity: 0; }
body.quiet .fx { opacity: 0; }
body.quiet .stage .bgw, body.quiet .stage .actor { filter: saturate(.35) brightness(.7); transition: filter 2.6s ease; }
body.quiet .hud { box-shadow: none; }
.stage.drop .bgw { animation: dim 2.4s ease forwards; }
@keyframes dim { to { filter: saturate(.4) brightness(.65); } }

/* ---------- 結末 ---------- */
.rc-route { margin: 0 0 6px; font-size: .78em; color: var(--muted); }
.epi { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.epi li { padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .05); border-left: 3px solid var(--gold); overflow-wrap: anywhere; }
.epi li b { display: block; font-size: .8em; color: var(--gold); }
.ends-h { margin: 6px 0 8px; font-size: .95em; color: var(--gold); }

/* 動きを減らす */
html.rm *, html.rm *::before, html.rm *::after { animation: none !important; transition: none !important; }
html.rm .fx { display: none; }
html.rm .stage-fx > * { display: none; }
