/* © 2026 神ゲーカンパニー All rights reserved. */
/* 見た目の方針: 黒曜石(濃い藍黒・わずかに光る面)と金の装飾。ボタンはルーンの丸い印章。紋章風のHUD */
:root { --gold: #d9b56c; --gold2: #8c6a32; --goldL: #f4dfa6; --ink: #0b0d16; --ink2: rgba(9, 11, 20, .84); --obs: linear-gradient(160deg, rgba(34, 36, 56, .92), rgba(10, 11, 20, .96) 55%, rgba(18, 20, 34, .94)); --paper: #efe4cc; --hp: #c8423a; --mp: #4a8cf0; --sp: #e2c45a; --F1: 'Zen Antique', 'Hiragino Mincho ProN', 'Yu Mincho', serif; --F2: 'Yuji Syuku', 'Zen Antique', serif; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--paper); font-family: var(--F1); touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
canvas#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font-family: var(--F1); cursor: pointer; }
#touchzone { position: fixed; inset: 0; display: none; z-index: 2; }
body.touch.play #touchzone { display: block; }
#stick { position: fixed; width: 124px; height: 124px; margin: -62px 0 0 -62px; border-radius: 50%; border: 2px solid rgba(217, 181, 108, .55); background: radial-gradient(circle, rgba(10, 12, 22, .1), rgba(10, 12, 22, .45)); box-shadow: 0 0 0 6px rgba(10, 12, 22, .25), inset 0 0 18px rgba(217, 181, 108, .15); display: none; z-index: 3; pointer-events: none; }
#stick::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; border: 1px dashed rgba(217, 181, 108, .35); }
#stick i { position: absolute; left: 37px; top: 37px; width: 50px; height: 50px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f6e2b0, #9a7434 70%, #5a4020); box-shadow: 0 0 14px rgba(217, 181, 108, .7), inset 0 -3px 6px rgba(0, 0, 0, .4); }
#nums { position: fixed; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.dmg { position: absolute; left: 0; top: 0; font: 700 22px var(--F1); color: #fff; text-shadow: 0 2px 0 #000, 0 0 8px rgba(0, 0, 0, .8); white-space: nowrap; will-change: transform; }
.dmg.crit { color: #ffd34a; font-size: 32px; text-shadow: 0 2px 0 #5a2a00, 0 0 12px #ff8a00; }
.dmg.weak { color: #ff6ad5; font-size: 30px; }
.dmg.me { color: #ff5a4a; font-size: 26px; }
.dmg.heal { color: #7dffb0; }
.dmg.info { color: #bfe3ff; font-size: 18px; }

/* ---- 共通の飾り: 金の角飾り ---- */
.ornate { position: relative; }
.ornate::before, .ornate::after { content: ''; position: absolute; width: 14px; height: 14px; border: 2px solid var(--gold); pointer-events: none; }
.ornate::before { left: -3px; top: -3px; border-right: none; border-bottom: none; }
.ornate::after { right: -3px; bottom: -3px; border-left: none; border-top: none; }

/* ---- HUD ---- */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; opacity: 0; transition: opacity .5s; }
.hud.show { opacity: 1; }
.stats { position: absolute; left: max(18px, env(safe-area-inset-left)); top: 16px; width: min(360px, 48vw); padding: 10px 16px 9px 66px; background: var(--obs); border: 1px solid rgba(217, 181, 108, .55); border-left: none; clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); box-shadow: 0 4px 16px rgba(0, 0, 0, .5); }
.stats::before { content: 'ᛟ'; position: absolute; left: 10px; top: 50%; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%; border: 2px solid var(--gold); background: radial-gradient(circle at 50% 35%, #2a2e4c, #0b0d16); color: var(--goldL); font: 24px serif; display: grid; place-items: center; box-shadow: 0 0 12px rgba(217, 181, 108, .35), inset 0 0 8px rgba(217, 181, 108, .25); }
.stats::after { content: ''; position: absolute; left: 10px; top: 50%; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%; border: 1px dashed rgba(217, 181, 108, .4); transform: scale(1.22); }
.lv { display: flex; gap: 10px; align-items: baseline; margin-bottom: 5px; text-shadow: 0 2px 4px #000; }
.lv b { font-size: 16px; color: var(--goldL); letter-spacing: .08em; }
.lv small { font-size: 11px; color: var(--gold); }
.bar { position: relative; height: 16px; margin: 0 0 6px 0; background: linear-gradient(#060810, #10131f); border: 1px solid rgba(217, 181, 108, .7); clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); overflow: hidden; box-shadow: inset 0 0 8px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .6); }
.bar i, .bar u { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: left; }
.bar u { background: rgba(255, 255, 255, .55); z-index: 0; transition: transform .6s .25s; }
.bar i { z-index: 1; }
.bar i::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 45%; background: linear-gradient(rgba(255, 255, 255, .4), transparent); }
.bar i::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 0 60%, rgba(255, 255, 255, .25)); animation: shine 2.6s linear infinite; }
@keyframes shine { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
/* 目盛り(25%ごと)と、左のラベル */
.bar::before { content: ''; position: absolute; inset: 0; z-index: 2; background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), rgba(0, 0, 0, .55) calc(25% - 1px) 25%); pointer-events: none; }
.bar::after { position: absolute; left: 7px; top: 0; z-index: 3; font: 700 9px sans-serif; letter-spacing: .08em; color: rgba(255, 248, 220, .9); line-height: 16px; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.bar.hp::after { content: 'HP'; } .bar.mp::after { content: 'MP'; line-height: 11px; } .bar.sp::after { content: 'SP'; line-height: 7px; font-size: 8px; }
.bar.hp i { background: linear-gradient(#ff8a72, #c8362a 55%, #7a1a16); }
.bar.mp { height: 11px; } .bar.mp i { background: linear-gradient(#9ac4ff, #3a6ad0 60%, #1e3c90); }
.bar.sp { height: 7px; width: 70%; } .bar.sp i { background: linear-gradient(#fff4b0, #c8a030); }
.bar span { position: absolute; right: 12px; top: 0; z-index: 3; font-size: 11px; line-height: 16px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.bar.mp span { line-height: 11px; font-size: 10px; }
.lowhp .bar.hp { animation: hpWarn .7s infinite alternate; } @keyframes hpWarn { to { box-shadow: inset 0 0 8px rgba(0, 0, 0, .9), 0 0 12px rgba(255, 60, 40, .9); border-color: #ff6a5a; } }
.obj { position: absolute; right: max(18px, env(safe-area-inset-right)); top: 16px; max-width: 44vw; text-align: right; padding: 8px 16px 8px 22px; background: var(--obs); border: 1px solid rgba(217, 181, 108, .55); border-right: 3px solid var(--gold); clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%); text-shadow: 0 2px 3px #000; box-shadow: 0 4px 16px rgba(0, 0, 0, .5); }
.obj small { display: block; font-size: 10px; color: var(--gold); letter-spacing: .4em; }
.obj small::before { content: '◆ '; font-size: 8px; }
.obj span { font-size: 15px; }
.obj.flash { animation: objf 1.2s; } @keyframes objf { 0%, 30% { box-shadow: 0 0 24px rgba(217, 181, 108, .8); border-color: var(--goldL); } }
.skillbox { position: absolute; left: max(18px, env(safe-area-inset-left)); bottom: 22px; display: flex; align-items: center; gap: 12px; }
.skicon { position: relative; width: 62px; height: 62px; border: 2px solid var(--gold); border-radius: 50%; background: radial-gradient(circle at 50% 35%, #2c3052, #0b0d16); display: grid; place-items: center; font-size: 26px; box-shadow: 0 0 16px rgba(217, 181, 108, .35), inset 0 0 10px rgba(217, 181, 108, .2); overflow: hidden; }
.skicon::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; border: 1px dashed rgba(217, 181, 108, .45); }
.skicon svg { width: 34px; height: 34px; position: relative; }
.skinfo b { display: block; font-size: 14px; text-shadow: 0 2px 3px #000; color: var(--goldL); } .skinfo small { font-size: 11px; color: var(--gold); }
#skCd { position: absolute; left: 0; top: 0; width: 62px; height: 62px; border-radius: 50%; background: rgba(0, 0, 0, .7); transform-origin: bottom; transform: scaleY(0); }
#skCdT { position: absolute; left: 0; width: 62px; top: 50%; margin-top: -9px; text-align: center; font: 700 15px var(--F1); font-style: normal; color: #fff; text-shadow: 0 1px 3px #000; pointer-events: none; }
.potbox { position: absolute; left: max(270px, 23vw); bottom: 26px; display: flex; align-items: center; gap: 6px; text-shadow: 0 2px 3px #000; }
.pot { width: 26px; height: 34px; position: relative; }
.pot::before { content: ''; position: absolute; left: 4px; right: 4px; bottom: 0; height: 22px; border-radius: 50%; border: 2px solid #f0e0c0; background: radial-gradient(circle at 40% 40%, #ff9aa8, #b81e3a); }
.pot::after { content: ''; position: absolute; left: 9px; top: 2px; width: 8px; height: 10px; border: 2px solid #f0e0c0; border-bottom: none; background: #6a4a2a; }
.potbox b { font-size: 20px; } .potbox small { font-size: 11px; color: var(--gold); }
.storebox { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); display: flex; gap: 6px; }
.storebox i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--gold); background: radial-gradient(circle, #6a4ac0, #1a1030); box-shadow: 0 0 8px #8a6aff; }
.storebox i.e { background: rgba(0, 0, 0, .4); box-shadow: none; opacity: .5; }
.cross { position: absolute; left: 50%; top: 46%; width: 26px; height: 26px; margin: -13px; opacity: .85; }
.cross::before, .cross::after { content: ''; position: absolute; background: rgba(255, 255, 255, .9); box-shadow: 0 0 3px #000; }
.cross::before { left: 12px; top: 2px; width: 2px; height: 7px; box-shadow: 0 15px 0 rgba(255, 255, 255, .9); }
.cross::after { top: 12px; left: 2px; height: 2px; width: 7px; box-shadow: 15px 0 0 rgba(255, 255, 255, .9); }
.cross i { position: absolute; inset: 0; border: 2px solid transparent; border-radius: 50%; transition: .1s; }
.cross.lock i { border-color: rgba(255, 90, 70, .9); inset: -6px; }
.cross.charge i { border-color: #8ac8ff; box-shadow: 0 0 12px #4a9cff; }
.prompt { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); padding: 8px 20px; background: var(--obs); border: 1px solid var(--gold); font-size: 15px; opacity: 0; transition: opacity .2s; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.prompt.show { opacity: 1; }
body.touch .prompt { pointer-events: auto; top: 58%; padding: 14px 32px; font-size: 18px; border-width: 2px; border-radius: 30px; background: linear-gradient(rgba(44, 36, 20, .94), rgba(12, 10, 8, .94)); box-shadow: 0 0 18px rgba(217, 181, 108, .45), 0 4px 14px #000a; }
body.touch .prompt::before { content: 'タップ'; display: inline-block; margin-right: 10px; padding: 2px 8px; border-radius: 3px; background: var(--gold); color: #1a1208; font-size: 13px; }
body.touch .prompt b { display: none; }
body.touch .prompt.note::before { display: none; }
.prompt.note { pointer-events: none !important; background: rgba(10, 12, 20, .6); border-color: rgba(217, 181, 108, .4); }
body.touch .prompt.on { background: var(--gold); color: #1a1208; }
.prompt b { display: inline-block; min-width: 24px; padding: 1px 6px; margin-right: 8px; border-radius: 3px; background: var(--gold); color: #1a1208; text-align: center; }
.bossbar { position: absolute; left: 50%; top: 18px; width: min(640px, 72vw); transform: translateX(-50%); text-align: center; opacity: 0; transition: opacity .6s; }
.bossbar.show { opacity: 1; }
.bossbar b { font: 22px var(--F2); letter-spacing: .2em; color: #ffd6c8; text-shadow: 0 0 10px #ff2a00, 0 2px 4px #000; }
.bossbar b::before, .bossbar b::after { content: '◆'; font-size: 10px; color: var(--gold); margin: 0 10px; vertical-align: middle; text-shadow: none; }
.bossbar em { display: block; font-style: normal; font-size: 13px; letter-spacing: .3em; color: #ffb090; margin-top: 2px; text-shadow: 0 2px 3px #000; }
.bossbar em::before { content: '― '; } .bossbar em::after { content: ' ―'; }
.bossbar em.pop { animation: statePop .8s; } @keyframes statePop { 0% { transform: scale(1.6); color: #fff; } }
.bossbar .bgauge { display: none; } body.seehp .bossbar .bgauge { display: block; }
.bossbar div { position: relative; height: 13px; margin-top: 4px; border: 1px solid var(--gold); background: rgba(0, 0, 0, .75); overflow: hidden; clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 6px 100%, 0 50%); box-shadow: 0 0 10px rgba(0, 0, 0, .6); }
.bossbar i, .bossbar u { position: absolute; inset: 0; transform-origin: left; }
.bossbar u { background: #fff4; transition: transform .8s .3s; } .bossbar i { background: linear-gradient(#ff6a4a, #a01810 60%, #600a08); }
.bossbar small { display: block; font-size: 13px; margin-top: 5px; color: #ffc0a0; text-shadow: 0 2px 3px #000; min-height: 18px; }
.party { position: absolute; left: max(18px, env(safe-area-inset-left)); top: 100px; font-size: 12px; text-shadow: 0 1px 2px #000; padding: 6px 10px; background: rgba(9, 11, 20, .55); border-left: 2px solid var(--gold); }
.party div { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; } .party em { font-style: normal; width: 52px; } .party s { display: block; width: 70px; height: 4px; background: #000a; position: relative; } .party s i { position: absolute; inset: 0; background: #6ad06a; transform-origin: left; }
.party .down { opacity: .45; }

/* ---- スマホのボタン: 黒曜石の印章 ---- */
.tbtns { position: fixed; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); width: 250px; height: 250px; z-index: 7; display: none; }
body.touch.play .tbtns { display: block; }
.tbtns button { position: absolute; width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(217, 181, 108, .8); background: radial-gradient(circle at 50% 32%, rgba(58, 62, 96, .9), rgba(9, 11, 20, .92) 70%); color: var(--goldL); font-size: 15px; letter-spacing: .05em; box-shadow: 0 3px 12px #000c, inset 0 0 10px rgba(217, 181, 108, .18); overflow: hidden; text-shadow: 0 1px 2px #000; }
.tbtns button::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; border: 1px dashed rgba(217, 181, 108, .45); pointer-events: none; }
.tbtns button::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(rgba(0, 0, 0, .72) calc(var(--cd, 0) * 100%), transparent 0); pointer-events: none; opacity: 0; transition: opacity .15s; }
.tbtns button.cd::after { opacity: 1; }
.tbtns button.cd { color: rgba(244, 223, 166, .55); }
.tbtns button.on { background: radial-gradient(circle at 50% 32%, rgba(244, 223, 166, .95), rgba(140, 106, 50, .95) 70%); color: #1a1208; box-shadow: 0 0 20px rgba(217, 181, 108, .8); }
.tbtns .b5 { right: 0; bottom: 0; width: 90px; height: 90px; font-size: 19px; border-color: #8ac8ff; box-shadow: 0 3px 12px #000c, inset 0 0 14px rgba(138, 200, 255, .3); color: #d8ecff; }
.tbtns .b5::before { border-color: rgba(138, 200, 255, .5); }
.tbtns .b4 { right: 96px; bottom: 0; } .tbtns .b1 { right: 0; bottom: 100px; border-color: #ffb070; } .tbtns .b3 { right: 84px; bottom: 74px; } .tbtns .b2 { right: 152px; bottom: 124px; width: 54px; height: 54px; border-color: #7ad0ff; } .tbtns .b6 { right: 168px; bottom: 4px; width: 58px; height: 58px; border-color: #b8f0a0; } .tbtns .b7 { right: 72px; bottom: 164px; width: 48px; height: 48px; font-size: 13px; border-color: #ff8a9a; }

.toast { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: 8; padding: 10px 30px; font-size: 18px; background: linear-gradient(90deg, transparent, var(--ink2) 12%, var(--ink2) 88%, transparent); color: var(--paper); opacity: 0; transition: opacity .3s; pointer-events: none; text-align: center; white-space: nowrap; text-shadow: 0 2px 3px #000; border-top: 1px solid rgba(217, 181, 108, .35); border-bottom: 1px solid rgba(217, 181, 108, .35); }
.toast.show { opacity: 1; }
/* ---- 会話 ---- */
.dialog { position: fixed; left: 50%; bottom: max(26px, env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); width: min(880px, 94vw); min-height: 112px; padding: 26px 34px 24px; z-index: 12; background: var(--obs); border: 1px solid rgba(217, 181, 108, .75); box-shadow: 0 0 0 3px rgba(0, 0, 0, .4), 0 10px 40px rgba(0, 0, 0, .6), inset 0 0 40px rgba(217, 181, 108, .06); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.dialog::before, .dialog::after { content: ''; position: absolute; width: 16px; height: 16px; border: 2px solid var(--gold); }
.dialog::before { left: 6px; top: 6px; border-right: none; border-bottom: none; } .dialog::after { right: 6px; bottom: 6px; border-left: none; border-top: none; }
.dialog.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.dname { position: absolute; left: 24px; top: -17px; padding: 4px 22px; font-size: 16px; letter-spacing: .12em; background: linear-gradient(#3a2e18, #15100a); border: 1px solid var(--gold); color: var(--goldL); clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.dtext { font-size: 19px; line-height: 1.75; white-space: pre-wrap; }
.dnext { position: absolute; right: 18px; bottom: 12px; width: 0; height: 0; border: 7px solid transparent; border-top-color: var(--gold); animation: bob 1s infinite; opacity: 0; }
.dialog.done .dnext { opacity: 1; } @keyframes bob { 50% { transform: translateY(4px); } }
.choices { position: fixed; left: 50%; bottom: 175px; transform: translateX(-50%); z-index: 17; display: none; flex-direction: column; gap: 8px; min-width: 320px; max-width: 92vw; }
.choices.show { display: flex; }
.choices button { padding: 12px 24px 12px 38px; font-size: 17px; color: var(--paper); background: var(--obs); border: 1px solid var(--gold); text-align: left; position: relative; clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.choices button::before { content: '◆'; position: absolute; left: 16px; top: 50%; margin-top: -9px; font-size: 11px; color: var(--gold); }
.choices button:hover, .choices button:active { background: linear-gradient(90deg, rgba(217, 181, 108, .45), rgba(217, 181, 108, .15)); color: #fff; }
.letterbox i { position: fixed; left: 0; right: 0; height: 0; background: #000; z-index: 9; transition: height .6s; }
.letterbox i:first-child { top: 0; } .letterbox i:last-child { bottom: 0; }
.letterbox.on i { height: 9vh; }
.titlecard { position: fixed; left: 0; right: 0; top: 34%; z-index: 10; text-align: center; opacity: 0; pointer-events: none; transition: opacity 1.2s; text-shadow: 0 0 20px rgba(0, 0, 0, .9), 0 3px 6px #000; }
.titlecard.show { opacity: 1; }
.titlecard small { font-size: 16px; letter-spacing: .6em; color: var(--gold); }
.titlecard h2 { margin: 6px 0; font: 400 clamp(38px, 7vw, 76px) var(--F2); letter-spacing: .18em; color: #fff7e6; }
.titlecard i { display: block; width: min(420px, 60vw); height: 1px; margin: 0 auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.fade { position: fixed; inset: 0; z-index: 20; background: #000; opacity: 1; pointer-events: none; transition: opacity .8s; }
.fade.white { background: #fff; }
.flashw { position: fixed; inset: 0; z-index: 11; background: #fff; opacity: 0; pointer-events: none; }
.vign { position: fixed; inset: 0; z-index: 4; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(160, 0, 0, .65)); transition: opacity .2s; }

/* ---- スキル選択 ---- */
.skills { position: fixed; inset: 0; z-index: 14; display: none; flex-direction: column; align-items: center; justify-content: flex-start; padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.skills > * { flex-shrink: 0; }
.skills .cards { margin-bottom: auto; }
.skills.show { display: flex; }
.skills h3 { font: 400 clamp(20px, 3vw, 28px) var(--F2); letter-spacing: .2em; color: #4a3a1a; text-shadow: 0 0 18px #fff, 0 0 4px #fff; margin: auto 0 18px; }
.cards { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; max-width: 1180px; }
.card { position: relative; width: 210px; min-height: 300px; padding: 18px 16px 14px; background: linear-gradient(170deg, rgba(255, 252, 240, .95), rgba(236, 226, 200, .95)); border: 1px solid #c8a868; border-radius: 6px; color: #2a2010; text-align: center; box-shadow: 0 8px 30px rgba(120, 90, 30, .3), inset 0 0 0 4px rgba(255, 255, 255, .6), inset 0 0 0 5px rgba(200, 168, 104, .6); transition: transform .25s, box-shadow .25s; cursor: pointer; opacity: 0; transform: translateY(30px); }
.card.in { opacity: 1; transform: none; }
.card:hover, .card.sel { transform: translateY(-8px); box-shadow: 0 14px 40px rgba(200, 150, 40, .55), inset 0 0 0 4px rgba(255, 255, 255, .7), inset 0 0 0 5px #d4b06a; }
.card .rk { position: absolute; top: 10px; right: 10px; font: 700 12px sans-serif; padding: 2px 7px; border-radius: 3px; letter-spacing: .1em; }
.card .rk.ssr { background: linear-gradient(90deg, #f5d36a, #ff9a4a, #f5d36a); color: #3a1a00; }
.card .rk.n { background: #8a8a8a; color: #fff; }
.card .ic { width: 74px; height: 74px; margin: 6px auto 10px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #fff, #e8d8b0); border: 1px solid #c8a868; box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(200, 168, 104, .5); }
.card .ic svg { width: 44px; height: 44px; }
.card h4 { margin: 0 0 4px; font: 400 21px var(--F2); letter-spacing: .08em; }
.card .en { font-size: 11px; color: #8a6a32; letter-spacing: .2em; }
.card p { font-size: 13px; line-height: 1.6; text-align: left; margin: 10px 0 0; }
.card .tag { font-size: 12px; color: #a0522d; margin-top: 8px; text-align: left; }
.snote { margin-top: 16px; font-size: 14px; color: #3a2a10; text-shadow: 0 0 8px #fff; min-height: 20px; }

/* ---- プロローグ ---- */
.prologue { position: fixed; inset: 0; z-index: 15; background: #000; display: none; place-items: center; }
.prologue.show { display: grid; }
.prologue canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.prologue p { position: relative; max-width: 760px; padding: 0 24px; font-size: clamp(17px, 2.4vw, 23px); line-height: 2.1; text-align: center; white-space: pre-wrap; text-shadow: 0 0 10px #000; }
.skip { position: absolute; right: 20px; bottom: 20px; z-index: 2; background: none; border: 1px solid #fff4; color: #fff9; padding: 6px 16px; font-size: 14px; }

/* ---- タイトル ---- */
.title { position: fixed; inset: 0; z-index: 16; display: none; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 30%, rgba(30, 30, 60, .15), rgba(0, 0, 0, .65)); }
.title.show { display: flex; }
.tin { text-align: center; padding: 20px; max-width: 760px; }
.title .sub { letter-spacing: .5em; color: var(--gold); font-size: 14px; margin: 0; text-shadow: 0 2px 4px #000; }
.ttl { font: 400 clamp(44px, 9vw, 92px) var(--F2); margin: 10px 0 4px; letter-spacing: .1em; color: #fff6e0; text-shadow: 0 0 30px rgba(120, 160, 255, .55), 0 4px 10px #000; line-height: 1.1; }
.ttl small { display: block; font-size: .36em; letter-spacing: .4em; color: var(--gold); }
.ttl2 { font-size: 16px; letter-spacing: .2em; margin: 6px 0 26px; text-shadow: 0 2px 4px #000; }
.tbtn { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.go { padding: 13px 44px; font-size: 19px; letter-spacing: .2em; color: #1a1208; background: linear-gradient(#f6e2b0, #c9a45c 55%, #9a7434); border: 1px solid #fff2c8; clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); box-shadow: 0 4px 18px rgba(217, 181, 108, .45); }
.q2 { padding: 12px 24px; font-size: 15px; color: var(--paper); background: var(--obs); border: 1px solid var(--gold); clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.how { list-style: none; padding: 0; margin: 26px 0 0; font-size: 13px; line-height: 1.9; color: #ddd3bf; text-shadow: 0 1px 3px #000; }
.how b { color: var(--gold); }
.foot { margin-top: 18px; font-size: 11px; color: #fff8; }
.loading { position: fixed; inset: 0; z-index: 30; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: #05060a; }
.loading.show { display: flex; }
.loading b { font: 400 18px var(--F1); letter-spacing: .5em; color: var(--gold); }
.loading div { width: 220px; height: 2px; background: #222; } .loading i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.loading small { font-size: 12px; color: #888; }

/* ---- 結果・死亡・一時停止 ---- */
.result, .dead, .pausep { position: fixed; inset: 0; z-index: 18; display: none; align-items: center; justify-content: center; background: rgba(0, 0, 0, .55); overflow: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.result.show, .dead.show, .pausep.show { display: flex; }
.rin, .din, .pin { text-align: center; padding: 24px; max-width: 760px; }
.rin { position: relative; background: var(--obs); border: 1px solid rgba(217, 181, 108, .7); box-shadow: 0 0 0 3px rgba(0, 0, 0, .4), 0 20px 60px rgba(0, 0, 0, .7); margin: 20px; }
.rin::before, .rin::after { content: ''; position: absolute; width: 18px; height: 18px; border: 2px solid var(--gold); }
.rin::before { left: 6px; top: 6px; border-right: none; border-bottom: none; } .rin::after { right: 6px; bottom: 6px; border-left: none; border-top: none; }
.rin small { letter-spacing: .6em; color: var(--gold); }
.rin h2 { font: 400 clamp(32px, 6vw, 56px) var(--F2); margin: 4px 0 8px; letter-spacing: .15em; text-shadow: 0 0 20px #000; color: var(--goldL); }
.rline { font-size: 17px; margin: 0 0 10px; }
.rstats { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; font-size: 14px; margin-bottom: 12px; }
.rstats div b { display: block; font-size: 22px; color: var(--gold); }
#rImg { width: min(560px, 90vw); height: auto; border: 1px solid var(--gold); display: block; margin: 0 auto 14px; }
.rbtn { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.rnext { margin-top: 16px; letter-spacing: .4em; color: var(--gold); }
.din h2 { font: 400 48px var(--F2); color: #ff9a8a; text-shadow: 0 0 20px #a00; margin: 0 0 10px; }
.din .dnote { color: #ff9a8a; font-size: 14px; }
.din p { font-size: 15px; margin-bottom: 22px; color: #ddd; max-width: 520px; line-height: 1.8; }
.pin { display: flex; flex-direction: column; gap: 10px; min-width: 260px; background: var(--obs); border: 1px solid var(--gold); }
.pin h3 { margin: 0 0 6px; font: 400 22px var(--F2); letter-spacing: .3em; }
/* ---- 第一章 完 ---- */
.ending { position: fixed; inset: 0; z-index: 21; display: none; align-items: center; justify-content: center; text-align: center; background: radial-gradient(ellipse at 50% 40%, rgba(20, 16, 30, .6), rgba(0, 0, 0, .96)); }
.ending.show { display: flex; }
.ending h2 { font: 400 clamp(40px, 8vw, 84px) var(--F2); letter-spacing: .3em; color: var(--goldL); text-shadow: 0 0 40px rgba(217, 181, 108, .5); margin: 0 0 8px; opacity: 0; animation: endIn 2.4s .4s forwards; }
.ending p { font-size: clamp(15px, 2vw, 19px); line-height: 2.1; color: #ddd3bf; white-space: pre-wrap; opacity: 0; animation: endIn 2s 2.2s forwards; margin: 0 0 22px; }
.ending small { display: block; letter-spacing: .5em; color: var(--gold); opacity: 0; animation: endIn 2s 4.2s forwards; }
.ending i { display: block; width: min(420px, 60vw); height: 1px; margin: 10px auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
@keyframes endIn { to { opacity: 1; } }
@media (max-width: 960px) { .stats { width: min(270px, 33vw); } .bossbar { width: 44vw; } .obj { max-width: 28vw; } .party { top: 94px; } }
@media (max-width: 700px) { .card { width: 46vw; min-height: 0; padding: 12px 10px 10px; } .card p { font-size: 12px; } .card .ic { width: 52px; height: 52px; } .card .ic svg { width: 32px; height: 32px; } .card h4 { font-size: 17px; } .dtext { font-size: 16px; } .obj span { font-size: 13px; } .skills h3 { font-size: 17px; margin-bottom: 10px; } .potbox { left: auto; right: 280px; } .stats { padding-left: 58px; } .stats::before { width: 38px; height: 38px; margin-top: -19px; font-size: 20px; } .stats::after { width: 38px; height: 38px; margin-top: -19px; } .party { top: 92px; } }
@media (max-height: 520px) { .choices { bottom: auto; top: 10px; gap: 5px; min-width: 260px; } .choices button { padding: 7px 18px 7px 34px; font-size: 15px; } .dialog { padding: 18px 26px 14px; min-height: 86px; } .dtext { font-size: 16px; line-height: 1.6; } .dname { font-size: 14px; top: -15px; } }

/* ボタンのすき間は、見回しに使えるように(ボタンだけが指を受ける) */
.tbtns { pointer-events: none; } .tbtns button { pointer-events: auto; }

/* チャンス表示: 照準の下に、スキルの色で */
.chance { position: absolute; left: 50%; top: 60%; transform: translate(-50%, 8px); padding: 8px 26px 9px; font-size: 19px; letter-spacing: .06em; color: #fff; white-space: nowrap; text-shadow: 0 2px 4px #000, 0 0 10px var(--c); background: linear-gradient(90deg, transparent, rgba(9, 11, 20, .82) 14%, rgba(9, 11, 20, .82) 86%, transparent); border-top: 1px solid var(--c); border-bottom: 1px solid var(--c); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.chance i { display: block; font-style: normal; font-size: 11px; letter-spacing: .4em; color: var(--c); text-align: center; margin-bottom: 1px; }
.chance.show { opacity: 1; transform: translate(-50%, 0); animation: chanceP .9s ease-in-out infinite alternate; }
@keyframes chanceP { to { box-shadow: 0 0 24px -6px var(--c); } }
body.chanceOn .tbtns .b1, body.chanceOn .skicon { animation: skPulse .6s ease-in-out infinite alternate; }
@keyframes skPulse { from { border-color: #ffb070; box-shadow: 0 0 6px #ffb070; } to { border-color: #fff4c0; box-shadow: 0 0 22px 4px #ffd890; } }
@media (max-width: 700px) { .chance { font-size: 15px; top: 56%; padding: 6px 18px; } }
@media (max-width: 700px) { .toast { white-space: normal; width: 92vw; font-size: 15px; padding: 8px 14px; } }
