/* ハクスラ陰陽師 遊べる版 v2 — 夜の境内で札を切る。色は 夜藍・和紙・灯 の3つ(朱はダメージだけ) */
:root {
  --yoru: #0b0e1f; --yoru-2: #121733; --washi: #f3ece0; --akari: #f0b25a; --shu: #e0553d;
  --ink: color-mix(in srgb, var(--yoru) 88%, #000);
  --line: color-mix(in srgb, var(--washi) 16%, transparent);
  --line-2: color-mix(in srgb, var(--washi) 30%, transparent);
  --glass: color-mix(in srgb, var(--yoru) 62%, transparent);
  --akari-glow: color-mix(in srgb, var(--akari) 55%, transparent);
  --f-disp: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --f-ui: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  --e-out: cubic-bezier(.22, 1, .36, 1); --e-io: cubic-bezier(.65, 0, .35, 1); --e-back: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: .18s; --t-base: .38s; --t-slow: .9s;
  --cw: 108px; --ch: calc(var(--cw) * 88 / 63); --strip: calc(var(--cw) * 10 / 63);
  --r: 14px; --gut: clamp(14px, 4vw, 28px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--yoru); }
html, body { margin: 0; color: var(--washi); font-family: var(--f-ui); font-size: 14px; line-height: 1.55; }
body { min-height: 100svh; background: transparent; overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0; z-index: -2; background: linear-gradient(180deg, rgba(11,14,31,.55) 0%, rgba(11,14,31,.82) 55%, rgba(11,14,31,.97) 100%), url(assets/haiden.webp) center 30% / cover no-repeat; filter: saturate(.85); }
body::after { content: ""; position: fixed; inset: -10%; z-index: -1; pointer-events: none; background: radial-gradient(40% 18% at 30% 78%, rgba(243,236,224,.07), transparent 70%), radial-gradient(35% 14% at 72% 70%, rgba(243,236,224,.06), transparent 70%), radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0,0,0,.55) 100%); animation: mist 38s var(--e-io) infinite alternate; }
@keyframes mist { to { transform: translate3d(-3%, -1.5%, 0) scale(1.04); } }
a { color: var(--akari); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: color-mix(in srgb, var(--akari) 45%, transparent); color: var(--washi); }
.eyebrow { font-family: var(--f-ui); font-weight: 500; font-size: 11px; letter-spacing: .42em; text-indent: .42em; color: color-mix(in srgb, var(--washi) 62%, transparent); margin: 0 0 12px; }

/* ---------- 札 ---------- */
.card { width: var(--cw); height: var(--ch); aspect-ratio: 63 / 88; border-radius: calc(var(--cw) * 3 / 63); overflow: hidden; box-shadow: 0 10px 22px -8px rgba(0,0,0,.7), 0 0 0 1px rgba(243,236,224,.10); background: #1b1f36; flex: none; position: relative; }
.card img { width: 100%; height: 100%; display: block; object-fit: cover; }
.card.small { --cw: 76px; --ch: calc(76px * 88 / 63); width: var(--cw); height: var(--ch); }
.card.mid { --cw: 120px; --ch: calc(120px * 88 / 63); width: var(--cw); height: var(--ch); }
.card.empty { background: rgba(243,236,224,.04); box-shadow: none; border: 1px dashed var(--line-2); }
.cap { font-size: 11px; text-align: center; color: color-mix(in srgb, var(--washi) 72%, transparent); margin-top: 5px; letter-spacing: .06em; }

/* ---------- オープニング ---------- */
#opening { position: fixed; inset: 0; z-index: 200; background: #05060d; display: grid; place-items: center; overflow: hidden; cursor: pointer; transition: opacity .9s var(--e-io), visibility 0s .9s; }
#opening.gone { opacity: 0; visibility: hidden; }
#opening .op-bg { position: absolute; inset: -4%; background: url(assets/haiden.webp) center 32% / cover; filter: brightness(.34) saturate(.8) blur(2px); opacity: 0; animation: opbg 3.2s var(--e-out) .2s forwards; }
@keyframes opbg { from { opacity: 0; transform: scale(1.12); } to { opacity: 1; transform: scale(1.02); } }
#opening .op-lights { position: absolute; inset: 0; }
#opening .op-lights i { position: absolute; left: var(--x); top: var(--y); width: calc(6px * var(--s, 1)); height: calc(6px * var(--s, 1)); border-radius: 50%; background: #ffe2ae; box-shadow: 0 0 10px 4px var(--akari-glow), 0 0 40px 14px color-mix(in srgb, var(--akari) 16%, transparent); opacity: 0; animation: wisp 7s var(--e-io) var(--d) infinite; }
@keyframes wisp { 0% { opacity: 0; transform: translate(0, 20px) scale(.6); } 20% { opacity: .95; } 55% { opacity: .7; transform: translate(10px, -40px) scale(1); } 80% { opacity: .9; } 100% { opacity: 0; transform: translate(-6px, -110px) scale(.5); } }
@keyframes flicker { 0%, 100% { opacity: .85; } 45% { opacity: .62; } 52% { opacity: .9; } }
#opening .op-mist { position: absolute; inset: 0; background: radial-gradient(60% 22% at 50% 82%, rgba(243,236,224,.16), transparent 70%), radial-gradient(45% 18% at 20% 70%, rgba(243,236,224,.08), transparent 70%); opacity: 0; animation: opfade 2s ease 1.2s forwards, mist 24s var(--e-io) 1.2s infinite alternate; }
@keyframes opfade { to { opacity: 1; } }
#opening .op-center { position: relative; text-align: center; padding: 0 var(--gut); }
/* iPhone の Safari で filter(blur/drop-shadow)を掛けた透過画像が白い四角になった(hika 09-24 13:28)→ 影とぼかしは画像に焼き(logo_s=影つき・logo_b=ぼかし)、動きは opacity と transform だけ。
   箱はロゴ本体の大きさ(1200×371)のまま、画像は周りの影の余白(ロゴ幅の 15%)ぶん外にはみ出して置く(箱ごと広げると画面幅を超えて中身が右に寄った・hika 14:03) */
#opening .op-logo { --lw: min(78vw, 640px); position: relative; width: var(--lw); aspect-ratio: 1200 / 371; margin: 0 auto; opacity: 0; transform: scale(1.06); animation: oplogo 1.7s var(--e-out) 1.55s forwards; }
#opening .op-logo img { position: absolute; left: -17.5%; top: calc(var(--lw) * -.15); width: 130%; height: auto; max-width: none; display: block; pointer-events: none; }
#opening .op-logo .ls { opacity: 0; animation: oplogo-s 1.7s var(--e-out) 1.55s forwards; }
#opening .op-logo .lb { animation: oplogo-b 1.7s ease-in 1.55s forwards; }
@keyframes oplogo { 60% { opacity: 1; } to { opacity: 1; transform: scale(1); } }
@keyframes oplogo-s { to { opacity: 1; } }
@keyframes oplogo-b { 55% { opacity: 1; } to { opacity: 0; } }
#opening .op-tag { margin: clamp(18px, 3vh, 30px) 0 0; font-family: var(--f-disp); font-weight: 600; font-size: clamp(14px, 3.6vw, 20px); letter-spacing: .38em; text-indent: .38em; color: color-mix(in srgb, var(--washi) 86%, transparent); opacity: 0; transform: translateY(10px); animation: opup 1s var(--e-out) 2.75s forwards; }
@keyframes opup { to { opacity: 1; transform: none; } }
#opening .op-tap { position: absolute; bottom: calc(9vh + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; margin: 0; font-size: 12px; letter-spacing: .5em; text-indent: .5em; color: color-mix(in srgb, var(--washi) 70%, transparent); opacity: 0; animation: opfade .8s ease 3.5s forwards, tap 2.4s ease-in-out 4.3s infinite; }
@keyframes tap { 50% { opacity: .35; } }

/* ---------- 開始画面 ---------- */
#setup { max-width: 980px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) var(--gut) 64px; }
.su-head { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: clamp(24px, 6vh, 56px) 0 clamp(24px, 5vh, 44px); }
/* 09-24 17:0x hika「ロゴが若干右にズレてない？」: 画像の中身は右の五芒星に重みが寄る(白の重心が中央から +2.6%)。絵を左へ 2.5%(ロゴ幅比)ずらして目で見た中心を合わせる */
.su-logo { --lw: min(72vw, 460px); position: relative; width: var(--lw); aspect-ratio: 1200 / 371; }
.su-logo img { position: absolute; left: -17.5%; top: calc(var(--lw) * -.15); width: 130%; height: auto; max-width: none; display: block; pointer-events: none; }
.su-links { display: flex; gap: 22px; font-size: 12px; letter-spacing: .24em; }
.su-links a { color: color-mix(in srgb, var(--washi) 70%, transparent); border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: color var(--t-fast), border-color var(--t-fast); }
@media (hover: hover) { .su-links a:hover { color: var(--akari); border-color: var(--akari); } }
.su-sec { padding: 22px 0 24px; border-top: 1px solid var(--line); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.seg.sm { display: inline-grid; gap: 6px; }
.modebtn { background: color-mix(in srgb, var(--yoru-2) 70%, transparent); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-align: center; transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast) var(--e-out), box-shadow var(--t-base); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@media (hover: hover) { .modebtn:hover { border-color: var(--line-2); } }
.modebtn:active { transform: scale(.97); }
.modebtn b { display: block; font-family: var(--f-disp); font-weight: 700; font-size: 20px; letter-spacing: .08em; }
.modebtn small { display: block; font-size: 11px; opacity: .66; margin-top: 2px; }
.modebtn.sel { border-color: var(--akari); background: color-mix(in srgb, var(--akari) 13%, var(--yoru-2)); box-shadow: 0 0 0 1px var(--akari) inset, 0 0 26px -6px var(--akari-glow); }
.seg.sm .modebtn { padding: 7px 14px; font-size: 13px; }
.charrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.charpick { background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.charpick .card { --cw: 100%; width: 100%; height: auto; transition: transform var(--t-base) var(--e-out), box-shadow var(--t-base), filter var(--t-base); filter: brightness(.72) saturate(.8); }
.charpick .nm { font-family: var(--f-disp); font-weight: 700; font-size: 17px; letter-spacing: .14em; text-indent: .14em; opacity: .7; transition: opacity var(--t-fast); }
@media (hover: hover) { .charpick:hover .card { filter: brightness(.9); } }
.charpick.sel .card { transform: translateY(-6px); filter: none; box-shadow: 0 18px 30px -12px rgba(0,0,0,.8), 0 0 0 2px var(--akari), 0 0 34px -4px var(--akari-glow); }
.charpick.sel .nm { opacity: 1; color: var(--akari); }
.charpick:disabled { opacity: .28; cursor: default; }
.chardetail { margin-top: 16px; padding: 14px 16px; border-radius: var(--r); background: var(--glass); border: 1px solid var(--line); font-size: 13px; line-height: 1.7; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); min-height: 70px; }
.chardetail b { font-family: var(--f-disp); font-size: 16px; letter-spacing: .06em; }
.chardetail .st { display: inline-flex; gap: 12px; margin-left: 10px; font-size: 12px; opacity: .8; }
.chardetail .evo { color: var(--akari); }
.chardetail .row2 { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.chardetail .linkbtn { margin: 0; }
.npcline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.npcline .lab, .optrow .lab { font-size: 11px; letter-spacing: .24em; opacity: .6; margin-right: 2px; }
.npctype { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.npctype .modebtn { padding: 6px 12px; font-size: 12px; }
.npctype[hidden] { display: none; }
.lvrow { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.lvrow .modebtn { padding: 12px 0; font-family: var(--f-disp); font-weight: 700; font-size: 18px; }
.lvdesc { margin-top: 12px; font-size: 13px; opacity: .82; min-height: 1.6em; }
.lvdesc b { font-family: var(--f-disp); color: var(--akari); font-size: 16px; margin-right: 8px; letter-spacing: .08em; }
.linkbtn { background: none; border: 0; padding: 4px 0; margin-top: 8px; font-size: 12px; letter-spacing: .2em; color: color-mix(in srgb, var(--washi) 62%, transparent); border-bottom: 1px solid var(--line); }
.adv { display: grid; gap: 10px; margin-top: 12px; }
.optrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.optrow .modebtn { padding: 7px 12px; font-size: 12px; }
.bossrow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.bossbtn { display: flex; align-items: center; gap: 12px; padding: 10px; text-align: left; }
.bossbtn img { width: 46px; border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,.5); }
.bossbtn span { font-family: var(--f-disp); font-weight: 700; font-size: 18px; letter-spacing: .1em; }
.su-start { position: sticky; bottom: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 18px calc(-1 * var(--gut)) 0; padding: 30px var(--gut) calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent 0, color-mix(in srgb, var(--yoru) 95%, transparent) 24px, var(--yoru) 100%); }
.su-sum { margin: 0; font-size: 12px; letter-spacing: .08em; color: color-mix(in srgb, var(--washi) 78%, transparent); text-align: center; }
.big { font-family: var(--f-disp); font-weight: 700; letter-spacing: .3em; text-indent: .3em; font-size: 17px; border-radius: 999px; border: 1px solid var(--akari); background: color-mix(in srgb, var(--akari) 16%, var(--yoru)); color: var(--washi); padding: 13px 34px; transition: transform var(--t-fast) var(--e-out), box-shadow var(--t-base), background var(--t-base); }
@media (hover: hover) { .big:hover { background: color-mix(in srgb, var(--akari) 26%, var(--yoru)); box-shadow: 0 0 30px -6px var(--akari-glow); } }
.big:active { transform: scale(.97); }
.big:disabled { opacity: .35; cursor: default; box-shadow: none; }
.big.start { font-size: 20px; padding: 15px 64px; background: linear-gradient(180deg, color-mix(in srgb, var(--akari) 32%, var(--yoru)), color-mix(in srgb, var(--akari) 12%, var(--yoru))); box-shadow: 0 0 40px -8px var(--akari-glow), 0 14px 30px -14px rgba(0,0,0,.8); position: relative; overflow: hidden; }
.big.start::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,240,210,.28) 50%, transparent 70%); transform: translateX(-120%); animation: sheen 4.2s var(--e-io) 1.5s infinite; }
@keyframes sheen { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.su-ver { text-align: center; font-size: 11px; opacity: .45; letter-spacing: .12em; margin-top: 18px; }

/* ---------- 盤 ---------- */
#table { display: none; min-height: 100svh; padding: calc(6px + env(safe-area-inset-top)) clamp(8px, 2.4vw, 20px) 0; gap: 10px; flex-direction: column; max-width: 1280px; margin: 0 auto; }
#table.on { display: flex; }
#hud { order: 0; } #top { order: 1; } #mid { order: 2; } #bottom { order: 3; margin-top: auto; margin-bottom: calc(6px + env(safe-area-inset-bottom)); }
/* 問いは敵のすぐ下(hika 09-24 11:56「目線が敵とアクション離れてやりづらい」)。札を選ぶ問いの高さぶんを取っておき、問いが出たり消えたりしても自分の欄が動かない */
@media (max-width: 999px) { #mid { min-height: 192px; } }   /* 問いの行動札 84px の高さ(09-24 17:0x) */
#hud { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 4px 4px 8px; border-bottom: 1px solid var(--line); }
.hud-r { display: flex; gap: 6px; align-items: center; }
#sndbtn { width: 30px; height: 28px; padding: 0; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--line); border-radius: 999px; color: var(--washi); }
#sndbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#sndbtn .spk { fill: currentColor; stroke: none; }
#sndbtn .mute { display: none; }
#sndbtn.off { opacity: .6; }
#sndbtn.off .wave { display: none; }
#sndbtn.off .mute { display: inline; }
#logbtn { font-size: 12px; background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; letter-spacing: .12em; }
.langbtn { font: inherit; font-size: 12px; color: var(--washi); background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; letter-spacing: .06em; cursor: pointer; }
.su-links .langbtn { padding: 1px 10px; margin-left: auto; }
html:not(.en) .langbtn { display: none; }
html.en .pab { white-space: nowrap; letter-spacing: 0; }   /* 英語版: ATK/DEF/SPL が折れないように */
#hud .langbtn { white-space: nowrap; padding: 5px 9px; }   /* 英語版は仕上げ中: ?lang=en で開いた時だけ切り替えを出す */
.prog { display: flex; gap: 7px; align-items: center; }
.prog i { width: 9px; height: 9px; border-radius: 50%; background: rgba(243,236,224,.14); box-shadow: 0 0 0 1px var(--line) inset; transition: background var(--t-base), box-shadow var(--t-base); }
.prog i.on { background: var(--akari); box-shadow: 0 0 10px 2px var(--akari-glow); }
.prog i.now { animation: flicker 2.4s ease-in-out infinite; }
.prog i.boss { border-radius: 2px; width: 12px; }
#turnno { font-family: var(--f-disp); font-weight: 700; font-size: 16px; letter-spacing: .16em; text-align: center; }
#turnno small { font-family: var(--f-ui); font-weight: 400; font-size: 11px; letter-spacing: .2em; opacity: .6; margin-left: 10px; }
#speed { font: inherit; font-size: 12px; background: var(--glass); color: var(--washi); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; }
#top { display: block; }
#box { display: none; }
#enemies { display: flex; justify-content: center; gap: clamp(18px, 4vw, 44px); align-items: flex-start; --cw: 150px; --ch: calc(150px * 88 / 63); flex-wrap: wrap; padding-top: 6px; }
.bossrow { display: flex; justify-content: center; width: 100%; }
.mobrow { display: flex; justify-content: center; gap: 24px; width: 100%; --cw: 104px; --ch: calc(104px * 88 / 63); padding-top: 10px; border-top: 1px solid var(--line); margin-top: 8px; }
.estack { display: flex; flex-direction: column; align-items: center; width: calc(var(--cw) + 40px); cursor: pointer; }
.estack.boss { width: auto; }
.ecards { position: relative; width: var(--cw); }
.ecards .card { position: absolute; left: 0; top: 0; }
.ecards .card.body { z-index: 2; }
.ecards .card.hp { z-index: 1; }
/* HP 札の窓: 今の HP の1マスだけ見せる(hika 09-24 14:05)。上の角だけ札の角 */
.hpwin { position: absolute; left: 0; top: 0; width: var(--cw); height: calc(var(--ch) / 12); overflow: hidden; z-index: 1; border-radius: calc(var(--cw) * 3 / 63) calc(var(--cw) * 3 / 63) 0 0; box-shadow: 0 0 0 1px rgba(243,236,224,.10); }
.ecards .hpwin .card, .cstack .hpwin .card { position: absolute; left: 0; box-shadow: none; border-radius: 0; }
.cstack .hpwin { left: var(--strip); height: calc(var(--ch) / 10); }
.estack.dead .card { filter: grayscale(1) brightness(.45); }
.estack.acting .ecards { border-radius: 10px; box-shadow: 0 0 0 2px var(--akari), 0 0 34px -2px var(--akari-glow); }
.card .hl { position: absolute; border-radius: 3px; background: color-mix(in srgb, var(--akari) 28%, transparent); box-shadow: 0 0 8px 3px var(--akari-glow); pointer-events: none; animation: hlpulse 1.1s ease-in-out infinite alternate; }
@keyframes hlpulse { from { opacity: .6; } to { opacity: 1; } }
.einfo { margin-top: 8px; font-size: 13px; text-align: center; line-height: 1.45; width: 100%; }
.einfo .eline, .einfo .plan { white-space: nowrap; overflow: hidden; }
.einfo .eline b { font-family: var(--f-disp); font-size: 15px; letter-spacing: .06em; }
.einfo .plan { color: var(--akari); font-size: 14px; font-weight: 500; margin-top: 2px; }
.einfo .hpbar { width: 100%; height: 5px; background: rgba(243,236,224,.14); border-radius: 3px; margin: 5px 0 3px; overflow: hidden; }
.einfo .hpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--shu), var(--akari)); border-radius: 3px; transition: width var(--t-slow) var(--e-out); }
.estack.boss .einfo { text-align: center; }
.plan .done { background: rgba(243,236,224,.14); border-radius: 4px; padding: 0 6px; font-size: 11px; color: var(--washi); }
#prompt { background: var(--glass); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; display: none; backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1); box-shadow: 0 20px 40px -24px rgba(0,0,0,.9); }
#prompt.on { display: block; animation: rise var(--t-base) var(--e-out); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#prompt .title { font-size: 15px; margin-bottom: 12px; line-height: 1.5; }
#prompt .title.dim { opacity: .6; }
.who { font-family: var(--f-disp); font-weight: 700; letter-spacing: .06em; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--washi) 12%, transparent); box-shadow: 0 0 0 1px var(--line-2) inset; }
.who.s1 { background: color-mix(in srgb, #8fb3ff 16%, transparent); }
.who.e { background: color-mix(in srgb, var(--akari) 18%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--akari) 50%, transparent) inset; }
#prompt .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
#prompt .col { display: flex; flex-direction: column; gap: 8px; min-width: 240px; flex: 1; }
.opt { background: color-mix(in srgb, var(--washi) 8%, transparent); color: var(--washi); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; text-align: left; line-height: 1.5; transition: border-color var(--t-fast), background var(--t-fast); }
@media (hover: hover) { .opt:hover { border-color: var(--akari); background: color-mix(in srgb, var(--akari) 10%, transparent); } }
.opt b { color: var(--akari); }
.opt.tiny { padding: 4px 10px; font-size: 11px; }
.cardbtn { background: none; border: 0; border-radius: 12px; padding: 4px; color: inherit; transition: transform var(--t-fast) var(--e-out); }
@media (hover: hover) { .cardbtn:hover:not(:disabled) { transform: translateY(-4px); } }
.cardbtn .card { transition: box-shadow var(--t-base); }
.cardbtn.sel .card { box-shadow: 0 0 0 2px var(--akari), 0 0 28px -4px var(--akari-glow); }
@media (hover: hover) { .cardbtn:hover:not(:disabled) .card { box-shadow: 0 0 0 2px var(--akari), 0 0 28px -4px var(--akari-glow); } }   /* 09-25 hika「押してないのに光ってる」: iPhone は最後に触った位置に「指が乗っている」が残り、そこに出た新しい札が光る → 指で触る端末では hover を出さない */
.cardbtn:disabled { opacity: .28; cursor: default; }
.events { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 14px; }
.events .ev { padding: 6px 12px; border-left: 2px solid color-mix(in srgb, var(--akari) 60%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--washi) 7%, transparent), transparent); border-radius: 0 8px 8px 0; animation: evin var(--t-base) var(--e-out) both; }
.events .ev:nth-child(2) { animation-delay: .06s; } .events .ev:nth-child(3) { animation-delay: .12s; } .events .ev:nth-child(4) { animation-delay: .18s; } .events .ev:nth-child(n+5) { animation-delay: .24s; }
@keyframes evin { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.chk { display: flex; gap: 10px; align-items: center; background: color-mix(in srgb, var(--washi) 6%, transparent); border: 1px solid var(--line); padding: 8px 12px; border-radius: 10px; }
.chk input { width: 18px; height: 18px; accent-color: var(--akari); }
.chk select { margin-left: auto; background: var(--yoru-2); color: var(--washi); border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; }
.sum { margin: 4px 0 12px; opacity: .85; }
#bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }   /* 09-24: 二人の欄は同じ高さ(手札の段を左右でそろえる) */
.parea { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border-radius: 18px; border: 1px solid var(--line); background: color-mix(in srgb, var(--yoru) 45%, transparent); min-width: 0; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: border-color var(--t-base), box-shadow var(--t-base); }
.parea.lead { border-color: color-mix(in srgb, var(--akari) 55%, transparent); box-shadow: 0 0 30px -16px var(--akari-glow); }
.acts { display: flex; flex-direction: column; gap: 6px; flex: none; }
.grp { display: flex; flex-direction: column; align-items: center; }
.pside { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; }
.fan { display: flex; }
.fan .card + .card { margin-left: -46px; }
.cstack { position: relative; --cw: 150px; --ch: calc(150px * 88 / 63); --strip: calc(150px * 10 / 63); width: calc(var(--cw) + var(--strip) * max(3, var(--nr, 0) + 1)); height: calc(var(--ch) * 1.1 + var(--strip) * var(--nb, 0) + 4px); margin-left: calc(var(--strip) * max(2, var(--nl, 0) - 1)); flex: none; }
.cstack .card { position: absolute; left: var(--strip); top: 0; }
.cstack .card.hp { z-index: 1; }
.cstack .card.body { z-index: 5; }
.cstack .card.weapon { z-index: 3; }
.cstack .card.weapon.L { left: calc(var(--strip) - var(--strip) * var(--k)); }
.cstack .card.weapon.R { left: calc(var(--strip) + var(--strip) * var(--k)); }
.cstack .card.weapon.B { left: var(--strip); }
.shiki { --skmax: 70px; display: flex; gap: 6px; flex-wrap: nowrap; align-items: flex-end; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 10px 6px 0 0; width: 100%; box-sizing: border-box; }
.shiki::-webkit-scrollbar { display: none; }
/* 式神は何体いても1行(hika 09-24 14:54)。札の幅 = 欄の幅を数で割った値(上限は今の大きさ・下限 30px。それより多い時だけ横に送れる) */
.shiki .skg { position: relative; flex: 0 0 auto; width: max(26px, min(var(--skmax, 54px), calc((100% - (var(--n, 1) - 1) * 6px) / var(--n, 1)))); }
.shiki .skg.partner { width: max(45px, min(calc(var(--skmax, 54px) * 1.5), calc((100% - (var(--n, 1) - 1) * 6px) / var(--n, 1) * 1.5))); }
.shiki .skg .card { width: 100% !important; height: auto !important; aspect-ratio: 63 / 88; }
.skb { position: absolute; top: -6px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--sumi, #26262c); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 1.5px var(--washi, #f3ece0); font-variant-numeric: tabular-nums; z-index: 2; }
.skb.g { background: var(--shu); }
.skg.out .card { opacity: .35; filter: grayscale(.8); } .skg .cap { font-size: 10px; } .skg.out .cap { color: color-mix(in srgb, var(--shu) 70%, var(--washi)); }
.skg.partner { position: relative; } .skg.partner .card { box-shadow: 0 0 0 2px var(--akari), 0 0 22px var(--akari-glow); }
.skg.partner .ptag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--akari); color: var(--yoru); font-size: 10px; font-weight: 700; padding: 1px 9px; border-radius: 10px; letter-spacing: .14em; }
.pinfo { font-size: 13px; line-height: 1.45; }
.pinfo .pname b { font-family: var(--f-disp); font-size: 17px; letter-spacing: .08em; }
.pinfo .pstat { font-size: 13px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.pinfo .pstat b { font-family: var(--f-disp); font-size: 18px; }
.pinfo .pstat .php { margin-right: 1em; }
.pinfo small { display: block; opacity: .62; margin-top: 3px; font-size: 11px; line-height: 1.5; }
.pinfo .lead { color: var(--akari); border: 1px solid color-mix(in srgb, var(--akari) 60%, transparent); border-radius: 10px; padding: 0 8px; font-size: 10px; letter-spacing: .1em; cursor: pointer; }
.pinfo .lead.off { color: rgba(243,236,224,.6); border-color: var(--line-2); }
.pinfo .pname { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.pinfo .npcl { font-size: 10px; letter-spacing: .06em; white-space: nowrap; padding: 0 7px; border-radius: 10px; background: rgba(243,236,224,.08); color: rgba(243,236,224,.72); }
#logsheet { position: fixed; inset: 0; z-index: 160; display: none; align-items: flex-end; justify-content: center; background: rgba(5,6,13,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
#logsheet.on { display: flex; animation: fadein var(--t-base) var(--e-out); }
#logsheet .ls-in { width: min(100%, 720px); max-height: 72svh; display: flex; flex-direction: column; background: color-mix(in srgb, var(--yoru-2) 94%, transparent); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); animation: rise var(--t-base) var(--e-out); }
#logsheet .ls-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
#logsheet .ls-head b { font-family: var(--f-disp); letter-spacing: .2em; }
#logsheet .ls-head button { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: 12px; }
#log { font-size: 12px; line-height: 1.6; overflow-y: auto; padding-top: 8px; }
#log .turn { color: var(--akari); margin-top: 4px; }
.score { margin: 10px 0 16px; text-align: center; }
.score .big { font-size: 22px; }
.score .sub { font-size: 12px; opacity: .75; margin-top: 4px; line-height: 1.5; }

/* 札を大きく見る */
#peek { display: none; position: fixed; inset: 0; background: rgba(5,6,13,.84); z-index: 150; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#peek.on { display: flex; animation: fadein var(--t-base) var(--e-out); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
#peek img { max-height: 64vh; max-width: 92vw; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.7); }
#peek .pimgs { display: flex; gap: 12px; justify-content: center; align-items: flex-start; } #peek .pimgs img { max-height: 58vh; max-width: 45vw; width: auto; height: auto; object-fit: contain; }
#peek.on .pimgs img { animation: peekin var(--t-base) var(--e-back); }
@keyframes peekin { from { transform: scale(.92) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
#peek .ptxt { background: var(--washi); color: var(--ink); border-radius: 12px; padding: 12px 16px; max-width: 560px; font-size: 14px; line-height: 1.7; }

/* ---------- 演出(#fx は固定の上掛け・盤の描き直しに巻き込まれない) ---------- */
#fx { position: fixed; inset: 0; z-index: 120; pointer-events: none; overflow: hidden; }
.fx-banner { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(80% 40% at 50% 50%, rgba(5,6,13,.78), rgba(5,6,13,.35) 70%, transparent); animation: bnbg 1.9s var(--e-io) forwards; }
@keyframes bnbg { 0% { opacity: 0; } 14% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
.fx-banner .bn { text-align: center; position: relative; }
.fx-banner { background: radial-gradient(90% 50% at 50% 50%, rgba(5,6,13,.9), rgba(5,6,13,.55) 70%, rgba(5,6,13,.2)); }
.fx-banner .bn-img { display: block; width: min(54vw, 290px); margin: 0 auto 18px; border-radius: 10px; box-shadow: 0 0 0 1px rgba(243,236,224,.2), 0 30px 70px rgba(0,0,0,.85), 0 0 60px rgba(224,85,61,.35); opacity: 0; animation: bnimg 2.6s var(--e-out) forwards; }
@keyframes bnimg { 0% { opacity: 0; transform: scale(1.35); filter: blur(10px) brightness(.4); } 22% { opacity: 1; transform: scale(.98); filter: blur(0) brightness(1); } 27% { transform: translateX(-7px) scale(1); } 32% { transform: translateX(6px); } 37% { transform: translateX(-3px); } 42% { transform: none; } 82% { opacity: 1; } 100% { opacity: 0; transform: scale(1.02); } }
.fx-banner.boss .bn-main { font-size: clamp(38px, 10vw, 76px); padding-top: 6px; }
.fx-banner .bn-rule { width: min(56vw, 420px); height: 1px; margin: 0 auto; background: linear-gradient(90deg, transparent, var(--akari), transparent); transform: scaleX(0); animation: rule .9s var(--e-out) .1s forwards; }
@keyframes rule { to { transform: scaleX(1); } }
.fx-banner .bn-main { font-family: var(--f-disp); font-weight: 800; font-size: clamp(46px, 13vw, 104px); letter-spacing: -.02em; line-height: 1.15; padding: 10px 0 4px; }
.fx-banner .bn-main span { display: inline-block; opacity: 0; filter: blur(10px); transform: translateY(24px); animation: bnch .9s var(--e-out) forwards; }
@keyframes bnch { to { opacity: 1; filter: blur(0); transform: none; } }
.fx-banner .bn-sub { font-size: clamp(12px, 3.2vw, 15px); letter-spacing: .5em; text-indent: .5em; opacity: 0; margin: 2px 0 14px; animation: opfade .7s ease .5s forwards; }
.fx-banner.boss { background: radial-gradient(120% 80% at 50% 45%, rgba(34,6,9,.9), rgba(5,6,13,.92)); animation-duration: 2.6s; }
.fx-banner.boss .bn-main { color: color-mix(in srgb, var(--washi) 92%, var(--shu)); text-shadow: 0 0 40px rgba(224,85,61,.45); }
.fx-banner.boss .bn-rule { background: linear-gradient(90deg, transparent, var(--shu), transparent); }
.fx-shake { animation: shake .42s var(--e-out); }
@keyframes shake { 0% { transform: translate(0, 0); } 18% { transform: translate(-7px, 2px) rotate(-.6deg); } 36% { transform: translate(6px, -2px) rotate(.5deg); } 54% { transform: translate(-4px, 1px); } 72% { transform: translate(2px, 0); } 100% { transform: none; } }
.fx-num { position: absolute; transform: translate(-50%, -50%); font-family: var(--f-disp); font-weight: 800; font-size: clamp(34px, 8vw, 54px); letter-spacing: -.02em; line-height: 1; text-shadow: 0 3px 14px rgba(0,0,0,.8); animation: num 1.25s var(--e-out) forwards; }
.fx-num.hit { color: var(--shu); }
.fx-num.zero { color: rgba(243,236,224,.8); font-size: clamp(26px, 6vw, 38px); }
.fx-num.guard { color: #cfe2ff; font-size: clamp(24px, 6vw, 34px); letter-spacing: .1em; }
@keyframes num { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.55); } 14% { opacity: 1; transform: translate(-50%, -52%) scale(1.18); } 28% { transform: translate(-50%, -50%) scale(.96); } 40% { transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -95%) scale(1); } }
.fx-slash { position: absolute; height: 3px; transform-origin: 0 50%; background: linear-gradient(90deg, transparent, #fff 30%, var(--washi) 70%, transparent); border-radius: 3px; box-shadow: 0 0 12px rgba(255,255,255,.8); animation: slash .38s var(--e-out) forwards; }
@keyframes slash { 0% { clip-path: inset(0 100% 0 0); opacity: 1; } 55% { clip-path: inset(0 0 0 0); opacity: 1; } 100% { clip-path: inset(0 0 0 100%); opacity: 0; } }
.fx-ward { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; border: 1.5px solid rgba(207,226,255,.9); box-shadow: 0 0 18px rgba(170,205,255,.7), inset 0 0 18px rgba(170,205,255,.35); animation: ward .7s var(--e-out) forwards; }
.fx-ward svg { position: absolute; inset: 12%; width: 76%; height: 76%; }
@keyframes ward { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6) rotate(-20deg); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.12) rotate(0); } }
.fx-flip { position: absolute; perspective: 800px; }
.fx-flip .in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: flipin .62s var(--e-out) forwards; }
.fx-flip .fc { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 6px; overflow: hidden; }
.fx-flip .fc img { width: 100%; height: 100%; display: block; }
.fx-flip .fc.front { transform: rotateY(180deg); }
@keyframes flipin { 0% { transform: rotateY(0) scale(1.08); } 100% { transform: rotateY(180deg) scale(1); } }
.fx-deal { position: absolute; border-radius: 8px; overflow: hidden; box-shadow: 0 20px 40px -10px rgba(0,0,0,.8); animation: deal .7s var(--e-out) both; }
.fx-deal img { width: 100%; height: 100%; display: block; }
@keyframes deal { 0% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.7); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
.fx-ofuda { position: absolute; transform: translate(-50%, -50%); width: 26%; min-width: 26px; aspect-ratio: 1 / 3.2; background: linear-gradient(180deg, #faf5ea, #efe6d4); border-radius: 2px; box-shadow: 0 6px 18px rgba(0,0,0,.55); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6%; color: #1a1a24; animation: ofuda 1.3s var(--e-out) forwards; }
.fx-ofuda svg { width: 70%; }
.fx-ofuda b { font-family: var(--f-disp); font-weight: 800; font-size: clamp(14px, 3.4vw, 22px); line-height: 1; }
@keyframes ofuda { 0% { opacity: 0; transform: translate(-50%, -110%) scale(.9); } 22% { opacity: 1; transform: translate(-50%, -48%) scale(1.03); } 34% { transform: translate(-50%, -50%) scale(1); } 76% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.04); } }
.fx-mote { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--akari); box-shadow: 0 0 8px 2px var(--akari-glow); animation: mote 1.1s var(--e-out) forwards; }
@keyframes mote { from { opacity: 1; transform: translate(0, 0) scale(1); } to { opacity: 0; transform: translate(var(--mx), var(--my)) scale(.2); } }
.fx-burst { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(255,236,200,.95), rgba(240,178,90,.5) 35%, transparent 70%); animation: burst .9s var(--e-out) forwards; }
@keyframes burst { from { opacity: 1; transform: translate(-50%, -50%) scale(.2); } to { opacity: 0; transform: translate(-50%, -50%) scale(1.6); } }
.fx-leaf { position: absolute; top: -40px; width: 18px; height: 18px; animation: leaf var(--dur) linear forwards; }
.fx-leaf svg { width: 100%; height: 100%; animation: leafspin var(--spin) ease-in-out infinite alternate; }
@keyframes leaf { to { transform: translate(var(--lx), 110vh); } }
@keyframes leafspin { from { transform: rotate(-40deg); } to { transform: rotate(60deg); } }

/* 終わりの画面 */
#result { position: fixed; inset: 0; z-index: 140; display: grid; place-items: center; padding: var(--gut); background: radial-gradient(70% 55% at 50% 45%, rgba(11,14,31,.86), rgba(5,6,13,.97)); backdrop-filter: blur(12px) saturate(.8); -webkit-backdrop-filter: blur(12px) saturate(.8); opacity: 0; animation: fadein .7s var(--e-out) forwards; overflow-y: auto; }
#result.win { background: radial-gradient(80% 60% at 50% 30%, rgba(240,178,90,.24), rgba(11,14,31,.9) 55%, rgba(5,6,13,.98)); }
#result .rs { text-align: center; max-width: 560px; }
#result .rs-eyebrow { font-size: 11px; letter-spacing: .5em; text-indent: .5em; opacity: .6; margin: 0 0 8px; }
#result .rs-title { font-family: var(--f-disp); font-weight: 800; font-size: clamp(48px, 15vw, 120px); letter-spacing: -.03em; line-height: 1.1; margin: 0; }
#result .rs-title span { display: inline-block; opacity: 0; transform: translateY(30px) scale(.97, .91); filter: blur(8px); animation: rstitle 1s var(--e-out) forwards; }
@keyframes rstitle { 60% { transform: translateY(-2%) scale(1.045); filter: blur(0); opacity: 1; } 80% { transform: scale(.988); } to { transform: none; opacity: 1; filter: blur(0); } }
#result.win .rs-title { color: var(--washi); text-shadow: 0 0 50px rgba(240,178,90,.5); }
#result.lose .rs-title { color: color-mix(in srgb, var(--washi) 70%, transparent); }
#result .rs-sub { font-size: 14px; opacity: .82; margin: 10px 0 0; }
#result .rs-score { margin: 26px 0 6px; font-family: var(--f-disp); font-weight: 800; font-size: clamp(36px, 10vw, 60px); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
#result .rs-score small { font-family: var(--f-ui); font-weight: 400; font-size: 11px; letter-spacing: .4em; display: block; opacity: .6; }
#result .rs-detail { font-size: 12px; opacity: .6; line-height: 1.6; }
#result .rs-btns { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 30px; }
#result .rs-btns .big { min-width: 260px; }
#result .rs-btns .big.ghost { background: transparent; border-color: var(--line-2); }

/* PC: 盤(左) | 問い(右・上に固定)。問いが盤に被らない */
@media (min-width: 1000px) {
  #table.on { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 420px); grid-template-rows: auto auto 1fr; grid-template-areas: "hud hud" "top mid" "bottom mid"; column-gap: 22px; align-items: start; }
  #hud { grid-area: hud; } #top { grid-area: top; } #bottom { grid-area: bottom; margin-top: 0; }
  #mid { grid-area: mid; position: sticky; top: 12px; bottom: auto; margin-top: 4px; padding-bottom: 0; align-self: start; }
  #prompt .cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  #prompt .cards3 .cardbtn { width: 100%; padding: 2px; }
  #prompt .cards3 .card.mid { width: 100%; height: auto; }
  #prompt .col { min-width: 0; }
  /* 二人: 各欄を「札の山|情報」+下に行動札の段(手札を表で出すと横並びでは情報の列が潰れる) */
  #bottom:not(.solo) .parea { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "stack side" "acts acts"; align-items: start; gap: 10px 16px; }
  #bottom:not(.solo) .parea .cstack { grid-area: stack; --cw: 116px; --ch: calc(116px * 88 / 63); --strip: calc(116px * 10 / 63); }
  #bottom:not(.solo) .parea .pside { grid-area: side; }
  #bottom:not(.solo) .parea .acts { grid-area: acts; flex-direction: row; gap: 12px; align-self: end; }
  #bottom:not(.solo) .parea { grid-template-rows: auto 1fr; }
}
/* ---------- 幅 ---------- */
@media (max-width: 1100px) { :root { --cw: 84px; } .card.small { --cw: 60px; --ch: calc(60px * 88 / 63); } #enemies { --cw: 120px; --ch: calc(120px * 88 / 63); } .cstack { --cw: 120px; --ch: calc(120px * 88 / 63); --strip: calc(120px * 10 / 63); } }
@media (max-width: 760px) {
  html, body { font-size: 13px; }
  .charrow { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .charpick .nm { font-size: 14px; letter-spacing: .06em; text-indent: .06em; }
  .lvrow { grid-template-columns: repeat(5, 1fr); }
  .modebtn b { font-size: 18px; }
  .bossbtn span { font-size: 15px; }
  #hud { gap: 8px; } #turnno { font-size: 14px; letter-spacing: .1em; } #turnno small { display: block; margin: 0; white-space: nowrap; letter-spacing: .04em; }   /* 音のボタンを足して「1ターン目」が3行に折れた(hika 09-24 14:05 のスクショ) */
  .prog { gap: 5px; } #sndbtn { width: 28px; }
  #bottom { grid-template-columns: 1fr 1fr; gap: 8px; }
  .parea { flex-direction: column; align-items: center; gap: 8px; padding: 8px 6px; border-radius: 14px; }
  #enemies { --cw: clamp(64px, calc((100svh - 642px) * 63 / 88 / 1.084), 170px); --ch: calc(var(--cw) * 88 / 63); gap: 14px; }   /* 妖の段に使える高さ(画面−見出し・問い・自分)。HP 札は1マスだけ(09-24 14:05)なので札の高さ×(1+1/12) */
  #enemies { gap: 8px; }
  #enemies .estack { width: min(calc(var(--cw) + 104px), calc(50vw - 22px)); }
  #enemies .mobrow .estack { width: min(calc(var(--cw) + 90px), calc(50vw - 22px)); }
  #enemies .bossrow .estack.boss { --cw: var(--bosscw, 112px); --ch: calc(var(--cw) * 88 / 63); width: min(calc(var(--cw) + 170px), calc(100vw - 24px)); }
  .estack.boss { flex-direction: column; align-items: center; }
  .mobrow { --cw: var(--mobcw, 76px); --ch: calc(var(--cw) * 88 / 63); gap: 12px; }
  .parea .cstack { order: 0; --cw: 104px; --ch: calc(104px * 88 / 63); --strip: calc(104px * 10 / 63); margin-left: calc(var(--strip) * max(1, var(--nl, 0) - 1)); }
  .parea .pside { order: 1; width: 100%; align-items: center; }
  .parea .pinfo { text-align: center; font-size: 11px; }
  .parea .acts { order: 2; flex-direction: row; justify-content: center; gap: 4px; width: 100%; }
  .parea .acts .card.small { --cw: 44px; --ch: calc(44px * 88 / 63); width: var(--cw); height: var(--ch); }
  .parea .acts .fan .card + .card { margin-left: -34px; }
  .parea .acts .cap { font-size: 9px; }
  .parea .shiki { justify-content: center; }
  .parea .shiki { --skmax: 54px; }
  .events { font-size: 13px; }
  #prompt { padding: 12px 12px 10px; border-radius: 16px; }
  #prompt .title { margin-bottom: 8px; }
  #prompt .cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 84px)); justify-content: center; gap: 18px; }   /* 09-24 17:0x hika「札もう少し小さくてもいいから、自キャラもう少し大きく」: 100→84px */
  #prompt .cards3 .cap { margin-top: 3px; font-size: 12px; }
  #prompt .card.mid { --cw: 96px; --ch: calc(96px * 88 / 63); width: var(--cw); height: var(--ch); }
  #prompt .cards3 .card.mid { width: 100%; height: auto; }
  #prompt .cards3 .cardbtn { width: 100%; padding: 2px; }
  #prompt .cards3 .card.mid { width: 100%; height: auto; }
  #enemies .parea.foe .cstack { --cw: clamp(68px, calc(100svh * .16 - 54px), 96px); --ch: calc(var(--cw) * 88 / 63); --strip: calc(var(--cw) * 10 / 63); }
  #enemies .parea.foe { padding: 8px; gap: 6px 10px; }
}
@media (max-width: 420px) { .charpick .nm { font-size: 12px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  body::after { animation: none; }
  #opening .op-logo, #opening .op-logo .ls, #opening .op-tag, #opening .op-tap, #opening .op-bg, #opening .op-mist, #opening .op-lights i { opacity: 1; filter: none; transform: none; }
  #opening .op-logo .lb { display: none; }
}

/* ---------- 札に付ける演出(ui.js attach: 描き直しても経過時間から続く) ---------- */
.att-num { position: absolute; left: 50%; top: 62%; -webkit-text-stroke: 1.5px rgba(10,8,14,.8); paint-order: stroke fill; z-index: 30; transform: translate(-50%, -50%); font-family: var(--f-disp); font-weight: 800; font-size: clamp(34px, 8vw, 54px); letter-spacing: -.02em; line-height: 1; text-shadow: 0 3px 14px rgba(0,0,0,.85); pointer-events: none; animation: num 1.25s var(--e-out) both; white-space: nowrap; }
.att-num.hit { color: var(--shu); }
.att-num.zero { color: rgba(243,236,224,.85); font-size: clamp(26px, 6vw, 38px); }
.att-num.guard { color: #d6e6ff; font-size: clamp(24px, 6vw, 34px); letter-spacing: .1em; }
.att-slash { position: absolute; left: 6%; top: 44%; width: 118%; height: 3px; z-index: 29; transform-origin: 0 50%; transform: rotate(38deg); background: linear-gradient(90deg, transparent, #fff 30%, var(--washi) 70%, transparent); border-radius: 3px; box-shadow: 0 0 12px rgba(255,255,255,.85); pointer-events: none; animation: slash .42s var(--e-out) both; }
.att-ward { position: absolute; left: 50%; top: 62%; z-index: 28; width: 96%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 1.5px solid rgba(214,230,255,.9); box-shadow: 0 0 18px rgba(170,205,255,.7), inset 0 0 18px rgba(170,205,255,.35); color: rgba(214,230,255,.85); pointer-events: none; animation: ward .76s var(--e-out) both; }
.att-ward svg { position: absolute; inset: 12%; width: 76%; height: 76%; }
.att-flip { position: absolute; inset: 0; z-index: 12; perspective: 700px; pointer-events: none; }
.att-flip .in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: flipin .65s var(--e-out) both; }
.att-flip .fc { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: inherit; overflow: hidden; }
.att-flip .fc img { width: 100%; height: 100%; display: block; }
.att-flip .fc.front { transform: rotateY(180deg); }
.att-ofuda { position: absolute; left: 50%; top: 42%; z-index: 30; width: 26%; min-width: 26px; aspect-ratio: 1 / 3.2; transform: translate(-50%, -50%); background: linear-gradient(180deg, #faf5ea, #eee4d0); border-radius: 2px; box-shadow: 0 6px 18px rgba(0,0,0,.6); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8%; color: #1a1a24; pointer-events: none; animation: ofuda 1.3s var(--e-out) both; }
.att-ofuda svg { width: 70%; }
.att-ofuda b { font-family: var(--f-disp); font-weight: 800; font-size: clamp(14px, 3.4vw, 22px); line-height: 1; }
.att-motes { position: absolute; inset: 0; z-index: 31; pointer-events: none; }
.att-motes i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #ffe2ae; box-shadow: 0 0 8px 2px var(--akari-glow); animation: mote 1.25s var(--e-out) both; }
.att-burst { position: absolute; left: 50%; top: 30%; z-index: 29; width: 150%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(255,236,200,.95), rgba(240,178,90,.5) 35%, transparent 70%); pointer-events: none; animation: burst .95s var(--e-out) both; }
.deal-in { animation: dealin .72s var(--e-out) both; }
.deal-in.r { animation-name: dealinr; }
@keyframes dealin { 0% { opacity: 0; transform: translateY(-46vh) rotate(-8deg) scale(.8); } 70% { opacity: 1; transform: translateY(1.5%) rotate(.6deg) scale(1.01); } 100% { opacity: 1; transform: none; } }
@keyframes dealinr { 0% { opacity: 0; transform: translateY(-46vh) rotate(8deg) scale(.8); } 70% { opacity: 1; transform: translateY(1.5%) rotate(-.6deg) scale(1.01); } 100% { opacity: 1; transform: none; } }
.fx-shake { animation: shake .46s var(--e-out) both; }
@media (prefers-reduced-motion: reduce) { .att-slash, .att-motes, .att-burst, .att-flip { display: none; } .deal-in, .fx-shake { animation: none; } }

/* 一人: キャラの札の右に情報・手札・式神 */
#bottom.solo .parea { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "stack side" "stack acts"; align-items: start; gap: 10px 16px; }
#bottom.solo .parea .cstack { grid-area: stack; }
#bottom.solo .parea .pside { grid-area: side; align-items: flex-start; width: auto; }
#bottom.solo .parea .acts { grid-area: acts; flex-direction: row; justify-content: flex-start; gap: 8px; width: auto; }
#bottom.solo .parea .pinfo { text-align: left; }
#bottom.solo .parea .shiki { justify-content: flex-start; }
@media (max-width: 760px) {
  #table { gap: 8px; }
  #hud { padding-bottom: 6px; }
  #bottom.solo .parea { padding: 8px 8px; gap: 6px 10px; }
  #bottom.solo .parea .cstack { --cw: calc(clamp(108px, calc(100svh * .18 - 20px), 140px) - min(var(--nl, 0), 6) * 5px);   /* 左に差した装備が多いと山が横に広がって右の欄が潰れるので、その分だけ札を小さく */ --ch: calc(var(--cw) * 88 / 63); --strip: calc(var(--cw) * 10 / 63); }
  /* 二人: 2列ぶんを1画面に。キャラの札は小さく、特性の文は札を押して見る */
  #bottom:not(.solo) .parea { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "stack side" "acts acts"; align-items: start; gap: 6px 3px; padding: 8px 6px; }
  #bottom:not(.solo) .parea .cstack { grid-area: stack; --cw: clamp(58px, calc(33.8vw - 68px), 84px); --ch: calc(var(--cw) * 88 / 63); --strip: calc(var(--cw) * 10 / 63); width: calc(var(--cw) + var(--strip) * max(2, var(--nr, 0) + 1)); }   /* 09-24: 自キャラ 66→最大84px(画面の幅で。情報の列 70px を残す)。右の装備の予約を3→2本に */
  #bottom:not(.solo) .parea .pside { grid-area: side; align-items: flex-start; width: auto; gap: 6px; }
  #bottom:not(.solo) .parea .acts { grid-area: acts; align-self: end; }
  #bottom:not(.solo) .parea { grid-template-rows: auto 1fr; }
  #bottom:not(.solo) .parea .npct { display: none; }
  #bottom:not(.solo) .parea .pinfo { text-align: left; }
  #bottom:not(.solo) .parea .pinfo small { display: none; }
  #bottom:not(.solo) .parea .pinfo .pname b { font-size: 15px; }
  #bottom:not(.solo) .parea .pinfo .pstat span { display: block; margin: 0; }
  #bottom:not(.solo) .parea .pinfo .pstat .pab { white-space: nowrap; font-size: 11px; letter-spacing: -.07em; }
  #bottom:not(.solo) .parea .pinfo .pname { display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: center; }
  #bottom:not(.solo) .parea .shiki { justify-content: flex-start; gap: 4px; }
  #bottom:not(.solo) .parea .shiki { --skmax: 40px; }
  #bottom.solo .parea .pinfo { font-size: 12px; }
  #bottom.solo .parea .acts .card.small { --cw: 40px; --ch: calc(40px * 88 / 63); }
  #bottom.solo .parea .acts .fan .card + .card { margin-left: -30px; }
}
.events { max-height: 36vh; overflow-y: auto; }
#enemies .parea.foe { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "stack side" "stack acts"; align-items: start; gap: 10px 16px; width: 100%; }
#enemies .parea.foe .cstack { grid-area: stack; }
#enemies .parea.foe .pside { grid-area: side; align-items: flex-start; width: auto; }
#enemies .parea.foe .acts { grid-area: acts; flex-direction: row; justify-content: flex-start; gap: 8px; width: auto; }
#enemies .parea.foe .pinfo { text-align: left; }
#enemies { transition: opacity .35s var(--e-io); }
#enemies.swap { opacity: 0; }

/* 何が起きたか: 打った→受けた の筋・動いた人の光・前のターンのまとめ */
.fx-streak { position: absolute; height: 4px; margin-top: -2px; transform-origin: 0 50%; border-radius: 4px; pointer-events: none; animation: streak .52s var(--e-out) forwards; }
.fx-streak.atk { background: linear-gradient(90deg, transparent, rgba(255,226,174,.35) 25%, #ffe2ae 80%, #fff); box-shadow: 0 0 14px 2px var(--akari-glow); }
.fx-streak.fire { background: linear-gradient(90deg, transparent, rgba(160,190,255,.35) 25%, #c9d8ff 80%, #fff); box-shadow: 0 0 16px 3px rgba(140,170,255,.6); }
.fx-streak.foe { background: linear-gradient(90deg, transparent, rgba(224,85,61,.35) 25%, #ff8a6b 80%, #ffe0d6); box-shadow: 0 0 14px 2px rgba(224,85,61,.55); }
@keyframes streak { 0% { clip-path: inset(0 100% 0 0); opacity: 1; } 42% { clip-path: inset(0 0 0 0); opacity: 1; } 100% { clip-path: inset(0 0 0 100%); opacity: .2; } }
.fx-impact { position: absolute; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%; pointer-events: none; opacity: 0; animation: impact .55s var(--e-out) both; }
.fx-impact.atk { background: radial-gradient(circle, rgba(255,240,210,.95), rgba(240,178,90,.45) 35%, transparent 68%); }
.fx-impact.fire { background: radial-gradient(circle, rgba(230,238,255,.95), rgba(140,170,255,.45) 35%, transparent 68%); }
.fx-impact.foe { background: radial-gradient(circle, rgba(255,220,210,.95), rgba(224,85,61,.5) 35%, transparent 68%); }
@keyframes impact { 0% { opacity: 0; transform: scale(.3); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5); } }
.card.act-on { animation: actring .9s var(--e-out) both; }
@keyframes actring { 0%, 100% { box-shadow: 0 10px 22px -8px rgba(0,0,0,.7), 0 0 0 1px rgba(243,236,224,.10); } 20%, 70% { box-shadow: 0 10px 22px -8px rgba(0,0,0,.7), 0 0 0 2px var(--akari), 0 0 30px 2px var(--akari-glow); } }
#prompt .title.tline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.recap { display: inline-flex; flex-wrap: wrap; gap: 4px 5px; align-items: center; font-size: 12px; }
.recap .rc-lab { font-size: 10px; letter-spacing: .24em; opacity: .55; margin-right: 2px; }
.recap .rc { padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--washi) 9%, transparent); box-shadow: 0 0 0 1px var(--line) inset; white-space: nowrap; font-variant-numeric: tabular-nums; }
.recap .rc.hit { color: #ffb3a1; box-shadow: 0 0 0 1px color-mix(in srgb, var(--shu) 55%, transparent) inset; }
.recap .rc.hit.me { background: color-mix(in srgb, var(--shu) 22%, transparent); color: #ffd2c6; }
.recap .rc.guard { color: #d6e6ff; box-shadow: 0 0 0 1px rgba(170,205,255,.45) inset; }
.recap .rc.zero { opacity: .75; }

/* 押せる妖(標的を選ぶ時) */
.estack.pick .ecards { border-radius: 10px; animation: pickring 1.2s ease-in-out infinite; }
.estack.pick .einfo .eline b { color: var(--akari); }
@keyframes pickring { 0%, 100% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--akari) 70%, transparent), 0 0 18px -4px var(--akari-glow); } 50% { box-shadow: 0 0 0 3px var(--akari), 0 0 34px 0 var(--akari-glow); } }

.events .ev b.dm { color: #ff9a82; font-size: 1.12em; }
.events .ev b.dz { opacity: .7; }
.events .ev .gd { color: #cfe0ff; }
.events .ev .kill { color: var(--akari); font-family: var(--f-disp); font-weight: 700; letter-spacing: .2em; }

/* 表で見せる手札・使用済みは重ねを浅く(字が読めるように) */
.fan.open .card + .card, .parea .acts .fan.open .card + .card, #bottom.solo .parea .acts .fan.open .card + .card { margin-left: -14px; }

/* テンション: 進化の幕・勝った時の封・受けた時の赤・HP が少ない時 */
.fx-banner.evo { background: radial-gradient(90% 60% at 50% 45%, rgba(60,40,10,.88), rgba(5,6,13,.9)); }
.fx-banner.evo .bn-img { box-shadow: 0 0 0 1px rgba(255,226,174,.5), 0 30px 70px rgba(0,0,0,.85), 0 0 80px rgba(240,178,90,.55); }
.fx-banner.evo .bn-main { color: #fff1d6; text-shadow: 0 0 40px rgba(240,178,90,.65); }
.fx-banner.evo .bn-sub { color: var(--akari); }
.fx-hurt { position: absolute; inset: 0; box-shadow: inset 0 0 90px 24px rgba(224,85,61,var(--a, .45)); animation: hurt .62s var(--e-out) forwards; }
@keyframes hurt { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }
.fx-seal { position: absolute; transform: translate(-50%, -50%); pointer-events: none; }
.fx-seal b { display: block; font-family: var(--f-disp); font-weight: 800; font-size: clamp(90px, 26vw, 180px); line-height: 1; color: #fff4dc; text-shadow: 0 0 30px rgba(240,178,90,.9), 0 0 80px rgba(240,178,90,.5), 0 6px 20px rgba(0,0,0,.6); animation: seal 1.45s var(--e-out) forwards; }
@keyframes seal { 0% { opacity: 0; transform: scale(1.8) rotate(-8deg); filter: blur(12px); } 22% { opacity: 1; transform: scale(.94) rotate(0); filter: blur(0); } 32% { transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(1.06); } }
.parea.danger { border-color: color-mix(in srgb, var(--shu) 70%, transparent); animation: danger 1.6s ease-in-out infinite; }
@keyframes danger { 0%, 100% { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--shu) 30%, transparent), 0 0 20px -12px rgba(224,85,61,.5); } 50% { box-shadow: inset 0 0 26px -6px rgba(224,85,61,.45), 0 0 34px -8px rgba(224,85,61,.7); } }
@media (prefers-reduced-motion: reduce) { .parea.danger { animation: none; } }

/* 初手の妖: 6枚を3列で小さく、選んだ妖の中身は詰めて */
#prompt .row.starts { display: grid; grid-template-columns: repeat(3, minmax(0, 96px)); justify-content: center; gap: 4px 14px; }
#prompt .row.starts .cardbtn { padding: 2px; }
#prompt .row.starts .card.mid { --cw: 100%; width: 100%; height: auto; }
#prompt .row.starts .cap { margin-top: 2px; }
#prompt .col.compact { gap: 4px; margin: 6px 0 8px; min-width: 0; }
#prompt .col .inf { padding: 3px 0 3px 10px; font-size: 12px; line-height: 1.5; border-left: 2px solid var(--line-2); color: color-mix(in srgb, var(--washi) 88%, transparent); }
#prompt .col .inf b { color: var(--akari); }
#prompt .row.starts ~ .big { display: block; margin: 4px auto 0; }
#prompt .col.compact:empty { display: none; }

/* HP の段が変わる時に札が滑る */
.card.slide { animation: slidetop .52s cubic-bezier(.33, 1, .68, 1) both; }
@keyframes slidetop { from { top: var(--from-top); } to { top: var(--to-top); } }
@media (prefers-reduced-motion: reduce) { .card.slide { animation: none; } }

/* 札を選んだ瞬間 */
#prompt .cardbtn.picked { transform: translateY(-8px) scale(1.06); transition: transform .16s var(--e-back); }
#prompt .cardbtn.picked .card { box-shadow: 0 0 0 3px var(--akari), 0 0 40px 2px var(--akari-glow); }
#prompt .has-pick .cardbtn:not(.picked) { opacity: .35; transition: opacity .16s; }
#prompt .row.loot { justify-content: center; gap: 18px; }

.chk.on { border-color: var(--akari); background: color-mix(in srgb, var(--akari) 12%, transparent); }

#log .line b.dm { color: #ff9a82; } #log .line b.dz { opacity: .7; } #log .line .gd { color: #cfe0ff; } #log .line .kill { color: var(--akari); font-weight: 700; }

/* ---------- チュートリアル(09-24 hika 16:56) ---------- */
.su-links .tutbtn { font: inherit; font-size: 12px; letter-spacing: .24em; color: var(--akari); background: none; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--akari) 60%, transparent); padding: 0 0 2px; cursor: pointer; }
#coach { position: fixed; inset: 0; z-index: 140; pointer-events: none; opacity: 0; transition: opacity .22s var(--e-out); }
#coach.on { opacity: 1; }
#coach .co-back { position: absolute; inset: 0; }
#coach.block .co-back { pointer-events: auto; }
#coach .co-spot { position: absolute; border-radius: 14px; box-shadow: 0 0 0 200vmax rgba(5, 7, 20, .58); outline: 2px solid color-mix(in srgb, var(--akari) 85%, transparent); outline-offset: 2px; transition: left .3s var(--e-out), top .3s var(--e-out), width .3s var(--e-out), height .3s var(--e-out); }
#coach:not(.block) .co-spot { box-shadow: 0 0 0 200vmax rgba(5, 7, 20, .28); animation: co-pulse 1.6s ease-in-out infinite; }
#coach .co-spot[hidden] { display: block; left: 50%; top: 50%; width: 0; height: 0; outline: 0; }
@keyframes co-pulse { 50% { outline-color: color-mix(in srgb, var(--akari) 35%, transparent); } }
#coach .co-bub { position: absolute; pointer-events: auto; padding: 14px 16px 12px; border-radius: 16px; background: linear-gradient(180deg, #1b2144, #10142b); border: 1px solid color-mix(in srgb, var(--akari) 45%, transparent); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .7); color: var(--washi); font-size: 14px; line-height: 1.7; animation: co-in .32s var(--e-out); }
#coach:not(.block) .co-bub { pointer-events: none; }
@keyframes co-in { from { opacity: 0; transform: translateY(6px); } }
#coach .co-txt b { color: var(--akari); font-weight: 700; margin-right: .3em; }
#coach .co-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
#coach .co-n { font-size: 11px; letter-spacing: .1em; opacity: .55; }
#coach .co-next { font: inherit; font-size: 13px; letter-spacing: .12em; color: var(--yoru); background: var(--akari); border: 0; border-radius: 999px; padding: 6px 18px; cursor: pointer; }
#coach .co-next[hidden] { display: none; }
#tutask { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; background: rgba(5, 7, 20, .6); opacity: 0; transition: opacity .25s var(--e-out); }
#tutask.on { opacity: 1; }
#tutask .ta-box { width: min(340px, calc(100vw - 32px)); padding: 22px 18px 18px; border-radius: 18px; background: linear-gradient(180deg, #1b2144, #10142b); border: 1px solid var(--line); text-align: center; }
#tutask .ta-t { font-family: var(--f-disp); font-size: 20px; letter-spacing: .14em; margin: 0 0 16px; }
#tutask .ta-b { display: grid; gap: 10px; }

/* 09-25 公開の結果画面: 予約・キャンペーン・公式ページ */
.rs-cta { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 18px 0 6px; }
.rs-cta p { margin: 0; font-size: 13px; letter-spacing: .12em; color: var(--akari); }
.rs-cta a.big { text-decoration: none; min-width: 220px; text-align: center; }
/* 09-25 チュートリアル v2: 台本の答えだけ押せる */
#prompt .tut-off { opacity: .3; pointer-events: none; }
#prompt .tut-go { position: relative; animation: co-pulse 1.4s ease-in-out infinite; }
#prompt .opt.tut-go, #prompt .big.tut-go { border-color: var(--akari); }
