/* HOLYPLACE SAGA — 16-bit UI. The game is a fixed 1280×720 stage scaled to fit any screen. */
@font-face { font-family: 'Cubic11'; src: url('assets/fonts/Cubic_11.woff2') format('woff2'); font-display: swap; }
:root {
  --ink: #07060a; --panel: #15121c; --panel2: #1f1a29; --line: #4a3d5c; --line-hi: #7d6a95;
  --gold: #f6c453; --gold-d: #a5671b; --text: #f3ead7; --mute: #a596b8;
  --red: #e8473d; --red-d: #7d1b1b; --blue: #46a9ff; --blue-d: #1a3f7d; --purple: #b67cf0;
  --font: 'Cubic11', 'Microsoft JhengHei', 'PingFang TC', 'Noto Sans TC', monospace;
  --px: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; width: 100%; height: 100%; overflow: hidden; background: #000; color: var(--text);
  font-family: var(--font); position: fixed; inset: 0;
  touch-action: none; overscroll-behavior: none; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
button, input { font-family: inherit; touch-action: none; }
img { -webkit-user-drag: none; image-rendering: auto; }
.hidden { display: none !important; }
#app { position: fixed; inset: 0; overflow: hidden; background: #000; }

/* ---------- Stage ---------- */
.stage { position: absolute; left: 50%; top: 50%; width: 1280px; height: 720px; transform-origin: 50% 50%; overflow: hidden; background: #05040a; }
#game { position: absolute; inset: 0; width: 1280px; height: 720px; display: block; image-rendering: pixelated; outline: none; }

/* ---------- Pixel primitives ---------- */
.px-button {
  display: block; width: 100%; margin: 8px 0 0; padding: 12px 18px; border: 0; cursor: pointer;
  font-size: 22px; letter-spacing: 1px; color: var(--text); background: var(--panel2); clip-path: var(--px);
  box-shadow: inset 0 0 0 3px var(--line), inset 0 -6px 0 rgba(0,0,0,.35);
}
.px-button:hover, .px-button:focus-visible { box-shadow: inset 0 0 0 3px var(--gold), inset 0 -6px 0 rgba(0,0,0,.35); color: #fff; outline: none; }
.px-button:active { transform: translateY(2px); }
.px-button.primary { background: var(--gold); color: #1a1006; box-shadow: inset 0 0 0 3px #ffe39a, inset 0 -6px 0 var(--gold-d); }
.px-button.primary:hover, .px-button.primary:focus-visible { background: #ffd977; }
.px-button.small { display: inline-block; width: auto; font-size: 18px; padding: 8px 14px; margin: 0; }
.px-button:disabled { opacity: .45; cursor: default; }
.px-icon { width: 44px; height: 44px; border: 0; font-size: 20px; color: var(--text); background: var(--panel); clip-path: var(--px); box-shadow: inset 0 0 0 3px var(--line); cursor: pointer; }
.px-icon:hover, .px-icon:focus-visible { box-shadow: inset 0 0 0 3px var(--gold); outline: none; }

/* ---------- Screens ---------- */
.screen { position: absolute; inset: 0; background: #000; }
.screen-bg { position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px); object-fit: cover; opacity: .28; filter: saturate(.7); }
.art-box { position: absolute; top: 0; height: 720px; }
.art-box > img { display: block; width: 100%; height: 100%; }
.title-box { left: 100px; width: 1080px; }
.baked-menu { position: absolute; inset: 0; }
.baked-button { position: absolute; top: 32.6%; height: 6.4%; border: 0; background: transparent; cursor: pointer; clip-path: var(--px); }
.baked-button:hover, .baked-button:focus-visible { background: rgba(255, 214, 120, .16); box-shadow: inset 0 0 0 3px var(--gold); outline: none; }
.b-story { left: 27.1%; width: 15.1%; } .b-coop { left: 43.1%; width: 14.4%; } .b-train { left: 58.4%; width: 14.4%; }
.title-foot { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; align-items: center; gap: 24px; font-size: 18px; color: var(--gold); text-shadow: 2px 2px 0 #000; }
.title-foot .px-button { position: absolute; right: 18px; bottom: 0; }
.blink { animation: blink 1.1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

.select-box { left: 0; width: 960px; }
.roster { position: absolute; left: 1.2%; right: 1.2%; top: 52%; bottom: 7%; display: grid; grid-template-columns: repeat(8, 1fr); }
.roster-cell { position: relative; border: 0; background: transparent; cursor: pointer; clip-path: var(--px); }
.roster-cell.selected { box-shadow: inset 0 0 0 3px var(--gold); background: rgba(246,196,83,.08); }
.roster-cell:disabled { cursor: default; background: rgba(0,0,0,.42); }
/* legacy */ .roster-cell .lock { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); font-size: 13px; padding: 3px 6px; color: var(--mute); background: #000c; font-style: normal; }
.char-card { position: absolute; right: 0; top: 0; bottom: 0; width: 320px; padding: 74px 26px 26px; background: linear-gradient(90deg, #0b0910f0, #0b0910); border-left: 3px solid var(--line); display: flex; flex-direction: column; }
.char-card small { color: var(--mute); font-size: 15px; letter-spacing: 2px; }
.char-card h2 { margin: 6px 0 4px; font-size: 64px; line-height: 1; color: var(--gold); text-shadow: 4px 4px 0 var(--gold-d); font-weight: normal; }
.char-role { margin: 0 0 18px; font-size: 16px; color: var(--text); }
.char-skills { list-style: none; margin: 0 0 auto; padding: 0; font-size: 18px; }
.char-skills li { padding: 9px 0; border-bottom: 2px dashed #2e2638; }
.char-skills b { display: inline-block; min-width: 38px; margin-right: 8px; padding: 2px 6px; text-align: center; font-weight: normal; color: #1a1006; background: var(--gold); }
.char-skills em { font-style: normal; font-size: 13px; color: var(--purple); }
.char-skills .ult b { background: var(--red); color: #fff; }
.back { position: absolute; left: 18px; top: 18px; z-index: 2; }

.stage-screen { background: #000 url('assets/scenes/stage01/background.png') center top / 1280px auto no-repeat; }
.stage-screen::before { content: ''; position: absolute; inset: 0; background: rgba(5,3,10,.72); }
.stage-panel { position: absolute; left: 50%; top: 50%; width: 720px; transform: translate(-50%, -50%); padding: 26px 30px 24px; background: var(--panel); clip-path: var(--px); box-shadow: inset 0 0 0 3px var(--line); }
.panel-title small, .px-modal small { color: var(--mute); font-size: 15px; letter-spacing: 3px; }
.panel-title h2, .px-modal h2 { margin: 2px 0 16px; font-size: 38px; font-weight: normal; color: var(--gold); text-shadow: 3px 3px 0 var(--gold-d); }
.stage-list { display: grid; gap: 10px; }
.stage-item { display: grid; grid-template-columns: 112px 70px 1fr 64px; align-items: center; gap: 14px; padding: 14px 18px; border: 0; color: var(--text); text-align: left; background: var(--panel2); clip-path: var(--px); box-shadow: inset 0 0 0 3px var(--line); cursor: pointer; }
.stage-item:hover, .stage-item:focus-visible { box-shadow: inset 0 0 0 3px var(--gold); outline: none; }
.stage-item .ch { font-size: 18px; color: var(--gold); }
.stage-item .nm { font-size: 26px; } .stage-item .nm small { display: block; font-size: 14px; color: var(--mute); letter-spacing: 0; }
.stage-item .rk { font-size: 34px; text-align: center; color: var(--gold); }
.stage-item:disabled { opacity: .5; cursor: default; }
.stage-item:disabled .rk { font-size: 15px; color: var(--mute); }
.panel-actions { display: flex; justify-content: space-between; margin-top: 18px; }

/* ---------- Modals ---------- */
.modal-layer { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(4,3,8,.74); }
.px-modal { width: 440px; padding: 26px 30px 28px; text-align: center; background: var(--panel); clip-path: var(--px); box-shadow: inset 0 0 0 3px var(--line-hi); }
.px-modal.wide { width: 680px; }
.px-modal p { font-size: 18px; line-height: 1.6; color: var(--text); }
.help-grid { display: grid; grid-template-columns: 200px 1fr; gap: 10px 18px; text-align: left; font-size: 18px; }
.help-grid span { color: var(--gold); } .help-grid b { font-weight: normal; }
.help-tip { font-size: 15px !important; color: var(--mute) !important; text-align: left; }
.settings-grid { display: grid; grid-template-columns: 140px 1fr; gap: 14px 18px; align-items: center; text-align: left; font-size: 20px; margin-bottom: 14px; }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; padding: 8px 0; border: 0; font-size: 18px; color: var(--mute); background: var(--panel2); clip-path: var(--px); box-shadow: inset 0 0 0 3px var(--line); cursor: pointer; }
.seg button.on { color: #1a1006; background: var(--gold); box-shadow: inset 0 0 0 3px #ffe39a; }
input[type=range] { width: 100%; accent-color: var(--gold); height: 28px; }
.result .rank { font-size: 120px; line-height: 1; color: var(--gold); text-shadow: 6px 6px 0 var(--gold-d); margin: 4px 0 10px; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.result-stats strong { display: block; font-size: 26px; font-weight: normal; color: var(--text); }
.result-stats span { font-size: 13px; color: var(--mute); }

/* ---------- HUD ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; text-shadow: 2px 2px 0 #000; }
.hud button { pointer-events: auto; }
.hud-player { position: absolute; left: 18px; top: 14px; display: flex; gap: 10px; }
.hud-portrait { width: 64px; height: 74px; padding: 5px; background: var(--panel); clip-path: var(--px); box-shadow: inset 0 0 0 3px var(--gold-d); }
.hud-portrait img { width: 54px; height: 64px; object-fit: cover; image-rendering: pixelated; }
.hud-name { font-size: 22px; color: var(--gold); } .hud-name small { font-size: 13px; color: var(--mute); }
.pbar { position: relative; width: 300px; height: 18px; margin-top: 4px; background: #000; box-shadow: 0 0 0 3px #000, inset 0 0 0 2px #2b2533; }
.pbar i { position: absolute; left: 2px; top: 2px; bottom: 2px; width: 100%; max-width: calc(100% - 4px); transition: width .12s steps(4); }
.pbar.hp i { background: linear-gradient(var(--red) 0 55%, #b32a24 55%); }
.pbar.en { height: 12px; width: 240px; } .pbar.en i { background: linear-gradient(var(--blue) 0 55%, #2c78c9 55%); }
.pbar span { position: absolute; right: 6px; top: -1px; font-size: 13px; line-height: 18px; color: #fff; }
.pbar.en span { line-height: 12px; font-size: 11px; top: 0; }
.hud-stage { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); text-align: center; }
.hud-stage-name { font-size: 20px; color: var(--text); }
.wave-pips { display: flex; gap: 6px; justify-content: center; margin-top: 6px; }
.wave-pips i { width: 22px; height: 8px; background: #2b2533; box-shadow: 0 0 0 2px #000; }
.wave-pips i.done { background: var(--gold); } .wave-pips i.now { background: var(--text); animation: blink .6s steps(2, start) infinite; }
.wave-pips i.boss { width: 30px; background: var(--red-d); } .wave-pips i.boss.now { background: var(--red); }
.hud-right { position: absolute; right: 18px; top: 14px; display: flex; align-items: center; gap: 12px; }
.hud-timer { font-size: 22px; }
.boss-hud { position: absolute; left: 50%; top: 74px; width: 560px; transform: translateX(-50%); }
.boss-name { display: flex; justify-content: space-between; align-items: baseline; font-size: 20px; color: #ffb1a6; }
.boss-name small { font-size: 13px; color: var(--mute); }
.pbar.boss { width: 100%; height: 16px; } .pbar.boss i { background: linear-gradient(#d23b6a 0 55%, #8f1f45 55%); }
.boss-hud.rage .pbar.boss i { background: linear-gradient(#ff7a3d 0 55%, #b8401a 55%); }
.combo-hud { position: absolute; right: 34px; top: 150px; text-align: right; color: var(--gold); }
.combo-hud strong { display: block; font-size: 76px; line-height: .9; font-weight: normal; text-shadow: 4px 4px 0 var(--gold-d), 6px 6px 0 #000; }
.combo-hud span { font-size: 22px; letter-spacing: 3px; }
.combo-hud.pop strong { animation: pop .14s steps(2); }
@keyframes pop { from { transform: scale(1.25); } }
.banner { position: absolute; left: 0; right: 0; top: 214px; padding: 12px 0; text-align: center; font-size: 34px; color: var(--text); background: linear-gradient(90deg, transparent, rgba(0,0,0,.78) 25% 75%, transparent); }
.combat-tip { position: absolute; left: 50%; bottom: 66px; transform: translateX(-50%); font-size: 15px; color: var(--mute); white-space: nowrap; }
.skills-hud { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; gap: 8px; }
.skill { position: relative; width: 150px; height: 52px; padding: 5px 10px 0 52px; overflow: hidden; border: 0; text-align: left; color: var(--text); background: var(--panel); clip-path: var(--px); box-shadow: inset 0 0 0 3px var(--line); cursor: pointer; pointer-events: auto; }
.skill kbd { position: absolute; left: 10px; top: 9px; min-width: 34px; padding: 6px 4px; text-align: center; font: 16px var(--font); color: #1a1006; background: var(--gold); }
.skill strong { display: block; font-size: 16px; font-weight: normal; } .skill small { font-size: 12px; color: var(--mute); }
.skill.ultimate { width: 170px; box-shadow: inset 0 0 0 3px var(--gold-d); } .skill.ultimate kbd { background: var(--red); color: #fff; font-size: 12px; }
.skill.low-energy { opacity: .55; }
.cooldown-cover { position: absolute; inset: 0; background: rgba(0,0,0,.7); transform-origin: bottom; transform: scaleY(0); }
.cooldown-number { position: absolute; right: 10px; top: 16px; font-size: 26px; color: #fff; }
html.touch-mode .skills-hud, html.touch-mode .combat-tip { display: none; }

/* ---------- Touch controls (viewport layer) ---------- */
.touch-controls { position: fixed; inset: 0; z-index: 30; pointer-events: none; display: none; --u: min(15vh, 9vw, 96px); }
html.touch-large .touch-controls { --u: min(18vh, 10.5vw, 116px); }
html.mobile-playing .touch-controls { display: block; }
.touch-stick { position: absolute; left: 0; bottom: 0; width: 45%; height: 70%; pointer-events: auto; touch-action: none;
  --sx: calc(env(safe-area-inset-left) + 24px + var(--u) * 1.15); --sy: calc(100% - env(safe-area-inset-bottom) - 18px - var(--u) * 1.15); }
.stick-ring { position: absolute; left: var(--sx); top: var(--sy); width: calc(var(--u) * 2.1); height: calc(var(--u) * 2.1); transform: translate(-50%, -50%); border-radius: 50%; background: rgba(10,8,16,.45); box-shadow: inset 0 0 0 4px rgba(246,196,83,.45); }
.stick-knob { position: absolute; left: var(--sx); top: var(--sy); width: calc(var(--u) * .9); height: calc(var(--u) * .9); margin: calc(var(--u) * -.45) 0 0 calc(var(--u) * -.45); border-radius: 50%; background: rgba(246,196,83,.75); box-shadow: inset 0 -5px 0 rgba(120,70,10,.6); }
.touch-stick.active .stick-ring { box-shadow: inset 0 0 0 4px var(--gold); }
.touch-actions { position: absolute; right: calc(env(safe-area-inset-right) + 16px); bottom: calc(env(safe-area-inset-bottom) + 14px); width: calc(var(--u) * 4); height: calc(var(--u) * 3.4); }
.tb { position: absolute; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; pointer-events: auto; touch-action: none; color: var(--text); font: calc(var(--u) * .22) var(--font); background: rgba(21,18,28,.72); box-shadow: inset 0 0 0 3px rgba(125,106,149,.85), inset 0 -5px 0 rgba(0,0,0,.4); overflow: hidden; }
.tb b { font-weight: normal; position: relative; z-index: 1; }
.tb.pressed { transform: scale(.92); background: rgba(246,196,83,.35); }
.tb-attack { right: 0; bottom: 0; width: calc(var(--u) * 1.35); height: calc(var(--u) * 1.35); font-size: calc(var(--u) * .3); background: rgba(232,71,61,.62); box-shadow: inset 0 0 0 4px #ff8a7d, inset 0 -6px 0 rgba(0,0,0,.35); }
.tb-jump { right: calc(var(--u) * 1.5); bottom: 0; width: var(--u); height: var(--u); }
.tb-dodge { right: calc(var(--u) * .2); bottom: calc(var(--u) * 1.5); width: var(--u); height: var(--u); }
.tb-guard { right: calc(var(--u) * 2.65); bottom: 0; width: calc(var(--u) * .85); height: calc(var(--u) * .85); }
.tb-skill { width: calc(var(--u) * .78); height: calc(var(--u) * .78); font-size: calc(var(--u) * .19); }
.tb-skill[data-touch-action=skill1] { right: calc(var(--u) * 1.4); bottom: calc(var(--u) * 1.2); }
.tb-skill[data-touch-action=skill2] { right: calc(var(--u) * 2.35); bottom: calc(var(--u) * 1.0); }
.tb-skill[data-touch-action=skill3] { right: calc(var(--u) * 1.6); bottom: calc(var(--u) * 2.15); }
.tb-ult { right: calc(var(--u) * .45); bottom: calc(var(--u) * 2.6); width: calc(var(--u) * .9); height: calc(var(--u) * .9); background: rgba(246,196,83,.4); box-shadow: inset 0 0 0 3px var(--gold); }
.tb-skill.vinyl { box-shadow: inset 0 0 0 3px var(--purple); }
.tb.unavailable { opacity: .45; }
.touch-cooldown { position: absolute; inset: 0; background: rgba(0,0,0,.65); transform-origin: bottom; transform: scaleY(0); }
.touch-cd-label, .touch-dodge-cd { position: absolute; bottom: 12%; font-style: normal; font-size: calc(var(--u) * .16); z-index: 1; }
.tb-pause { position: absolute; top: calc(env(safe-area-inset-top) + 10px); right: calc(env(safe-area-inset-right) + 12px); width: calc(var(--u) * .6); height: calc(var(--u) * .6); border-radius: 0; clip-path: var(--px); font-size: calc(var(--u) * .24); }
html.touch-mode .hud-right .px-icon { visibility: hidden; }

/* ---------- Rotate gate / loading ---------- */
.rotate-gate { position: fixed; inset: 0; z-index: 50; display: none; place-content: center; text-align: center; gap: 8px; background: #000; padding: 24px; }
html.portrait-mode .rotate-gate { display: grid; }
.rotate-gate h2 { margin: 18px 0 0; font-size: 26px; font-weight: normal; color: var(--gold); }
.rotate-gate p { margin: 0; color: var(--mute); }
.rotate-phone { justify-self: center; width: 54px; height: 90px; border: 5px solid var(--text); border-radius: 8px; animation: turn 1.6s steps(4) infinite; }
@keyframes turn { 50%, 100% { transform: rotate(-90deg); } }
.loading { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: #000; font-size: 22px; color: var(--gold); letter-spacing: 6px; }
.loading.done { display: none; }

/* ---------- Stage list thumbs, skill icons, rank image ---------- */
.stage-item .thumb { width: 112px; height: 63px; object-fit: cover; image-rendering: pixelated; background: #0b0910; box-shadow: 0 0 0 2px #000; }
.stage-list { max-height: 470px; overflow-y: auto; }
.stage-item { padding: 8px 14px; }
.skill { padding-left: 92px; }
.skill .skill-icon { position: absolute; left: 6px; top: 6px; width: 40px; height: 40px; image-rendering: pixelated; }
.skill kbd { left: 50px; }
.result .rank img { width: 128px; height: 128px; image-rendering: pixelated; }
/* touch skill buttons carry their icon */
.tb-skill[data-touch-action=skill1] { background-image: url('assets/ui/icons/skill_808.png'); }
.tb-skill[data-touch-action=skill2] { background-image: url('assets/ui/icons/skill_vinyl.png'); }
.tb-skill[data-touch-action=skill3] { background-image: url('assets/ui/icons/skill_resonance.png'); }
.tb-ult { background-image: url('assets/ui/icons/skill_ultimate.png'); }
.tb-skill { background-size: 70%; background-position: center 30%; background-repeat: no-repeat; image-rendering: pixelated; }
.tb-skill b { position: absolute; bottom: 8%; font-size: calc(var(--u) * .15); text-shadow: 1px 1px 0 #000; }
html.shop-near .tb-attack { background: rgba(47,111,214,.75); box-shadow: inset 0 0 0 4px #9fd0ff, inset 0 -6px 0 rgba(0,0,0,.35); }

/* ---------- Coins, GO, shop, boss intro ---------- */
.hud-coins { display: flex; align-items: center; gap: 6px; font-size: 20px; color: #ffd36e; }
.hud-coins i { width: 14px; height: 14px; background: #ffd36e; box-shadow: inset -3px -3px 0 #b8861e, 0 0 0 2px #000; }
.hud-coins i.art { width: 22px; height: 22px; background: url(assets/ui/icons/coin.png) center / contain no-repeat; box-shadow: none; image-rendering: pixelated; }
.shop-merchant { float: left; width: 112px; height: 112px; margin: 0 16px 8px 0; border: 3px solid #000; image-rendering: pixelated; }
.go-arrow { position: absolute; right: 60px; top: 300px; font-size: 54px; color: #ffe28a; text-shadow: 4px 4px 0 #000; animation: blink .7s steps(2, start) infinite; }
.go-arrow span { font-size: 40px; }
.shop-prompt { position: absolute; left: 50%; top: 270px; transform: translateX(-50%); padding: 8px 18px; font-size: 22px; color: #fff; background: rgba(47,111,214,.85); clip-path: var(--px); box-shadow: inset 0 0 0 3px #9fd0ff; }
.shop .shop-coins { margin: 0 0 12px; font-size: 20px; color: var(--mute); } .shop .shop-coins b { color: #ffd36e; font-weight: normal; }
.shop-items { display: grid; gap: 10px; }
.shop-item { display: grid; grid-template-columns: 64px 1fr 110px; align-items: center; gap: 14px; padding: 10px 16px; border: 0; color: var(--text); text-align: left; background: var(--panel2); clip-path: var(--px); box-shadow: inset 0 0 0 3px var(--line); cursor: pointer; }
.shop-item:hover, .shop-item:focus-visible { box-shadow: inset 0 0 0 3px #9fd0ff; outline: none; }
.shop-item:disabled { opacity: .45; cursor: default; }
.shop-item img { width: 64px; height: 64px; image-rendering: pixelated; }
.shop-item .nm { font-size: 26px; } .shop-item .nm small { display: block; font-size: 15px; color: var(--mute); }
.shop-item .pr { font-size: 28px; color: #ffd36e; text-align: right; } .shop-item .pr i { font-style: normal; font-size: 14px; margin-left: 4px; }
.boss-intro { position: absolute; inset: 160px 0 auto; height: 220px; display: flex; align-items: center; justify-content: center; gap: 24px; background: linear-gradient(90deg, transparent, rgba(40,6,20,.9) 20% 80%, transparent); animation: slidein .35s steps(5); }
.boss-intro img { height: 220px; image-rendering: pixelated; }
.boss-intro small { display: block; font-size: 18px; letter-spacing: 6px; color: #ff8fa0; }
.boss-intro strong { font-size: 54px; font-weight: normal; color: #fff; text-shadow: 4px 4px 0 #6a1022; }
@keyframes slidein { from { transform: translateX(-120px); opacity: 0; } }
.skill { width: 196px; } .skill.ultimate { width: 214px; }
.skill strong { white-space: nowrap; font-size: 15px; }

/* Shop item icon: art when delivered, otherwise a pixel stand-in. */
.shop-item .ico { width: 64px; height: 64px; display: grid; place-items: center; background: #0b0910; box-shadow: inset 0 0 0 2px #2b2533; }
.shop-item .ico img { width: 64px; height: 64px; image-rendering: pixelated; }
.shop-item .ico.cabbage:empty::before { content: ''; width: 34px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #b9f08a 0 30%, #5cab4a 31% 70%, #2f6b2f 71%); }
.shop-item .ico.beer:empty::before { content: ''; width: 22px; height: 38px; background: linear-gradient(#f4f0e0 0 18%, #e2a52b 18%); box-shadow: 4px 0 0 -0 #c58a1e, 0 0 0 2px #000; }

#error-report { position: fixed; left: 8px; bottom: 8px; z-index: 99; max-width: 70vw; font: 12px var(--font); color: #fff; pointer-events: none; }
#error-report div { margin-top: 4px; padding: 4px 8px; background: rgba(160,20,30,.88); }

/* ---- Character select (8 slots; only B.O.P playable for now) ---- */
.select-box { overflow: hidden; }
.select-box > #select-art { position: absolute; inset: 0; }
.select-alt { position: absolute; left: 0; right: 0; top: 0; height: 52%; display: flex; align-items: center; justify-content: center; gap: 28px;
  background: radial-gradient(ellipse at 50% 60%, rgba(var(--char-rgb, 246,196,83), .28), rgba(6,4,10,.94) 70%); }
.select-alt img { height: 92%; image-rendering: pixelated; filter: brightness(.35) saturate(.4) drop-shadow(0 0 18px rgba(var(--char-rgb), .7)); }
.select-alt b { display: block; font-size: 64px; color: rgb(var(--char-rgb)); text-shadow: 4px 4px 0 #000, 0 0 24px rgba(var(--char-rgb), .6); font-weight: normal; }
.select-alt span { font-size: 22px; color: var(--mute); letter-spacing: .2em; }
.select-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: screen; }
.roster { top: 50%; bottom: 0; left: 0; right: 0; gap: 0; }
.roster-cell { overflow: visible; clip-path: none; padding: 0; background: #07050b; }
.roster-cell .crop { position: absolute; inset: 0; overflow: hidden; }
.roster-cell .crop img { width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 80%; animation: breathe 2.6s ease-in-out infinite; filter: brightness(.62) saturate(.8); transition: filter .2s; }
.roster-cell:nth-child(2n) .crop img { animation-delay: -.7s; } .roster-cell:nth-child(3n) .crop img { animation-delay: -1.5s; }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.022); } }
.roster-cell:hover .crop img { filter: brightness(.85) saturate(.95); }
.roster-cell.selected .crop img { filter: brightness(1.12) saturate(1.1); }
.roster-cell .beam { position: absolute; inset: -6% 8% 0; opacity: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(var(--c), .0), rgba(var(--c), .55) 35%, rgba(var(--c), .15) 80%, rgba(var(--c), 0)); mix-blend-mode: screen; }
.roster-cell.selected .beam { opacity: 1; animation: beam 1.4s ease-in-out infinite; }
@keyframes beam { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
.roster-cell .pose { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; image-rendering: pixelated; }
.roster-cell.posing .pose { opacity: 1; } .roster-cell.posing .crop img { filter: brightness(.22) blur(2px); }
.roster-cell .marker { position: absolute; left: 50%; top: -34px; width: 34px; height: 30px; transform: translateX(-50%); opacity: 0; pointer-events: none;
  clip-path: polygon(0 0, 100% 0, 50% 100%); background: linear-gradient(90deg, rgb(var(--c)) 0%, #fff 50%, rgb(var(--c)) 100%) 0 0 / 300% 100%;
  filter: drop-shadow(0 0 6px rgb(var(--c))) drop-shadow(0 0 14px rgb(var(--c))); }
.roster-cell.selected .marker { opacity: 1; animation: marker-bob 1s ease-in-out infinite, marker-shine 1.6s linear infinite; }
.roster-cell .marker-glow { position: absolute; left: 50%; top: -48px; width: 90px; height: 60px; transform: translateX(-50%); opacity: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--c), .7), rgba(var(--c), 0)); mix-blend-mode: screen; }
.roster-cell.selected .marker-glow { opacity: 1; animation: beam 1s ease-in-out infinite; }
@keyframes marker-bob { 0%, 100% { margin-top: 0; } 50% { margin-top: 7px; } }
@keyframes marker-shine { from { background-position: 0 0; } to { background-position: 300% 0; } }
.roster-cell.flash::after { content: ''; position: absolute; inset: 0; background: rgba(var(--c), .7); mix-blend-mode: screen; animation: cell-flash .35s ease-out forwards; pointer-events: none; }
@keyframes cell-flash { from { opacity: 1; } to { opacity: 0; } }
.char-soon { color: var(--mute); font-size: 15px; line-height: 1.6; }
#start-button:disabled { filter: grayscale(1); opacity: .6; }
.roster-cell.selected { box-shadow: none; background: #07050b; }
.select-box > #select-art.hidden { display: none; }

/* ---- Add to home screen ---- */
.title-foot .install { right: 130px; white-space: nowrap; width: auto; min-width: max-content; border-color: var(--gold); color: var(--gold); animation: install-glow 1.6s ease-in-out infinite; }
@keyframes install-glow { 0%, 100% { box-shadow: 0 0 0 rgba(246,196,83,0); } 50% { box-shadow: 0 0 16px rgba(246,196,83,.7); } }
.install-modal { max-width: 640px; }
.install-modal ol { text-align: left; font-size: 20px; line-height: 1.9; margin: 14px 0; padding-left: 1.4em; }
.install-modal ol b { color: var(--gold); font-weight: normal; }
.install-modal .share-icon { display: inline-block; width: 22px; height: 26px; vertical-align: -5px; border: 2px solid var(--gold); border-top: 0; border-radius: 0 0 3px 3px; position: relative; margin: 0 4px; }
.install-modal .share-icon::before { content: '↑'; position: absolute; left: 50%; top: -14px; transform: translateX(-50%); color: var(--gold); font-size: 20px; }
.install-note { color: var(--mute); font-size: 15px; }
.install-arrow { position: absolute; font-size: 54px; color: var(--gold); text-shadow: 0 0 14px var(--gold); animation: install-bob .9s ease-in-out infinite; pointer-events: none; }
.install-arrow.down { left: 50%; bottom: 8px; transform: translateX(-50%); }
.install-arrow.up { right: 70px; top: 6px; transform: rotate(180deg); }
.install-arrow.none { display: none; }
@keyframes install-bob { 0%, 100% { margin-top: 0; margin-bottom: 0; } 50% { margin-top: 12px; margin-bottom: -12px; } }

/* ---- Save / cloud ---- */
.save-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 16px; }
.save-row b { color: var(--gold); font-weight: normal; font-size: 20px; }
.save-row code { color: var(--gold); letter-spacing: .08em; font-family: inherit; }
.save-help { color: var(--mute); font-size: 15px; line-height: 1.6; }
.save-text { width: 100%; height: 140px; background: #0b0912; color: var(--text); border: 2px solid #3a3346; font: 14px/1.4 monospace; padding: 8px; resize: none; }
.save-actions { display: flex; gap: 12px; justify-content: center; margin-top: 12px; }
.result-coins { color: var(--gold); font-size: 22px; margin: 4px 0 8px; }

/* ---- Select v2: big semi-transparent art on top, 8 separate cells below ---- */
.select-box { background: radial-gradient(ellipse at 50% 30%, rgba(var(--char-rgb, 246,196,83), .22), #07050b 70%); }
.select-alt { position: absolute; inset: 0 0 auto 0; height: 56%; display: block; background: none; overflow: hidden; }
.select-alt img { position: absolute; left: 50%; top: 0; height: 140%; width: auto; transform: translateX(-50%); opacity: .55; image-rendering: auto; filter: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%), linear-gradient(to right, transparent, #000 25%, #000 75%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%), linear-gradient(to right, transparent, #000 25%, #000 75%, transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect; animation: big-in .45s ease-out; }
.select-alt img.portrait { height: 175%; top: -4%; }
@keyframes big-in { from { opacity: 0; transform: translateX(-46%); } to { opacity: .55; transform: translateX(-50%); } }
.select-alt-text { position: absolute; left: 28px; bottom: 18px; text-align: left; }
.select-alt-text b { display: block; font-size: 56px; color: rgb(var(--char-rgb)); text-shadow: 4px 4px 0 #000, 0 0 24px rgba(var(--char-rgb), .6); font-weight: normal; }
.select-alt-text span { font-size: 18px; color: var(--mute); letter-spacing: .2em; }
.roster { top: 58%; bottom: 3%; left: 1.5%; right: 1.5%; gap: 8px; }
.roster-cell { background: #0d0a13; border: 2px solid #2b2533; border-radius: 4px; overflow: hidden; }
.roster-cell.selected { border-color: rgb(var(--c)); box-shadow: 0 0 14px rgba(var(--c), .6), inset 0 0 18px rgba(var(--c), .25); background: #120e1a; }
.roster-cell .crop img { animation: none; filter: brightness(.55) saturate(.7); }
.roster-cell.selected .crop img { animation: breathe 2.6s ease-in-out infinite; filter: brightness(1.1); }
.roster-cell .sprite { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; filter: brightness(.6) saturate(.7); }
.roster-cell.selected .sprite { filter: none; }
.roster-cell .cell-name { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 13px; color: rgba(var(--c), .9); text-shadow: 1px 1px 0 #000; }
.roster-cell .marker { top: 6px; } .roster-cell .marker-glow { top: -6px; }
.roster-cell .pose { display: none; }
.roster-cell .crop:not(.hidden) ~ .cell-name { display: none; }

/* ---- 無聲街區 hub ---- */
.title-screen .hub-entry { position: absolute; left: 50%; top: 44%; transform: translateX(-50%); width: auto; min-width: 0; white-space: nowrap; font-size: 22px; padding: 8px 22px; border-color: #b98cff; color: #e3ccff;
  box-shadow: 0 0 18px rgba(185,140,255,.55); animation: install-glow 2s ease-in-out infinite; z-index: 3; }
.hub-screen { pointer-events: none; background: none; }
.hub-screen > * { pointer-events: auto; }
.hub-exit { position: absolute; left: 16px; top: 14px; }
.hub-coins { position: absolute; right: 18px; top: 14px; display: flex; align-items: center; gap: 8px; padding: 6px 14px; background: rgba(8,6,12,.8); border: 2px solid #3a3346; color: var(--gold); font-size: 22px; }
.hub-coins i { width: 22px; height: 22px; background: url(assets/ui/icons/coin.png) center / contain no-repeat; image-rendering: pixelated; }
.hub-dialog { position: absolute; left: 0; right: 0; bottom: 0; height: 330px; display: flex; align-items: flex-end; gap: 0; background: linear-gradient(to top, rgba(4,3,8,.95) 55%, rgba(4,3,8,0)); }
.hub-bust { height: 330px; width: auto; margin-left: 30px; image-rendering: auto; filter: drop-shadow(0 0 12px rgba(0,0,0,.8)); animation: big-in .3s ease-out; }
.hub-talk { flex: 1; padding: 0 40px 26px 20px; }
.hub-talk small { color: var(--mute); font-size: 15px; letter-spacing: .1em; }
.hub-text { min-height: 120px; margin: 8px 0 12px; padding: 18px 22px; white-space: pre-wrap; font-size: 24px; line-height: 1.55; position: relative; }
.hub-text.typing::after { content: '● ● ●'; position: absolute; left: 22px; top: 18px; letter-spacing: 6px; animation: beam 1s ease-in-out infinite; }
.hub-menu { display: flex; gap: 12px; }
/* writing styles per shopkeeper (they cannot speak) */
.style-note .hub-text { background: #efe3c4; color: #2a1d12; font-family: "Kaiti TC", "BiauKai", "STKaiti", "DFKai-SB", serif; transform: rotate(-1.2deg); box-shadow: 4px 6px 0 rgba(0,0,0,.5); max-width: 640px; }
.style-note .hub-text.typing::after { color: #6b4a2a; }
.style-phone .hub-text { background: #1c1622; color: #fff; border-radius: 18px; max-width: 560px; font-family: inherit; border: 2px solid #ff7ad9; }
.style-phone .hub-text::before { content: '💬 已讀'; position: absolute; right: 14px; bottom: 6px; font-size: 12px; color: #ff9ae4; }
.style-crt .hub-text { background: #031a08; color: #6dff8b; font-family: Cubic11, monospace; text-shadow: 0 0 6px #2bff62; border: 3px solid #4a5a3a; max-width: 640px;
  background-image: repeating-linear-gradient(to bottom, rgba(0,0,0,.25) 0 2px, transparent 2px 4px); }
.style-sign .hub-text { background: #c79a5e; color: #141010; font-family: "Kaiti TC", "BiauKai", "STKaiti", sans-serif; font-weight: bold; font-size: 34px; transform: rotate(1.6deg); max-width: 520px; text-align: center;
  box-shadow: inset 0 0 0 4px #a37b45, 5px 6px 0 rgba(0,0,0,.5); }
.hub-shop { max-width: 980px; }
.hub-shop-list { max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.shop-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: rgba(255,255,255,.04); border: 1px solid #2b2533; }
.shop-item b { display: block; font-size: 19px; font-weight: normal; } .shop-item small { color: var(--mute); font-size: 13px; }
.shop-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.shop-acts .on { border-color: var(--gold); color: var(--gold); } .shop-acts .disabled { opacity: .45; }
.hub-shop-coins { display: none; }
.hub-maker { max-width: 1000px; }
.maker-tier { color: var(--mute); font-size: 15px; } .maker-presets { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; } .maker-presets .on { border-color: var(--gold); color: var(--gold); }
.maker-tempo { display: flex; align-items: center; gap: 10px; } .maker-tempo input { flex: 1; }
.maker-grid { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.maker-row { display: grid; grid-template-columns: 70px repeat(16, 1fr); gap: 3px; align-items: center; } .maker-row span { font-size: 14px; color: var(--mute); }
.maker-cell { height: 26px; border: 1px solid #3a3346; background: #15111c; padding: 0; } .maker-cell.beat { background: #1d1726; }
.maker-cell.on { background: var(--gold); box-shadow: 0 0 8px rgba(246,196,83,.7); } .maker-cell:disabled { cursor: default; }
.maker-steps i { text-align: center; font-size: 12px; color: var(--mute); font-style: normal; height: 6px; } .maker-steps i.now { background: #b98cff; }
.maker-note { color: var(--mute); font-size: 13px; }
html.mobile-hub .touch-controls { display: block; }
html.mobile-hub .touch-controls .tb:not(.tb-attack), html.mobile-hub #touch-pause { display: none; }
.hub-shop-list .shop-item { flex: 1; min-width: 0; width: auto; height: auto; border: 0; background: none; padding: 0; text-align: left; display: block; box-shadow: none; }
.hub-shop-list .shop-item b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-shop-list .shop-acts { flex: 0 0 auto; }
.hub-shop-list .shop-item { clip-path: none; cursor: default; }

/* Hub on phones: stay clear of the iPhone home indicator and above the touch layer */
.hub-screen { z-index: 40; }
.hub-exit, .hub-coins { z-index: 41; }
.hub-dialog { height: auto; padding-bottom: calc(48px + env(safe-area-inset-bottom)); align-items: flex-end; }
.hub-bust { height: 250px; margin-left: 24px; }
.hub-talk { padding: 0 32px 0 12px; }
.hub-text { min-height: 0; max-height: 210px; overflow: hidden; font-size: 22px; padding: 14px 20px; }
.style-sign .hub-text { font-size: 30px; }
.hub-menu { gap: 14px; } .hub-menu .px-button { font-size: 20px; padding: 10px 26px; }
#hub-shop .px-modal, #hub-maker .px-modal { max-height: calc(100% - 70px); overflow-y: auto; margin-bottom: 40px; }
.hub-shop-list { max-height: 300px; }

/* ---- Select v3 (2026-10-23): title-cover layout, characters stand on the stage floor ---- */
.select-screen { background: #07050b; }
.select-cover { position: absolute; left: 0; top: -66px; width: 1280px; height: 853px; }
.select-cover > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.select-cover .select-fx { position: absolute; left: 0; top: 66px; width: 1280px; height: 720px; pointer-events: none; mix-blend-mode: screen; }
.cover-roster { position: absolute; inset: 0; }
.cslot { position: absolute; padding: 0; border: 0; background: none; cursor: pointer; }
.cslot .crop { position: absolute; left: 0; top: 0; width: 100%; height: 96%; overflow: hidden;
  -webkit-mask-image: radial-gradient(ellipse 50% 52% at 50% 50%, #000 70%, transparent 100%); mask-image: radial-gradient(ellipse 50% 52% at 50% 50%, #000 70%, transparent 100%); }
.cslot .crop img { position: absolute; max-width: none; }
.cslot .crop.hidden { display: none; }
.cslot .sprite { position: absolute; image-rendering: pixelated; pointer-events: none; }
.cslot .crop, .cslot .sprite { filter: brightness(.45) saturate(.6); transition: filter .2s; }
.cslot:hover .crop, .cslot:hover .sprite { filter: brightness(.75) saturate(.85); }
.cslot.selected .crop, .cslot.selected .sprite { filter: brightness(1.08) drop-shadow(0 0 10px rgba(var(--c), .85)); }
.cslot.selected .crop { animation: breathe 2.6s ease-in-out infinite; transform-origin: 50% 95%; }
.cslot .cell-name { position: absolute; left: -20%; right: -20%; bottom: -8%; text-align: center; font-size: 20px; color: rgba(var(--c), .7); text-shadow: 2px 2px 0 #000, 0 0 8px rgba(var(--c), .5); white-space: nowrap; }
.cslot.selected .cell-name { color: rgb(var(--c)); font-size: 24px; text-shadow: 2px 2px 0 #000, 0 0 14px rgba(var(--c), .9); }
.cslot .beam { position: absolute; left: 10%; right: 10%; top: -10%; bottom: 0; opacity: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(var(--c), .28) 60%, rgba(var(--c), .5)); filter: blur(6px); }
.cslot.selected .beam { opacity: 1; animation: beam 1.4s ease-in-out infinite; }
.cslot .marker { position: absolute; left: 50%; top: -6%; width: 30px; height: 26px; transform: translateX(-50%); opacity: 0; pointer-events: none;
  background: rgb(var(--c)); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.cslot.selected .marker { opacity: 1; animation: marker-bob 1s ease-in-out infinite; }
.cslot.flash::after { content: ''; position: absolute; inset: 0; background: rgba(var(--c), .5); mix-blend-mode: screen; animation: cell-flash .35s ease-out forwards; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 40%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 50%, #000 40%, transparent 70%); }
.select-card { left: 50%; right: auto; top: 214px; bottom: auto; width: 780px; height: 180px; transform: translateX(-50%); padding: 14px 20px; flex-direction: row; gap: 20px;
  background: linear-gradient(180deg, #0b0910d8, #0b0910ee); border: 2px solid rgba(var(--char-rgb, 246,196,83), .7); border-left-width: 2px; box-shadow: 0 0 22px rgba(var(--char-rgb, 246,196,83), .35); }
.select-card .sc-left { flex: 0 0 300px; display: flex; flex-direction: column; justify-content: center; }
.select-card .sc-right { flex: 1; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.select-card h2 { font-size: 48px; color: rgb(var(--char-rgb, 246,196,83)); text-shadow: 3px 3px 0 #000; }
.select-card .char-role { margin: 4px 0 0; font-size: 15px; }
.select-card .char-skills { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; margin: 0; font-size: 15px; }
.select-card .char-skills li { padding: 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.select-card .char-soon { margin: 10px 0 0; font-size: 16px; color: var(--mute); }
.select-card #start-button { align-self: flex-end; margin-top: 6px; padding: 8px 22px; font-size: 20px; }
.cslot .crop, .cslot .sprite { filter: brightness(.55) saturate(.7); }
.cslot .cell-name { font-size: 24px; color: rgba(var(--c), .85); text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 0 0 10px rgba(var(--c), .6); }
.cslot.selected .cell-name { font-size: 28px; }
/* Select v3: half-body portrait on the upper left, info card to its right */
.select-portrait { position: absolute; left: 0; top: 0; width: 470px; height: 410px; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent); mask-image: linear-gradient(180deg, #000 78%, transparent); }
.select-portrait img { position: absolute; left: 50%; bottom: 0; height: 100%; width: auto; transform: translateX(-50%); image-rendering: pixelated;
  filter: drop-shadow(0 0 16px rgba(var(--char-rgb, 246,196,83), .55)); }
.select-portrait img:not([src]) { display: none; }
.select-portrait img.full { height: 175%; bottom: auto; top: -2%; opacity: .9; } /* temporary full-body art, show the upper half */
.select-portrait.enter img { animation: portrait-in .35s ease-out; }
@keyframes portrait-in { from { opacity: 0; translate: -40px 0; } to { opacity: 1; translate: 0 0; } }
.select-card { left: 470px; transform: none; width: 780px; }
.select-card .sc-left { flex-basis: 290px; }
.char-name-img { display: block; max-width: 280px; max-height: 76px; object-fit: contain; object-position: left center; image-rendering: pixelated; margin: 4px 0; }
.char-name-img.hidden, .select-card h2.hidden { display: none; }
.cslot.still.selected .sprite { animation: breathe 2.6s ease-in-out infinite; transform-origin: 50% 96%; }
.char-name-img { max-height: 96px; max-width: 290px; margin: 0; }

/* ---- Title: arcade entry next to 無聲街區 ---- */
.title-screen .arcade-entry { width: auto; min-width: 0; position: absolute; left: 50%; top: 44%; transform: translateX(calc(-100% - 10px)); white-space: nowrap; font-size: 22px; padding: 8px 22px; z-index: 3;
  border-color: var(--gold); color: #ffe7a8; box-shadow: 0 0 18px rgba(246,196,83,.5); }
.title-screen .hub-entry { transform: translateX(10px); }

/* ---- Story chapter list ---- */
.stage-list { max-height: 470px; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 4px; }
.chapter-item { grid-template-columns: 96px 110px 1fr 96px; padding: 8px 14px; min-height: 84px; }
.chapter-item .hero { position: relative; width: 96px; height: 72px; overflow: hidden; border: 2px solid rgba(var(--c), .7); background: #0b0910; }
.chapter-item .hero img { position: absolute; left: 50%; top: -4px; width: 120px; transform: translateX(-50%); }
.chapter-item .ch { color: rgb(var(--c)); } .chapter-item .ch small { display: block; font-size: 13px; color: var(--mute); }
.chapter-item .nm small { font-size: 13px; }
.chapter-item .rk { font-size: 18px; color: var(--mute); }
.chapter-item:not(:disabled) .rk { font-size: 30px; color: var(--gold); }
.chapter-item:disabled { opacity: .55; cursor: default; }
.chapter-item:disabled .hero img { filter: grayscale(.8) brightness(.6); }

/* ---- Story scenes ---- */
.story-layer { position: absolute; inset: 0; z-index: 60; background: #050308; overflow: hidden; cursor: pointer; }
.story-layer.hidden { display: none; }
.story-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.38) saturate(.8) blur(2px); transform: scale(1.04); }
.story-portrait { position: absolute; bottom: 150px; height: 560px; width: auto; pointer-events: none; filter: drop-shadow(0 0 20px rgba(0,0,0,.8));
  -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent); mask-image: linear-gradient(180deg, #000 80%, transparent); }
.story-portrait:not([src]) { display: none; }
.story-portrait.left { left: 20px; } .story-portrait.right { right: 20px; transform: scaleX(-1); }
.story-portrait.enter { animation: portrait-in .3s ease-out; }
.story-box { position: absolute; left: 60px; right: 60px; bottom: calc(26px + env(safe-area-inset-bottom)); min-height: 150px; padding: 18px 28px 18px; background: linear-gradient(180deg, #0d0a14f2, #07050bf8);
  border: 3px solid #4a3d5c; box-shadow: 0 0 0 3px #000, 0 0 30px rgba(0,0,0,.7); }
.story-box.hidden, .story-card.hidden { display: none; }
.story-box[data-side="right"] .story-namebar { left: auto; right: 24px; }
.story-namebar { position: absolute; left: 24px; top: -54px; height: 64px; display: flex; align-items: flex-end; }
.story-namebar img { height: 74px; width: auto; filter: drop-shadow(2px 2px 0 #000); }
.story-namebar img.hidden { display: none; }
.story-namebar span { font-size: 30px; color: var(--gold); text-shadow: 3px 3px 0 #000; }
.story-namebar span:empty { display: none; }
#story-text { margin: 10px 0 0; font-size: 26px; line-height: 1.55; color: #f3ecff; min-height: 80px; }
.story-box.narr { background: none; border-color: transparent; box-shadow: none; text-align: center; bottom: 40%; }
.story-box.narr #story-text { font-size: 28px; color: #d9cfe8; text-shadow: 2px 2px 0 #000; }
.story-more { position: absolute; right: 20px; bottom: 10px; color: var(--gold); font-style: normal; animation: marker-bob 1s ease-in-out infinite; }
.story-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; animation: story-card-in .8s ease-out; }
.story-card small { font-size: 26px; color: var(--gold); letter-spacing: .3em; }
.story-card h2 { margin: 8px 0; font-size: 92px; font-weight: normal; color: #fff3d6; text-shadow: 5px 5px 0 #000, 0 0 30px rgba(246,196,83,.6); }
.story-card b { font-weight: normal; font-size: 24px; color: #e8c983; letter-spacing: .2em; }
.story-card p { margin: 26px 0 0; font-size: 24px; color: #d9cfe8; }
.story-card i { margin-top: 40px; font-style: normal; font-size: 18px; color: var(--mute); animation: install-glow 1.6s ease-in-out infinite; }
@keyframes story-card-in { from { opacity: 0; letter-spacing: .5em; } to { opacity: 1; } }
.story-skip { position: absolute; right: 18px; top: 18px; z-index: 2; }
.story-namebar { top: -74px; height: 86px; } .story-namebar img { height: 96px; }

/* 2026-10-23 標題選單：五顆程式按鈕，蓋住封面內建的三顆（底板遮住原圖按鈕與箭頭）。
   排列：故事／闖關／合作（上排，封面原位）＋ 訓練／無聲街區（下排置中）。
   樣式仿封面：黑底銀色雙框白字；hover/focus＝金框金字發光＋左側 ▶。 */
.title-menu { position: absolute; left: 352px; top: 218px; width: 576px; height: 146px; z-index: 3;
  background: radial-gradient(ellipse 62% 60% at 50% 50%, rgba(6,5,10,.97) 70%, rgba(6,5,10,0) 100%); }
.title-menu .cover-button { position: absolute; width: 160px; height: 48px; margin: 0; padding: 0 6px; display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 23px; letter-spacing: 2px; color: #ececf2; text-shadow: 1px 0 0 currentColor; border: 0;
  background: rgba(12,11,17,.96); clip-path: var(--px);
  box-shadow: inset 0 0 0 3px #d7d7e0, inset 0 0 0 6px rgba(12,11,17,.96), inset 0 0 0 7px #7d7d8a; }
.title-menu .r1 { top: 16px; } .title-menu .r2 { top: 80px; }
.title-menu .r1.c1 { left: 30px; } .title-menu .r1.c2 { left: 208px; } .title-menu .r1.c3 { left: 386px; }
.title-menu .r2.c1 { left: 119px; } .title-menu .r2.c2 { left: 297px; }
.title-menu .cb-icon { width: auto; height: 22px; max-width: 30px; width: 22px; height: 22px; fill: currentColor; shape-rendering: crispEdges; flex: none; }
.title-menu .cover-button:hover, .title-menu .cover-button:focus-visible, .title-menu .cover-button:focus { color: #ffd36a; outline: none;
  box-shadow: inset 0 0 0 3px #ffc94d, inset 0 0 0 6px rgba(40,22,4,.96), inset 0 0 0 7px #b8792a; filter: drop-shadow(0 0 8px rgba(255,190,70,.7)); }
.title-menu .cover-button:active { transform: translateY(2px); }
.title-menu::after { content: '▶'; position: absolute; left: var(--ptr-x, 8px); top: var(--ptr-y, 28px); transform: translateX(-100%); color: #ffd36a; font-size: 18px; text-shadow: 0 0 8px rgba(255,190,70,.8); pointer-events: none; transition: left .12s, top .12s; }
.title-menu:has(.r1.c1:is(:hover,:focus)) { --ptr-x: 8px; --ptr-y: 28px; }
.title-menu:has(.r1.c2:is(:hover,:focus)) { --ptr-x: 186px; --ptr-y: 28px; }
.title-menu:has(.r1.c3:is(:hover,:focus)) { --ptr-x: 364px; --ptr-y: 28px; }
.title-menu:has(.r2.c1:is(:hover,:focus)) { --ptr-x: 97px; --ptr-y: 92px; }
.title-menu:has(.r2.c2:is(:hover,:focus)) { --ptr-x: 275px; --ptr-y: 92px; }
.title-menu .r1.c3 .cb-icon { width: 26px; }
.title-menu .cover-button span { white-space: nowrap; }

/* 2026-10-23 老闆對話改成故事模式版型：大半身站在對話框上、全寬對話框（老闆的書寫樣式在框內） */
.hub-dialog { inset: 0; height: auto; display: block; padding: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(4,3,8,.85) 0, rgba(4,3,8,.55) 32%, rgba(4,3,8,0) 55%); }
.hub-dialog.hidden { display: none; }
.hub-bust { position: absolute; left: 20px; bottom: calc(150px + env(safe-area-inset-bottom)); height: 500px; margin: 0; z-index: 1; }
.hub-talk { position: absolute; left: 60px; right: 60px; bottom: calc(26px + env(safe-area-inset-bottom)); min-height: 190px; z-index: 2; pointer-events: auto;
  padding: 18px 28px 16px; display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, #0d0a14f2, #07050bf8); border: 3px solid #4a3d5c; box-shadow: 0 0 0 3px #000, 0 0 30px rgba(0,0,0,.7); }
.hub-talk small { position: absolute; left: 24px; top: -40px; font-size: 26px; color: var(--gold); text-shadow: 3px 3px 0 #000; letter-spacing: .05em; }
.hub-text { margin: 0; min-height: 96px; max-height: 190px; max-width: none !important; font-size: 24px; }
.style-sign .hub-text { font-size: 30px; }
.hub-menu { justify-content: flex-end; flex-wrap: wrap; }
