/* 人狼盤面対戦 RPG「百年目の神」 */
:root {
  --bg: #1b1626; --bg2: #2a2138; --ink: #f4eef8; --muted: #b6a9c4;
  --pink: #ff8fab; --gold: #f4c76b; --red: #e0607a; --box: rgba(20, 15, 30, .88);
  --card: #fdf7fb; --card-ink: #4a3f55; --dead: #6c6378;
  --round: "M PLUS Rounded 1c", system-ui, sans-serif; --mincho: "Shippori Mincho", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(900px 500px at 50% -10%, #3b2a52 0%, transparent 65%), var(--bg);
  color: var(--ink); font-family: var(--round); -webkit-tap-highlight-color: transparent;
}
button { font: inherit; }
.hidden { display: none !important; }
.screen { min-height: 100dvh; }

/* ---------- タイトル ---------- */
#title { display: flex; align-items: center; justify-content: center; padding: 24px 16px; position: relative; }
.back-home { position: absolute; top: 14px; left: 16px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.title-card { width: min(560px, 100%); text-align: center; }
.kicker { color: var(--muted); letter-spacing: .2em; font-size: .85rem; margin: 0 0 6px; }
.logo { font-family: var(--mincho); font-weight: 800; font-size: clamp(2.6rem, 11vw, 4.2rem); margin: 0;
  letter-spacing: .12em; text-shadow: 0 0 24px rgba(244, 199, 107, .35); }
.lead { color: var(--muted); line-height: 1.8; margin: 14px 0 22px; }
.menu { display: grid; gap: 10px; }
.menu button { padding: 14px 16px; border-radius: 14px; border: 1px solid #4a3d5e; background: var(--bg2); color: var(--ink);
  font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.menu button:hover:not(:disabled) { border-color: var(--pink); }
.menu button.primary { background: var(--pink); color: #2a1020; border: 0; }
.menu button:disabled { opacity: .45; cursor: default; }
.menu small { color: var(--muted); font-weight: 500; }
.menu button.primary small { color: #5a2a3a; }
.endings { display: flex; gap: 8px; justify-content: center; margin: 16px 0 6px; flex-wrap: wrap; }
.end-badge { padding: 4px 12px; border-radius: 999px; font-size: .8rem; border: 1px dashed #5b4d70; color: var(--muted); }
.end-badge.got { border-style: solid; color: #2a1020; background: var(--gold); border-color: var(--gold); font-weight: 700; }
.end-badge.got.bad { background: var(--red); border-color: var(--red); color: #fff; }
.note { color: var(--muted); font-size: .8rem; line-height: 1.7; margin-top: 18px; }

/* ---------- 本編 ---------- */
#play { display: flex; flex-direction: column; max-width: 820px; margin: 0 auto; height: 100dvh; }
.bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--muted); font-size: .9rem; }
.bar #chap-label { flex: 1; font-weight: 700; color: var(--ink); }
.icon-btn { background: none; border: 1px solid #4a3d5e; color: var(--ink); border-radius: 10px; width: 36px; height: 32px; cursor: pointer; }
.score { font-size: .8rem; }
.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; padding: 0 12px; overflow: auto; }
.place { min-height: 1.4em; margin: 4px 0 10px; color: var(--muted); font-size: .85rem; letter-spacing: .05em; text-align: center; }
.place:not(:empty)::before { content: "― "; } .place:not(:empty)::after { content: " ―"; }

.board { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; width: min(640px, 100%); }
.cd { position: relative; border-radius: 10px; background: var(--card); color: var(--card-ink); padding: 6px 4px 5px;
  text-align: center; min-height: 64px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: background .4s, opacity .4s, transform .3s; }
.cd .no { font-weight: 800; font-size: .85rem; line-height: 1; }
.cd .nm { font-size: .78rem; font-weight: 700; }
.cd .tags { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; }
.tag { font-size: .62rem; padding: 1px 5px; border-radius: 999px; background: #e9e0f2; color: #5b4d70; font-weight: 700; }
.tag.co-占 { background: #ffe1ea; color: #c2456b; } .tag.co-霊 { background: #e0efff; color: #3d6fa8; }
.tag.black { background: #2b2233; color: #fff; }
.tag.late { background: #fff2cc; color: #8a6a00; }
.cd.god { background: linear-gradient(180deg, #fff3cf, #f4c76b); }
.cd.god .no { font-family: var(--mincho); }
.cd.dead { background: repeating-linear-gradient(135deg, #4a4256 0 8px, #433b4e 8px 16px); color: #b9aec8; }
.cd.dead .tags .tag { opacity: .7; }
.cd .how { font-size: .66rem; font-weight: 800; color: #fff; background: var(--dead); border-radius: 6px; padding: 0 5px; }
.cd .how.bite { background: var(--red); }
.cd.flash { transform: scale(1.08); }
@media (max-width: 520px) { .board { grid-template-columns: repeat(4, 1fr); } .cd { min-height: 56px; } }

.box { position: relative; margin: 10px 12px 14px; padding: 18px 20px 26px; border-radius: 16px; background: var(--box);
  border: 1px solid #4a3d5e; min-height: 150px; cursor: pointer; outline: none; }
#text p { margin: 0 0 .5em; font-size: clamp(1rem, 3.8vw, 1.15rem); line-height: 1.85; animation: fadein .35s ease both; }
#text p:nth-child(2) { animation-delay: .12s; } #text p:nth-child(3) { animation-delay: .24s; } #text p:nth-child(4) { animation-delay: .36s; }
#text .sp { color: var(--pink); font-weight: 800; }
#text .god-word { color: var(--gold); font-weight: 800; }
#text .center { text-align: center; }
#text .big-title { font-family: var(--mincho); font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 800; letter-spacing: .1em; text-align: center; margin: 10px 0 4px; }
#text .small-title { text-align: center; color: var(--muted); }
#text .kick { text-align: center; color: var(--muted); letter-spacing: .3em; margin: 0; }
#text ul { margin: 0; padding-left: 1.2em; line-height: 1.8; }
#text li { margin-bottom: .3em; animation: fadein .35s ease both; }
.next { position: absolute; right: 16px; bottom: 8px; color: var(--pink); animation: blink 1.2s infinite; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- クイズ・選択 ---------- */
.panel { position: fixed; inset: 0; background: rgba(10, 6, 16, .72); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet { width: min(640px, 100%); max-height: 92dvh; overflow: auto; background: #2a2138; border-radius: 20px 20px 0 0; padding: 20px 18px 24px;
  border: 1px solid #4a3d5e; animation: up .3s ease; }
@media (min-width: 700px) { .panel { align-items: center; } .sheet { border-radius: 20px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet .label { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .1em; padding: 3px 12px; border-radius: 999px; background: var(--pink); color: #2a1020; }
.sheet .label.vote { background: #8ec5ff; color: #10243a; }
.sheet .label.final { background: var(--gold); color: #2a1a00; }
.sheet h2 { font-size: 1.12rem; line-height: 1.7; margin: 12px 0; }
.sheet .hint { background: #1f1829; border-radius: 12px; padding: 10px 14px; color: var(--muted); font-size: .88rem; line-height: 1.7; margin: 0 0 12px; }
.sheet .hint ul { margin: 0; padding-left: 1.1em; }
.choices { display: grid; gap: 10px; }
.choices button { text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid #5b4d70; background: #352a46; color: var(--ink);
  font-weight: 700; font-size: 1rem; cursor: pointer; }
.choices button:hover:not(:disabled) { border-color: var(--pink); }
.choices button.ok { background: #2f6b4f; border-color: #58c08d; }
.choices button.ng { background: #6b2f3c; border-color: var(--red); }
.choices button:disabled { cursor: default; }
.verdict { margin: 14px 0 0; font-weight: 800; font-size: 1.1rem; text-align: center; }
.verdict.ok { color: #7fe0b0; } .verdict.ng { color: #ff9cb0; }
.timer { height: 6px; border-radius: 6px; background: #1f1829; overflow: hidden; margin: 6px 0 14px; }
.timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--pink)); transition: width 1s linear; }
.timer-note { color: var(--muted); font-size: .8rem; text-align: right; margin-top: -8px; }
.sheet .go { display: block; width: 100%; margin-top: 16px; padding: 13px; border-radius: 14px; border: 0; background: var(--pink); color: #2a1020; font-weight: 800; cursor: pointer; }
.sheet .go.sub { background: none; border: 1px solid #5b4d70; color: var(--ink); margin-top: 10px; }
.endcard { text-align: center; }
.endcard .big { font-family: var(--mincho); font-size: 1.8rem; font-weight: 800; letter-spacing: .1em; margin: 8px 0; }
.endcard .big.bad { color: var(--red); } .endcard .big.true { color: var(--gold); }
.endcard p { color: var(--muted); }

/* ---------- RPGツクール風の画面 ---------- */
.win { background: linear-gradient(180deg, rgba(40, 52, 120, .94), rgba(18, 24, 66, .94)); border: 2px solid #eceaf6;
  border-radius: 8px; box-shadow: inset 0 0 0 2px #151a44, 0 4px 14px rgba(0, 0, 0, .45); color: #fff; }
.scene { position: relative; width: min(820px, calc(100% - 24px)); aspect-ratio: 5 / 3; margin: 0 auto; border-radius: 8px; overflow: hidden;
  background: #000; flex: none; box-shadow: 0 0 0 2px #eceaf6, 0 6px 18px rgba(0, 0, 0, .5); }
.scene .bg { position: absolute; inset: 0; background: #000 center / cover no-repeat; image-rendering: pixelated; transition: filter .6s; }
.scene .tint { position: absolute; inset: 0; pointer-events: none; transition: background .6s; z-index: 2; }
.scene .actors { position: absolute; inset: 0; z-index: 1; }
.scene .place { position: absolute; left: 8px; top: 8px; margin: 0; padding: 3px 12px; font-size: .78rem; z-index: 3; min-height: 0; color: #fff; }
.scene .place:empty { display: none; }
.scene .place::before, .scene .place::after { content: none; }
.light-evening .tint { background: linear-gradient(180deg, rgba(255, 120, 60, .32), rgba(150, 50, 90, .28)); mix-blend-mode: multiply; }
.light-night .tint { background: rgba(10, 16, 64, .78); mix-blend-mode: multiply; }
.light-morning .tint { background: rgba(255, 245, 220, .12); }
.light-day .tint { background: none; }
.light-dawn .tint { background: linear-gradient(180deg, rgba(255, 170, 120, .35), rgba(120, 120, 200, .2)); mix-blend-mode: multiply; }
.light-dusk .tint { background: rgba(70, 40, 110, .45); mix-blend-mode: multiply; }
.light-sepia .bg, .light-sepia .actors { filter: sepia(.9) brightness(.85) contrast(.9); }
.light-out .tint { background: rgba(0, 0, 0, .9); transition: background .25s; }
.light-sepia .tint { background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, .55)); }
.actor { position: absolute; width: 10%; aspect-ratio: 1; transform: translate(-50%, -100%); background-repeat: no-repeat;
  background-size: 300% 400%; background-position: 50% 0%; image-rendering: pixelated; transition: left .4s, top .4s; }
.actor[data-face="up"] { background-position: 50% 100%; }
.actor.talk { animation: talk .9s steps(1) infinite, bob .9s ease-in-out infinite; }
.actor[data-face="up"].talk { animation: talkup .9s steps(1) infinite, bob .9s ease-in-out infinite; }
@keyframes talk { 0% { background-position: 0% 0%; } 33% { background-position: 50% 0%; } 66% { background-position: 100% 0%; } }
@keyframes talkup { 0% { background-position: 0% 100%; } 33% { background-position: 50% 100%; } 66% { background-position: 100% 100%; } }
@keyframes bob { 50% { margin-top: -3px; } }
#play { height: auto; min-height: 100dvh; }
.box.win { margin: 10px auto 8px; width: min(820px, calc(100% - 24px)); background: linear-gradient(180deg, rgba(40, 52, 120, .96), rgba(18, 24, 66, .96)); border-radius: 8px; min-height: 140px; }
.box.win #text p { color: #fff; }
.board-wrap { width: min(820px, calc(100% - 24px)); margin: 4px auto 0; color: var(--muted); font-size: .85rem; }
.board-wrap summary { cursor: pointer; padding: 6px 2px; }
.board-wrap .board { margin: 6px auto 0; }
.credit { text-align: center; color: var(--muted); font-size: .72rem; margin: 14px 0 18px; }
.credit a { color: var(--muted); }
.sheet { background: linear-gradient(180deg, rgba(40, 52, 120, .98), rgba(18, 24, 66, .98)); border: 2px solid #eceaf6; }
.choices button { background: rgba(10, 14, 44, .55); border-color: #8d93c8; }

/* ---------- パソコン: 左に場面、右に盤面 ---------- */
.play-grid { width: 100%; }
.play-main, .play-side { min-width: 0; }
.board-wrap { width: min(820px, calc(100% - 24px)); }
@media (min-width: 1000px) {
  #play { max-width: 1400px; }
  .play-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 470px); gap: 18px; align-items: start; padding: 0 16px; }
  .scene, .box.win { width: 100%; }
  .board-wrap { width: 100%; margin: 0; }
  .board-wrap summary { display: none; }
  .board-wrap .gboard { margin: 0; }
  .credit { text-align: left; }
}

/* ---------- 演出: 顔・名前・文字送り・場面転換・光・天気 ---------- */
.box.win { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; padding-top: 22px; }
.box.win.has-face { grid-template-columns: 88px 1fr; }
.face { width: 88px; aspect-ratio: 1; border: 2px solid #eceaf6; border-radius: 6px; background: #0d1236 no-repeat;
  background-size: 300% 400%; background-position: 50% 0%; image-rendering: pixelated; box-shadow: inset 0 0 0 2px #151a44; }
.nameplate { position: absolute; left: 14px; top: -16px; padding: 3px 14px; border-radius: 6px; font-weight: 800; font-size: .9rem;
  background: linear-gradient(180deg, #3a4aa8, #1c2462); border: 2px solid #eceaf6; color: #fff; letter-spacing: .05em; }
.nameplate.god { background: linear-gradient(180deg, #f4c76b, #b07d1e); color: #2a1a00; }
.bg.fadein { animation: bgfade .6s ease both; }
@keyframes bgfade { from { filter: brightness(0); } to { filter: brightness(1); } }
.scene .fx { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; }
.fx.fx-bite { animation: flash .7s ease-out; background: radial-gradient(circle, rgba(255, 40, 60, .55), rgba(120, 0, 20, .75)); }
.fx.fx-exec { animation: flash .8s ease-out; background: rgba(10, 6, 20, .8); }
.fx.fx-black { animation: flash .5s ease-out; background: rgba(0, 0, 0, .55); }
.fx.fx-gone { animation: flash 1.4s ease-out; background: rgba(255, 255, 255, .85); }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }
.scene.shake { animation: shake .45s linear; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translate(-6px, 2px); } 40% { transform: translate(5px, -3px); } 60% { transform: translate(-4px, 1px); } 80% { transform: translate(3px, 2px); } }
.scene .weather { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.weather[data-w="rain"] { background: repeating-linear-gradient(100deg, transparent 0 22px, rgba(190, 205, 255, .45) 22px 23px, transparent 23px 41px);
  background-size: 200% 200%; animation: rain .35s linear infinite; }
@keyframes rain { from { background-position: 0 0; } to { background-position: -30px 120px; } }
.weather[data-w="glow"] { background: radial-gradient(circle at 20% 18%, rgba(255, 170, 90, .35), transparent 30%),
  radial-gradient(circle at 70% 22%, rgba(255, 150, 80, .3), transparent 32%); animation: glow 2.4s ease-in-out infinite alternate; mix-blend-mode: screen; }
@keyframes glow { from { opacity: .55; } to { opacity: 1; } }
.scene-title { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; text-align: center; color: #fff; pointer-events: none; }
.scene-title p { margin: 0; }
.scene-title .kick { color: #c9c3e6; letter-spacing: .4em; font-size: clamp(.8rem, 2vw, 1rem); }
.scene-title .big-title { font-family: var(--mincho); font-weight: 800; font-size: clamp(1.6rem, 5vw, 3rem); letter-spacing: .14em; margin-top: 8px;
  text-shadow: 0 0 18px rgba(244, 199, 107, .45); }
.scene-title .small-title { font-family: var(--mincho); font-size: clamp(1.1rem, 3vw, 1.6rem); letter-spacing: .1em; }
.scene-title.show p { animation: rise 1.2s ease both; }
.scene-title.show p:nth-child(2) { animation-delay: .35s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); letter-spacing: .3em; } to { opacity: 1; transform: none; } }
.choices button { position: relative; padding-left: 34px; }
.choices button:hover:not(:disabled)::before, .choices button:focus-visible::before { content: "▶"; position: absolute; left: 12px; color: var(--gold); }
@media (max-width: 520px) { .box.win.has-face { grid-template-columns: 60px 1fr; } .face { width: 60px; } }
@media (prefers-reduced-motion: reduce) { .scene.shake, .weather, .scene-title.show p, .bg.fadein { animation: none !important; } }

/* ---------- タイトル背景（川瀬巴水「おぼろ夜（宮島）」・パブリックドメイン） ---------- */
#title { overflow: hidden; isolation: isolate; }
.title-bg { position: absolute; inset: 0; z-index: -1; background: #0b1424 url(/static/rpg/img/title-bg.jpg) center 64% / cover no-repeat;
  animation: titlezoom 40s ease-in-out infinite alternate; }
.title-bg::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(8, 10, 24, .6) 85%), linear-gradient(180deg, rgba(8, 10, 24, .45), transparent 25%, transparent 70%, rgba(8, 10, 24, .6)); }
@media (min-width: 1000px) {
  #title { justify-content: flex-start; padding-left: 7vw; }
  #title .title-card { width: 500px; }
  .title-bg { left: 28%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%); mask-image: linear-gradient(90deg, transparent, #000 22%); }
  #title::before { content: ""; position: absolute; inset: 0; z-index: -2; background: #0a1322; }
}
@keyframes titlezoom { from { transform: scale(1.02); } to { transform: scale(1.1) translateY(-1.5%); } }
#title .title-card { padding: 26px 22px 18px; border-radius: 14px; background: rgba(12, 14, 30, .62); backdrop-filter: blur(3px);
  box-shadow: 0 0 0 1px rgba(236, 234, 246, .18), 0 10px 40px rgba(0, 0, 0, .5); }
#title .lead, #title .kicker, #title .note { color: #d6d0ea; }
.title-credit { position: absolute; right: 12px; bottom: 8px; margin: 0; font-size: .68rem; color: rgba(214, 208, 234, .7); }

/* ---------- 立ち絵（話している人が前に出る） ---------- */
.scene .stand { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.standee { position: absolute; bottom: -1%; height: 66%; aspect-ratio: 4 / 5; transform: translateX(-50%);
  background: no-repeat center bottom / contain; image-rendering: pixelated; filter: brightness(.5) saturate(.7);
  transition: filter .25s, left .3s; }
.standee.right { transform: translateX(-50%) scaleX(-1); }
.standee.speaking { filter: drop-shadow(0 0 10px rgba(255, 255, 255, .25)); animation: breathe 2.6s ease-in-out infinite; }
.standee.enter { animation: standin .35s ease-out both; }
.standee.enter.speaking { animation: standin .35s ease-out both, breathe 2.6s ease-in-out .35s infinite; }
@keyframes standin { from { opacity: 0; translate: 0 6%; } to { opacity: 1; translate: 0 0; } }
@keyframes breathe { 0%, 100% { translate: 0 0; } 50% { translate: 0 -1.2%; } }
.light-night .standee.speaking, .light-dusk .standee.speaking { filter: brightness(.85) saturate(.85) drop-shadow(0 0 10px rgba(160, 180, 255, .3)); }
.light-sepia .standee { filter: sepia(.9) brightness(.8); }
.scene .actors.behind { filter: brightness(.55) blur(.4px); transition: filter .3s; }
.scene .place { z-index: 6; }
@media (prefers-reduced-motion: reduce) { .title-bg, .standee { animation: none !important; } }

/* ---------- 配役ボタン・はじめに ---------- */
.roles-btn { background: linear-gradient(180deg, #f4c76b, #c8932e); color: #2a1a00; border: 0; border-radius: 10px; height: 32px; padding: 0 12px;
  font-weight: 800; cursor: pointer; letter-spacing: .05em; }
.panel.roles { z-index: 12; }
.lineup { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 6px 0 10px; }
.lu { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: rgba(10, 14, 44, .55); border: 1px solid #8d93c8; }
.lu .ra { width: 40px; height: 40px; display: grid; place-items: center; }
.lu .ra svg { width: 100%; height: 100%; }
.lu .god-mark { font-family: var(--mincho); font-weight: 800; font-size: 1.6rem; color: var(--gold); }
.lu.god { border-color: var(--gold); }
.lu.wolf { border-color: var(--red); }
.lu b { font-size: .82rem; }
.lu small { color: var(--muted); font-size: .75rem; }
.lu-note { color: #d6d0ea; font-size: .86rem; line-height: 1.7; margin: 6px 0; }
.god-rules { margin: 4px 0 6px; padding-left: 1.2em; line-height: 1.8; font-size: .9rem; }
@media (max-width: 520px) { .lineup { grid-template-columns: repeat(3, 1fr); } }

/* ---------- 選択肢の記号・自由な処刑 ---------- */
.choices button .key { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; margin-right: 10px; border-radius: 6px;
  background: var(--gold); color: #2a1a00; font-weight: 800; font-size: .85rem; }
.choices button:hover:not(:disabled)::before, .choices button:focus-visible::before { content: none; }
.hang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.hang-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; border: 1px solid #8d93c8;
  background: rgba(10, 14, 44, .55); color: #fff; font-weight: 700; cursor: pointer; text-align: left; }
.hang-pick:hover { border-color: var(--gold); background: rgba(80, 30, 40, .6); }
.hang-pick .hn { display: inline-grid; place-items: center; min-width: 1.8em; height: 1.8em; border-radius: 50%; background: #fff; color: #1c2462; font-weight: 800; }
.hang-pick small { width: 100%; color: var(--gold); font-size: .72rem; }
.gboard .card.pickable { cursor: pointer; outline: 3px dashed rgba(224, 96, 122, .9); outline-offset: 2px; animation: pickpulse 1.2s ease-in-out infinite; }
.gboard .card.pickable:hover { transform: translateY(-3px); }
@keyframes pickpulse { 50% { outline-color: rgba(224, 96, 122, .3); } }
/* while choosing, the sheet sits low so the board stays visible */
@media (min-width: 1000px) { .panel:has(.hang-grid) { align-items: flex-end; justify-content: flex-start; background: none; pointer-events: none; }
  .panel:has(.hang-grid) .sheet { pointer-events: auto; margin: 0 0 16px 16px; width: min(760px, 58vw); } }
.reveal { display: grid; justify-items: center; gap: 4px; padding: 10px 0; }
.reveal .ra.big { width: 110px; height: 110px; display: grid; place-items: center; font-size: 3rem; animation: revealin .6s ease-out both; }
.reveal .ra.big svg { width: 100%; height: 100%; }
.reveal .who { margin: 6px 0 0; font-weight: 800; font-size: 1.1rem; }
.reveal .role { margin: 0; font-family: var(--mincho); font-weight: 800; font-size: 1.5rem; }
.reveal .role.wolf, .reveal .role.madman { color: var(--red); }
.reveal .role.unknown { color: var(--gold); }
@keyframes revealin { from { transform: rotateY(90deg) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.endcard .big.if { color: #b9a8ff; }
.end-badge.got.if { background: #7a6ad8; border-color: #7a6ad8; color: #fff; }
.end-count { width: 100%; text-align: center; color: var(--muted); font-size: .8rem; }

/* ---------- 群衆：盤面のカードと同じ並び（番号つき） ---------- */
.actor[data-n]::after { content: attr(data-n); position: absolute; left: 50%; bottom: -14%; transform: translateX(-50%);
  min-width: 1.5em; padding: 0 4px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #1c2462;
  font: 800 clamp(.55rem, 1.3vw, .75rem)/1.5 var(--round, sans-serif); text-align: center; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.actor[data-n="神"]::after { background: var(--gold); color: #2a1a00; }
.actor.lit { filter: drop-shadow(0 0 6px #fff6c8) drop-shadow(0 0 10px rgba(244, 199, 107, .9)); z-index: 2; }
.actor.lit[data-n]::after { background: var(--gold); color: #2a1a00; }
.gboard .card.talking { box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(244, 199, 107, .8); transform: translateY(-3px); transition: transform .2s, box-shadow .2s; }

/* ---------- 本家と同じ絵柄（ベクター）：背景・人物 ---------- */
.scene .bg { image-rendering: auto; }
.actor { width: 12%; background-color: #FFF6EC; background-repeat: no-repeat; background-position: center 30%; background-size: 92%; border-radius: 50%; border: 3px solid #fff;
  box-shadow: 0 3px 8px rgba(30, 20, 60, .35); image-rendering: auto; }
.actor[data-n="神"] { border-color: var(--gold); background-color: #FFF3C4; }
.actor.talk, .actor[data-face="up"].talk { animation: bob .9s ease-in-out infinite; }
.actor[data-n]::after { bottom: -18%; }
.standee { image-rendering: auto; height: 78%; aspect-ratio: 300 / 360; bottom: -2%; }
.standee.right { transform: translateX(-50%); }
#title .title-bg { background-image: url(/static/rpg/img/title.svg); background-position: center; }
@media (min-width: 1000px) { .title-bg { left: 0; -webkit-mask-image: none; mask-image: none; } }

/* ---------- 盤面から吊る人を選ぶ ---------- */
#text .hang-ask { display: inline-block; margin: 0 0 6px; padding: 2px 12px; border-radius: 999px; background: #8ec5ff; color: #10243a; font-weight: 800; font-size: .8rem; }
#text .hang-hint { color: var(--gold); font-size: .9rem; }
.hang-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.hang-row button { padding: 10px 18px; border-radius: 12px; font-weight: 800; cursor: pointer; border: 2px solid #eceaf6; }
.hang-yes { background: #e0607a; color: #fff; }
.hang-no { background: rgba(10, 14, 44, .55); color: #fff; }
.gboard.picking { box-shadow: 0 0 0 3px rgba(224, 96, 122, .8), 0 0 24px rgba(224, 96, 122, .45); }
.gboard .card.chosen { outline: 4px solid #e0607a !important; outline-offset: 2px; animation: none; transform: translateY(-4px) scale(1.04); }
.respect { display: inline-block; margin: 6px 0 0; padding: 3px 14px; border-radius: 999px; border: 1px solid rgba(244, 199, 107, .7);
  color: var(--gold); font-weight: 800; font-size: .85rem; letter-spacing: .18em; background: rgba(244, 199, 107, .08); }
/* tapping the message window must not select its text */
.box, .scene, .gboard, .bar { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }

/* ======== 大きなゲーム画面＋右にメモ（盤面はゲーム画面の中の村人に） ======== */
.memo-wrap { width: min(820px, calc(100% - 24px)); margin: 4px auto 0; color: #e8e4f4; }
.memo-wrap summary { cursor: pointer; padding: 6px 2px; color: var(--muted); font-size: .85rem; }
.memo { max-height: 60dvh; overflow-y: auto; padding: 12px 14px; border-radius: 12px; background: #FFF9EE; color: #3E3550;
  box-shadow: inset 0 0 0 2px #E8D9BF, 0 6px 18px rgba(0, 0, 0, .35); font-size: .88rem; line-height: 1.55;
  background-image: repeating-linear-gradient(180deg, transparent 0 25px, rgba(150, 120, 80, .14) 25px 26px); }
.memo-empty { color: #8A8099; margin: 4px 0; }
.memo-day h3 { margin: 10px 0 4px; font-size: .82rem; letter-spacing: .1em; color: #8C6237; border-bottom: 2px dashed #E3CFA8; padding-bottom: 2px; }
.memo-day:first-child h3 { margin-top: 0; }
.memo ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.memo li { padding: 2px 8px; border-radius: 6px; border-left: 4px solid #C9C3DA; background: rgba(255, 255, 255, .7); }
.memo li.m-co { border-left-color: #E8B04A; }
.memo li.m-white { border-left-color: #9FB0DE; }
.memo li.m-black { border-left-color: #C2304A; color: #8A1E33; font-weight: 700; }
.memo li.m-exec { border-left-color: #6C5B7B; }
.memo li.m-bite { border-left-color: #E0607A; }
.memo li.m-note { border-left-color: #7BC88F; font-weight: 700; }
.memo li.m-clue { border-left-color: #F4C76B; background: #FFF3C4; }
.memo li.new { animation: memonew 1.6s ease-out; }
@keyframes memonew { 0% { background: #FFE38A; transform: translateX(6px); } 100% { transform: none; } }
.promo { font-size: .75rem; color: var(--muted); line-height: 1.6; margin: 10px 4px; }
.promo a { color: var(--gold); }
@media (min-width: 1000px) {
  #play { max-width: 1500px; }
  .play-grid { grid-template-columns: minmax(0, 1fr) 330px; }
  .memo-wrap { width: 100%; margin: 0; }
  .memo-wrap summary { display: none; }
  .memo { max-height: calc(100dvh - 140px); }
}

/* 村人（本家の盤面の印つき） */
.actor { overflow: visible; }
.actor.dead { filter: grayscale(1) brightness(.75); opacity: .8; }
.actor .tok-x { position: absolute; inset: 0; display: grid; place-items: center; font: 800 clamp(1.6rem, 5vw, 3.2rem)/1 sans-serif; color: rgba(62, 53, 80, .75); }
.actor .tok-dead { position: absolute; left: 50%; top: -8%; transform: translateX(-50%); padding: 0 6px; border-radius: 99px; font: 800 clamp(.5rem, 1.1vw, .72rem)/1.6 var(--round, sans-serif);
  background: #6C5B7B; color: #fff; white-space: nowrap; filter: none; }
.actor .tok-dead.bite { background: #E0607A; }
.actor.co-seer { border-color: #F4C76B; box-shadow: 0 0 0 3px #FFE9A8, 0 3px 8px rgba(30, 20, 60, .35); }
.actor.co-medium { border-color: #FF9AA2; box-shadow: 0 0 0 3px #FFD1DC, 0 3px 8px rgba(30, 20, 60, .35); }
.actor .tok-co { position: absolute; left: 50%; top: -14%; transform: translateX(-50%); padding: 0 7px; border-radius: 99px; white-space: nowrap;
  font: 800 clamp(.5rem, 1.1vw, .72rem)/1.6 var(--round, sans-serif); background: #FFE9A8; color: #6B4A00; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.actor.co-medium .tok-co { background: #FFD1DC; color: #8A2340; }
.actor.dead .tok-co { top: -30%; }
.actor .tok-mark { position: absolute; right: -18%; top: 4%; padding: 0 5px; border-radius: 99px; font: 800 clamp(.45rem, 1vw, .65rem)/1.6 sans-serif;
  background: #C9B6FF; color: #3E2A7A; white-space: nowrap; }
.actor .tok-res { position: absolute; left: 100%; top: 18%; margin-left: 6px; display: flex; flex-wrap: wrap; gap: 0 5px; width: max-content; max-width: 7.5em;
  padding: 2px 7px; border-radius: 10px; background: rgba(255, 255, 255, .95); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.actor .tok-res .res { display: inline-flex; align-items: center; font: 800 clamp(.7rem, 1.6vw, 1.05rem)/1.25 var(--font-logo, sans-serif); color: #3E3550; }
.actor .tok-res .res.white i { color: #8A8099; font-style: normal; }
.actor .tok-res .res.black b, .actor .tok-res .res.black i { color: #C2304A; font-style: normal; }
.actor.pop { animation: tokpop .6s ease-out; }
@keyframes tokpop { 30% { transform: translate(-50%, -100%) scale(1.15); } }
.scene.picking .actor.pickable { cursor: pointer; outline: 3px dashed rgba(224, 96, 122, .95); outline-offset: 3px; }
.scene.picking .actor.pickable:hover { transform: translate(-50%, -104%) scale(1.06); }
.scene.picking { box-shadow: 0 0 0 3px rgba(224, 96, 122, .9), 0 0 24px rgba(224, 96, 122, .5); }
.actor.chosen { outline: 5px solid #e0607a !important; outline-offset: 3px; transform: translate(-50%, -104%) scale(1.1); z-index: 3; }
.actor .tok-res.left { left: auto; right: 100%; margin: 0 6px 0 0; }
.actor.dead .tok-co, .actor.dead .tok-mark { display: none; }
#text b.hl { color: var(--gold); font-weight: 800; text-shadow: 0 0 10px rgba(244, 199, 107, .45); }
/* 配役・ルールの画面：文字を大きく */
.roles-sheet h2 { font-size: 1.35rem; }
.roles-sheet .lu-note { font-size: 1.02rem; }
.roles-sheet .god-rules { font-size: 1.12rem; line-height: 1.9; }
.roles-sheet .small-title { font-size: 1.05rem; }
.roles-sheet .lu b { font-size: .95rem; }

/* ======== タイトル：枠なし、大きな題字、クリックで開始 ======== */
#title { cursor: pointer; justify-content: center !important; padding: 24px 16px !important; }
#title .title-card { width: auto !important; background: none !important; box-shadow: none !important; backdrop-filter: none !important; padding: 0 !important; text-align: center; }
#title .kicker { letter-spacing: .5em; font-size: .9rem; color: rgba(236, 230, 250, .75); text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
#title .logo { font-size: clamp(3.6rem, 13vw, 8.5rem); letter-spacing: .16em; line-height: 1.1; margin: 10px 0 6px;
  text-shadow: 0 0 30px rgba(244, 199, 107, .55), 0 4px 18px rgba(0, 0, 0, .7); animation: logoin 2.4s ease both; }
@keyframes logoin { from { opacity: 0; filter: blur(8px); letter-spacing: .4em; } to { opacity: 1; filter: none; } }
#title .respect { background: rgba(10, 12, 30, .45); }
#title .lead { font-family: var(--mincho); font-size: clamp(1rem, 2.2vw, 1.3rem); line-height: 2; margin: 22px 0 36px; color: #efe9fb; text-shadow: 0 2px 10px rgba(0, 0, 0, .8); }
#title .press { margin: 0; font-family: var(--mincho); font-size: clamp(1.1rem, 2.6vw, 1.5rem); letter-spacing: .4em; color: #fff;
  text-shadow: 0 0 12px rgba(244, 199, 107, .8); animation: pressblink 2.2s ease-in-out infinite; }
@keyframes pressblink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
#title .menu { display: none; }
#title.open .press { display: none; }
#title.open .menu { display: flex; flex-direction: column; align-items: center; gap: 18px; }
#title .menu .word { background: none !important; border: 0 !important; color: #fff; font-family: var(--mincho); font-weight: 800; padding: 4px 18px;
  font-size: clamp(1.3rem, 3vw, 1.9rem); letter-spacing: .3em; cursor: pointer; text-shadow: 0 2px 12px rgba(0, 0, 0, .8); display: block; }
#title .menu .word.sub { font-size: clamp(1rem, 2.2vw, 1.3rem); color: rgba(236, 230, 250, .8); }
#title .menu .word:hover { color: var(--gold); text-shadow: 0 0 14px rgba(244, 199, 107, .8); }
#title .menu .word:hover::before { content: "▶ "; }
#title .endings { position: absolute; left: 0; right: 0; bottom: 34px; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 0 16px; }
#title .end-badge { font-size: .72rem; padding: 2px 10px; background: rgba(10, 12, 30, .5); }
#title .end-count { width: auto; margin-left: 6px; align-self: center; color: rgba(236, 230, 250, .7); font-size: .75rem; }
@media (min-width: 1000px) { #title { padding-left: 16px !important; } }
#title .respect-k { display: block; margin-top: 8px; letter-spacing: .4em; font-size: 1rem; font-weight: 700; color: rgba(244, 199, 107, .95); }

/* 幕の題字を大きく */
.scene-title .act-title { font-family: var(--mincho); font-weight: 800; font-size: clamp(1.8rem, 4.2vw, 3rem); letter-spacing: .18em; text-shadow: 0 0 18px rgba(244, 199, 107, .45); }
/* クイズ・選択はメッセージ枠の中に */
.q-in-box { display: grid; gap: 10px; }
.q-label { justify-self: start; padding: 2px 12px; border-radius: 999px; background: var(--pink); color: #2a1020; font-weight: 800; font-size: .8rem; letter-spacing: .1em; }
#text .q-text { margin: 0; font-size: 1.08rem; line-height: 1.7; }
.q-hint { margin: 0; padding: 8px 12px 8px 28px; border-radius: 10px; background: rgba(10, 14, 44, .55); color: #d6d0ea; font-size: .88rem; line-height: 1.7; }
.q-choices { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.q-choices button { padding: 10px 14px; }
#text .verdict { margin: 0; font-weight: 800; font-size: 1.05rem; }
#text .verdict.ok { color: #7be0a8; } #text .verdict.ng { color: #ff9aa2; }
.q-go { justify-self: start; padding: 10px 22px; border-radius: 12px; border: 0; background: var(--pink); color: #2a1020; font-weight: 800; cursor: pointer; }
.actor[data-n]::after { white-space: nowrap; }
.q-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; }
.q-foot .q-go { margin: 0; width: auto; }
/* タイトルの宣伝（人狼盤面対戦） */
.promo-card { position: absolute; right: 22px; bottom: 26px; display: grid; gap: 2px; width: 260px; padding: 14px 16px; border-radius: 16px; text-decoration: none;
  background: linear-gradient(160deg, rgba(255, 249, 238, .96), rgba(255, 228, 236, .96)); color: #3E3550; box-shadow: 0 8px 26px rgba(0, 0, 0, .45), 0 0 0 3px rgba(255, 255, 255, .6);
  cursor: pointer; transition: transform .2s; }
.promo-card:hover { transform: translateY(-3px); }
.pc-kick { font-size: .72rem; color: #8C6237; letter-spacing: .08em; }
.pc-name { font-family: var(--font-logo, sans-serif); font-weight: 800; font-size: 1.35rem; color: #C2457A; }
.pc-lead { font-size: .78rem; line-height: 1.5; }
.pc-go { justify-self: start; margin-top: 6px; padding: 4px 14px; border-radius: 999px; background: var(--pink); color: #2a1020; font-weight: 800; font-size: .85rem; }
@media (max-width: 900px) {
  .promo-card { position: static; margin: 26px auto 0; width: min(320px, 100%); }
  #title { flex-direction: column; }
  #title .endings { position: static; margin-top: 18px; }
}
/* 宣伝カードは左上に、本家の画像つきで */
.promo-card { position: absolute; left: 20px; top: 18px; right: auto; bottom: auto; width: 280px; padding: 0; gap: 0; overflow: hidden; border-radius: 14px;
  background: #FFF9EE; z-index: 2; }
.promo-card img { display: block; width: 100%; height: auto; }
.pc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; }
.pc-row .pc-lead { font-size: .74rem; color: #6B5A4A; }
.pc-row .pc-go { margin: 0; white-space: nowrap; font-size: .8rem; padding: 3px 12px; }
@media (max-width: 900px) {
  .promo-card { position: absolute; left: 12px; top: 12px; width: 170px; margin: 0; }
  .pc-row .pc-lead { display: none; }
  .pc-row { justify-content: center; padding: 6px; }
  #title .title-card { margin-top: 110px; }
}
.pc-head { display: block; padding: 6px 10px; text-align: center; font-weight: 800; font-size: .85rem; color: #fff; background: linear-gradient(90deg, #E8608A, #C2457A); letter-spacing: .04em; }
@media (max-width: 900px) { .pc-head { font-size: .66rem; padding: 4px 6px; letter-spacing: 0; } }
@media (max-width: 900px) { .promo-card { width: 200px; } .promo-card .pc-head { font-size: .62rem; white-space: nowrap; letter-spacing: -.02em; } }

/* パソコン：画面の高さに収める（場面＋メッセージ枠がスクロールなしで見えるように） */
@media (min-width: 1000px) {
  #play { height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  #play .bar { flex: none; padding-top: 8px; padding-bottom: 8px; }
  .play-grid { flex: 1; min-height: 0; align-items: start; }
  .play-main { display: flex; flex-direction: column; align-items: center; min-height: 0; }
  .scene { width: min(100%, calc((100dvh - 250px) * 5 / 3)) !important; }
  .box.win { width: min(100%, calc((100dvh - 250px) * 5 / 3)) !important; min-height: 150px; }
  .memo { max-height: calc(100dvh - 110px); }
}

/* the scroll held up to the sun (the hidden 大 shows through) */
.scene .scroll-lit { position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0; pointer-events: none;
  transition: opacity 1.8s ease; }

/* 配信向けの文字の大きさ（パソコンの画面: 1080p でセリフ約39px、メモ約24px、名札約22px）。
   文が多い場面はメッセージ枠を高くし、その分だけ場面の絵を小さくする（rpg.js の fitBox が --boxh を決める） */
@media (min-width: 1000px) {
  .play-main { --boxh: 27vh; }
  #text p, #text-probe p { font-size: 3.6vh; line-height: 1.7; margin: 0 0 .3em; }
  .nameplate { font-size: 2.6vh; top: -2.3vh; padding: .2vh 1.4vh; }
  .box.win { min-height: var(--boxh); padding: 2.6vh 2.4vh; }
  .scene { width: min(100%, calc((100dvh - var(--boxh) - 9vh) * 5 / 3)) !important; }
  .box.win { width: min(100%, calc((100dvh - 27vh - 9vh) * 5 / 3)) !important; }   /* the window keeps its width; only the picture shrinks */
  .play-grid { grid-template-columns: minmax(0, 1fr) clamp(330px, 45vh, 620px); }
  .memo { font-size: 2.25vh; line-height: 1.45; background-image: none; }
  .memo-day h3 { font-size: 2vh; }
  .actor[data-n]::after { font-size: 2vh; }
  .actor .tok-res .res { font-size: 2.7vh; }
  .actor .tok-co, .actor .tok-dead { font-size: 1.7vh; }
  #text .q-text { font-size: 3vh; line-height: 1.6; }
  .q-hint { font-size: 2.3vh; }
  .q-choices button, .q-go { font-size: 2.6vh; }
  .q-choices { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  #text .verdict { font-size: 3vh; }
  .q-label, #text .hang-ask { font-size: 1.9vh; }
  #text .hang-hint { font-size: 2.4vh; }
  .scene .place { font-size: 1.9vh; }
  .bar, #chap-label { font-size: 2vh; }
}

/* 配役・ルール・手がかり・最後の問いなどの画面も配信向けの大きさに（パソコンの画面） */
@media (min-width: 1000px) {
  .sheet { width: min(92vw, 118vh); padding: 3.4vh 3.4vh 3.6vh; }
  .sheet .label { font-size: 2vh; padding: .4vh 1.6vh; }
  .sheet h2, .roles-sheet h2 { font-size: 3.8vh; margin: 1.6vh 0; }
  .sheet .hint { font-size: 2.4vh; }
  .roles-sheet .lu-note { font-size: 2.7vh; line-height: 1.6; }
  .roles-sheet .god-rules { font-size: 3vh; line-height: 1.75; }
  .roles-sheet .small-title { font-size: 2.6vh; }
  .lineup { gap: 1.2vh; margin: 1vh 0 1.6vh; }
  .lu { padding: 1.4vh .6vh; gap: .4vh; }
  .lu .ra { width: 6.4vh; height: 6.4vh; }
  .lu .god-mark { font-size: 4.6vh; }
  .lu b, .roles-sheet .lu b { font-size: 2.5vh; }
  .lu small { font-size: 2vh; }
  .choices button { font-size: 2.6vh; }
  .sheet .go { font-size: 2.6vh; padding: 1.6vh; margin-top: 2.2vh; }
  .verdict { font-size: 3vh; }
  .endcard .big { font-size: 5vh; }
}

/* タイトル: 大神ルートの条件のヒント */
.end-hint { width: 100%; text-align: center; font-size: .78rem; color: rgba(244, 199, 107, .85); letter-spacing: .06em; }

/* タイトル: 章をえらぶ */
#title .chapter-pick { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px; margin-top: 26px; }
#title .chapter-pick .cp-label { width: 100%; text-align: center; font-size: .78rem; letter-spacing: .3em; color: rgba(236, 230, 250, .65); }
#title .chapter-pick .cp { background: rgba(10, 12, 30, .45); border: 1px solid rgba(236, 230, 250, .35); color: #efe9fb; border-radius: 999px;
  padding: 6px 16px; font-family: var(--mincho); font-weight: 700; font-size: .92rem; cursor: pointer; }
#title .chapter-pick .cp:hover { border-color: var(--gold); color: var(--gold); }

/* 宣伝カード: 横長（左に画像、右に文字） */
.promo-card { display: grid; grid-template-columns: 200px 1fr; grid-template-rows: auto 1fr; width: 470px; }
.promo-card .pc-head { grid-column: 1 / -1; }
.promo-card img { grid-column: 1; grid-row: 2; width: 200px; height: 105px; object-fit: cover; }
.promo-card .pc-row { grid-column: 2; grid-row: 2; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding: 10px 14px; }
.promo-card .pc-row .pc-lead { display: block; font-size: .86rem; line-height: 1.5; }
@media (max-width: 900px) {
  .promo-card { grid-template-columns: 120px 1fr; width: 300px; }
  .promo-card img { width: 120px; height: 63px; }
  .promo-card .pc-row { padding: 6px 10px; gap: 4px; }
  .promo-card .pc-row .pc-lead { font-size: .7rem; }
}

/* HIDDEN END「大神」: appears on the title once every other ending has been seen */
.end-hidden { flex-basis: auto; margin: 8px auto 0; padding: 9px 14px; border-radius: 999px; border: 1px solid rgba(244, 199, 107, .7);
  background: rgba(20, 14, 30, .75); color: #f4c76b; font: inherit; font-size: .85rem; letter-spacing: .12em; cursor: pointer; }
.end-hidden:hover { background: rgba(244, 199, 107, .16); }
.end-hidden.got { letter-spacing: .06em; }
.endcard p.unlock { color: #f4c76b; }
.endcard .big.last { color: var(--gold); }

/* 回想: the whole picture turns sepia (the background's own fade-in animation would otherwise undo the filter) */
.scene.light-sepia { filter: sepia(.85) saturate(.75) brightness(.92); transition: filter .5s; }
.scene.light-sepia .bg, .scene.light-sepia .actors { filter: none; }

/* HIDDEN END「大神」の最後: 固まったような間のあと、ミカの笑った顔が画面いっぱいに出る */
.scare { position: fixed; inset: 0; z-index: 1000; background: #1a0006; display: grid; place-items: center; overflow: hidden; cursor: default; }
.scare-face { position: absolute; left: 50%; top: 50%; width: min(190vmin, 1700px); aspect-ratio: 300 / 360; background: url(/static/rpg/img/people/c2-grin.svg) center / contain no-repeat;
  transform: translate(-50%, -60%); filter: contrast(1.15) saturate(.55); animation: scare-shake .09s linear 7; }
.scare.s-out { background: #000; }
.scare.s-out .scare-face { display: none; }
@keyframes scare-shake { 0% { translate: -7px 4px; } 50% { translate: 6px -5px; } 100% { translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { .scare-face { animation: none; } }

/* エンディング集: the title shows one button; the list is its own page */
.end-open { padding: 7px 18px; border-radius: 999px; border: 1px solid rgba(236, 230, 250, .45); background: rgba(10, 12, 30, .55);
  color: #ece6fa; font: inherit; font-size: .82rem; letter-spacing: .1em; cursor: pointer; }
.end-open:hover { background: rgba(236, 230, 250, .14); }
.end-open.new { border-color: #f4c76b; color: #f4c76b; }
.gallery { position: fixed; inset: 0; z-index: 900; background: rgba(12, 9, 22, .94); overflow-y: auto; display: flex; justify-content: center; align-items: flex-start; padding: 28px 16px; }
.gallery-box { width: min(640px, 100%); display: flex; flex-direction: column; gap: 10px; color: #f4eef8; }
.gallery-box h2 { margin: 0; text-align: center; font-family: "Shippori Mincho", serif; letter-spacing: .3em; font-size: 1.5rem; }
.gallery-count { margin: 0 0 8px; text-align: center; color: rgba(236, 230, 250, .7); font-size: .85rem; }
.gallery-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 12px 16px; border-radius: 14px;
  border: 1px dashed #5b4d70; background: rgba(255, 255, 255, .03); }
.gallery-row .g-name { grid-column: 1; font-size: .72rem; letter-spacing: .14em; color: rgba(236, 230, 250, .6); }
.gallery-row .g-title { grid-column: 1; font-size: 1.05rem; font-weight: 700; color: rgba(236, 230, 250, .45); }
.gallery-row .g-hint { grid-column: 1 / -1; font-size: .78rem; color: rgba(244, 199, 107, .85); }
.gallery-row .g-play { grid-column: 2; grid-row: 1 / span 2; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(236, 230, 250, .5);
  background: none; color: #ece6fa; font: inherit; font-size: .8rem; cursor: pointer; white-space: nowrap; }
.gallery-row .g-play:hover { background: rgba(236, 230, 250, .14); }
.gallery-row.got { border-style: solid; border-color: #7d6a99; background: rgba(255, 255, 255, .06); }
.gallery-row.got .g-title { color: #fff; }
.gallery-row.got.bad { border-color: var(--red); } .gallery-row.got.true { border-color: var(--gold); }
.gallery-row.got.if { border-color: #7a6ad8; } .gallery-row.got.secret { border-color: #f4c76b; }
.gallery-row.fresh { border: 1px solid #f4c76b; }
.gallery-row.fresh .g-play { border-color: #f4c76b; color: #f4c76b; }
.gallery .go { align-self: center; margin-top: 10px; padding: 9px 26px; border-radius: 999px; border: 1px solid rgba(236, 230, 250, .5); background: none; color: #ece6fa; font: inherit; font-size: .9rem; cursor: pointer; }
.gallery .go:hover { background: rgba(236, 230, 250, .14); }
