/* 社内政治サバイバル — スマートフォン優先のデザイン（幅320pxから） */
:root {
  --navy: #1b2340; --navy2: #2a3560; --ink: #1f2433; --muted: #5b6074; --paper: #fffdf8; --cream: #fff6e6;
  --red: #ff4d5e; --yellow: #ffe14d; --blue: #3d7cff; --gold: #f2b134; --line: #e6dccb;
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .9, .25, 1.15);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: #10162c; min-height: 100vh; overflow-x: hidden;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px); background-size: 32px 32px; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
.app { position: relative; max-width: 760px; margin: 0 auto; background: var(--paper); min-height: 100vh; min-height: 100svh; box-shadow: 0 0 60px rgba(0, 0, 0, .5); overflow-x: hidden; }
.screen { display: none; }
.screen.is-active { display: block; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 26px; border: 0; border-radius: 14px; font-weight: 800; font-size: 17px; letter-spacing: .02em; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.btn:active { transform: translateY(2px); }
.btn-main { background: var(--red); color: #fff; box-shadow: 0 5px 0 #b8293a, 0 12px 24px -10px rgba(255, 77, 94, .7); }
.btn-sub { background: #fff; color: var(--navy); border: 2px solid var(--navy); box-shadow: 0 4px 0 var(--navy); }
.btn-x { background: #000; color: #fff; box-shadow: 0 4px 0 #444; }
.btn-text { min-height: 44px; padding: 0 12px; border: 0; background: none; font-weight: 700; color: var(--navy); text-decoration: underline; text-underline-offset: 4px; }
.fiction { margin: 0; padding: 14px 16px 22px; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- タイトル ---------- */
#s-title.is-active { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
.t-stage { position: relative; height: clamp(220px, 40svh, 360px); overflow: hidden; background: #efe9df; }
.t-bg, .t-bg svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.t-bg .door-l, .t-bg .door-r { transition: transform .9s cubic-bezier(.6, 0, .3, 1); transform-box: fill-box; }
.t-bg .door-l { transform-origin: left center; } .t-bg .door-r { transform-origin: right center; }
.t-stage.open .door-l { transform: scaleX(.06); } .t-stage.open .door-r { transform: scaleX(.06); }
.t-stage.open .t-bg { animation: zoomIn 1s .25s cubic-bezier(.6, 0, .3, 1) both; }
.t-stage.open .t-parade { animation: paradeOut .6s both; }
@keyframes zoomIn { to { transform: scale(2.4); opacity: 0; } }
@keyframes paradeOut { to { transform: translateY(60%); opacity: 0; } }
.t-parade { position: absolute; left: 0; right: 0; bottom: -6%; display: flex; justify-content: center; padding: 0 2%; }
.pp { width: 15%; max-width: 110px; margin: 0 -2.4%; animation: peek .7s calc(var(--i) * .08s) var(--ease) both, bob 3.2s calc(1s + var(--i) * .3s) ease-in-out infinite; transform-origin: bottom center; }
.pp:nth-child(odd) { margin-bottom: 4%; }
.pp svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .18)); }
@keyframes peek { from { transform: translateY(80%) rotate(-8deg); } }
@keyframes bob { 50% { transform: translateY(-5%) rotate(1.5deg); } }
.t-copy { position: relative; padding: 18px 20px 0; text-align: center; }
.brand { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.t-kicker { margin: 0; }
.t-kicker span { display: inline-block; padding: 4px 12px; border: 2px solid var(--red); color: var(--red); font-weight: 900; font-size: 13px; letter-spacing: .1em; transform: rotate(-3deg); border-radius: 4px; animation: stampIn .5s .4s var(--ease) both; }
@keyframes stampIn { from { transform: scale(2.4) rotate(-12deg); opacity: 0; } }
.t-title { margin: 10px 0 0; line-height: 1.02; font-weight: 900; color: var(--navy); }
.t-title .l1 { display: inline-block; font-size: clamp(36px, 11.5vw, 64px); background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%); padding: 0 .1em; animation: slideUp .6s .1s var(--ease) both; }
.t-title .l2 { display: block; font-size: clamp(44px, 14.4vw, 84px); color: var(--red); letter-spacing: -.02em; text-shadow: 3px 3px 0 var(--navy); animation: slideUp .6s .22s var(--ease) both; }
.t-title .l3 { display: block; margin-top: 8px; font-size: clamp(14px, 4.2vw, 19px); letter-spacing: .06em; color: var(--navy); animation: slideUp .6s .34s var(--ease) both; }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } }
.t-hook { margin: 14px 0 0; font-size: 15px; line-height: 1.7; color: var(--ink); }
.t-q { margin: 10px auto 0; display: inline-block; padding: 8px 16px; background: var(--navy); color: #fff; border-radius: 999px; font-size: 15px; }
.t-actions { display: grid; justify-items: center; gap: 10px; padding: 18px 20px 4px; }
.t-actions .btn { width: min(100%, 360px); }
.t-row { display: flex; gap: 10px; }
.t-meta, .t-seen { margin: 0; font-size: 13px; color: var(--muted); }
.t-seen { color: var(--red); font-weight: 700; }

/* ---------- プレイ画面 ---------- */
#s-play.is-active { display: flex; flex-direction: column; height: 100vh; height: 100svh; min-height: 480px; }
.hud { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px 6px 12px; padding-top: max(6px, env(safe-area-inset-top)); background: var(--navy); color: #fff; }
.hud-l { margin: 0; font-size: 13px; white-space: nowrap; }
.hud-l b { font-size: 14px; }
.hud-l span { opacity: .7; }
.hud-r { display: flex; gap: 4px; }
.hb { position: relative; display: inline-flex; align-items: center; gap: 3px; min-width: 44px; min-height: 40px; padding: 0 8px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 10px; background: rgba(255, 255, 255, .08); color: #fff; font-size: 12px; font-weight: 700; justify-content: center; }
.hb span { font-size: 15px; }
.hb .badge { position: absolute; top: -6px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--red); font-style: normal; font-size: 11px; line-height: 18px; text-align: center; }
.hb.bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35) rotate(-6deg); } }
@media (max-width: 430px) { .hb i { display: none; } .hb { padding: 0 6px; } }

.stage { position: relative; flex: 1 1 auto; min-height: 220px; overflow: hidden; container-type: size; background: #e8eef6; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bg, .bg svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.bg.bg-in { animation: bgIn .7s ease both; }
@keyframes bgIn { from { transform: scale(1.18); filter: blur(6px); } }
.stage.shake-angry { animation: shake .45s; }
.stage.shake-surprise { animation: jolt .4s; }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes jolt { 30% { transform: scale(1.03); } }
.air { position: absolute; inset: 0; pointer-events: none; transition: background 1s, opacity 1s; opacity: 0; z-index: 1; }
.air.warm { opacity: 1; background: radial-gradient(ellipse at 50% 100%, rgba(255, 190, 80, .45), transparent 70%); }
.air.cold { opacity: 1; background: radial-gradient(ellipse at 50% 100%, rgba(80, 120, 255, .4), transparent 70%); }
.air.calm { opacity: 0; }
.cast { position: absolute; inset: 0; z-index: 2; }
.ch { position: absolute; bottom: -3%; left: var(--x); width: min(var(--w), 76cqh); max-width: 380px; transform: translateX(-50%); transition: left .5s var(--ease), width .5s var(--ease), filter .3s; }
.ch-in { transform-origin: 50% 100%; transition: transform .35s var(--ease); }
.ch-in svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .22)); }
.ch-tag { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); padding: 2px 10px; border-radius: 999px; background: var(--c); color: #fff; font-size: 12px; font-weight: 800; white-space: nowrap; box-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.ch.is-speaking { z-index: 3; }
.ch.is-speaking .ch-in { transform: scale(1.08) translateY(-3%); }
.ch.is-quiet { filter: brightness(.78) saturate(.8); }
.ch.is-quiet .ch-in { transform: scale(.93); }
.ch.in-l .ch-in { animation: inL .7s var(--ease) both; }
.ch.in-r .ch-in { animation: inR .7s var(--ease) both; }
@keyframes inL { from { transform: translateX(-130%) rotate(-12deg); opacity: 0; } }
@keyframes inR { from { transform: translateX(130%) rotate(12deg); opacity: 0; } }
.ch.pop .ch-in svg { animation: pop .42s var(--ease); }
@keyframes pop { 0% { transform: scale(.9, 1.08); } 50% { transform: scale(1.06, .95); } }
.ch.f-angry.pop .ch-in svg { animation: angry .5s; }
@keyframes angry { 20%, 60% { transform: translateX(-4%) rotate(-2deg); } 40%, 80% { transform: translateX(4%) rotate(2deg); } }
.ch.f-surprise.pop .ch-in svg { animation: jump .5s var(--ease); }
@keyframes jump { 40% { transform: translateY(-12%) scale(1.04); } }
.ch.f-laugh.pop .ch-in svg { animation: laugh .6s; }
@keyframes laugh { 25%, 75% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.ch.f-sad.pop .ch-in svg { animation: sink .6s ease; }
@keyframes sink { 50% { transform: translateY(5%) scale(.97); } }
.ch.glow-up .ch-in svg { animation: glowUp 1s ease; }
.ch.glow-down .ch-in svg { animation: glowDown 1s ease; }
@keyframes glowUp { 30% { filter: drop-shadow(0 0 18px rgba(255, 200, 60, .95)) brightness(1.1); transform: translateY(-4%); } }
@keyframes glowDown { 30% { filter: drop-shadow(0 0 18px rgba(255, 60, 80, .9)) grayscale(.4); transform: translateX(3%); } }
.cfx { animation: cfx 1s ease infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes cfx { to { transform: scale(1.15); } }

/* 視線・関係の線 */
.gaze, .ties { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
.gz { stroke: rgba(255, 255, 255, .9); stroke-width: 2; stroke-dasharray: .03 .02; animation: gz 1.2s linear infinite, drawIn .6s ease both; filter: drop-shadow(0 0 3px rgba(0, 0, 0, .6)); transition: stroke .4s, stroke-width .4s, opacity .4s; }
@keyframes gz { to { stroke-dashoffset: -.1; } }
@keyframes drawIn { from { opacity: 0; } }
.gz.good { stroke: var(--gold); stroke-width: 4; stroke-dasharray: none; }
.gz.bad { stroke: var(--red); stroke-width: 3; }
.gz.fade { opacity: .15; }
.tie { stroke-width: 5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: tie .7s var(--d) ease forwards; }
.tie.up { stroke: var(--gold); filter: drop-shadow(0 0 6px rgba(255, 200, 60, .9)); }
.tie.down { stroke: var(--red); animation: tie .5s var(--d) ease forwards, snap .5s calc(var(--d) + .6s) ease forwards; }
@keyframes tie { to { stroke-dashoffset: 0; } }
@keyframes snap { to { stroke-dasharray: .2 .08; opacity: .35; } }
.fxl { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.ribs { position: absolute; top: 10px; left: 8px; right: 8px; display: grid; justify-items: center; gap: 6px; }
.rib { margin: 0; padding: 8px 14px; border-radius: 12px; background: #fff; border: 3px solid var(--c); font-size: 14px; font-weight: 800; box-shadow: 0 6px 0 rgba(0, 0, 0, .18); animation: ribIn .55s var(--d) var(--ease) both; max-width: 100%; }
.rib.down { background: #fff1f2; }
@keyframes ribIn { from { transform: translateX(120%) rotate(6deg) scale(.7); opacity: 0; } }

/* 裏ログのカード */
.logfly { position: absolute; left: 50%; top: 50%; width: min(86%, 380px); padding: 16px 18px 14px; background: #fffbe8; border: 3px solid var(--navy); border-radius: 6px; box-shadow: 10px 10px 0 rgba(27, 35, 64, .35); transform: translate(-50%, -50%) rotate(-2deg); animation: logIn .7s var(--ease) both; }
.logfly:before { content: ''; position: absolute; top: -12px; left: 50%; width: 90px; height: 22px; margin-left: -45px; background: rgba(255, 225, 77, .85); transform: rotate(3deg); }
@keyframes logIn { from { transform: translate(60%, 80%) rotate(25deg) scale(.4); opacity: 0; } }
.logfly.to-hud { animation: logOut .5s ease forwards; }
@keyframes logOut { to { transform: translate(110%, -160%) rotate(10deg) scale(.1); opacity: 0; } }
.lf-k { margin: 0; font-size: 12px; font-weight: 900; color: var(--red); letter-spacing: .14em; }
.lf-t { margin: 4px 0 8px; font-size: 17px; font-weight: 900; }
.lf-t span { margin-right: 6px; }
.lf-b { margin: 0; font-size: 14px; line-height: 1.7; }
.lf-s { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }
.cards { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.lc { position: absolute; left: 50%; top: 34%; width: min(40%, 190px); padding: 10px 10px; background: #fffbe8; border: 2px solid var(--navy); border-radius: 6px; font-size: 12.5px; font-weight: 800; line-height: 1.4; box-shadow: 4px 4px 0 rgba(27, 35, 64, .35); transform: translate(calc(-50% + var(--x) * 3.4), -50%) rotate(var(--a)); }
.lc span { display: block; font-size: 20px; }
.cards.spread .lc { animation: spread .8s calc(var(--i) * .09s) var(--ease) both; }
@keyframes spread { from { transform: translate(-50%, 120%) scale(.3) rotate(40deg); opacity: 0; } }
.nolog { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); margin: 0; padding: 10px 16px; background: rgba(255, 255, 255, .9); border-radius: 10px; font-weight: 700; white-space: nowrap; }

/* スマホのチャット */
.phone { position: absolute; z-index: 5; top: 8px; bottom: 8px; left: 50%; width: min(94%, 420px); transform: translateX(-50%); display: flex; flex-direction: column; background: #f4f6fb; border: 6px solid var(--navy); border-radius: 26px; overflow: hidden; box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .5); }
.phone.phone-in { animation: phoneIn .6s var(--ease) both; }
@keyframes phoneIn { from { transform: translate(-50%, 110%) rotate(8deg); } }
.ph-head { margin: 0; padding: 8px 14px; background: var(--navy); color: #fff; font-weight: 800; font-size: 14px; }
.ph-body { flex: 1; overflow-y: auto; padding: 10px 10px 4px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.ph-hint { margin: 0; padding: 4px 0 6px; text-align: center; font-size: 11.5px; color: var(--muted); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.bb { display: flex; gap: 8px; align-items: flex-start; animation: bbIn .45s var(--ease) both; }
@keyframes bbIn { from { transform: translateX(40px) scale(.85); opacity: 0; } }
.bb-av { flex: none; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: var(--c); border: 2px solid var(--c); }
.bb-av svg { width: 150%; height: auto; margin: -8% 0 0 -25%; display: block; }
.bb-c { min-width: 0; display: grid; gap: 2px; }
.bb-c b { font-size: 11.5px; color: var(--c); }
.bb-c span { display: inline-block; padding: 8px 12px; border-radius: 4px 14px 14px 14px; background: #fff; font-size: 15px; line-height: 1.6; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); overflow-wrap: anywhere; }
.bb-sys { align-self: center; padding: 6px 12px; border-radius: 999px; background: rgba(27, 35, 64, .1); font-size: 13px; text-align: center; }
.bb-typing { display: flex; gap: 4px; padding: 10px 14px; align-self: flex-start; margin-left: 46px; background: #fff; border-radius: 14px; }
.bb-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa3ae; animation: dot 1s infinite; }
.bb-typing i:nth-child(2) { animation-delay: .15s; } .bb-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-4px); } }

/* 場面転換 */
.cut { position: fixed; inset: 0; z-index: 30; pointer-events: none; display: grid; place-items: center; visibility: hidden; }
.cut.run { visibility: visible; animation: cutHide 1.15s step-end forwards; }
@keyframes cutHide { to { visibility: hidden; } }
.cut-in { width: 140%; padding: 22px 0; background: var(--navy); color: #fff; text-align: center; transform: rotate(-6deg) translateX(110%); box-shadow: 0 0 0 8px var(--yellow); }
.cut.run .cut-in { animation: cutRun 1.1s cubic-bezier(.7, 0, .3, 1) forwards; }
@keyframes cutRun { 0% { transform: rotate(-6deg) translateX(110%); } 35%, 62% { transform: rotate(-6deg) translateX(0); } 100% { transform: rotate(-6deg) translateX(-110%); } }
.cut.place-board .cut-in, .cut.place-meeting .cut-in { background: #2a1a2e; box-shadow: 0 0 0 8px var(--red); }
.cut.place-night .cut-in, .cut.place-archive .cut-in { background: #0f1430; box-shadow: 0 0 0 8px #5a8cff; }
.cut-time { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .2em; color: var(--yellow); }
.cut-title { margin: 4px 0; font-size: clamp(28px, 9vw, 44px); font-weight: 900; }
.cut-sub { margin: 0; font-size: 13px; opacity: .85; }

/* 文章と選択肢 */
.panel { position: relative; flex: none; padding: 12px 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); background: var(--paper); border-top: 4px solid var(--navy); min-height: 172px; }
.panel.is-chat { min-height: 0; }
.panel.is-chat .msg { display: none; }
.msg { cursor: pointer; min-height: 120px; padding-right: 4px; }
.msg.msg-in { animation: msgIn .3s ease both; }
@keyframes msgIn { from { transform: translateY(6px); opacity: .3; } }
.who { display: inline-block; margin: 0 0 6px; min-height: 26px; padding: 3px 12px; border-radius: 8px; background: var(--c, transparent); color: #fff; font-weight: 900; font-size: 14px; }
.who:empty { padding: 0; }
.txt { margin: 0; font-size: 16.5px; line-height: 1.8; min-height: 3.6em; overflow-wrap: anywhere; }
.msg.is-sys .txt { color: #3d4256; font-style: normal; padding: 6px 10px; border-left: 4px solid var(--gold); background: var(--cream); }
.msg.is-thought .txt { color: var(--muted); }
.next { position: absolute; right: 16px; bottom: 10px; color: var(--red); font-size: 14px; animation: blink 1s infinite; }
.panel.is-chat .next, .opts:not([hidden]) ~ .next { display: none; }
.skip { position: absolute; right: 10px; top: 8px; z-index: 8; min-height: 36px; padding: 0 12px; border: 2px solid var(--navy); border-radius: 999px; background: #fff; color: var(--navy); font-size: 12.5px; font-weight: 800; }
.panel.is-asking .skip { display: none; }
.panel.is-chat .skip { top: -46px; background: rgba(27, 35, 64, .85); color: #fff; border-color: transparent; }
.opts.opts-in .prompt { animation: slideUp .4s var(--ease) both; }
.prompt { margin: 0 0 10px; font-size: 15px; font-weight: 900; color: var(--navy); }
.prompt:before { content: 'Q. '; color: var(--red); }
.opt-list { display: grid; gap: 8px; }
.opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 8px 12px; border: 2px solid var(--navy); border-radius: 12px; background: #fff; text-align: left; font-size: 15px; font-weight: 700; line-height: 1.45; box-shadow: 0 4px 0 var(--navy); transition: transform .12s, background .2s; }
.opts.opts-in .opt { animation: optIn .5s calc(.08s + var(--d) * .08s) var(--ease) both; }
@keyframes optIn { from { transform: translateX(60px); opacity: 0; } }
.opt:hover { background: #fffbe0; }
.opt:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--navy); }
.opt-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 900; }
.opt-t { min-width: 0; overflow-wrap: anywhere; }
.opt.is-picked { background: var(--yellow); animation: picked .5s var(--ease) forwards; }
@keyframes picked { 40% { transform: scale(1.04) rotate(-1deg); } 100% { transform: scale(1.02); } }
.opt.is-out { animation: optOut .4s ease forwards; }
@keyframes optOut { to { transform: translateX(-40px); opacity: 0; } }

/* ---------- エンディング ---------- */
#s-end { --ec: var(--red); }
.e-top { position: relative; padding: 26px 18px 0; text-align: center; background: linear-gradient(180deg, var(--navy) 0, var(--navy) 62%, var(--paper) 62%); color: #fff; overflow: hidden; }
.e-no { margin: 0; font-size: 13px; font-weight: 900; letter-spacing: .24em; color: var(--yellow); }
.e-name { margin: 6px 0 4px; font-size: clamp(28px, 8.6vw, 44px); font-weight: 900; line-height: 1.2; outline: 0; display: inline-block; padding: 4px 14px; border: 4px solid var(--ec); border-radius: 8px; transform: rotate(-2deg); background: rgba(255, 255, 255, .06); }
.e-top.stamp-in .e-name { animation: stamp .7s .2s var(--ease) both; }
@keyframes stamp { 0% { transform: scale(3) rotate(-14deg); opacity: 0; } 60% { transform: scale(.94) rotate(-2deg); opacity: 1; } 100% { transform: rotate(-2deg); } }
.e-type { margin: 10px 0 0; font-size: 14px; }
.e-type b { display: inline-block; padding: 2px 12px; border-radius: 999px; background: var(--ec); color: #fff; font-size: 16px; }
.e-catch { margin: 10px 0 0; font-size: 17px; font-weight: 800; line-height: 1.6; }
.e-art { position: relative; height: clamp(190px, 52vw, 300px); margin: 14px -18px 0; overflow: hidden; }
.ea-bg, .ea-bg svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .9; }
.ea { position: absolute; bottom: -4%; width: 34%; max-width: 230px; }
.ea svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .3)); }
.ea0 { left: 50%; transform: translateX(-50%); width: 40%; z-index: 2; animation: inUp .8s .4s var(--ease) both; }
.ea1 { left: 4%; animation: inL .8s .6s var(--ease) both; }
.ea2 { right: 4%; animation: inR .8s .7s var(--ease) both; }
@keyframes inUp { from { transform: translate(-50%, 100%); } }
.e-block { margin: 18px 14px 0; padding: 18px 16px; background: #fff; border: 2px solid var(--line); border-radius: 16px; }
.e-block h3 { margin: 0 0 12px; font-size: 17px; font-weight: 900; color: var(--navy); }
.e-story { margin: 12px 0 0; font-size: 15px; line-height: 1.85; }
.org { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 460px; background: #f6f8fc; border-radius: 12px; overflow: hidden; background-image: linear-gradient(rgba(27, 35, 64, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(27, 35, 64, .05) 1px, transparent 1px); background-size: 20px 20px; }
@media (min-width: 560px) { .org { aspect-ratio: 4 / 3; } }
.ol-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ol { stroke: #8a93ad; stroke-width: 2; transition: opacity .5s; }
.ol.gone { opacity: 0; }
.ol.new { stroke: var(--navy); stroke-width: 2.5; stroke-dasharray: 1; stroke-dashoffset: 1; animation: tie .6s var(--d) ease forwards; }
.on { position: absolute; transform: translate(-50%, -50%); padding: 5px 9px; border-radius: 8px; background: #fff; border: 2px solid var(--navy); font-size: clamp(10.5px, 3vw, 13px); font-weight: 800; line-height: 1.3; text-align: center; white-space: nowrap; box-shadow: 0 3px 0 rgba(27, 35, 64, .3); transition: left 1.2s var(--ease), top 1.2s var(--ease), background .4s, opacity .6s, border-color .4s; z-index: 2; }
.on.you { background: var(--blue); border-color: var(--blue); color: #fff; }
.on.gold { background: var(--yellow); border-color: #c99a1a; }
.on.you.gold { background: var(--blue); box-shadow: 0 0 0 4px var(--yellow), 0 3px 0 rgba(27, 35, 64, .3); }
.on.dim { opacity: .45; border-style: dashed; }
.on.out { border-style: dashed; }
.on.new { opacity: 0; }
.on.moved.new, .on.moved { opacity: 1; }
.on.moved.dim { opacity: .45; }
.why { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; font-size: 15px; line-height: 1.7; }
.sub-h { margin: 14px 0 8px; font-size: 13px; font-weight: 900; color: var(--muted); }
.keys { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: k; }
.keys li { position: relative; padding: 8px 10px 8px 36px; background: var(--cream); border-radius: 10px; font-size: 14px; line-height: 1.6; counter-increment: k; }
.keys li:before { content: counter(k); position: absolute; left: 9px; top: 9px; width: 20px; height: 20px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 900; display: grid; place-items: center; }
.keys li span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.fates { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.fates li { padding-left: 16px; position: relative; }
.fates li:before { content: ''; position: absolute; left: 0; top: .55em; width: 9px; height: 9px; border-radius: 50%; background: #c7ccd8; }
.fates li.gold:before { background: var(--gold); } .fates li.good:before { background: var(--blue); } .fates li.bad:before { background: var(--red); }
.e-ask { text-align: center; background: var(--navy); border-color: var(--navy); color: #fff; }
.ask-k { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; color: var(--yellow); }
.ask-q { margin: 6px 0 0; font-size: clamp(19px, 5.6vw, 24px); font-weight: 900; line-height: 1.5; }
.tpl { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { min-height: 38px; padding: 0 14px; border: 2px solid var(--navy); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 800; }
.chip.is-on { background: var(--navy); color: #fff; }
.share-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
textarea { width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; font: inherit; font-size: 15px; line-height: 1.6; resize: vertical; background: var(--paper); }
.share-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.share-btns .btn { padding: 0 10px; font-size: 15.5px; }
.help { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.e-actions { display: grid; justify-items: center; gap: 6px; margin: 22px 14px 0; }
.e-actions .btn { width: min(100%, 360px); }
.elist { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.elist li { display: flex; align-items: baseline; gap: 10px; padding: 8px 12px; border-radius: 10px; background: #f3f4f7; border-left: 6px solid #c7ccd8; font-size: 14px; }
.elist li.got { background: #fff; border-left-color: var(--c); box-shadow: 0 1px 0 var(--line); }
.elist li.now { outline: 3px solid var(--c); }
.elist li span { font-size: 12px; color: var(--muted); }

/* 相関図 */
.web { position: relative; width: 100%; max-width: 420px; aspect-ratio: 1 / 1; margin: 0 auto; }
.wl-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wl { stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.web.web-in .wl { animation: tie .7s var(--d) ease forwards; }
.wl.gold { stroke: var(--gold); stroke-width: 1.6; }
.wl.good { stroke: var(--blue); stroke-width: 1; }
.wl.none { stroke: #b9bfcc; stroke-width: .55; }
.wl.bad { stroke: var(--red); stroke-width: .9; }
.web.web-in .wl.bad { animation: tie .7s var(--d) ease forwards, snap .5s calc(var(--d) + .8s) ease forwards; }
.wn { position: absolute; width: 21%; transform: translate(-50%, -50%); text-align: center; }
.wf { display: block; width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--c, #ddd); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.wf svg { display: block; width: 150%; height: auto; margin: -6% 0 0 -25%; }
.wn b { display: block; margin-top: 2px; font-size: clamp(10px, 2.8vw, 12.5px); white-space: nowrap; }
.wn.unmet { opacity: .45; }
.wn.me { width: 26%; z-index: 2; }
.wn.me .wf { background: var(--blue); border-color: var(--yellow); }
.web.web-in .wn { animation: wnIn .5s var(--ease) both; }
@keyframes wnIn { from { transform: translate(-50%, -50%) scale(.3); opacity: 0; } }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 12.5px; }
.lg { display: inline-block; width: 22px; height: 0; margin-right: 4px; vertical-align: middle; border-top: 4px solid; }
.lg.gold { border-color: var(--gold); border-top-width: 6px; } .lg.good { border-color: var(--blue); } .lg.none { border-color: #b9bfcc; border-top-style: dotted; } .lg.bad { border-color: var(--red); border-top-style: dashed; }

/* ダイアログ */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 14px; background: rgba(16, 22, 44, .7); overflow-y: auto; }
.modal.m-in .m-box { animation: mIn .35s var(--ease) both; }
@keyframes mIn { from { transform: translateY(30px) scale(.94); opacity: 0; } }
.m-box { width: min(100%, 480px); max-height: calc(100svh - 28px); overflow-y: auto; padding: 20px 18px; background: var(--paper); border-radius: 18px; border: 3px solid var(--navy); }
.m-wide { width: min(100%, 720px); }
.m-small { width: min(100%, 360px); text-align: center; }
.m-box h2 { margin: 0 0 6px; font-size: 20px; font-weight: 900; color: var(--navy); }
.m-box h2 small { font-size: 13px; color: var(--muted); }
.m-note { margin: 0 0 12px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.m-close { margin-top: 14px; width: 100%; }
.m-btns { display: grid; gap: 4px; }
.m-btns .m-close { margin-top: 6px; }
.set { margin: 0 0 12px; padding: 12px; border: 2px solid var(--line); border-radius: 12px; }
.set legend { padding: 0 6px; font-weight: 900; font-size: 14px; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg label { display: grid; place-items: center; min-height: 44px; border: 2px solid var(--navy); border-radius: 10px; font-size: 13px; font-weight: 800; cursor: pointer; }
.seg label:has(input:checked) { background: var(--navy); color: #fff; }
.seg label:has(input:focus-visible) { outline: 3px solid var(--blue); }
.sw { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 800; }
.sw input { width: 24px; height: 24px; accent-color: var(--red); }
.vol { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; font-size: 14px; }
.vol input { flex: 1; accent-color: var(--red); min-height: 32px; }
.vol output { width: 2.2em; text-align: right; }
.loglist { display: grid; gap: 10px; }
.logc { padding: 12px 14px; background: #fffbe8; border: 2px solid var(--navy); border-radius: 6px; box-shadow: 4px 4px 0 rgba(27, 35, 64, .25); }
.logc h3 { margin: 0 0 6px; font-size: 15px; } .logc h3 span { margin-right: 6px; }
.logc p { margin: 0; font-size: 14px; line-height: 1.7; }
.charlist { display: grid; gap: 12px; }
@media (min-width: 640px) { .charlist { grid-template-columns: 1fr 1fr; } }
.cc { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 12px; background: #fff; border: 2px solid var(--line); border-top: 6px solid var(--c); border-radius: 12px; }
.cc-art svg { width: 100%; height: auto; display: block; }
.cc h3 { margin: 0; font-size: 16px; } .cc h3 small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.cc-r { margin: 2px 0 6px; font-size: 12.5px; font-weight: 700; color: var(--c); }
.cc-v { margin: 0 0 6px; font-size: 13px; line-height: 1.6; }
.cc dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 8px; font-size: 12.5px; line-height: 1.6; }
.cc dt { font-weight: 900; color: var(--muted); } .cc dd { margin: 0; }
.lock { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; margin: 0; padding: 10px 18px; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 800; font-size: 14px; transform: translate(-50%, 200%); opacity: 0; pointer-events: none; }
.toast.show { animation: toast 2.4s ease both; }
@keyframes toast { 10%, 85% { transform: translate(-50%, 0); opacity: 1; } }
.nojs { padding: 20px; text-align: center; background: #fff; }

/* 広い画面：舞台を大きく */
@media (min-width: 760px) {
  .txt { font-size: 18px; }
  .opt { font-size: 16px; }
  .panel { padding: 14px 22px 18px; }
  .e-block { margin: 20px 28px 0; padding: 22px 24px; }
}
@media (max-height: 640px) {
  .panel { min-height: 150px; }
  .msg { min-height: 100px; }
  .opt { min-height: 48px; padding: 6px 10px; font-size: 14.5px; }
  .opt-list { gap: 6px; }
}

/* 動きを減らす（端末設定・ゲーム内設定） */
@media (prefers-reduced-motion: reduce) { html:not(.rm-off) .pp, html:not(.rm-off) .cfx { animation: none; } }
html.rm *, html.rm *:before, html.rm *:after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
html.rm .gz, html.rm .ph-hint, html.rm .next { animation: none !important; }
