/* Royal Crypt — cinematic presentation. Rules and save format are unchanged. */
:root{--gold:#c7aa70;--text:#e2e5df;--muted:#9aa6a6;--line:#52606442;--surface:#141c21;--surface-hi:#202b30;--surface-low:#0a1015}
body{background:radial-gradient(ellipse at 60% 10%,#202c35 0%,#111a21 43%,#090e13 100%);color:var(--text)}
body:before{opacity:.025}body:after{display:none}.topbar{background:#0b1118e8;box-shadow:0 1px #a5916140}.sidebar{background:linear-gradient(90deg,#0e151c,#141d24);border-color:#9a875028}.brand b,h1{background:none;color:#e3d2ae}.brand small{color:#899799;letter-spacing:2px}.brand-mark{filter:none;color:var(--gold)}
.quiet,.icon-button,.potion{background:linear-gradient(#263239,#1a252b);border-color:#58636380;box-shadow:inset 0 1px #ffffff08}.quiet:hover:not(:disabled),.icon-button:hover:not(:disabled){border-color:#c7aa70;color:#f4e1bb}.profile .avatar{background:#151f27;border-color:#8f7c4a75}.side-title{color:#9ea9a8}.side-title span{color:#c7aa70}.chapter h1{color:#e8e0cd;font-weight:500}.chapter .eyebrow{color:#9fafb0}.chapter-tools .quiet{white-space:nowrap}.chapter>div:first-child{min-width:0}.chapter h1{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Whole illustration in focus; the extended ambience fills wide screens. */
.arena{isolation:isolate;background:#080f15!important;border:1px solid #9a875d70;border-radius:9px;animation:none!important;box-shadow:0 16px 38px #0007,inset 0 1px #dcc89c25;--frame-x:50%;--frame-y:50%;--hud-height:74px;--art-offset:0%;--aim-x:50%;--aim-y:41%}
.arena:before{display:none}.arena:after{z-index:5;box-shadow:none;opacity:0;background:transparent;transition:none}
.arena[data-enemy="guardian"]{--frame-x:50%;--frame-y:40%;--art-offset:1.5%;--aim-x:49%;--encounter-accent:#94b5bd}
.arena[data-enemy="herald"]{--frame-x:50%;--frame-y:45%;--art-offset:0%;--encounter-accent:#b39ed4}
.arena[data-enemy="priest"]{--frame-x:50%;--frame-y:35%;--art-offset:0%;--encounter-accent:#9cbd96}
.arena[data-enemy="knight"]{--frame-x:50%;--frame-y:45%;--art-offset:3%;--aim-x:47%;--encounter-accent:#d9a174}
.arena[data-enemy="elite"]{--frame-x:50%;--frame-y:38%;--art-offset:-1%;--encounter-accent:#d6b977}
.arena[data-enemy="king"]{--frame-x:50%;--frame-y:42%;--art-offset:0%;--encounter-accent:#ccaa73}
.scene-backdrop{position:absolute;inset:-20px;z-index:0;background-position:center 42%;background-size:cover;filter:blur(22px) brightness(.43) saturate(.6);opacity:.55;pointer-events:none}
.scene-stage{position:absolute;inset:0 5% var(--hud-height);z-index:1;pointer-events:none;transform:translateX(var(--art-offset))}
.scene-art{display:block;width:100%;height:100%;object-fit:contain;object-position:var(--frame-x) var(--frame-y);filter:brightness(1.1) contrast(1.02);mask-image:linear-gradient(90deg,transparent,#000 5%,#000 95%,transparent);-webkit-mask-image:linear-gradient(90deg,transparent,#000 5%,#000 95%,transparent)}
.scene-haze{position:absolute;z-index:2;inset:65% 0 var(--hud-height);opacity:.22;pointer-events:none;background:radial-gradient(ellipse at 30% 100%,#a7c4d640,transparent 65%);animation:mist-shift 18s ease-in-out infinite alternate;transform-origin:bottom center}
@keyframes mist-shift{to{transform:translateX(3%) scaleX(1.05);opacity:.35}}
.arena-shade{z-index:2;background:linear-gradient(90deg,#080f1540,transparent 22%,transparent 78%,#080f1540);pointer-events:none}
#embers{z-index:2;opacity:.6}.arena-top{z-index:4;top:13px;left:16px;right:16px}.encounter-label{background:#091219b8;backdrop-filter:blur(5px);border:1px solid #a6987240;box-shadow:none;letter-spacing:1.3px;font-size:10px;padding:5px 9px}.arena-top #turn{color:#c6d0cd;font-size:10px;letter-spacing:1.5px;text-shadow:0 2px 5px #000}
/* Enemy HUD sits on its own rail; it no longer covers the painted character. */
.enemy-hud{position:absolute;bottom:0;left:0;right:0;height:var(--hud-height);z-index:4;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:10px 20px;background:linear-gradient(90deg,#111e27f5,#152029ef,#0d1820f5);border-top:1px solid #af986144;box-shadow:0 -6px 30px #0003}
.enemy-info{position:static;min-width:0;flex:1;max-width:520px}.enemy-title{display:none}.enemy-info h2{margin:0 0 6px;font-size:clamp(16px,1.55vw,23px);line-height:1.15;color:#f0e4cd;background:none;text-shadow:0 2px 3px #000;filter:none;letter-spacing:.025em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.enemy-health{width:100%;max-width:100%;padding:0;border:0;background:none;box-shadow:none;backdrop-filter:none;gap:8px;font-size:11px}.enemy-health>span{display:none}.arena .meter.enemy{height:5px;border:0;background:#080e13;box-shadow:0 0 0 1px #59553e40}.arena .meter.enemy i{background:linear-gradient(90deg,#873b39,#cb7259);box-shadow:0 0 9px #ba6a4533;transition:width .32s cubic-bezier(.15,.7,.3,1)}.enemy-health b{font-variant-numeric:tabular-nums;color:#cfcec4;font-size:11px;min-width:68px;text-align:right}
.enemy-intent{position:static;flex:none;max-width:42%;padding:7px 10px;background:#080e145c;border:1px solid #83939930;border-radius:5px;box-shadow:none;backdrop-filter:none;gap:9px}.enemy-intent small{display:block;font-size:8px;letter-spacing:1.1px;color:#94a5a9}.enemy-intent div>span{font-size:12px;color:#e7d6b3;white-space:nowrap}.intent-icon{width:20px;height:20px;filter:none}.status-badges{top:46px;left:15px;z-index:4;max-width:45%}.status-badge{font-size:10px;background:#0b141cdc;border-color:#66797975;backdrop-filter:none}.status-badge.rage{background:#491e20dd}
.enemy-rule{color:#a3b0ad;border-color:#61747235}.battle-message p{color:#c9d0c8}.battle-message>.ui-icon{filter:none;color:#ae9968}.enemy-rule b{color:#c8b181}.enemy-rule:hover{color:#ede3c9}
/* Compact table, engraved ivory cards, emphasis only when selected. */
.hand-area{border-top:1px solid #81939424;padding-top:6px}.hand-header h2{font:500 15px Cinzel,Georgia,serif;color:#c5b38c}.hand-tools .text-button{color:#a8b6b5}.cards{max-width:1060px;gap:11px}.cards .card{height:clamp(72px,12dvh,124px);border-radius:7px;background:linear-gradient(155deg,#f6efdb,#ddd3b6);border:1px solid #b2a480;box-shadow:0 6px 13px #0008,inset 0 0 17px #79613c14,inset 0 1px #fffa;transition:transform .16s,box-shadow .16s,border-color .16s;color:#28312e}.card.red{color:#922f36}.card:before{opacity:.055}.card:after{border-color:#826e454d;box-shadow:inset 0 0 0 2px #e9e1cb,inset 0 0 0 3px #ab976145}.card .corner{font-family:Georgia,serif;font-weight:bold;letter-spacing:0}.card .suit{filter:none;text-shadow:none}.card .court-crest{display:none}.court-art{position:absolute;width:57%;height:84%;top:8%;left:23%;object-fit:contain;opacity:.9;pointer-events:none}.card[data-rank="11"]>.suit,.card[data-rank="12"]>.suit,.card[data-rank="13"]>.suit{font-size:16px!important;right:7px!important;bottom:5px!important;left:auto!important;top:auto!important;transform:none!important;position:absolute}
.ace-ornament{position:absolute;inset:12% 20%;border:1px solid #8a73416b;transform:rotate(45deg);border-radius:50% 12%;pointer-events:none;opacity:.38}.card[data-rank="14"]>.suit{z-index:1}
.card.selected,.card.selected:hover:not(:disabled){animation:none!important;background:linear-gradient(145deg,#fff8e5,#eddaa1);border-color:#e4be72;box-shadow:0 0 0 1px #d1ae62,0 3px 17px #d6ab433a,0 9px 17px #0009}.card.enchanted{box-shadow:0 6px 13px #0008,inset 0 -3px #bb884b}.card.enchant-heal{box-shadow:0 6px 13px #0008,inset 0 -3px #569971}.card.enchant-ward{box-shadow:0 6px 13px #0008,inset 0 -3px #598dba}.card.enchant-fire{box-shadow:0 6px 13px #0008,inset 0 -3px #c27045}.enchant-mark{box-shadow:0 1px 5px #0003}.card.contributes-score:after{border-color:#b88a38;box-shadow:inset 0 0 0 1px #d5ad5b45}.contribution-badges i{background:#1c292ee8}.card.dealt{animation:table-deal .28s ease-out backwards;animation-delay:calc(var(--i)*20ms)}
@keyframes table-deal{from{opacity:0;transform:translateY(14px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
.action-panel{background:linear-gradient(110deg,#253037,#152027);border-color:#9b875a5c;border-radius:7px;box-shadow:0 4px 12px #0003;min-height:53px}.action-panel:before{display:none}.hand-score strong{color:#e4d3a9}.damage-score strong{color:#efc57a;text-shadow:none}.attack,.attack:not(:disabled){animation:none!important;background:linear-gradient(180deg,#d5b579,#b99657);color:#1a2225;border:1px solid #dec18a;box-shadow:inset 0 1px #fff5,0 3px 9px #0004}.attack:hover:not(:disabled){background:linear-gradient(#edcf95,#c7a160);box-shadow:0 0 15px #d0a55025,inset 0 1px #fff5}.attack:disabled{filter:saturate(.35);opacity:.4}.discard{background:#19252c;border-color:#667373;color:#d6ded9}.effect-preview{color:#adbbb6}.hand-footer{color:#839793}.hand-footer .text-button{color:#baac87}
/* Impact choreography is event-driven; the ambient frame never pans or zooms. */
.arena.hit,.arena.hurt{animation:none!important}.arena.hit .scene-art{animation:portrait-hit .3s ease-out}.arena[data-impact="heavy"].hit .scene-art{animation:portrait-heavy .36s ease-out}.arena.enemy-strike .scene-art{animation:portrait-strike .42s ease-in-out}.arena.hit:after{opacity:1;animation:impact-flash .3s ease-out both;background:radial-gradient(ellipse at var(--aim-x) var(--aim-y),#edcb733d,transparent 48%);box-shadow:none}.arena.hurt:after{opacity:1;animation:impact-flash .4s both;background:radial-gradient(ellipse,transparent 45%,#97372c60);box-shadow:none}.arena.shield-impact:after{opacity:1;animation:impact-flash .45s both;background:radial-gradient(ellipse at 50% 100%,#86d7f055,transparent 65%);box-shadow:inset 0 -3px #8bd7ec}.arena.poison-impact:after{opacity:1;animation:impact-flash .6s both;background:radial-gradient(ellipse at 50% 50%,#71ac5e38,transparent 62%);box-shadow:none}.arena.restoring:after{opacity:1;animation:impact-flash .55s both;background:linear-gradient(0deg,#8ab88e25,transparent 60%)}.arena.stun-impact:after{opacity:1;animation:impact-flash .45s both;background:radial-gradient(ellipse at 50% 40%,#b7dae849,transparent 48%)}.arena.vanquished .scene-art,.arena.dead .scene-art{filter:grayscale(.55) brightness(.75);transition:filter .5s}.arena.raging{border-color:#ba6854;box-shadow:0 0 24px #ac49331c}.arena.raging .scene-haze{background:radial-gradient(ellipse at 50% 100%,#c568393f,transparent 70%)}
@keyframes portrait-hit{30%{transform:translateX(3px);filter:brightness(1.35)}70%{transform:translateX(-2px)}}
@keyframes portrait-heavy{25%{transform:translate(4px,2px);filter:brightness(1.5)}55%{transform:translate(-3px,-1px)}80%{transform:translateX(1px)}}
@keyframes portrait-strike{40%{transform:scale(1.025) translateY(1px)}70%{transform:scale(1.01)}}
@keyframes impact-flash{0%{opacity:0}20%{opacity:1}100%{opacity:0}}
.damage-popup{left:var(--aim-x);top:var(--aim-y);font:600 clamp(28px,4vw,54px)/1 Cinzel,Georgia,serif;color:#f4d495;background:none;-webkit-text-fill-color:currentColor;text-shadow:0 3px 5px #000,0 0 14px #000;filter:none;z-index:7}.combo-banner{top:16%;font-size:clamp(12px,1.6vw,20px);letter-spacing:.15em;background:#0b131cc9;border-color:#bda36a59;backdrop-filter:blur(4px);z-index:6}.fx-layer{z-index:3}.flying-card{box-shadow:0 2px 18px #e7ca6d60}.flying-card .court-art{display:block}
/* Gallery and progression share the same metal-and-ink treatment. */
dialog{background:linear-gradient(145deg,#1c282f,#111a21);border-color:#9c885a;border-radius:10px;box-shadow:0 25px 85px #000c,inset 0 1px #eadba821}dialog::backdrop{background:#04080dc9;backdrop-filter:blur(5px)}dialog:before{opacity:.045}.dialog-top h2{color:#e6d8bc}.dialog-inner>p{color:#bbc7c2}.shop-item,.class-choice,.map-node,.option,.ending-stats>div{background:linear-gradient(145deg,#233138,#142028);border-color:#71817d50}.shop-item:hover,.map-node:hover:not(:disabled){border-color:#b8a271}.class-choice.active,.map-node.chosen{background:linear-gradient(145deg,#394035,#202b2c)}.art-study{margin:10px 0}.art-study img{width:100%;height:auto;max-height:68dvh;object-fit:contain;display:block;border-radius:4px;background:#090f15}.art-study figcaption{font-size:10px;letter-spacing:2px;color:#b7a079;margin-top:12px;text-align:center}.close-x{background:#25353e;border-color:#778379;min-width:36px;min-height:36px}.relic{filter:none}.relic:hover{filter:brightness(1.12)}
button:focus-visible,a:focus-visible,summary:focus-visible,select:focus-visible{outline:2px solid #efd29b;outline-offset:3px}.scene-stage,.scene-backdrop,.scene-haze{user-select:none}
@media(min-width:851px){.app-shell{grid-template-columns:190px minmax(0,1fr)}.sidebar{padding:16px 14px}.sidebar .dungeon-path li{font-size:11px;min-height:clamp(30px,4.8dvh,48px)}.sidebar .stats{margin:12px 0}.sidebar .avatar{width:33px;height:40px}.sidebar .profile{gap:8px}.sidebar .profile h2{font-size:12px}main{padding:10px 20px;gap:5px}.chapter h1{font-size:20px}.chapter{min-height:32px}.hand-area{gap:4px}.hand-header{min-height:27px}.battle-message{flex-basis:24px;max-height:24px}.enemy-rule{flex-basis:24px;min-height:24px}}
@media(max-width:850px){.scene-stage{inset:18px 5% var(--hud-height)}.arena{--hud-height:66px}.enemy-hud{padding:8px 12px;gap:12px}.enemy-info h2{font-size:17px}.enemy-intent{max-width:44%;padding:5px 6px;gap:5px}.enemy-intent div>span{font-size:11px}.enemy-intent small{font-size:7px}.intent-icon{width:17px;height:17px}.status-badges{top:38px;left:10px}.arena-top{top:8px;left:10px;right:10px}.cards .card{height:clamp(68px,12dvh,108px)}.scene-haze{opacity:.15}.chapter-tools{gap:4px}.chapter-tools .quiet{padding:4px 6px;font-size:11px}.art-button span{display:none}.profile{margin:0}}
@media(max-width:620px){.arena{--hud-height:63px}.scene-stage{inset:18px 5% var(--hud-height)}.arena-top #turn,.encounter-label{font-size:8px;letter-spacing:.6px}.encounter-label{padding:3px 5px}.enemy-hud{padding:7px 9px;gap:8px}.enemy-info h2{font-size:14px;margin-bottom:6px}.enemy-health{gap:5px}.enemy-health b{font-size:9px;min-width:52px}.enemy-intent{padding:4px 5px;gap:4px;max-width:44%}.enemy-intent div>span{font-size:10px}.enemy-intent .intent-icon{width:14px;height:14px}.status-badges{top:33px;max-width:38%;gap:3px}.status-badge{font-size:8px;padding:2px 4px}.chapter-tools .quiet{font-size:10px;min-height:26px;padding:3px 5px}.chapter .eyebrow{font-size:8px;letter-spacing:.3px}.chapter>div:first-child{flex:1;overflow:hidden}.chapter .eyebrow{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.cards{gap:9px;padding:9px 3px 4px}.cards .card{height:clamp(48px,calc((100dvh - 440px) / 3),90px)}.court-art{width:55%;height:92%;left:30%;top:4%}.card .suit{font-size:29px}.card .corner{font-size:19px}.hand-area{padding-top:4px}.action-panel{gap:6px;padding:6px}.hand-score strong{font-size:11px}.action-buttons .attack,.action-buttons .discard{padding:7px 7px;font-size:11px}.damage-score strong{font-size:22px}.damage-score span{font-size:7px}.combo-banner{top:20%;font-size:11px;letter-spacing:.08em}.hand-footer{font-size:9px}.hand-footer .text-button{font-size:10px}.art-study img{max-height:62dvh}}
@media(max-height:620px) and (min-width:851px){.sidebar .profile{margin-bottom:8px}.sidebar .relic{width:29px;height:31px}.arena{--hud-height:56px}.enemy-hud{padding:6px 13px}.enemy-info h2{font-size:16px}.enemy-intent small{display:none}.scene-stage{inset:0 5% var(--hud-height)}.cards .card{height:clamp(58px,11dvh,72px)}.cards{padding-top:9px}.hand-header{min-height:24px}.hand-area{padding-top:3px}.action-panel{min-height:45px}.action-buttons .attack,.action-buttons .discard{min-height:34px;padding:6px 10px}.hand-footer{min-height:16px}.effect-preview{min-height:15px;max-height:22px}}
@media(max-height:540px) and (min-width:520px) and (orientation:landscape){.app-shell{grid-template-columns:1fr}.sidebar{padding:3px 18px}.sidebar .stats{margin:0}.arena{--hud-height:51px}.scene-stage{inset:17px 5% var(--hud-height)}.enemy-hud{padding:5px 8px;gap:6px}.enemy-info h2{font-size:13px;margin-bottom:4px}.enemy-health b{font-size:9px;min-width:45px}.enemy-intent{padding:3px 4px;max-width:42%}.enemy-intent small{display:none}.enemy-intent div>span{font-size:9px}.enemy-intent .intent-icon{display:none}.arena-top{top:5px;left:8px;right:8px}.encounter-label,.arena-top #turn{font-size:7px;padding:2px 3px}.status-badges{top:26px;left:8px}.status-badge{font-size:7px}.hand-area{border:0;padding:0}.cards{gap:9px 8px;padding:8px 3px 4px}.cards .card{height:100%;min-height:30px}.action-panel{min-height:42px;gap:5px;padding:4px 6px}.action-buttons .attack,.action-buttons .discard{padding:5px 7px;min-height:31px;font-size:11px}.chapter-tools .quiet{font-size:9px;padding:2px 4px;min-height:23px}.chapter .eyebrow{font-size:7px;max-width:110px}.chapter h1{display:none}.chapter-tools{gap:2px}.court-art{height:94%;top:3%;left:30%;width:50%}}
@media(max-height:550px) and (max-width:519px){.arena{--hud-height:47px}.scene-stage{inset:15px 5% var(--hud-height)}.enemy-info h2{font-size:12px;margin-bottom:3px}.enemy-intent div>span{font-size:9px}.enemy-intent small{display:none}.cards{grid-template-columns:repeat(8,minmax(0,1fr));gap:4px}.cards .card{height:52px}.court-art,.ace-ornament{display:none}.hand-area{padding-top:2px}.enemy-hud{padding:4px 8px}.status-badges{display:none}.battle-message{flex-basis:22px;max-height:22px}}
/* Honor both the OS preference and the in-game animation switch, including ambience. */
body.no-motion .arena *,body.no-motion .card,body.no-motion .attack{animation:none!important;transition:none!important}body.no-motion #embers,body.no-motion .scene-haze{display:none}body.no-motion .arena:after{display:none}
@media(prefers-reduced-motion:reduce){.arena *,.card,.attack{animation:none!important;transition:none!important}#embers,.scene-haze,.arena:after{display:none}}
/* Stable health tracks: the number cannot squeeze the fill on narrow screens. */
.enemy-health{display:grid;grid-template-columns:minmax(0,1fr) max-content;align-items:center;min-width:0;width:100%;gap:8px}
.enemy-health .meter{width:100%;min-width:0;max-width:100%;flex:none;height:7px}
.enemy-health b{min-width:0;text-align:right;font-variant-numeric:tabular-nums}
.meter{position:relative;min-width:0;isolation:isolate}
.meter i{min-width:0;max-width:100%;height:100%;transform:none;transition:none!important;flex:none}
.meter[data-empty="true"] i{box-shadow:none!important}
#modal,#dialogContent{scroll-behavior:auto;overflow-anchor:none}
.rune-level{position:absolute;right:6px;bottom:5px;z-index:2;min-width:13px;padding:0 2px;font:700 9px/13px sans-serif;background:#111c23;color:#f5db9c;border-radius:3px;pointer-events:none}
.rune-before{opacity:.65;margin-bottom:5px}.option strong+.rune-before{margin-top:6px}
.shop-feedback{height:3em;min-height:3em;line-height:1.5;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
