/* Immersive art direction: independent environment, actor, altar and playable cards. */
:root{--ivory:#ecdfbf;--gold:#caa461;--rail:168px;--table-height:clamp(235px,36dvh,370px);--card-height:clamp(100px,18dvh,178px)}
html,body{width:100%;height:100%;height:100dvh;overflow:hidden;overscroll-behavior:none}
body,.immersive body{display:block;position:relative;margin:0;padding:0;background:#080e13;color:var(--ivory)}
body:before,body:after{display:none}.app-shell{display:block;position:static;width:100%;height:100%;max-width:none;margin:0}main{display:block;position:static;height:100%;padding:0;gap:0}
.topbar{position:fixed;z-index:12;inset:max(14px,env(safe-area-inset-top)) 22px auto;height:58px;padding:0;border:0;box-shadow:none;background:none;pointer-events:none;align-items:flex-start}.topbar>*{pointer-events:auto}.brand{font-family:Cinzel,Georgia,serif;font-size:clamp(23px,2.4vw,39px);font-weight:400;letter-spacing:1.5px;line-height:1.1;text-shadow:0 2px 5px #000,0 0 18px #000}.brand b{color:#e6c78c}.brand-mark{display:none}.brand small{font:9px/1.4 Georgia,serif;letter-spacing:2.5px;color:#baa67f;margin-top:8px}.topbar nav{gap:7px;margin-left:auto}.topbar .quiet,.topbar .icon-button{height:36px;min-width:36px;min-height:36px;padding:6px 10px;border:1px solid #b7985866;background:#090f13b8;color:#e7d5af;border-radius:50%;box-shadow:inset 0 0 0 2px #11191a}.topbar .quiet span{display:none}.topbar .save-state{position:fixed;bottom:8px;left:20px;font-size:8px;letter-spacing:.3px;color:#9b9c8c;max-width:145px;margin:0}
/* Whole scene fills the screen. Nothing in the HUD determines the crop. */
body #arena{position:fixed;inset:0;min-height:0;width:100%;height:100%;border:0;border-radius:0;box-shadow:none;isolation:isolate;--aim-x:59%;--aim-y:38%;--art-offset:0%}
#arena .scene-backdrop{inset:0;background-image:url('assets/immersive/crypt.webp');background-position:center 44%;background-size:cover;filter:none;opacity:1}
#arena .scene-stage{inset:85px 7% calc(var(--table-height) - 38px) 24%;transform:none;display:flex;justify-content:center;align-items:flex-end}
#arena .scene-art{width:100%;height:100%;object-fit:contain;object-position:50% 100%;filter:drop-shadow(0 12px 14px #0008);mask-image:none;-webkit-mask-image:none}
#arena .arena-shade{inset:0;background:linear-gradient(90deg,#03090ccc,transparent 26%,transparent 88%,#03090c40),linear-gradient(0deg,#05090cc9,transparent 43%,transparent 83%,#03070ba8)}
#arena .scene-haze{inset:45% 0 15%;opacity:.22}#arena #embers{opacity:.65}
#arena .enemy-hud{top:22px;bottom:auto;left:35%;right:22%;height:auto;padding:0;display:block;background:none;border:0;box-shadow:none;text-align:center;z-index:6}
#arena .enemy-info{width:100%;max-width:none}.enemy-info h2{font:500 clamp(15px,1.6vw,24px)/1.25 Cinzel,Georgia,serif!important;text-transform:uppercase;letter-spacing:.08em!important;margin:0 0 10px!important;color:#f2e6cc!important;text-shadow:0 2px 6px #000}
#arena .enemy-health{position:relative;display:flex;flex-direction:column;gap:5px;max-width:none;width:100%;padding:0;background:none;border:0;box-shadow:none}
#arena .enemy-health .meter{width:100%;height:11px;padding:2px;border:1px solid #b4995d;background:#070b0b;border-radius:0;box-shadow:0 0 0 3px #080e12aa,inset 0 0 4px #000}
#arena .meter.enemy i,.meter.player i{background:linear-gradient(0deg,#891f23,#d35949);border-radius:0;box-shadow:inset 0 1px #f8927580}
#arena .enemy-health b{font:14px/1.2 Georgia,serif;letter-spacing:1px;color:#f0dfb7;text-shadow:0 2px 4px #000}
#arena .enemy-intent{position:fixed;top:122px;right:24px;left:auto;bottom:auto;max-width:25vw;padding:9px 13px;background:linear-gradient(90deg,#180b0add,#070c0cce);border:1px solid #925a448f;border-radius:0;box-shadow:0 6px 18px #0005;text-align:left}
#arena .enemy-intent small{display:block;font-size:8px;letter-spacing:1.7px;color:#c6ad86}.enemy-intent div>span{font:12px Georgia,serif!important;white-space:normal!important;color:#f0dabc!important}.enemy-intent .intent-icon{width:25px!important;height:25px!important;color:#d56a51}
#arena .arena-top{position:fixed;top:99px;left:calc(var(--rail) + 32px);right:26px;display:flex;justify-content:space-between}.encounter-label{border:0;background:none;backdrop-filter:none;padding:0;font:9px Georgia,serif;letter-spacing:2px;color:#d4c29e}#arena .arena-top #turn{font-size:9px;color:#d4c29e}
#arena .status-badges{position:fixed;left:auto;right:24px;top:188px;max-width:25vw;justify-content:flex-end}.status-badge{background:#081110dd;border:1px solid #a28b5766;color:#dfd8b6;font-size:10px;padding:5px 8px}
/* Compact player rail, with all acquired rune buttons accessible. */
body .sidebar{position:fixed;inset:108px auto 27px 20px;width:var(--rail);height:auto;z-index:7;display:flex;flex-direction:column;overflow:hidden;padding:0 15px 0 0;background:none;border:0;gap:0;text-shadow:0 2px 5px #000}
.sidebar .profile{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin:0 0 10px}.sidebar .profile .avatar{position:relative;width:64px;height:64px;overflow:hidden;border-radius:50%;border:1px solid #dbc18b;background:#121b1b;box-shadow:0 0 0 3px #0a1112,0 0 0 4px #89714688;flex:none}.avatar img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 25%;filter:sepia(.35) brightness(.72)}.avatar #classSigil{position:absolute;right:3px;bottom:0;color:#f0d896;font-size:22px;text-shadow:0 2px 4px #000}.sidebar .profile>div:last-child{display:block}.sidebar .profile small{display:none}.sidebar .profile h2{font:500 14px Cinzel,Georgia,serif;color:#e5d3b1;margin:0 0 3px}.sidebar .profile #level{font-size:9px;line-height:1.3;color:#b8ad93}
.sidebar .health-label{display:flex;font-size:10px;margin:0 0 5px}.sidebar .health-label>span{display:none}.sidebar .health-label strong{font:14px Georgia,serif;letter-spacing:.5px}.sidebar .meter.player{height:8px;min-height:8px;border:1px solid #b3975b;background:#080e10;border-radius:0;padding:1px}.sidebar .stats{display:flex;flex-wrap:wrap;gap:8px 12px;margin:13px 0}.sidebar .stats>div{padding:0;font-size:11px;gap:5px;flex:none;background:none;border:0}.sidebar .stats>div:first-child{width:100%;font:21px Georgia,serif}.sidebar .stats>div>span:nth-child(2){display:none}.sidebar .stats>div>span:first-child{width:17px;height:17px}.sidebar .stats b{margin:0;color:#e9d6b0;font-weight:400}
.sidebar>.side-title{display:flex;font-size:8px;letter-spacing:1px;padding:8px 0 0;border:0}.sidebar .side-title span{font-size:8px}.sidebar .dungeon-path{display:flex;gap:8px;flex-wrap:nowrap;margin:10px 0 5px;padding:0}.sidebar .dungeon-path li{display:flex;min-height:24px;width:24px;flex:none;padding:0}.sidebar .dungeon-path li:after,.sidebar .path-text{display:none}.sidebar .dungeon-path .node{width:24px;height:24px;line-height:24px;font-size:10px;background:#0b1418c9;box-shadow:none;border-color:#b3965e70}.sidebar .dungeon-path .current .node{color:#f2d187;border-color:#d9b169;background:#302719d9}
.sidebar>.relics{display:flex;flex-wrap:wrap;gap:7px;margin:10px 0;max-height:135px;overflow-y:auto;scrollbar-width:thin}.sidebar .relic{width:35px;height:35px;border-radius:50%;background:radial-gradient(circle,#1b2a2c,#070f13);border:1px solid #b2925380;box-shadow:inset 0 0 0 3px #050a0d,0 2px 7px #0006;font-size:22px}.rune-level{bottom:0;right:0;font-size:8px}.sidebar .deck-button{display:flex;gap:6px;align-items:center;font-size:10px;padding:5px 7px;min-height:31px;margin:3px 0;background:#060c10a6;border:1px solid #a58a4c55;border-radius:0}.sidebar .deck-button span{margin-left:auto}.sidebar>.side-bottom{display:block;margin:0;padding:0;border:0}.side-bottom>span,.side-bottom p,.route-peek{display:none}.side-bottom #mapBtn{font-size:10px;color:#c2ae85;padding:8px 0}
/* Subtle tools and encounter explanation remain interactive above the altar. */
body .chapter{position:fixed;top:76px;left:22px;right:22px;z-index:8;display:flex;min-height:0;pointer-events:none;gap:12px}.chapter>div{pointer-events:auto}.chapter h1{display:none}.chapter .eyebrow{font:9px Georgia,serif;letter-spacing:1.3px;color:#c8b386;max-width:260px;display:block}.chapter-tools{margin-left:auto;display:flex;gap:6px}.chapter-tools .quiet{min-height:26px;padding:3px 7px;font-size:10px;border-radius:0;background:#081014b3;border:1px solid #b7985866;color:#cdb990}.chapter .mobile-deck{display:none}
body .enemy-rule{position:fixed;z-index:8;left:calc(var(--rail) + 32px);bottom:calc(var(--table-height) + 30px);max-width:420px;width:40%;height:25px;min-height:25px;min-width:0;padding:4px 8px;background:#050c10b5;border:1px solid #b29a603d;border-radius:0;color:#ddd1b5}.enemy-rule #enemyRule{font-size:10px}.enemy-rule b{font-size:9px}.enemy-rule>.ui-icon{width:13px;height:13px}
body .battle-message{position:fixed;z-index:8;left:calc(var(--rail) + 32px);right:24px;bottom:calc(var(--table-height) + 3px);height:25px;max-height:25px;padding:2px 7px;gap:7px;pointer-events:none;text-shadow:0 2px 5px #000;background:linear-gradient(90deg,#061014a8,transparent)}.battle-message p{font:12px/1.4 Georgia,serif;color:#e4dcc7;margin:0}.battle-message>.ui-icon{height:12px;width:12px}
/* Separate foreground artwork gives the hand a physical surface. */
.altar{position:fixed;z-index:3;left:-2%;right:-2%;bottom:-5px;height:calc(var(--table-height) + 34px);background:url('assets/immersive/altar.webp') center top / 100% 100% no-repeat;pointer-events:none}
body .hand-area{position:fixed;z-index:9;bottom:15px;left:calc(var(--rail) + 28px);right:26px;padding:0;border:0;display:flex;gap:3px;height:calc(var(--table-height) - 10px);min-height:0;max-width:1280px;margin:0 auto}
.hand-header{min-height:28px;flex:none;padding:0 9px;margin:0}.hand-header h2{display:none}.hand-header>div>span{font:10px Georgia,serif;letter-spacing:.2px;color:#d0c7ab;text-shadow:0 2px 4px #000}.hand-tools{gap:14px}.hand-tools .text-button,.hand-tools .potion{font-size:11px;color:#d8c9a3}.hand-tools .potion{background:#080f13bd;border:1px solid #a88d5255;border-radius:3px;min-height:26px;padding:3px 8px}
body .cards{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:1fr;gap:clamp(7px,1vw,16px);width:100%;max-width:1050px;min-height:0;flex:1;padding:10px 8px 8px;margin:auto;perspective:1000px}
body .cards .card{height:100%;min-height:0;max-height:var(--card-height);align-self:end;aspect-ratio:auto;border:1px solid #927744;border-radius:5px;background:radial-gradient(ellipse at 30% 20%,#f5e6c3,#cbb68b);color:#242321;box-shadow:0 5px 4px #0008,inset 0 0 0 2px #ecd5a5,inset 0 0 0 3px #9a7e4844;transform:rotate(var(--fan,0deg));transform-origin:50% 100%;transition:transform .16s ease,border-color .16s,box-shadow .16s}
.cards .card:nth-child(1){--fan:-3deg}.cards .card:nth-child(2){--fan:-2deg}.cards .card:nth-child(3){--fan:-1deg}.cards .card:nth-child(6){--fan:1deg}.cards .card:nth-child(7){--fan:2deg}.cards .card:nth-child(8){--fan:3deg}
body .cards .card.red{color:#942f29}.card:after{inset:5px;border:1px solid #82652d5c;box-shadow:none;border-radius:2px}.card:before{opacity:.12}.card .corner{z-index:3;text-shadow:0 1px #ffecba;line-height:1}.cards .card .corner{font:700 clamp(20px,2.8dvh,29px)/1 Georgia,serif;left:7px;top:6px}.cards .card .corner i{font-size:.65em;margin-top:2px}.cards .card .corner.bottom{display:block;inset:auto 7px 6px auto;transform:rotate(180deg)}
body .card .court-art{position:absolute;left:23%;top:6%;width:63%;height:88%;object-fit:cover;object-position:center;opacity:1;mix-blend-mode:multiply;border:0;border-radius:1px;pointer-events:none}
body .cards .card>.suit{position:absolute;left:50%;top:50%;right:auto;bottom:auto;transform:translate(-50%,-50%);font-size:clamp(30px,6dvh,62px);filter:drop-shadow(0 1px #ffebbd);line-height:1}
body .card[data-rank="11"]>.suit,body .card[data-rank="12"]>.suit,body .card[data-rank="13"]>.suit{display:none}.ace-ornament{inset:19% 24%;border-width:2px;opacity:.45}.cards .card:hover:not(:disabled){transform:translateY(-5px) rotate(var(--fan));border-color:#ddbd78}.cards .card.selected,.cards .card.selected:hover:not(:disabled){transform:translateY(-12px) rotate(var(--fan));border-color:#ffdf87;background:radial-gradient(ellipse at 30% 20%,#fff0cc,#e3c68b);box-shadow:0 0 0 2px #e6b45e,0 0 17px #e7b44b85,0 8px 5px #0009}.selected-mark{background:#dfb865;color:#1c211b;border-color:#ffe2a0;width:15px;height:15px;font-size:10px;line-height:15px;bottom:-7px;left:calc(50% - 7px)}
.hand-area .effect-preview{min-height:15px;height:15px;max-height:15px;flex:none;font-size:9px;line-height:15px;justify-content:center;color:#d0c7aa;gap:8px;text-shadow:0 2px 4px #000}
body .action-panel{display:flex;align-items:center;justify-content:center;flex:none;min-height:54px;height:54px;width:100%;max-width:990px;align-self:center;padding:4px 8px;gap:20px;background:linear-gradient(90deg,transparent,#050909b8 20%,#050909b8 85%,transparent);border:0;box-shadow:none;border-radius:0}.hand-score{min-width:120px}.hand-score small{font-size:8px;letter-spacing:1.8px;color:#b6a071}.hand-score strong{font:500 clamp(12px,1.4vw,18px) Cinzel,Georgia,serif;color:#ecd39c}.damage-score{padding:0 14px;border:0;display:flex;align-items:center;gap:7px}.damage-score strong{font:26px Georgia,serif;color:#f2c372}.damage-score span{font:9px Georgia,serif;letter-spacing:1px}.action-buttons{margin-left:auto;gap:12px}.action-buttons .attack,.action-buttons .discard{height:42px;min-height:42px;padding:8px 22px;font:500 13px Cinzel,Georgia,serif;letter-spacing:.8px;border-radius:2px;border:1px solid #b79857;box-shadow:inset 0 0 0 2px #080d0d,inset 0 0 0 3px #967d484d,0 3px 10px #0008}.action-buttons .attack{background:linear-gradient(#8a6930,#342a16);color:#fff0c7}.action-buttons .attack:hover:not(:disabled){background:linear-gradient(#a58443,#4d3b1a);color:#fff3d8}.action-buttons .discard{background:#080e12e6;color:#dfcea5}.discard span{font:10px Georgia,serif;color:#b6a990}.hand-footer{min-height:13px;height:13px;font-size:9px;margin:0 8px;line-height:13px;color:#b9b29c}.hand-footer .text-button{font-size:9px;color:#c9b17e}
body .travel-actions{position:fixed;z-index:11;left:calc(var(--rail) + 30px);right:26px;bottom:26px;width:auto;padding:8px;background:#081014f5;border:1px solid #c5a766}.travel-actions[hidden]{display:none}.travel-actions .attack{margin:0;min-height:40px}
#arena .combo-banner{top:26%;left:59%;font-size:16px}.damage-popup{left:59%;top:37%}.fx-layer{left:59%}.view-status{top:105px}
dialog{z-index:100;background:linear-gradient(145deg,#172124f7,#090f13fb);border:1px solid #bba16b;border-radius:3px;box-shadow:0 30px 100px #000,inset 0 0 0 4px #0b1419,inset 0 0 0 5px #ac945638}dialog::backdrop{background:#020609c9;backdrop-filter:blur(7px)}.dialog-top h2{font-family:Cinzel,Georgia,serif}.shop-item,.class-choice,.map-node,.option{border-radius:3px;background:linear-gradient(130deg,#22302ca8,#101a1bcc);border-color:#a2884d50}.shop-item:hover,.option:hover{border-color:#c8a76b}.deck-grid .card{background:#e4cf9e}.deck-grid .court-art{object-fit:contain}.ending-art{filter:none}
@media(min-width:851px) and (max-height:760px){:root{--rail:145px;--table-height:250px;--card-height:130px}.sidebar .profile{flex-direction:row;align-items:center;gap:9px}.sidebar .profile .avatar{width:42px;height:42px}.sidebar .profile h2{font-size:11px}.sidebar .stats{margin:9px 0;gap:5px 10px}.sidebar .stats>div:first-child{width:auto;font-size:16px}.sidebar>.side-title{display:flex;padding-top:6px}.sidebar .dungeon-path{display:flex;margin:7px 0}.sidebar .relics{max-height:110px;margin:8px 0}.sidebar .relic{width:31px;height:31px}.sidebar .deck-button{margin-top:0}.sidebar .profile #level{font-size:8px}.hand-score strong{font-size:13px}}
@media(min-width:851px) and (max-height:620px){:root{--table-height:210px;--card-height:100px}.sidebar .profile .avatar{width:35px;height:35px}.sidebar .profile{margin-bottom:5px}.sidebar .relics{max-height:80px}.sidebar .dungeon-path{display:none}.sidebar .side-title:not(.relic-heading){display:none}.sidebar .stats{margin:7px 0}.sidebar .relic{width:29px;height:29px}.hand-area .hand-header{min-height:25px}.hand-area .action-panel{height:46px;min-height:46px}.action-buttons .attack,.action-buttons .discard{min-height:36px;height:36px}.sidebar .side-bottom{display:none}.hand-area .cards{padding-top:9px;padding-bottom:6px}}
/* Portrait phone: a compact HUD and a two-row hand, inside the visual viewport. */
@media(max-width:850px){:root{--rail:0px;--table-height:clamp(260px,40dvh,330px);--card-height:118px}.topbar{inset:max(8px,env(safe-area-inset-top)) 12px auto;height:35px;align-items:center}.brand{font-size:22px;letter-spacing:1px}.brand small{display:none}.topbar nav{gap:5px}.topbar .quiet,.topbar .icon-button{height:32px;min-height:32px;min-width:32px;padding:5px 8px}.topbar .save-state{display:none}
body .sidebar{inset:52px 12px auto;width:auto;height:38px;padding:0;display:grid;grid-template-columns:34px minmax(100px,1fr) minmax(125px,1fr);grid-template-rows:19px 8px;gap:4px 12px;overflow:visible}.sidebar .profile{display:block;grid-column:1;grid-row:1/3;margin:0}.sidebar .profile .avatar{display:block;width:29px;height:29px}.sidebar .profile>div:last-child{display:none}.avatar #classSigil{font-size:13px}.sidebar .health-label{grid-column:2;grid-row:1;margin:0;align-self:center}.sidebar .health-label strong{font-size:12px}.sidebar .meter.player{grid-column:2;grid-row:2;height:7px;min-height:7px}.sidebar .stats{grid-column:3;grid-row:1/3;display:flex;flex-wrap:nowrap;margin:0;gap:9px;justify-content:flex-end}.sidebar .stats>div,.sidebar .stats>div:first-child{font:12px Georgia,serif;width:auto;flex:none;gap:3px}.sidebar .stats>div>span:first-child{width:14px;height:14px}.sidebar>.side-title,.sidebar>.dungeon-path,.sidebar>.relics,.sidebar>.deck-button,.sidebar>.side-bottom{display:none}
body .chapter{top:95px;left:12px;right:12px;min-height:25px;align-items:center}.chapter .eyebrow{font-size:8px;letter-spacing:.4px;max-width:180px}.chapter-tools{gap:4px}.chapter-tools .quiet{padding:3px 5px;font-size:9px;min-height:26px}.chapter .mobile-deck{display:block}.chapter .art-button span{display:none}#arena .enemy-hud{top:135px;left:16%;right:16%}#arena .enemy-info h2{font-size:17px!important;margin-bottom:6px!important}#arena .enemy-health .meter{height:9px}#arena .enemy-health b{font-size:11px}#arena .scene-stage{inset:194px 4% calc(var(--table-height) + 20px) 4%}#arena .scene-art{object-position:center bottom}#arena .arena-top{top:122px;left:12px;right:12px}#arena .arena-top #turn,.encounter-label{font-size:7px;letter-spacing:.6px}#arena .enemy-intent{top:auto;bottom:calc(var(--table-height) + 50px);right:12px;left:auto;max-width:65%;padding:5px 8px}#arena .enemy-intent small{display:none}.enemy-intent div>span{font-size:10px!important}.enemy-intent .intent-icon{width:16px!important;height:16px!important}#arena .status-badges{top:198px;left:12px;right:auto;max-width:40%;justify-content:flex-start}.status-badge{font-size:8px;padding:3px 5px}#arena .arena-shade{background:linear-gradient(0deg,#04090e80,transparent 45%,transparent 66%,#04090eb8)}
body .enemy-rule{left:12px;right:12px;width:auto;max-width:none;bottom:calc(var(--table-height) + 22px);height:23px;min-height:23px}.enemy-rule #enemyRule{font-size:9px}body .battle-message{left:12px;right:12px;bottom:calc(var(--table-height) - 3px);height:23px;max-height:23px}.battle-message p{font-size:11px}
.altar{height:calc(var(--table-height) + 25px);left:-35%;right:-35%;background-size:100% 100%}body .hand-area{left:12px;right:12px;bottom:max(8px,env(safe-area-inset-bottom));height:calc(var(--table-height) - 15px);gap:3px}.hand-header{min-height:28px;padding:0 2px}.hand-header>div:first-child{display:block}.hand-header>div>span{font-size:10px}.hand-tools{gap:9px}.hand-tools .text-button,.hand-tools .potion{font-size:11px}body .cards{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:10px 9px;max-width:550px;padding:5px 2px 6px;flex:1}body .cards .card{height:100%;max-height:none;min-height:0;--fan:0deg;align-self:stretch;border-radius:4px}.cards .card .corner{font-size:21px;left:7px;top:5px}.cards .card .corner i{font-size:13px}.cards .card .corner.bottom{display:none}body .cards .card>.suit{font-size:35px;left:63%;top:53%}.cards .card.selected,.cards .card.selected:hover:not(:disabled){transform:translateY(-4px);box-shadow:0 0 0 1px #e8bd69,0 0 10px #ffbd4759,0 6px 5px #0008}body .cards .card .court-art{width:61%;height:94%;top:3%;left:33%;object-fit:cover;object-position:50% 28%}.selected-mark{display:none}.hand-area .effect-preview{font-size:8px;height:13px;min-height:13px;line-height:13px;justify-content:flex-start}.hand-area .action-panel{display:grid;grid-template-columns:minmax(63px,1fr) 36px auto;height:45px;min-height:45px;padding:0 1px;gap:8px}.hand-score{min-width:0}.hand-score small{display:none}.hand-score strong{font:12px/1.2 Georgia,serif}.damage-score{padding:0;gap:0;display:flex;flex-direction:column}.damage-score strong{font-size:23px}.damage-score span{font-size:7px;letter-spacing:0}.action-buttons{gap:5px;margin:0}.action-buttons .attack,.action-buttons .discard{min-height:37px;height:37px;padding:5px 9px;font:11px Georgia,serif;letter-spacing:0}.action-buttons .attack .ui-icon{display:none}.discard span{font-size:9px;margin-left:2px}.hand-footer{margin:0;font-size:8px;min-height:12px;height:12px}.hand-footer .text-button{font-size:8px}body .travel-actions{left:12px;right:12px;bottom:18px}
#arena .combo-banner{left:50%;top:35%;font-size:12px}.damage-popup{left:50%;top:37%}.fx-layer{left:50%}.view-status{top:48px}.dialog-inner{padding:18px}.dialog-top h2{font-size:21px}
}
@media(max-width:850px) and (min-width:621px) and (min-height:541px){:root{--table-height:285px}body .cards{grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:1fr;max-width:780px}.cards .card .corner.bottom{display:block}.cards .card .court-art{left:23%;width:65%}.hand-area .action-panel{grid-template-columns:1fr 55px auto}.action-buttons .attack,.action-buttons .discard{padding:8px 22px;font-size:13px}#arena .scene-stage{left:15%;right:10%}}
/* Landscape phones allocate one side to the enemy and the other to the hand. */
@media(max-height:540px) and (min-width:520px) and (orientation:landscape){:root{--table-height:220px}.topbar{inset:7px 12px auto;height:28px}.brand{font-size:21px}.topbar .quiet,.topbar .icon-button{height:28px;min-height:28px;min-width:28px;padding:4px 6px}body .sidebar{inset:45px auto auto 12px;width:42%;height:25px;grid-template-columns:minmax(90px,1fr) minmax(115px,1fr);grid-template-rows:14px 6px;gap:3px 12px}.sidebar .profile{display:none}.sidebar .health-label{grid-column:1;grid-row:1}.sidebar .health-label strong{font-size:10px}.sidebar .meter.player{grid-column:1;grid-row:2;height:6px;min-height:6px}.sidebar .stats{grid-column:2;font-size:10px}.sidebar .stats>div,.sidebar .stats>div:first-child{font-size:11px}body .chapter{top:auto;bottom:10px;left:12px;right:auto;width:42%;align-items:center}.chapter .eyebrow{max-width:110px;font-size:7px}.chapter-tools .quiet{font-size:8px;min-height:26px}.chapter-tools{gap:3px}#arena .enemy-hud{left:5%;right:57%;top:90px}#arena .enemy-info h2{font-size:14px!important}#arena .enemy-health b{font-size:10px}#arena .scene-stage{inset:145px 53% 70px 3%}#arena .arena-top{top:77px;left:12px;right:57%}#arena .enemy-intent{left:12px;right:auto;top:auto;bottom:78px;max-width:40%;padding:4px 7px}#arena .enemy-intent small{display:none}#arena .status-badges{top:150px;left:12px;max-width:25%}body .enemy-rule{left:12px;right:auto;width:42%;bottom:51px;min-height:21px;height:21px}body .battle-message{display:none}.altar{left:40%;right:-35%;height:calc(100% - 48px);bottom:-14px}body .hand-area{left:48%;right:12px;top:47px;bottom:10px;height:auto}.hand-header{min-height:25px}.hand-header>div>span{font-size:9px}.hand-tools{gap:7px}.hand-tools .text-button,.hand-tools .potion{font-size:10px;min-height:25px}.cards .card .corner{font-size:19px}body .cards{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:9px 7px;padding-top:5px}.cards .card .corner.bottom{display:none}body .cards .card{max-height:none}.hand-area .action-panel{grid-template-columns:minmax(48px,1fr) 30px auto;height:39px;min-height:39px;gap:5px}.action-buttons .attack,.action-buttons .discard{min-height:32px;height:32px;font-size:10px;padding:5px 7px}.hand-score strong{font-size:10px}.damage-score strong{font-size:21px}.hand-area .effect-preview{font-size:8px}.hand-footer{font-size:7px}.hand-footer .text-button{font-size:8px}body .travel-actions{left:48%;right:12px;bottom:12px}#arena .combo-banner{left:25%;top:43%;font-size:11px}.damage-popup{left:25%;top:45%}.fx-layer{left:25%}}
@media(max-width:519px) and (max-height:680px){:root{--table-height:240px}.topbar{top:5px;height:31px}.brand{font-size:19px}body .sidebar{top:42px;height:31px}body .chapter{top:80px}#arena .enemy-hud{top:116px}#arena .enemy-info h2{font-size:14px!important}#arena .scene-stage{top:163px;bottom:calc(var(--table-height) + 24px)}#arena .arena-top{top:105px}#arena .status-badges{top:164px}.cards .card .corner{font-size:18px}.cards .card .corner i{font-size:12px}body .cards .card>.suit{font-size:27px}.action-buttons .attack,.action-buttons .discard{font-size:10px;padding:4px 7px}.hand-score strong{font-size:11px}}
@media(max-width:519px) and (max-height:550px){:root{--table-height:183px}body .cards{grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:1fr;gap:4px;max-width:none}body .cards .card .court-art,body .cards .card>.suit,.cards .ace-ornament{display:none}.cards .card .corner{font-size:17px;left:4px;top:6px}.hand-header>div>span{font-size:8px}.hand-tools .text-button,.hand-tools .potion{font-size:9px}.hand-footer{display:flex}#arena .scene-stage{top:159px}#arena .status-badges{display:none}.enemy-intent div>span{font-size:9px!important}.hand-area .effect-preview{font-size:7px}.enemy-rule #enemyRule{font-size:8px}}
body.no-motion .card,body.no-motion .arena *,body.no-motion .scene-haze{animation:none!important;transition:none!important}
@media(prefers-reduced-motion:reduce){.card,.arena *{animation:none!important;transition:none!important}}
/* Card pips are real suit glyphs, separate from the engraved court art. */
.card-pips{position:absolute;inset:12% 25%;display:grid;grid-template-columns:repeat(2,1fr);grid-auto-rows:1fr;align-items:center;justify-items:center;gap:0;pointer-events:none;font:20px/1 Georgia,serif}.card-pips i{font-style:normal}.card-pips i:nth-child(n+6){transform:rotate(180deg)}.pips-7 i:last-child,.pips-9 i:last-child{grid-column:1/3}.card:has(.card-pips)>.suit{display:none!important}.sidebar .relic{clip-path:none}.sidebar .relic:before,.sidebar .relic:after{border-radius:50%}
/* Shared hit point for each responsive arena, including card flight. */
#arena{--impact-x:59%;--impact-y:38%}#arena .fx-layer{inset:0}#arena .spark,#arena .shockwave{left:var(--impact-x);top:var(--impact-y)}#arena .slash{left:calc(var(--impact-x) - 15%);top:var(--impact-y);width:30%}#arena .combo-banner{left:var(--impact-x);right:auto;width:360px;margin-left:-180px}#arena .damage-popup{left:var(--impact-x);top:var(--impact-y)}
@media(max-width:850px){body .cards .card:nth-child(n){--fan:0deg}.cards .card-pips{inset:9% 10% 9% 40%;font-size:16px}#arena{--impact-x:50%;--impact-y:38%}#arena .combo-banner{width:280px;margin-left:-140px}}
@media(max-height:540px) and (min-width:520px) and (orientation:landscape){#arena{--impact-x:25%;--impact-y:49%}.cards .card-pips{font-size:14px}}
@media(max-width:519px) and (max-height:680px){.cards .card-pips{font-size:12px}}
@media(max-width:519px) and (max-height:550px){.cards .card-pips{display:none}}
