:root {
  color-scheme: dark;
  --ink: #1b1420;
  --curtain: #391d30;
  --plum: #302239;
  --gold: #eec584;
  --cream: #f3e1c0;
  --paper: #e0c39a;
  --muted: #cfbdd0;
  --fine: #c495644d;
  --red: #ec9c84;
  --blue: #a6cad2;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--cream);
  background: #1a141e;
}
*,*::before,*::after { box-sizing: border-box; }
html { touch-action: pan-y; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: radial-gradient(ellipse at top,#402739 0%,#211827 50%,#15111a 100%); -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; -webkit-user-drag: none; pointer-events: none; }
button { color: var(--cream); min-height: 38px; border: 1px solid var(--fine); border-radius: 5px; background: #3d2a40; font: inherit; font-weight: 570; padding: .45rem .73rem; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .49; cursor: default; }
button:not(:disabled):is(:hover,[aria-pressed="true"],.selected) { border-color: #e3ac6c; background-color: #583345; }
button:focus-visible { outline: 2px solid #ffe1ad; outline-offset: 2px; }
button.primary { color: #31201c; background: linear-gradient(180deg,#fae0a8,#d6a163); border: 1px solid #f3c884; font-weight: 780; box-shadow: inset 0 0 0 2px #482b2644,0 2px 10px #120e18a5; }
button.primary:not(:disabled):hover { background: #ffe8b9; }
button.quiet { background: #2e223491; border-color: #b6916e4f; color: #f2d4a4; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3 { font-family: Georgia, 'Songti SC', STSong, serif; line-height: 1.12; font-weight: 600; }
h1 { font-size: clamp(1.9rem,5vw,4.4rem); text-wrap: balance; }
h2 { font-size: 1.32rem; }
h3 { font-size: 1.12rem; }
p { line-height: 1.48; color: var(--muted); font-size: .94rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .11em; color: var(--gold); font-weight: 710; font-size: .72rem; }
:lang(zh) .eyebrow { letter-spacing: .085em; }
.shell { margin: auto; max-width: 1460px; min-height: 100dvh; padding: 0 max(20px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left)); }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .65rem 0; }
.masthead h1 { font-size: 1.05rem; }
.masthead nav { display: flex; flex-wrap: wrap; gap: .35rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .46rem; }
.scenery { position: relative; isolation: isolate; overflow: hidden; background-color: #33253c; background-size: cover; background-position: center; border: 1px solid #bd8d6a72; border-radius: 8px; }
.scenery::before { position: absolute; z-index: -1; content: ''; inset: 5px; pointer-events: none; border: 1px solid #e2b77744; border-radius: 4px; }
.lobby-stage { min-height: clamp(350px,61dvh,620px); display: flex; align-items: center; padding: clamp(20px,5vw,76px); background-image: linear-gradient(90deg,#1d1525f0 5%,#271c3478 56%,transparent),linear-gradient(0deg,#170f1ceb,transparent 33%),var(--art); }
.lobby-text { position: relative; width: min(590px,60%); z-index: 2; }
.lobby-text h1 { line-height: .95; margin-block: .5rem .65rem; max-width: 570px; color: #fbe0b2; text-shadow: 0 5px 24px #09050ce5; }
.lobby-text p { margin-bottom: 1.35rem; color: #f1ddc8; }
.lobby-text button { min-height: 45px; }
.lobby-actor,.lobby-villain { position: absolute; filter: drop-shadow(0 8px 11px #120d19); object-fit: contain; pointer-events: none; }
.lobby-actor { width: min(29%,360px); height: 73%; right: 26%; bottom: 2%; }
.lobby-villain { width: min(39%,520px); height: 90%; right: 2%; bottom: 1%; opacity: .95; }
.lobby-cast { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-block: 11px; }
.cast-card { display: flex; align-items: center; gap: .58rem; min-width: 0; padding: .42rem; text-align: left; background-image: radial-gradient(ellipse at 10% 30%,#573543,#302235 74%); }
.cast-card img { width: 61px; height: 61px; object-fit: contain; }
.cast-card strong,.cast-card small { display: block; }
.cast-card strong { font-family: Georgia,'Songti SC',serif; font-size: 1rem; }
.cast-card small { color: #ddc7c0; font-size: .72rem; margin-top: .24rem; }
.lobby-tools { display: flex; justify-content: flex-end; gap: .45rem; }
.run-heading,.battle-banner { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin: .35rem 0 .63rem; }
.run-heading strong,.run-heading .eyebrow,.battle-title .eyebrow { display: block; }
.run-heading > div:first-child strong { margin-top: .26rem; }
.run-resources,.result-stats { display: flex; align-items: center; gap: clamp(.65rem,4vw,2.3rem); }
.stat { display: inline-grid; grid-template-columns: auto auto; align-items: center; gap: 0 .35rem; white-space: nowrap; }
.stat i { color: var(--gold); font-style: normal; grid-row: span 2; }
.stat span { color: var(--muted); font-size: .7rem; }
.stat strong { color: #f3d2a3; font-size: .88rem; font-variant-numeric: tabular-nums; }
.story-scene { display: grid; align-content: center; justify-items: center; min-height: clamp(420px,72dvh,690px); padding: clamp(16px,4vw,60px); gap: 14px;
  background-image: radial-gradient(ellipse at 52% 44%,#21172635,#130e1adc 83%),linear-gradient(#1e18233d,#201527b8),var(--art); }
.page-title h1 { font-size: clamp(1.75rem,4.6vw,3.55rem); margin-block: .35rem .44rem; color: #f9deb6; }
.page-title p { max-width: 54ch; color: #ead5c6; }
.journey-title { text-align: center; }
.chapter-progress { display: flex; gap: clamp(5px,2vw,12px); justify-content: center; align-items: center; }
.chapter-progress i { font-size: .82rem; font-style: normal; background: #372a3c; border: 1px solid #b28d646e; border-radius: 50%; width: 31px; height: 31px; display: grid; place-items: center; color: #dfc5ae; }
.chapter-progress .past { background: #4a3e43; color: #f4c686; }
.chapter-progress .current { background: #ffd18a; color: #382123; box-shadow: 0 0 13px #efac665b; }
.routes { width: min(740px,100%); margin-top: .45rem; }
.routes h2 { margin-bottom: .55rem; text-align: center; }
.route-options { display: flex; justify-content: center; gap: .6rem; }
.route-option { min-height: 94px; flex: 0 1 250px; display: grid; grid-template-columns: auto 1fr auto; gap: .55rem; align-items: center; padding: .72rem; text-align: left; background: #281f30ee; border-color: #bd936f94; }
.route-option i { font-style: normal; color: #edbf87; font-size: 1.32rem; align-self: center; }
.route-option.elite i,.route-option.boss i { color: #f1a992; }
.route-option.rest i { color: #c8d1b0; }
.route-option strong,.route-option small { display: block; }
.route-option strong { color: #f1d7ab; font-family: Georgia,'Songti SC',serif; font-size: 1.12rem; }
.route-option small { margin-top: .22rem; color: #d1bdcb; font-size: .76rem; }
.scene-letter,.story-content { width: min(690px,100%); background: linear-gradient(145deg,#332339f7,#241a2cf2); padding: clamp(15px,3.4vw,34px); border: 1px solid #c49a7477; border-radius: 7px; box-shadow: 0 10px 45px #09060c65; }
.story-content { width: min(760px,100%); }
.options { display: grid; gap: .46rem; align-items: stretch; margin: .75rem 0 0; }
.options button { min-height: 42px; text-align: left; }
.story-tools,.scene-letter .result-stats { margin-block: .75rem; }
.centered { text-align: center; }
.centered .page-title p { margin-inline: auto; }
.centered .primary { margin-top: .85rem; }
.reward-gold { display: flex; justify-content: center; align-items: center; gap: .75rem; margin: .7rem 0; }
.offers { display: flex; gap: clamp(4px,2vw,14px); margin: .7rem auto; justify-content: center; }
.offer { flex: 0 1 118px; min-width: 0; display: grid; gap: 5px; }
.reward-offers > button { flex: 0 1 137px; }
.prop { display: flex; text-align: left; gap: .6rem; align-items: center; padding: .45rem .55rem; border: 1px solid var(--fine); border-radius: 5px; background-color: #312638; }
.prop img { width: 45px; height: 45px; object-fit: cover; border-radius: 4px; }
.prop strong { display: block; color: #efc593; }
.prop p { font-size: .78rem; }
.prop + .prop { margin-top: .5rem; }
.shop-prop { display: flex; align-items: center; gap: .52rem; }
.shop-prop .prop { flex: 1; }
.battle { display: flex; flex-direction: column; min-height: min(750px,calc(100dvh - 77px)); }
.battle-banner { margin-block: 0 .48rem; }
.battle-title h1 { font-size: clamp(1.47rem,3.2vw,2.56rem); color: #f8dcb6; margin-top: .14rem; }
.battle-tools { display: flex; gap: .34rem; flex-shrink: 0; }
.battle-tools button { min-height: 32px; font-size: .78rem; }
.stage { min-height: clamp(282px,49dvh,534px); flex: 1; display: flex; align-items: stretch;
  background-image: radial-gradient(ellipse at center,#25152600 37%,#1d132baa 99%),linear-gradient(0deg,#271a30ad 0,#291b3330 26%,transparent 77%,#281b2c50),var(--art); background-position: center,center,center 57%; }
.cast-on-stage { position: relative; z-index: 1; width: min(1120px,100%); margin: 0 auto; display: grid; grid-template-columns: .85fr 1.15fr; align-items: end; padding: 12px 4% 19px; gap: 5%; }
.actor { position: relative; align-self: end; display: flex; flex-direction: column; align-items: center; width: 100%; min-width: 0; color: #f9e2c1; padding: 0; border: 0; background: transparent; }
.actor.enemy:not(:disabled):hover,.actor.enemy:not(:disabled):focus-visible { background: transparent; }
.actor.hero { max-width: 340px; justify-self: start; }
.actor-figure { width: 100%; height: clamp(180px,31.5dvh,352px); object-fit: contain; object-position: center bottom; filter: drop-shadow(0 5px 5px #110a15b9) drop-shadow(0 0 14px #22112db9); transform-origin: center bottom; }
.actor.enemy .actor-figure { height: clamp(180px,30dvh,330px); }
.actor.enemy.boss .actor-figure { height: clamp(195px,35dvh,391px); }
.actor-read { width: min(215px,91%); display: block; border-radius: 5px; background: #22172bf2; border: 1px solid #cf9d6b70; box-shadow: 0 3px 12px #0f0919b5; text-align: left; padding: .39rem .48rem .35rem; }
.actor-read > strong { display: block; font-family: Georgia,'Songti SC',serif; font-size: 1.03rem; line-height: 1.12; margin-bottom: .29rem; }
.health-read { display: flex; align-items: center; gap: .35rem; }
.health-read b { font-size: .68rem; font-variant-numeric: tabular-nums; }
progress { display: block; appearance: none; -webkit-appearance: none; width: 100%; min-width: 9px; height: 5px; border: 0; border-radius: 3px; overflow: hidden; color: #d88377; background: #3e2b4a; }
progress::-webkit-progress-bar { background: #4b3452; }
progress::-webkit-progress-value { background: linear-gradient(90deg,#98485f,#e4a186); }
progress::-moz-progress-bar { background: linear-gradient(90deg,#98485f,#e4a186); }
.hero progress::-webkit-progress-value { background: linear-gradient(90deg,#935a65,#ffc693); }
.hero progress::-moz-progress-bar { background: linear-gradient(90deg,#935a65,#ffc693); }
.traits { display: flex; flex-wrap: wrap; gap: 3px; }
.traits:empty { display: none; }
.trait { display: inline-flex; gap: 2px; align-items: baseline; font-size: .68rem; line-height: 1.05; padding: .09rem .26rem; color: #e8d2d9; border: 1px solid #cba2d058; border-radius: 3px; margin-top: 3px; background: #423149; }
.trait i { color: var(--gold); font-style: normal; }
.enemy-side { display: flex; align-items: end; justify-content: center; gap: 2%; min-width: 0; }
.enemy { max-width: 380px; padding: 0; font-weight: normal; }
.enemy-side.multiple .enemy { max-width: 250px; }
.enemy .intent { display: inline-flex; align-items: center; justify-content: center; gap: .32rem; align-self: center; margin-bottom: 4px; padding: .33rem .52rem; background: #251c35f0; border: 1px solid #dcae817e; border-radius: 5px; font-weight: 790; font-size: clamp(.69rem,1.4vw,.95rem); line-height: 1.19; color: #efe1bd; }
.intent.threat { color: #ffd0ae; background: #4b2636f2; border-color: #e6987d98; }
.intent.exposed { color: #fbd7a3; border-color: #ffd99c; }
.counter { display: block; margin-top: .22rem; color: #f8c89d; font-size: .7rem; }
.aiming .enemy:not(:disabled) .actor-figure,.dragging .enemy:not(:disabled) .actor-figure { filter: drop-shadow(0 0 3px #e8bf98) drop-shadow(0 5px 8px #120e19); }
.aiming .enemy:not(:disabled):hover .actor-figure { filter: drop-shadow(0 0 9px #ffcf86); }
.enemy.dead { opacity: .42; filter: saturate(.33); }
.stage-aurora { pointer-events: none; position: absolute; z-index: -1; inset: 0; background: conic-gradient(from 31deg at 70% 0%,transparent 0 111deg,#edb98035 122deg,#e7a67446 155deg,transparent 170deg); mix-blend-mode: screen; animation: lightsway 8s ease-in-out infinite alternate; }
.stage-lights { position: absolute; z-index: 0; inset: auto 9% 0; height: 23px; background: radial-gradient(ellipse,#ffd4827e 9%,#d57a542a 30%,transparent 69%) left bottom/20% 100% repeat-x; pointer-events: none; }
.stage-result { position: absolute; z-index: 3; inset: 39% auto auto 50%; transform: translate(-50%,-8%); width: max-content; min-width: min(245px,85%); max-width: 90%;
  display: flex; flex-direction: column; align-items: center; gap: .65rem; background: #261c2cec; padding: .85rem 1.2rem; border: 1px solid #fae0a7a6; border-radius: 6px; box-shadow: 0 5px 28px #09060c9c; }
.stage-result strong { font: 1.47rem Georgia,'Songti SC',serif; color: #ffe0a6; }
.hero .actor-figure,.enemy:not(.dead) .actor-figure { animation: idle-paper 5s ease-in-out infinite alternate; }
.enemy:not(.dead) .actor-figure { animation-delay: -2s; }
@keyframes idle-paper { from { transform: rotate(-.55deg); } to { transform: rotate(.65deg) translateY(-2px); } }
.actor.actor-impact .actor-figure { animation: impact 250ms ease-in-out; }
.actor.actor-glint .actor-figure { animation: glint 400ms ease-out; }
.stage[data-effect="echo"] .stage-aurora { animation: brighten 450ms ease-out; }
.float-mark { position: absolute; right: 21%; top: 27%; z-index: 4; color: #ffe1b4; text-shadow: 0 2px 4px #150a1c,0 0 11px #8d2f56; font-weight: 900; font-size: 1.55rem; pointer-events: none; animation: float 620ms ease-out both; }
.float-mark.heal { color: #c8e6b7; }
@keyframes impact { 25% {transform: translate(8px,-2px) rotate(2deg);filter: brightness(1.55) drop-shadow(0 0 12px #ffb79f);} 58% {transform: translate(-6px,1px) rotate(-2deg);} }
@keyframes glint { 30% {filter: brightness(1.38) drop-shadow(0 0 12px #e5e9a2);} }
@keyframes float { to {opacity:0;transform:translateY(-36px);} }
@keyframes lightsway { 0% {opacity:.68;} 100% {opacity:1;} }
@keyframes brighten { 30% {opacity:1;filter:brightness(2.4);} }
.desk { position: relative; z-index: 1; margin-top: 8px; background: radial-gradient(ellipse at 50% 0,#513044,#2a2032 56%,#211927); border: 1px solid var(--fine); border-radius: 7px; padding: .42rem .68rem .58rem; }
.desk-top,.desk-buttons { display: flex; align-items: center; justify-content: space-between; gap: .35rem 1rem; }
.battle-meters { display: flex; align-items: center; gap: .5rem; font-size: .8rem; }
.battle-meters .turn { color: #e5c8ab; }
.energy { color: #f0ca92; }
.energy b { font-size: 1.35rem; font-family: Georgia,serif; }
.setup { display: inline-flex; gap: 5px; align-items: center; color: #d3bacd; padding: .27rem .43rem; border-radius: 4px; border: 1px solid #b78b784d; background: #39273c; white-space: nowrap; }
.setup.live { background: #674630; border-color: #e8b6749c; color: #ffe0a6; }
.setup i { font-style: normal; }
.pile-meter,.battle-keys { color: #d0bbca; font-size: .69rem; }
.battle-keys { letter-spacing: .04em; }
.hand { min-height: 130px; max-width: min(680px,100%); margin: .18rem auto .25rem; display: grid; grid-template-columns: repeat(var(--count),minmax(0,1fr)); align-items: end; gap: clamp(3px,1.2vw,12px); touch-action: none; }
.hand p { grid-column: 1/-1; justify-self: center; align-self: center; }
.hand-card,.card-item { position: relative; display: block; min-height: 0; border: 0; padding: 0; width: 100%; text-align: left; background: transparent; }
.hand-card { max-width: 112px; justify-self: center; transform: translateY(var(--lift,0)); margin-bottom: 8px; touch-action: none; }
.hand-card:not(:disabled):hover,.hand-card.selected { background: transparent; transform: translateY(-4px); }
.hand-card.selected .face,.hand-card:focus-visible .face { box-shadow: 0 0 0 2px #ffcb8a,0 0 16px #ffae7370; }
.hand-card.unready .face { filter: saturate(.53) brightness(.78); }
.hand-card.can-echo .face { border-color: #e9ba77; box-shadow: 0 0 11px #eaa74c5b; }
.hand-card.sealed .face { filter: saturate(.44) brightness(.76); }
.face { position: relative; display: grid; grid-template-rows: minmax(0,1fr) auto; background: #d2ae83; color: #35222e; border: 2px solid #e4c196; border-radius: 6px; text-align: center; padding: 4px; overflow: hidden; aspect-ratio: .78; box-shadow: 0 3px 9px #120c17af; }
.face img { width: 100%; height: 100%; min-height: 0; object-fit: cover; border-radius: 2px; }
.face strong { font: 700 clamp(.54rem,1.22vw,.9rem)/1.02 Georgia,'Songti SC',serif; padding: .24rem .13rem .14rem; min-height: 1.2em; }
.face.tier-1 { background: #c4aa94; border-color: #e8c9a5; }
.face.tier-2 { background: #bab4c9; border-color: #d5c6dc; }
.face.tier-3 { background: #e2b984; border-color: #ffcf8e; }
.face sup { margin-left: 2px; color: #8b1e39; }
.face.kind-talent { border-style: double; }
.face.role-lamplighter .card-image { filter: saturate(1.12) contrast(1.03); }
.face.role-maskmaker .card-image { filter: hue-rotate(-8deg) saturate(.92); }
.cost { position: absolute; top: 3px; left: 3px; z-index: 1; min-width: 1.35em; line-height: 1.14; padding-inline: .14em; border: 1px solid #ffe0ae; border-radius: 50%; background: #3d2838; color: #ffe1ac; font: 800 clamp(.7rem,1.5vw,1.15rem) Georgia,serif; }
.card-kind { position: absolute; top: 5px; right: 5px; color: #ffe4b3; text-shadow: 0 1px 2px #261b28; font-size: .8rem; }
.seal-label { position: absolute; inset: 42% 3px auto; font-weight: 780; font-size: .66rem; padding: 2px; text-align: center; color: #ffe2b6; background: #512b43e8; }
.card-preview { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: .36rem; padding: .33rem .48rem; border-radius: 4px; background: #261c2daf; }
.card-preview .preview-copy { display: grid; gap: 0 .4rem; grid-template-columns: auto 1fr; align-items: baseline; }
.preview-copy > div { display: flex; gap: .4rem; align-items: baseline; grid-row: span 3; }
.preview-copy strong { color: #f9d7a4; font-size: .84rem; }
.card-preview p { font-size: .76rem; }
.echo-copy,.echo-copy b,.echo-mark { color: #efc491; }
.echo-mark,.preview-copy small { font-size: .7rem; }
.preview-copy small { color: #c7ddba; }
.preview-actions { display: flex; align-items: center; gap: .25rem; flex: 0 0 auto; }
.preview-actions button { min-height: 34px; font-size: .76rem; padding: .28rem .47rem; }
.desk-buttons { margin-top: .29rem; }
.desk-buttons .primary { min-width: 8.7rem; min-height: 38px; }
.drag-card { pointer-events: none; position: fixed; z-index: 50; left: 0; top: 0; width: 91px; transform: translate(-50%,-70%) rotate(-5deg); opacity: .88; filter: drop-shadow(0 6px 10px #0e0818); }
dialog { width: min(680px,calc(100vw - 20px)); max-width: none; max-height: min(88dvh,760px); padding: 0; color: var(--cream); background: linear-gradient(145deg,#3b283a,#281e34); border: 1px solid #bc967ca6; border-radius: 8px; box-shadow: 0 18px 75px #08050cbf; }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: #150f1cc5; }
.sheet-heading { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .58rem .87rem; background: #3f2a40; border-bottom: 1px solid var(--fine); }
.sheet-heading button { padding: .15rem; width: 36px; height: 34px; min-height: 0; font-size: 1.35rem; }
#sheet-body { padding: .82rem .92rem 1rem; overflow: auto; overscroll-behavior: contain; touch-action: pan-y; }
#sheet-body h3,#sheet-body > p,#sheet-body .options { margin-block: .45rem .6rem; }
.picker { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .36rem; }
.role-pick { padding: .26rem .32rem; overflow: hidden; font-size: .82rem; }
.role-pick img { height: clamp(56px,14dvmin,108px); width: 100%; object-fit: contain; }
.role-pick span { display: block; margin-block: .26rem .12rem; }
.opening-hand,.filters { display: flex; flex-wrap: wrap; align-items: center; gap: .32rem; margin-block: .6rem; }
.opening-hand span { background: #51364a; border-radius: 3px; padding: .16rem .3rem; font-size: .73rem; }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(84px,1fr)); gap: 7px; align-items: start; }
.deck-item > button + button { min-height: 32px; width: 100%; margin-top: 4px; padding: .18rem; font-size: .71rem; }
.unknown-card { border: 1px solid #85617894; border-radius: 5px; aspect-ratio: .78; display: grid; place-items: center; background: radial-gradient(#614052,#302236 75%); color: #d5ae88; font-size: 1.4rem; }
.card-detail { display: grid; grid-template-columns: min(124px,34%) 1fr; align-items: center; gap: .85rem; margin: .38rem 0 .66rem; }
.card-detail p { margin-top: .38rem; }
.ending-entry { margin-bottom: .45rem; padding: .46rem .6rem; background: #493349; border: 1px solid var(--fine); border-radius: 4px; }
.history-cast { margin-top: .52rem; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .37rem; }
.logs { padding: 0; list-style: none; margin: 0; }
.logs li { padding: .28rem .38rem; color: #e2d1df; border-bottom: 1px solid #b3846940; font-size: .86rem; }
.logs li:is(.turn,.echo,.break) { color: #fac698; }
.logs li.heal { color: #c2d8b1; }
.instructions { margin: 0; padding-left: 1.25rem; }
.instructions li { margin-block: .43rem; color: #efdbc6; line-height: 1.48; }
#notice { position: fixed; z-index: 50; bottom: max(12px,env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 25px); color: #ffdfad; border-radius: 5px; background: #331e32; border: 1px solid #b68169; padding: .48rem .68rem; font-size: .85rem; pointer-events: none; }
.fast .actor-figure,.fast .stage-aurora { animation: none !important; }
@media (max-width: 760px) {
  .shell { padding-inline: max(8px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-right)); padding-bottom: max(8px,env(safe-area-inset-bottom)); }
  .lobby-stage { min-height: 325px; padding: 17px; }
  .lobby-text { width: min(310px,90%); }
  .lobby-text h1 { max-width: 230px; }
  .lobby-text p { max-width: 200px; font-size: .83rem; }
  .lobby-actor { right: 23%; width: 36%; height: 62%; }
  .lobby-villain { right: 2%; width: 49%; height: 76%; }
  .lobby-cast { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; margin-block: 7px; }
  .cast-card img { width: 46px; height: 48px; }
  .cast-card strong { font-size: .86rem; }
  .cast-card small { font-size: .66rem; }
  .run-heading { flex-wrap: wrap; margin-block: .25rem .4rem; }
  .run-heading .actions button { font-size: .73rem; min-height: 28px; padding: .25rem .48rem; }
  .run-heading > div:first-child strong { font-size: .82rem; }
  .run-resources { gap: .55rem; }
  .stat span { font-size: .63rem; }
  .stat strong { font-size: .77rem; }
  .story-scene { align-content: start; min-height: min(570px,77dvh); padding: clamp(13px,3vw,22px); gap: 10px; }
  .journey-title { margin-top: 13px; }
  .page-title p { font-size: .84rem; }
  .route-options { flex-direction: column; gap: 6px; }
  .route-option { flex: initial; min-height: 61px; padding: .45rem .6rem; }
  .route-option strong { font-size: .96rem; }
  .route-option small { font-size: .7rem; }
  .story-content,.scene-letter { margin-top: .6rem; padding: .73rem; }
  .offer > button:not(.card-item) { font-size: .69rem; padding: .14rem; }
  .reward-gold .prop { max-width: 72%; }
  .battle { min-height: 0; }
  .battle-banner { margin: .24rem 0 .34rem; }
  .battle-title .eyebrow { font-size: .62rem; }
  .battle-title h1 { font-size: clamp(1.13rem,4.8vw,1.52rem); }
  .battle-tools button { min-height: 28px; font-size: .69rem; padding: .2rem .37rem; }
  .stage { min-height: clamp(244px,44dvh,412px); }
  .cast-on-stage { display: block; padding: 0; }
  .actor.hero { position: absolute; bottom: 7px; left: 2%; width: 47%; }
  .actor-figure { height: clamp(108px,22dvh,207px); }
  .enemy-side { position: absolute; right: 1%; top: 6px; width: 62%; gap: 2px; }
  .enemy-side.multiple { width: 83%; right: 1%; }
  .actor.enemy .actor-figure { height: clamp(94px,18dvh,179px); }
  .actor.enemy.boss .actor-figure { height: clamp(110px,23.5dvh,235px); }
  .actor-read { padding: .25rem .29rem .21rem; max-width: 140px; }
  .actor-read > strong { font-size: .75rem; margin-bottom: .15rem; }
  .health-read { gap: .2rem; }
  .health-read b { font-size: .58rem; }
  .trait { font-size: .59rem; margin-top: 2px; }
  .enemy .intent { font-size: .66rem; padding: .22rem .29rem; margin-bottom: 2px; }
  .counter { font-size: .59rem; }
  .stage-result { inset-block-start: 48%; }
  .stage-result strong { font-size: 1.11rem; }
  .float-mark { font-size: 1.1rem; }
  .desk { margin-top: 4px; padding: .23rem .32rem .32rem; }
  .desk-top { gap: .25rem; flex-wrap: wrap; }
  .battle-meters { gap: .32rem; font-size: .69rem; }
  .energy b { font-size: 1.08rem; }
  .setup { padding: .18rem .24rem; gap: 2px; }
  .pile-meter { font-size: .61rem; }
  .hand { min-height: 0; gap: 3px; margin: .27rem 0 .06rem; max-width: 100%; }
  .hand-card { margin-bottom: 5px; transform: translateY(calc(var(--lift) * .4)); max-width: 92px; }
  .face { border-width: 1px; padding: 2px; border-radius: 4px; }
  .face strong { font-size: clamp(.51rem,2.1vw,.72rem); padding: .12rem 0 .06rem; display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .card-kind { font-size: .59rem; top: 4px; right: 4px; }
  .cost { font-size: .69rem; top: 2px; left: 2px; }
  .hand[data-count="9"] .card-kind,.hand[data-count="8"] .card-kind { display: none; }
  .seal-label { font-size: .53rem; }
  .card-preview { padding: .25rem .28rem; min-height: 33px; }
  .card-preview .preview-copy { display: block; max-height: min(12dvh,68px); overflow: auto; touch-action: pan-y; scrollbar-width: thin; }
  .preview-copy strong { font-size: .71rem; }
  .card-preview p,.preview-copy small { font-size: .66rem; line-height: 1.25; }
  .preview-actions button { min-height: 30px; font-size: .7rem; padding: .18rem .36rem; }
  .desk-buttons { justify-content: flex-end; margin-top: .23rem; }
  .desk-buttons .primary { min-height: 35px; width: min(46%,175px); font-size: .84rem; }
  .battle-keys { display: none; }
  .library-grid { grid-template-columns: repeat(auto-fill,minmax(62px,1fr)); gap: 5px; }
}
@media (max-width: 760px) and (max-height: 660px) {
  .stage { min-height: clamp(205px,40dvh,261px); }
  .actor-figure { height: clamp(97px,20dvh,136px); }
  .actor.enemy.boss .actor-figure { height: clamp(100px,21dvh,144px); }
}
@media (prefers-reduced-motion: reduce) {
  .stage-aurora,.actor .actor-figure { animation: none !important; }
}
