/* Fractured Realms R1 — presentation only, existing artwork and real game state. */
:root{--realm-gold:#d9b675;--realm-ink:#fff0d1;--realm-night:#091523}
.app-shell:not(.in-duel) .mobile-nav{background:linear-gradient(90deg,#07101b,#172737);border-color:#b89b626e}
.mobile-nav .nav-btn.active{color:#fff1bd;background:linear-gradient(135deg,#2c6e70,#102d38);box-shadow:inset 0 0 0 1px #ead0a17d,0 0 14px #42c3c02b}
.topbar .pill{border-color:#cbb07877;background:linear-gradient(#263744,#0b1723);color:var(--realm-ink)}
.section-head h2,.chapter-hero h1{font-family:Cinzel,Georgia,serif;color:var(--realm-ink);text-shadow:0 2px 8px #000}
.btn-primary{border:1px solid #ffe1a1;border-radius:3px;background:linear-gradient(#fff0bc,#e8c47b 43%,#ba8539 100%);box-shadow:inset 0 0 0 2px #69451e88,inset 0 0 0 3px #ffe8aa88,0 4px 14px #0009;color:#271a0e}
.btn-primary:not(:disabled):active{filter:brightness(.88)}
/* The hero uses existing individual card artwork, not a flattened mockup. */
.game-hub{isolation:isolate;grid-template-columns:minmax(0,1fr) minmax(240px,36%);grid-template-rows:auto minmax(0,1fr) auto;gap:14px 22px;border-color:#d4b47a;box-shadow:inset 0 0 0 4px #c5a1662b,0 15px 45px #0009;background:linear-gradient(90deg,#07111c66 0%,#07111c16 38%,#07111ccf 70%,#07111cf2 100%),url('./assets/brand/shardwake-splash.webp') center/cover}
.game-hub::before{content:"";position:absolute;inset:15% 37% 0 0;z-index:-1;background:var(--hub-champion) center 25%/contain no-repeat;mask-image:linear-gradient(90deg,#000 0%,#000 68%,transparent 100%);opacity:.92;pointer-events:none}
.game-hub::after{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(0deg,#06101ce8,transparent 30%,transparent 82%,#06101cb5)}
.hub-profile{grid-column:2;grid-row:1;justify-self:end;min-width:0;max-width:100%;padding:7px 10px;background:#081624d9;border:1px solid #c5a66c88;border-radius:5px}
.hub-profile h2{font-size:15px}.hub-profile img{border:2px solid #e8cb90;box-shadow:0 0 12px #e6c57833}
.hub-title{grid-column:1;grid-row:1/3;align-self:start;display:flex;flex-direction:column;align-items:flex-start;min-width:0}
.hub-title .sw-hub-signature{background:transparent;box-shadow:none;border:0;padding:0;margin:0 0 7px}
.hub-title .sw-hub-signature img{height:auto;width:min(330px,100%);object-fit:contain;border:0;border-radius:0;filter:drop-shadow(0 4px 8px #000)}
.hub-title h1{font-size:clamp(19px,2.8vw,44px);line-height:1.04;margin:7px 0;text-shadow:0 2px 10px #000,0 3px 7px #000}
.hub-title>p,.hub-title>.eyebrow{background:#071321a8;padding:3px 6px;text-shadow:0 2px 4px #000}
.hub-mission{grid-column:2;grid-row:2;align-self:center;max-width:none;border-color:#d7b678;border-radius:5px;box-shadow:inset 0 0 0 3px #b89d5e39,0 8px 18px #0009;background:linear-gradient(90deg,#0a1320ee,#0a1320a6 65%,#0a13204d),var(--hub-mission-art) center/cover}
.hub-mission h3{font-size:clamp(17px,2.1vw,30px);color:#ffe5ae;text-shadow:0 2px 6px #000}
.hub-play{grid-column:2;grid-row:3;align-items:center;justify-content:center;gap:6px;flex-direction:column}
.hub-play>.btn{width:100%;font-size:clamp(16px,2.3vw,27px);font-family:Cinzel,Georgia,serif;min-height:48px}
.hub-play>span{line-height:1.2;text-align:center}
.hub-modes{grid-column:1;grid-row:3;align-self:end;grid-template-columns:repeat(2,minmax(0,1fr));max-width:400px}
.hub-modes .btn{background:#091827e8;border-color:#bda36b88}
.chapter-hero{min-height:0;height:auto;padding:16px 20px;margin-bottom:12px;border-color:#c1a16a;background:linear-gradient(90deg,#091523f2,#0b1e31a8),url('./assets/art/world.webp') center 40%/cover}
.chapter-hero:before{display:none}
.chapter-hero h1{font-size:clamp(21px,2.7vw,42px);margin:5px 0}
.chapter-hero p{max-width:600px;margin:5px 0 10px}
.realm-overview{display:grid;grid-template-columns:minmax(0,1fr) minmax(190px,27%);gap:10px;margin-bottom:18px;align-items:stretch}
.realm-overview .realm-route{margin:0;border-radius:5px;background:#0a1825;min-width:0}
.realm-overview .realm-region{min-height:300px;justify-content:flex-end;padding:15px 8px 30px;background:linear-gradient(0deg,#06121fe8,transparent 60%,#0a162766),var(--realm-art) center/cover}
.realm-region:before{top:auto;bottom:100px;border-color:#e1c17c}
.realm-overview .realm-label{background:#071523df;border-radius:4px;padding:7px 5px}
.realm-overview .realm-node{max-width:100%;min-height:0}
.realm-current .realm-seal{background:radial-gradient(circle,#26756c,#0c252a);border-color:#a5ffe1}
.realm-feature{position:relative;display:flex;flex-direction:column;min-width:0;overflow:hidden;background:#0a1724;border:1px solid #d6b678;border-radius:5px;box-shadow:inset 0 0 0 3px #d6b67822,0 8px 22px #0008}
.realm-feature-art{min-height:100px;flex:1;background:linear-gradient(0deg,#0a1724,transparent 70%),var(--realm-art) center 25%/cover;display:flex;align-items:flex-start;padding:8px}
.realm-feature-art .eyebrow{background:#071523da;color:#f5dba5;padding:4px 6px}
.realm-feature-copy{padding:10px 12px;display:grid;gap:7px}
.realm-feature-copy h2{margin:0;font-size:clamp(15px,1.8vw,24px);color:#f7e7c1;line-height:1.1}
.realm-feature-copy p{margin:0;color:#c3d3dd;font-size:11px}
.realm-feature-reward{display:flex;align-items:center;gap:8px;padding:6px;border:1px solid #cdb27d48;background:#07111c}
.realm-feature-reward img{width:40px;aspect-ratio:2/3;object-fit:cover;border:1px solid #d8bd83}
.realm-feature-reward strong{display:block;font-size:12px;color:var(--realm-ink);overflow-wrap:anywhere}
.realm-feature-copy .btn{width:100%;min-height:36px}
.chapter-map{margin-top:4px}
/* Parchment and gold frame, large illustration; descriptions stay available in inspector. */
.library-page .tcg-card{border:2px solid #d9ba7d;border-radius:6px;box-shadow:inset 0 0 0 1px #4c3822,0 5px 14px #000b}
.library-page .tcg-card .card-bottom{background:linear-gradient(150deg,#f6e9cb,#cdb384);border-top:2px solid #987448}
.library-page .tcg-card .card-cost,.duel .tcg-card .card-cost{border-color:#efd9a7;border-radius:50%;background:radial-gradient(circle at 34% 26%,var(--faction),#102535 73%);color:#fff}
.library-page .tcg-card .card-art-shade{opacity:.7}
.library-page .library-selected .tcg-card{outline:2px solid #86e8df;outline-offset:2px;box-shadow:0 0 15px #52d5d777}
.collection-inspector,.deck-sidebar{background:linear-gradient(145deg,#182b38,#091523 65%);border:1px solid #d2b174;border-radius:5px}
.library-page .filter.active{background:linear-gradient(110deg,#265b62,#122731);color:#fff1cb;border-color:#dbbf88}
.library-page .filters [data-filter="cinder"],.library-page .filters [data-faction="cinder"]{border-color:#cf714e}
.library-page .filters [data-filter="grove"],.library-page .filters [data-faction="grove"]{border-color:#70b96e}
.library-page .filters [data-filter="tide"],.library-page .filters [data-faction="tide"]{border-color:#59bada}
.library-page .filters [data-filter="dawn"],.library-page .filters [data-faction="dawn"]{border-color:#e2c775}
.library-page .filters [data-filter="umbra"],.library-page .filters [data-faction="umbra"]{border-color:#b98ce3}
.deck-sidebar .mana-curve{padding:9px 5px;border:1px solid #a68e5b66;background:#071522}
.deck-line{border-bottom-color:#a68e5b44}
.duel .arena{background:radial-gradient(ellipse at 50% 50%,#31b6c230,transparent 48%),linear-gradient(180deg,#07121c66,#1020278c 60%,#06121ccc),url('./assets/art/world.webp') center 53%/cover no-repeat!important;border:1px solid #c5a66d;box-shadow:inset 0 0 0 3px #c5a66d3d,inset 0 0 35px #06101c}
.duel .arena::before{border:1px solid #81c4c94d;box-shadow:inset 0 0 16px #23acc222}
.duel-phase,.duel .selected-preview,.duel .combat-dock,.duel .arena-hand{border-color:#bfa36c;border-radius:4px;background-color:#0a1826}
.duel .hero-crest{border:2px solid #d4af6a;box-shadow:0 0 0 2px #091522,0 0 15px #e3b86c44}
.duel .health{color:#fff0cb;text-shadow:0 2px 5px #000}
.duel .board-unit .tcg-card{border-color:#bfa16b;border-radius:5px;box-shadow:0 4px 10px #000d}
.duel .combat-state-ready .tcg-card{border-color:#a5f5c5;box-shadow:0 0 10px #38d3a56e}
.duel .combat-state-attacker .tcg-card,.duel .chosen-target .tcg-card{border-color:#ffe1a1;box-shadow:0 0 15px #f3bd6488}
.duel .board-unit .card-bottom{background:linear-gradient(#162530ee,#081422)}
.duel .arena-lane .empty-slot{border:1px solid #c3a76a3b;background:#0713204a}
/* Result overlay: keep rewards truthful, including duplicate dust awards. */
.modal.result-modal{border:1px solid #dcba79;border-radius:6px;background:linear-gradient(110deg,#081522f5,#081522e3 70%,#081522b0),var(--result-art) center/cover;box-shadow:0 0 0 4px #bd995735,0 18px 70px #000c;text-align:center}
.result-won h2::before,.result-won h2::after{content:"✧";font-size:.55em;vertical-align:middle;margin:0 .55em;color:#c99543}
.result-won h2{text-shadow:0 0 25px #f3bd6670,0 2px 4px #000}
.result-modal .stat{border:1px solid #ceae6c77;background:#0c1727bd}
.result-modal .chapter-victory{display:flex;align-items:center;justify-content:center;gap:15px;text-align:left;background:linear-gradient(110deg,#2c2417f2,#101d2be6)}
.chapter-victory>div{display:grid;gap:6px}
.victory-reward-art{width:74px;aspect-ratio:2/3;object-fit:cover;border:2px solid #f0c779;box-shadow:0 0 20px #ffcc7277;transform:rotate(-3deg)}
.victory-reward-glyph{font-size:40px;color:#f8d58d}
@media(orientation:landscape) and (max-height:600px){
 .game-hub{grid-template-columns:minmax(0,1fr) minmax(220px,36%);gap:7px 12px;grid-template-rows:auto minmax(0,1fr) auto;padding:10px 16px}
 .hub-title .sw-hub-signature img{width:min(195px,90%);max-height:65px}
 .hub-title h1{font-size:clamp(18px,3vw,30px)}
 .hub-profile{padding:4px 7px}.hub-profile img{width:32px;height:32px}.hub-profile h2{font-size:12px}
 .hub-mission{padding:9px;min-height:0}.hub-mission h3{font-size:16px;margin:5px 0}.hub-mission p{font-size:10px;margin:4px 0}.hub-mission .btn{min-height:31px}
 .hub-play{gap:4px}.hub-play>.btn{min-height:38px;font-size:18px}.hub-play .difficulty-label select{min-height:27px}.hub-modes .btn{min-height:29px}
 .chapter-hero{min-height:0;height:auto;display:flex;flex-wrap:wrap;padding:7px 10px;gap:5px 10px;margin-bottom:8px}
 .chapter-hero h1{font-size:clamp(15px,2.5vw,23px);margin:0}.chapter-hero>p{display:none}.chapter-progress{width:150px;max-width:100%;margin:0}
 .realm-overview{gap:7px;grid-template-columns:minmax(0,1fr) minmax(170px,27%);margin-bottom:10px}
 .realm-overview .realm-region{min-height:220px;padding:8px 4px 15px;gap:5px}
 .realm-overview .realm-place{font-size:10px;text-align:center}
 .realm-overview .realm-node{gap:5px}.realm-overview .realm-label strong{font-size:10px}
 .realm-overview .realm-label small{font-size:8px}.realm-region:before{bottom:78px}
 .realm-feature-art{min-height:64px}.realm-feature-copy{padding:6px 7px;gap:5px}.realm-feature-copy h2{font-size:14px}.realm-feature-reward img{width:30px}.realm-feature-reward strong{font-size:10px}.realm-feature-copy .btn{min-height:31px;font-size:10px}
 .result-modal .chapter-victory{padding:7px;margin:7px 0}.victory-reward-art{width:45px;transform:none}
}
@media(max-width:550px) and (orientation:portrait){.realm-overview{grid-template-columns:1fr}.game-hub{grid-template-columns:1fr;height:auto;grid-template-rows:auto}.hub-profile,.hub-title,.hub-mission,.hub-play,.hub-modes{grid-column:1;grid-row:auto}.game-hub::before{inset:0}.hub-title h1{font-size:25px}}
@media(prefers-reduced-motion:reduce){.victory-reward-art{transform:none}}

/* Original carved arena assets. Layout and hit targets remain in the screen plane. */
.duel .arena[data-realm="cinder"]{background:linear-gradient(#060d1733,#060d1766),url("./assets/boards/cinder.svg") center/100% 100% no-repeat!important}
.duel .arena[data-realm="grove"]{background:linear-gradient(#060d1733,#060d1766),url("./assets/boards/grove.svg") center/100% 100% no-repeat!important}
.duel .arena[data-realm="tide"]{background:linear-gradient(#060d1733,#060d1766),url("./assets/boards/tide.svg") center/100% 100% no-repeat!important}
.duel .arena[data-realm="dawn"]{background:linear-gradient(#060d1733,#060d1766),url("./assets/boards/dawn.svg") center/100% 100% no-repeat!important}
.duel .arena[data-realm="umbra"]{background:linear-gradient(#060d1733,#060d1766),url("./assets/boards/umbra.svg") center/100% 100% no-repeat!important}
.duel .arena{border-radius:2px;outline:3px ridge #76674c;outline-offset:-5px}.duel .arena-lane{background:transparent}.duel .arena-lane .empty-slot{border:1px solid #bbaa7744;box-shadow:inset 0 0 12px #0007;background:#09121c22}.duel .rift-status{background:#08131ce8;border:1px solid #bda36c;box-shadow:0 3px 15px #0009}.duel .hero-crest{outline:2px solid #7f6a48;outline-offset:3px}.duel .board-unit .tcg-card{box-shadow:0 7px 8px #000b,inset 0 0 0 2px #c2a66d55}.duel .arena-hint{background:#06101bcc;padding:3px 8px;border-radius:2px}

/* Event particles sit above the scene and never intercept targets. */
.realm-particle{position:fixed;z-index:98;width:9px;height:16px;background:var(--particle-color);pointer-events:none;box-shadow:0 0 9px var(--particle-color);border-radius:50% 0}
.particle-cinder{width:7px;height:18px;border-radius:60% 5% 50% 20%;background:linear-gradient(#ffe9aa,var(--particle-color),#a92c18)}
.particle-grove{width:9px;height:16px;border-radius:90% 0 90% 0;border:1px solid #c5f7c7}
.particle-tide{width:7px;height:19px;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%);background:linear-gradient(#fff,#81ceec)}
.particle-dawn{width:15px;height:15px;clip-path:polygon(50% 0,60% 40%,100% 50%,60% 60%,50% 100%,40% 60%,0 50%,40% 40%)}
.particle-umbra{width:18px;height:18px;border-radius:50%;background:radial-gradient(circle,#160f28 25%,var(--particle-color) 60%,transparent 75%);box-shadow:none}
.particle-heal{border-radius:50%;width:8px;height:8px}
@media(prefers-reduced-motion:reduce){.realm-particle{display:none}}

/* Furnace R1: original environment, readable screen-plane controls. */
.duel .arena[data-realm="cinder"]{background:linear-gradient(#080b1222,#080b1233),url('./assets/boards/furnace-cinematic-r1.webp') center/100% 100% no-repeat!important;box-shadow:inset 0 0 0 2px #bc8c5644,inset 0 0 24px #090e18}
.duel .arena[data-realm="cinder"] .arena-lane .empty-slot{background:#09101b20;border-color:#d9ab6540;box-shadow:inset 0 0 15px #080d1633}

/* Wild Coast R1: distinct painted environments for acts II and III. Keep all hitboxes and game state. */
.duel .arena[data-realm="grove"]{
 background:linear-gradient(180deg,#07191155,#08160d22 46%,#07141a66),url('./assets/boards/grove-cinematic-r1.jpg') center 64%/cover no-repeat!important;
 border-color:#8aa46f;box-shadow:inset 0 0 0 2px #a4bd7344,inset 0 0 28px #06140c99;
}
.duel .arena[data-realm="tide"]{
 background:linear-gradient(180deg,#07172444,#071c2c22 46%,#05121e66),url('./assets/boards/tide-cinematic-r1.jpg') center 68%/cover no-repeat!important;
 border-color:#8ab4bc;box-shadow:inset 0 0 0 2px #81bcc144,inset 0 0 28px #05111d99;
}
.duel .arena[data-realm="grove"] .arena-lane .empty-slot{background:#07130d20;border-color:#bed5a24d;box-shadow:inset 0 0 10px #071b1066}
.duel .arena[data-realm="tide"] .arena-lane .empty-slot{background:#07172320;border-color:#aad4dd4d;box-shadow:inset 0 0 10px #051b2a66}
.duel .arena[data-realm="grove"] .rift-status{border-color:#b2d092;box-shadow:0 0 12px #77c98926,0 3px 12px #0009}
.duel .arena[data-realm="tide"] .rift-status{border-color:#9acddd;box-shadow:0 0 12px #73d7ee26,0 3px 12px #0009}
/* Reuse the location art in the campaign itself, tying the route to the actual battle. */
.realm-region.realm-grove{
 background:linear-gradient(0deg,#06121fe8,transparent 62%,#08171466),url('./assets/boards/grove-cinematic-r1.jpg') center 38%/cover!important;
}
.realm-region.realm-tide{
 background:linear-gradient(0deg,#06121fe8,transparent 62%,#08172466),url('./assets/boards/tide-cinematic-r1.jpg') center 38%/cover!important;
}
.realm-region.realm-cinder{
 background:linear-gradient(0deg,#06121fe8,transparent 62%,#1c0d0866),url('./assets/boards/furnace-cinematic-r1.webp') center/cover!important;
}
@media(orientation:landscape) and (max-height:600px){
 .duel .arena[data-realm="grove"]{background-position:center 66%!important}
 .duel .arena[data-realm="tide"]{background-position:center 70%!important}
}

/* Celestial Shadow R1: distinct original vector environments; no changes to combat layout or event logic. */
.duel .arena[data-realm="dawn"]{--arena-accent:#e9c675;background:linear-gradient(180deg,#09121c19,#07111c22 50%,#07111c55),url('./assets/boards/dawn-sanctuary-r1.svg') center 66%/cover no-repeat!important;border-color:#d9bc83;box-shadow:inset 0 0 0 2px #e9c67555,inset 0 0 28px #241b1088}
.duel .arena[data-realm="umbra"]{--arena-accent:#b595e7;background:linear-gradient(180deg,#0b0b1922,#120b2422 50%,#09081755),url('./assets/boards/umbra-abyss-r1.svg') center 66%/cover no-repeat!important;border-color:#a48ac9;box-shadow:inset 0 0 0 2px #b595e755,inset 0 0 28px #10091c99}
.duel .arena[data-realm="cinder"]{--arena-accent:#ef9664}
.duel .arena[data-realm="grove"]{--arena-accent:#9edc9b}
.duel .arena[data-realm="tide"]{--arena-accent:#8dd6e9}
.duel .arena[data-realm="dawn"] .arena-lane .empty-slot,.duel .arena[data-realm="umbra"] .arena-lane .empty-slot{background:#080e1830;border-color:color-mix(in srgb,var(--arena-accent) 35%,transparent);box-shadow:inset 0 0 12px #03070d77}
.duel .arena[data-realm] .rift-status{border-color:color-mix(in srgb,var(--arena-accent) 72%,#152031);box-shadow:0 0 12px color-mix(in srgb,var(--arena-accent) 22%,transparent),0 3px 12px #0009}
.duel .arena[data-realm] .hero-crest{outline-color:color-mix(in srgb,var(--arena-accent) 55%,#312d25);box-shadow:0 0 0 2px #091522,0 0 14px color-mix(in srgb,var(--arena-accent) 35%,transparent)}
.duel .arena[data-realm] .arena-lane .board-unit.combat-state-ready .tcg-card{border-color:#a5f5c5;box-shadow:0 0 0 1px #4eab83,0 0 12px #38d3a57a,0 5px 9px #000c}
.duel .arena[data-realm] .arena-lane .board-unit.combat-state-attacker .tcg-card,.duel .arena[data-realm] .arena-lane .board-unit.chosen-target .tcg-card{border-color:#ffe1a1;box-shadow:0 0 0 1px #c58b3c,0 0 15px #f3bd6488,0 5px 9px #000c}
.duel .arena[data-realm] .arena-hint{border:1px solid #b1a08050;background:#06101cec}
/* Subtle metal inlays on the interface, preserving buttons' real size and focus outlines. */
.duel .selected-preview,.duel .combat-dock{box-shadow:inset 0 0 0 2px #0b1420,inset 0 0 0 3px #c3a36a38,0 5px 14px #0008}
@media(orientation:landscape) and (max-height:600px){
 .duel .arena[data-realm="dawn"],.duel .arena[data-realm="umbra"]{background-position:center 66%!important}
 .duel .arena[data-realm] .arena-hint{padding:1px 5px}
}

/* Adaptive R1: separate wide, tablet, short-landscape and portrait menu layouts.
   Keep the combat geometry/event model and installed landscape PWA unchanged. */
.app-shell:not(.in-duel) .content{width:100%;min-width:0}
.library-page,.collection-layout,.deck-layout,.library-scroll,.collection-inspector,.deck-sidebar,.pack-layout>*{min-width:0}
.library-page .library-filters{flex-wrap:wrap}
.library-page .library-filters input{min-width:120px}
.library-page .library-filters label{white-space:nowrap}
.library-page .filters{scrollbar-width:thin;overscroll-behavior-x:contain}
.library-page .filter{flex-shrink:0}
.deck-sidebar .deck-editor-heading input,.deck-sidebar .deck-editor-heading select{min-width:0}
.deck-sidebar .deck-save{flex:none}
.deck-sidebar .deck-line span{min-width:0;overflow-wrap:anywhere}
.deck-sidebar .deck-list{overscroll-behavior:contain}
.duel .duel-rail,.duel .selected-preview,.duel .combat-dock{min-width:0}
.duel .arena-lane{min-width:0}
.duel .dock-actions .btn{white-space:normal}
.duel .hand-view-button{flex-shrink:0}
@media (orientation:landscape) and (min-width:1200px) and (min-height:650px){
 .app-shell:not(.in-duel) .main{padding-left:0;height:calc(100dvh - 64px - env(safe-area-inset-bottom,0px))}
 .app-shell:not(.in-duel) .mobile-nav{inset:auto 0 0 0;width:100%;height:calc(64px + env(safe-area-inset-bottom,0px));padding:5px max(12px,env(safe-area-inset-right,0px)) calc(5px + env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px));flex-direction:row;align-items:center;justify-content:center;gap:8px;border:0;border-top:1px solid #c7a66d;background:linear-gradient(#172736,#08121e);box-shadow:0 -5px 28px #0009}
 .app-shell:not(.in-duel) .mobile-nav .nav-btn{flex:1 1 0;max-width:208px;min-height:48px;flex-direction:row;gap:8px;font-size:12px;border:1px solid #bba07244;border-radius:4px}
 .app-shell:not(.in-duel) .mobile-nav .nav-btn.active{box-shadow:inset 0 0 0 1px #d6ba80,0 0 12px #44c5cb3d}
 .app-shell:not(.in-duel) .content{max-width:1880px;padding:12px 24px 14px;min-height:100%}
 .game-hub{min-height:calc(100dvh - 135px - env(safe-area-inset-bottom,0px));height:auto;grid-template-columns:minmax(0,1fr) minmax(320px,34%);gap:18px 30px;padding:26px 34px}
 .hub-title .sw-hub-signature img{width:min(410px,100%)}
 .hub-mission{padding:22px}.hub-play>.btn{min-height:60px}.hub-modes .btn{min-height:44px}
 .library-page{height:calc(100dvh - 135px - env(safe-area-inset-bottom,0px))}
 .collection-layout{grid-template-columns:minmax(0,1fr) clamp(280px,25vw,390px)}
 .deck-layout{grid-template-columns:minmax(0,1fr) clamp(310px,27vw,420px)}
 .library-scroll.card-grid{grid-template-columns:repeat(auto-fill,minmax(clamp(160px,12vw,204px),1fr));gap:12px}
 .library-scroll.card-grid .card-wrap{max-width:none}
 .library-scroll.card-grid .tcg-card{min-height:0;aspect-ratio:2/3}
 .library-scroll.card-grid .card-rule{display:-webkit-box;-webkit-line-clamp:2;min-height:2.8em;max-height:2.8em}
 .collection-inspector>.tcg-card{width:min(100%,240px)}
 .pack-layout{grid-template-columns:minmax(0,1fr) clamp(290px,25vw,390px)}
 .pack-stage{min-height:calc(100dvh - 220px)}
 .realm-overview .realm-region{min-height:clamp(280px,41vh,460px)}
 .duel{--rail:clamp(250px,21vw,355px);grid-template-rows:40px minmax(0,1fr) clamp(130px,20vh,215px)}
 .duel .arena{padding-left:clamp(100px,8vw,145px)}
 .duel .arena-head{width:clamp(83px,7vw,120px)}
 .duel .arena-lane{gap:clamp(8px,1.4vw,24px)}
 .duel .arena-hand .tcg-card{min-width:0;width:auto;flex:0 0 auto;aspect-ratio:2/3}
 .duel .dock-actions .btn{min-height:44px}
}
@media (orientation:landscape) and (min-height:601px) and (max-width:1199px){
 .app-shell:not(.in-duel) .mobile-nav{gap:7px}
 .app-shell:not(.in-duel) .mobile-nav .nav-btn{min-height:48px;font-size:10px}
 .game-hub{grid-template-columns:minmax(0,1fr) minmax(240px,37%);padding:16px;gap:12px}
 .collection-layout{grid-template-columns:minmax(0,1fr) minmax(220px,29%)}
 .deck-layout{grid-template-columns:minmax(0,1fr) minmax(240px,33%)}
 .library-scroll.card-grid{grid-template-columns:repeat(auto-fill,minmax(144px,1fr));gap:10px}
 .library-scroll.card-grid .tcg-card{min-height:220px}
 .library-scroll.card-grid .card-wrap{max-width:none}
 .library-scroll.card-grid .card-rule{display:none}
 .library-scroll.card-grid .card-bottom h4{font-size:13px}
 .pack-layout{grid-template-columns:minmax(0,1fr) 240px}
 .duel{--rail:clamp(200px,25vw,285px);grid-template-rows:36px minmax(0,1fr) clamp(112px,18vh,155px)}
 .duel .arena{padding-left:79px;padding-right:7px}
 .duel .arena-head{width:65px}
 .duel .arena-lane{gap:8px}
 .duel .arena-hand .tcg-card{min-width:0}
}
@media (orientation:landscape) and (max-height:600px){
 .app-shell:not(.in-duel) .main{scrollbar-width:thin}
 .library-page{height:auto;min-height:calc(100dvh - 48px)}
 .collection-layout,.deck-layout{min-height:220px;flex:1 0 auto;height:calc(100dvh - 142px)}
 .collection-layout{grid-template-columns:minmax(0,1fr) clamp(155px,29vw,230px)}
 .deck-layout{grid-template-columns:minmax(0,1fr) clamp(175px,31vw,275px)}
 .library-page .library-filters{gap:4px}
 .library-page .library-filters input{min-width:100px}
 .library-page .library-filters select{max-width:100%}
 .deck-layout .deck-sidebar{overflow:auto}
 .deck-sidebar .deck-list{min-height:48px}
 .deck-sidebar .deck-save .btn{min-height:36px;white-space:normal}
 .library-scroll.card-grid{grid-template-columns:repeat(auto-fill,minmax(122px,1fr));gap:8px}
 .library-scroll.card-grid .tcg-card{height:200px;min-height:200px}
 .library-scroll.card-grid .card-rule{display:none}
 .library-scroll.card-grid .card-wrap{max-width:none}
 .library-scroll.card-grid .card-bottom h4{font-size:12px;min-height:2.4em}
 .collection-inspector{padding:8px}
 .collection-inspector .btn{min-height:36px}
 .game-hub{height:auto;min-height:calc(100dvh - 48px);grid-template-rows:auto minmax(80px,1fr) auto}
 .hub-play>.btn{min-width:0;min-height:39px}
 .hub-modes .btn{white-space:normal}
 .pack-layout{height:auto;min-height:calc(100dvh - 90px);grid-template-columns:minmax(0,1fr) clamp(175px,30vw,235px)}
 .pack-stage{min-height:230px;height:auto}
 .duel .combat-dock .btn-primary{min-height:34px}
}
@media (orientation:landscape) and (max-height:420px) and (max-width:760px){
 .game-hub{grid-template-columns:minmax(0,1fr) minmax(195px,40%);padding:8px;gap:6px}
 .hub-profile{padding:3px 5px}.hub-profile h2{font-size:11px}
 .hub-mission{padding:6px}.hub-mission h3{font-size:14px}
 .hub-modes{gap:4px}
 .realm-overview{grid-template-columns:minmax(0,1fr) minmax(150px,31%)}
 .realm-overview .realm-label strong{overflow-wrap:anywhere}
 .duel{--rail:clamp(135px,23vw,165px)}
 .duel .arena{padding-left:56px;padding-right:4px}
 .duel .arena-head{width:48px}
 .duel .arena-lane{gap:4px;padding-right:2px}
 .duel .board-unit,.duel .empty-slot{min-width:0}
 .duel .duel-location{display:none}
 .duel .arena-hand .tcg-card{min-width:82px;width:82px;flex-basis:82px}
 .duel .tcg-card.mini .pt{padding:0;gap:2px}
 .duel .tcg-card.mini .pt b{min-width:16px;padding:1px 2px;font-size:10px}
 .duel .unit-information{right:-2px}
}
@media (orientation:portrait){
 /* Menus are usable in a normal vertical browser. Combat keeps landscape. */
 #rotate-device{display:none}
 body:has(.app-shell.in-duel) #rotate-device{display:flex;position:fixed;inset:0;z-index:9999;align-items:center;justify-content:center;text-align:center;padding:24px;color:#f4e7ce}
 body:has(.app-shell.in-duel) #rotate-device .rotate-card{width:min(92vw,390px);padding:24px;border:1px solid #c6a5687d;background:#09131ff6;border-radius:8px}
 body:has(.app-shell.in-duel) #rotate-device .rotate-icon{display:block;font-size:40px}
 .starter{height:100dvh;overflow-y:auto;display:block;padding:20px 12px 30px}
 .starter .faction-grid{grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:8px}
 .starter .faction-tile{height:clamp(138px,24vh,240px)}
 .starter .faction-name{font-size:19px}
 .app-shell:not(.in-duel) .main{padding-left:0;height:calc(100dvh - 60px - env(safe-area-inset-bottom,0px))}
 .app-shell:not(.in-duel) .mobile-nav{inset:auto 0 0;width:100%;height:calc(60px + env(safe-area-inset-bottom,0px));padding:4px 3px calc(4px + env(safe-area-inset-bottom,0px));flex-direction:row;gap:2px;justify-content:space-around;align-items:center;border:0;border-top:1px solid #c5a66d;background:#091523;box-shadow:0 -4px 15px #0008}
 .app-shell:not(.in-duel) .mobile-nav .nav-btn{flex:1 1 0;width:auto;min-width:0;min-height:49px;gap:3px;font-size:clamp(8px,2vw,12px);padding:3px 1px}
 .app-shell:not(.in-duel) .mobile-nav .nav-btn span{max-width:100%;overflow:hidden;text-overflow:ellipsis}
 .app-shell:not(.in-duel) .content{padding:12px;max-width:960px}
 .topbar{height:auto;min-height:34px;flex-wrap:wrap;gap:5px}
 .topbar .logo-text-sm{display:none}
 .game-hub{grid-template-columns:1fr;grid-template-rows:auto;min-height:0;height:auto;padding:15px;gap:14px}
 .game-hub::before{inset:9% 0 34%;opacity:.62}
 .hub-profile,.hub-title,.hub-mission,.hub-play,.hub-modes{grid-column:1;grid-row:auto;justify-self:stretch;max-width:none}
 .hub-title{min-height:clamp(180px,32vh,360px)}
 .hub-title h1{font-size:clamp(25px,6vw,42px)}
 .hub-title .sw-hub-signature img{width:min(270px,90%)}
 .hub-profile img{width:42px;height:42px}
 .hub-mission{padding:15px}
 .hub-play>.btn{min-height:48px;min-width:0}
 .hub-modes .btn{min-height:44px}
 .realm-overview{grid-template-columns:1fr}
 .realm-overview .realm-region{min-height:190px;padding:8px 4px 14px}
 .realm-overview .realm-label strong{font-size:11px}
 .realm-feature-art{min-height:125px}
 .chapter-hero{padding:12px}
 .chapter-map{grid-template-columns:1fr}
 .library-page{height:auto;min-height:0}
 .collection-layout,.deck-layout{grid-template-columns:1fr;height:auto;flex:none}
 .library-scroll.card-grid{max-height:49dvh;min-height:220px;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}
 .library-scroll.card-grid .card-wrap{max-width:none}
 .library-scroll.card-grid .tcg-card{min-height:0;aspect-ratio:2/3}
 .library-scroll.card-grid .card-bottom h4{font-size:12px;min-height:2.4em}
 .library-scroll.card-grid .card-rule{display:none}
 .library-scroll.card-grid .card-type{font-size:8px}
 .library-scroll.card-grid .card-pt{gap:3px;flex-wrap:nowrap}
 .collection-inspector{display:grid;grid-template-columns:minmax(90px,31%) minmax(0,1fr);align-items:start;gap:10px;padding:10px}
 .collection-inspector>.tcg-card{display:block;width:100%;min-width:0}
 .collection-inspector>.tcg-card .card-rule{display:none}
 .collection-inspector>.tcg-card .card-bottom h4{font-size:12px}
 .collection-inspector p{font-size:13px}
 .collection-inspector .btn{min-height:44px;white-space:normal}
 .deck-layout .deck-sidebar{height:auto;overflow:visible}
 .deck-sidebar .deck-list{max-height:230px}
 .deck-sidebar .deck-save .btn{min-height:44px}
 .pack-layout{grid-template-columns:1fr;height:auto}
 .pack-stage{min-height:280px;height:auto}
 .reveal-grid{grid-template-columns:repeat(auto-fit,minmax(90px,1fr))}
 .modal-backdrop{padding:10px}
 .modal{max-height:calc(100dvh - 20px);padding:14px}
}
@media (orientation:portrait) and (max-width:550px){
 .realm-overview .realm-route{grid-template-columns:1fr}
 .realm-overview .realm-region{min-height:165px}
 .realm-overview .realm-region:before{display:none}
 .library-page .library-filters input{flex:1 0 100%}
 .library-page .library-filters label{flex:1 1 auto}
 .library-page .library-filters select{min-height:38px}
 .library-page .section-head{flex-wrap:wrap}
 .collection-inspector>.tcg-card .card-cost{width:23px;height:23px;font-size:13px}
 .collection-inspector>.tcg-card .pt b{min-width:19px;padding:2px;gap:2px}
}
@media (prefers-reduced-motion:reduce){#rotate-device .rotate-icon{animation:none}}

/* Pack shop uses a separate layout from the opening stage. */
.pack-shop-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.pack-shop-grid .pack-offer{min-width:0}
.pack-shop-grid .pack-offer-copy{min-width:0;overflow-wrap:anywhere}
.pack-shop-grid .pack-claim .btn{max-width:100%;white-space:normal}
@media (orientation:landscape) and (max-height:600px){
 .pack-shop-grid{grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:8px}
 .pack-shop-grid .pack-offer-art{min-height:92px;height:110px}
 .pack-shop-grid .pack-offer-copy{padding:9px}
}
@media (orientation:portrait){
 .pack-shop-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,235px),1fr))}
 .pack-shop-grid .pack-claim .btn{min-height:44px}
}

/* Home Cinematic R1 — one landscape, one title, one primary decision.
   Use existing original world and knight illustrations; no flattened UI. */
.app-shell:has(.home-cinematic) .topbar{display:none}
.app-shell:has(.home-cinematic) .content{max-width:none;min-height:100%;padding:clamp(6px,1vw,16px)}
.game-hub.home-cinematic{
 --home-gold:#ddbc7b;isolation:isolate;position:relative;overflow:hidden;
 width:100%;min-height:calc(100dvh - 28px);height:auto;
 display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,34%);
 grid-template-rows:auto minmax(85px,1fr) auto;gap:clamp(10px,1.5vw,24px);
 padding:clamp(14px,2.4vw,42px);border:1px solid #9b8053;border-radius:3px;
 background:linear-gradient(90deg,#08131d12 0%,#08131d05 43%,#07111c35 61%,#07111ce8 100%),url('./assets/art/world.webp?v=0111') center/cover no-repeat;
 box-shadow:inset 0 0 0 3px #bba06b2a,inset 0 0 60px #0007;
}
.game-hub.home-cinematic::before{
 content:"";position:absolute;inset:5% 42% 0 0;z-index:-1;pointer-events:none;
 background:url('./assets/art/knight.webp?v=0111') left 36%/auto 113% no-repeat;
 mask-image:linear-gradient(90deg,#000 0%,#000 52%,#000c 66%,transparent 96%);
 opacity:1;
}
.game-hub.home-cinematic::after{
 content:"";inset:0;position:absolute;z-index:-1;pointer-events:none;
 background:linear-gradient(180deg,#07101bb8,transparent 25%,transparent 60%,#07111cdd),linear-gradient(90deg,transparent 52%,#07111c8c 79%,#07111cdd);
}
.home-cinematic .hub-title{grid-column:1;grid-row:1;align-self:start;min-height:0;display:block;max-width:100%;position:relative;padding:0;margin:0;text-align:left}
.home-cinematic .home-brand-symbol{width:clamp(24px,3.3vw,52px);height:auto;margin:0 0 3px;filter:drop-shadow(0 0 10px #54dce699)}
.home-cinematic .hub-title h1{font-family:Cinzel,Georgia,serif;font-size:clamp(28px,5.1vw,86px);font-weight:700;letter-spacing:-.065em;line-height:.98;color:#f4dfad;margin:0;text-shadow:0 2px 0 #6c462c,0 4px 12px #000,0 0 28px #000c}
@supports (-webkit-background-clip:text){.home-cinematic .hub-title h1{background:linear-gradient(#fff8d8 8%,#dfc18b 46%,#a77b44 51%,#ffeac3 92%);-webkit-background-clip:text;background-clip:text;color:transparent;text-shadow:none;filter:drop-shadow(0 2px 3px #000) drop-shadow(0 5px 12px #000)}}
.home-cinematic .hub-title .home-subtitle{background:none;color:#f0dfc4;letter-spacing:.24em;font:600 clamp(9px,1.05vw,16px) Cinzel,Georgia,serif;margin:10px 0 0;padding:0;text-shadow:0 2px 5px #000}
.home-cinematic .hub-profile{grid-column:2;grid-row:1;justify-self:stretch;align-self:start;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:9px;align-items:center;padding:9px 10px;border:1px solid #a58a5a;border-radius:3px;background:linear-gradient(135deg,#263541ed,#08131eec);box-shadow:inset 0 0 0 2px #bca16b22,0 4px 16px #0008}
.home-cinematic .hub-profile img{width:clamp(34px,4vw,56px);height:auto;aspect-ratio:1;object-fit:cover;object-position:center 23%;border:2px solid #cfb680;border-radius:50%}
.home-player{min-width:0}
.home-player strong{display:block;font-size:clamp(11px,1.1vw,16px);line-height:1.2;color:#f5e8c9;overflow-wrap:anywhere}
.home-player span{display:block;font-size:10px;margin:4px 0 0}
.home-cinematic .home-player .progress-track{margin-top:5px;height:3px}
.home-resources{display:grid;gap:5px;align-content:center}
.home-resource{display:flex;gap:4px;align-items:center;justify-content:flex-start;min-width:0;padding:3px 5px;color:#f6d68a;border:1px solid #c9ad6f4f;border-radius:3px;background:#07111e}
.home-resource:last-child{color:#80d8ef}
.home-resource b{font-variant-numeric:tabular-nums;font-size:12px}
.home-cinematic .hub-mission{position:relative;isolation:isolate;display:flex;align-items:flex-end;grid-column:2;grid-row:2;justify-self:stretch;align-self:end;min-width:0;max-width:none;height:clamp(140px,29vh,310px);padding:0;overflow:hidden;border:1px solid #c5a66d;border-radius:4px;background:#0b1824;box-shadow:0 8px 25px #000c,inset 0 0 0 3px #c5a66d44}
.home-encounter-art{position:absolute;inset:0;z-index:-1;background:linear-gradient(0deg,#07111efc 0%,#07111e99 39%,transparent 74%),var(--hub-mission-art) center 28%/cover no-repeat}
.home-encounter-copy{width:100%;padding:13px 16px;border-top:1px solid #c5a66d55;background:linear-gradient(90deg,#08131ed9,#08131e25)}
.home-cinematic .hub-mission .eyebrow{color:#e6c994;font-size:10px;letter-spacing:.13em}
.home-cinematic .hub-mission h3{font-size:clamp(17px,2vw,33px);font-weight:600;line-height:1.1;margin:6px 0;color:#fff0ca;text-shadow:0 2px 5px #000}
.home-cinematic .hub-mission p{font-size:clamp(10px,.9vw,13px);margin:5px 0 0;line-height:1.3;color:#cad2d7}
.home-cinematic .hub-play{grid-column:2;grid-row:3;display:grid;grid-template-columns:minmax(0,1fr);align-items:center;gap:8px;align-self:end}
.home-cinematic .hub-play>.btn{width:100%;min-width:0;margin:0;white-space:normal;justify-content:center}
.home-cinematic .home-play-btn{position:relative;min-height:clamp(48px,7vh,72px);font:700 clamp(21px,2.6vw,37px) Cinzel,Georgia,serif;letter-spacing:.075em;color:#21160c;border:2px solid #f8db99;border-radius:3px;background:linear-gradient(#fff0ba,#e1b76c 48%,#a77433 52%,#d6ad65);box-shadow:inset 0 0 0 2px #67421f,inset 0 0 0 4px #f9e0a4,0 5px 18px #000b}
.home-cinematic .home-play-btn .ico{width:clamp(18px,2vw,30px);height:auto}
.home-cinematic .home-campaign-btn{min-height:40px;font:600 clamp(13px,1.2vw,19px) Cinzel,Georgia,serif;letter-spacing:.12em;border:1px solid #ba9d66;background:linear-gradient(#233443,#081522);color:#f5dfb0;box-shadow:inset 0 0 0 2px #bba16b22}
.home-deck-line{display:flex;justify-content:space-between;gap:6px;align-items:center;flex-wrap:wrap;color:#d4d9d9;font-size:11px}
.home-deck-line>span{color:var(--hub-affinity)}
.home-cinematic .difficulty-label{margin:0;color:#c6c9cb;font-size:9px}
.home-cinematic .difficulty-label select{min-height:26px;padding:3px 6px;font-size:11px}
.home-progress{grid-column:1;grid-row:3;align-self:end;justify-self:start;min-width:0;max-width:100%;padding:10px 14px;border-left:2px solid #bda06a;background:linear-gradient(90deg,#08121ce8,#08121c26);text-shadow:0 2px 5px #000}
.home-progress .eyebrow{color:#e8c991;font-size:10px}
.home-progress p{font-size:clamp(11px,1.1vw,16px);color:#e0e3df;margin:5px 0 8px}
.home-progress p span{color:#d9bb7c}
.home-act-seals{display:flex;gap:7px;align-items:center}
.home-act-seals i{display:grid;place-items:center;width:25px;height:25px;font:600 11px Georgia,serif;border:1px solid #bca06b;border-radius:50%;color:#e7d3ac;background:#0c1a26}
.home-act-seals i.cleared{border-color:#93dfb4;background:#154c42;color:#d4ffdf}
@media (orientation:landscape) and (min-width:1200px) and (min-height:650px){
 .game-hub.home-cinematic{min-height:calc(100dvh - 64px - env(safe-area-inset-bottom,0px) - 34px);grid-template-columns:minmax(0,1fr) minmax(340px,32%);}
}
@media (orientation:landscape) and (max-height:600px){
 .game-hub.home-cinematic{min-height:calc(100dvh - 16px);grid-template-columns:minmax(0,1fr) minmax(218px,39%);grid-template-rows:auto minmax(75px,1fr) auto;gap:7px 10px;padding:10px}
 .game-hub.home-cinematic::before{inset:7% 40% 0 0;background-size:auto 115%}
 .home-cinematic .hub-title h1{font-size:clamp(25px,4.5vw,43px)}
 .home-cinematic .home-brand-symbol{width:25px}
 .home-cinematic .hub-title .home-subtitle{font-size:9px;margin:5px 0 0;letter-spacing:.18em}
 .home-cinematic .hub-profile{padding:5px;gap:5px}
 .home-cinematic .hub-profile img{width:30px}
 .home-player strong{font-size:10px}
 .home-player span{font-size:8px}
 .home-resource{padding:2px 3px;font-size:9px}
 .home-resource b{font-size:10px}
 .home-resources{gap:3px}
 .home-cinematic .hub-mission{height:clamp(90px,31vh,155px)}
 .home-encounter-copy{padding:7px 8px}
 .home-cinematic .hub-mission .eyebrow{font-size:8px}
 .home-cinematic .hub-mission h3{font-size:clamp(14px,2vw,21px);margin:4px 0}
 .home-cinematic .hub-mission p{font-size:9px;margin:3px 0 0}
 .home-cinematic .hub-play{gap:5px}
 .home-cinematic .home-play-btn{min-height:40px;font-size:19px}
 .home-cinematic .home-campaign-btn{min-height:32px;font-size:12px}
 .home-deck-line{font-size:9px}
 .home-cinematic .difficulty-label select{min-height:24px;font-size:10px}
 .home-progress{padding:6px 8px}
 .home-progress .eyebrow{font-size:8px}
 .home-progress p{font-size:10px;margin:4px 0}
 .home-act-seals i{width:19px;height:19px;font-size:9px}
}
@media (orientation:portrait){
 .app-shell:has(.home-cinematic) .content{padding:6px}
 .game-hub.home-cinematic{min-height:calc(100dvh - 76px - env(safe-area-inset-bottom,0px));grid-template-columns:1fr;grid-template-rows:auto minmax(150px,1fr) auto auto auto;gap:10px;padding:13px;background-position:60% center}
 .game-hub.home-cinematic::before{inset:0 0 32% 0;background-size:auto 100%;background-position:left top;mask-image:linear-gradient(90deg,#000 0%,#000b 58%,transparent 98%);opacity:.85}
 .game-hub.home-cinematic::after{background:linear-gradient(180deg,#07101b66,transparent 25%,#07111c33 35%,#07111ce8 67%,#07111c); }
 .home-cinematic .hub-profile{grid-column:1;grid-row:1;grid-template-columns:auto 1fr auto;justify-self:stretch}
 .home-cinematic .hub-title{grid-column:1;grid-row:2;min-height:clamp(150px,28vh,300px);padding:10px 0;align-self:start}
 .home-cinematic .hub-title h1{font-size:clamp(30px,10vw,64px)}
 .home-cinematic .home-brand-symbol{width:34px}
 .home-cinematic .hub-title .home-subtitle{font-size:10px;margin-top:7px}
 .home-cinematic .hub-mission{grid-column:1;grid-row:3;height:clamp(120px,20vh,190px)}
 .home-cinematic .hub-play{grid-column:1;grid-row:4}
 .home-cinematic .home-play-btn{min-height:50px;font-size:25px}
 .home-cinematic .home-campaign-btn{min-height:42px;font-size:15px}
 .home-progress{grid-column:1;grid-row:5;justify-self:stretch;padding:7px 10px}
}
@media (max-width:760px) and (orientation:landscape) and (max-height:420px){
 .game-hub.home-cinematic{grid-template-columns:minmax(0,1fr) minmax(190px,42%);padding:7px;gap:5px 7px}
 .home-cinematic .hub-title h1{font-size:clamp(23px,4.4vw,32px)}
 .home-cinematic .hub-mission{height:clamp(85px,29vh,120px)}
 .home-cinematic .home-play-btn{min-height:38px;font-size:17px}
}

.home-cinematic .hub-title.sw-hub-signature{display:block;background:none;border:0;border-radius:0;box-shadow:none;padding:0;margin:0}

/* Relic Forge R1 — shared ornamental language, functional controls kept in place. */
:root{--relic-edge:#bc995c;--relic-light:#f3d9a5;--relic-deep:#08131f}
.app-shell:not(.in-duel) .main:not(:has(.home-cinematic)){
 background:linear-gradient(180deg,#07121ce8,#0a1825f7 40%,#08121dfc),url('./assets/art/world.webp?v=0111') center/cover fixed;
}
.app-shell:not(.in-duel) .section-head{
 border-bottom:1px solid #c2a46a66;padding:6px 0 9px;position:relative;gap:8px;
}
.app-shell:not(.in-duel) .section-head h2{font-family:Cinzel,Georgia,serif;letter-spacing:.045em;text-transform:uppercase;color:#f6dfaf}
.app-shell:not(.in-duel) .section-head .eyebrow{color:#c0a87b}
.library-page .library-filters,.library-page .filters{background:linear-gradient(180deg,#182a38,#0d1b29);border:1px solid #bca16b4d;border-radius:3px;padding:6px}
.library-page .filter{border-radius:2px;border-color:#bfa46d55}
.library-page .filter[data-filter="cinder"],.deck-page .filter[data-faction="cinder"]{--filter-color:#f59a71}
.library-page .filter[data-filter="grove"],.deck-page .filter[data-faction="grove"]{--filter-color:#90db8f}
.library-page .filter[data-filter="tide"],.deck-page .filter[data-faction="tide"]{--filter-color:#83d6ee}
.library-page .filter[data-filter="dawn"],.deck-page .filter[data-faction="dawn"]{--filter-color:#edce85}
.library-page .filter[data-filter="umbra"],.deck-page .filter[data-faction="umbra"]{--filter-color:#c3a1ec}
.library-page .filter[data-faction],.library-page .filter:is([data-filter="cinder"],[data-filter="grove"],[data-filter="tide"],[data-filter="dawn"],[data-filter="umbra"]){color:var(--filter-color);border-color:color-mix(in srgb,var(--filter-color) 50%,#1a2731)}
.library-page .filter.active:is([data-faction],[data-filter="cinder"],[data-filter="grove"],[data-filter="tide"],[data-filter="dawn"],[data-filter="umbra"]){background:color-mix(in srgb,var(--filter-color) 18%,#0a1724)!important;border-color:var(--filter-color);box-shadow:inset 0 0 8px #0006}
.library-page .tcg-card,.modal-card>.tcg-card,.inspect-layout>.tcg-card,.pack-stage .tcg-card{border-radius:5px;border:2px solid #c5a36b;background:#121c27}
.library-page .tcg-card::before,.modal-card>.tcg-card::before,.inspect-layout>.tcg-card::before,.pack-stage .tcg-card::before{
 inset:1px;border:0;border-radius:3px;pointer-events:none;
 background:url('./assets/ui/relic-frame-r1.svg') center/100% 100% no-repeat;
 box-shadow:none;z-index:4;
}
.library-page .tcg-card .card-bottom,.modal-card>.tcg-card .card-bottom,.inspect-layout>.tcg-card .card-bottom,.pack-stage .tcg-card .card-bottom{
 background:linear-gradient(105deg,#dbc49b,#f6e7c9 32%,#f3e6cc 68%,#c9a875);border-top:2px solid #a07c45;
}
.library-page .tcg-card .card-bottom h4,.modal-card>.tcg-card .card-bottom h4,.inspect-layout>.tcg-card .card-bottom h4,.pack-stage .tcg-card .card-bottom h4{color:#291c14;text-shadow:none}
.library-page .tcg-card :is(.card-type,.card-rule,.rarity-glyph),.modal-card>.tcg-card :is(.card-type,.card-rule,.rarity-glyph),.inspect-layout>.tcg-card :is(.card-type,.card-rule,.rarity-glyph),.pack-stage .tcg-card :is(.card-type,.card-rule,.rarity-glyph){color:#493321}
.library-page .tcg-card .pt b,.modal-card>.tcg-card .pt b,.inspect-layout>.tcg-card .pt b,.pack-stage .tcg-card .pt b{background:linear-gradient(#714a2b,#352315);color:#fff0cf;border:1px solid #9e7540}
.library-page .tcg-card .pt b:last-child,.modal-card>.tcg-card .pt b:last-child,.inspect-layout>.tcg-card .pt b:last-child,.pack-stage .tcg-card .pt b:last-child{background:linear-gradient(#42684a,#224333);border-color:#6d8b55;color:#f2ffdf}
.library-page .tcg-card .pt b::before,.pack-stage .tcg-card .pt b::before{color:inherit}
.library-page .rarity-rare,.pack-stage .rarity-rare{box-shadow:0 0 0 1px #7ccbe4,0 0 13px #4ea9d247,0 6px 14px #000b}
.library-page .rarity-epic,.pack-stage .rarity-epic{box-shadow:0 0 0 1px #cb9ce7,0 0 13px #9862d952,0 6px 14px #000b}
.library-page .rarity-mythic,.pack-stage .rarity-mythic{box-shadow:0 0 0 1px #ffdb90,0 0 17px #eaa34466,0 6px 14px #000b}
.library-page .card-qty{color:#f5e2b8;background:#0a1724;border:1px solid #bca16b;z-index:6;font-variant-numeric:tabular-nums}
.collection-inspector,.deck-sidebar{border-radius:3px;background:linear-gradient(150deg,#233340,#091827 45%,#0a1420);box-shadow:inset 0 0 0 3px #0b1421,inset 0 0 0 4px #c6a86d44,0 6px 18px #0009}
.collection-inspector h3{font-family:Cinzel,Georgia,serif;color:#f5dfad}
.deck-sidebar .mana-curve{border-radius:2px;background:linear-gradient(#0b2030,#07131f);border-color:#b39b625c}
.deck-sidebar .mana-curve i{background:linear-gradient(#92f1f0,#4195a6 60%,#235d6c);box-shadow:0 0 7px #6cdbdf40}
.deck-sidebar .deck-line{border-bottom:1px solid #b59b642c}
.deck-sidebar .deck-line b{display:grid;place-items:center;min-width:22px;height:22px;background:#122d40;border:1px solid #bda778;border-radius:50%;color:#f4e2b8;flex:none}
.chapter-hero{border-radius:3px;box-shadow:inset 0 0 0 3px #b99a5a26}
.realm-overview .realm-route{border-radius:3px;box-shadow:inset 0 0 0 3px #bd9b5d44,0 5px 22px #000b}
.realm-overview .realm-region{isolation:isolate}
.realm-overview .realm-region::before{z-index:0;opacity:.85}
.realm-overview .realm-node{z-index:1}
.realm-overview .realm-label{border-radius:2px;background:linear-gradient(#142a35ed,#081421f5)}
.realm-overview .realm-feature{border-radius:3px;box-shadow:inset 0 0 0 3px #b99a5a35,0 8px 24px #000a}
.realm-feature-copy .eyebrow{color:#e4c68c}
.realm-feature .realm-feature-art{background-position:center 21%}
.chapter-card{border-radius:3px}
.chapter-card .chapter-reward{border:1px solid #b7a27445;background:#0b1724}
.pack-shop-grid .pack-offer{position:relative;border-radius:4px;border:1px solid #bea16b;background:linear-gradient(145deg,#223443,#0b1723 60%);overflow:hidden}
.pack-shop-grid .pack-offer-art{position:relative;isolation:isolate;border-bottom:1px solid #c6a66a;background-position:center 30%}
.pack-shop-grid .pack-offer-art::after{content:"";position:absolute;inset:5px;pointer-events:none;border:1px solid #ddbd7e88;box-shadow:inset 0 0 0 2px #07121c80}
.pack-shop-grid .pack-emblem{filter:drop-shadow(0 0 12px #f9d59788)}
.pack-shop-grid .pack-offer h2{font-family:Cinzel,Georgia,serif;color:#f2d9a4}
.pack-shop-grid .pack-claim .btn{border-radius:3px}
.pack-stage{border:1px solid #bfa168;background:radial-gradient(ellipse at center,#36747b3b,transparent 55%),linear-gradient(#0b1422b0,#081523dd),url('./assets/art/world.webp?v=0111') center/cover}
.pack-stage .booster{border:2px solid #e2be78;box-shadow:inset 0 0 0 4px #ad854a,0 0 38px #d5ab5f55,0 16px 30px #000b}
.pack-stage .card-back{border:2px solid #bd9f69;border-radius:4px;background:radial-gradient(ellipse at center,#2c6578,#0e2133 40%,#08121e 75%);box-shadow:inset 0 0 0 3px #152533,inset 0 0 0 4px #bca16b,0 7px 15px #000b}
.pack-stage .card-back::before{content:"";position:absolute;inset:2px;background:url('./assets/ui/relic-frame-r1.svg') center/100% 100% no-repeat;pointer-events:none}
.pack-stage .card-back>span{color:#bdedff;text-shadow:0 0 18px #53d7ed}
.pack-stage .card-back.glow-mythic{border-color:#ffdf9e;box-shadow:0 0 20px #edb96366,inset 0 0 0 3px #291d42}
.pack-stage .card-back.glow-rare{border-color:#83d4ec}
.modal.result-modal{width:min(96vw,1000px);max-height:calc(100dvh - 24px);background:linear-gradient(90deg,#07131aca,#07131ce0),var(--result-art) center 32%/cover;padding:clamp(14px,2.2vw,30px);border:1px solid #d5b471}
.result-modal.result-won{background:radial-gradient(ellipse at 25% 35%,#c98a3133,transparent 58%),linear-gradient(90deg,#07131a99,#07131cea),var(--result-art) center 32%/cover}
.result-heading{margin:0 0 12px}
.result-modal .result-heading h2{font-family:Cinzel,Georgia,serif;font-size:clamp(30px,4.4vw,60px)!important;letter-spacing:.09em;margin:5px 0;text-shadow:0 0 26px #c9954366,0 3px 5px #000}
.result-heading p{margin:6px auto;max-width:680px}
.result-treasury{display:grid;grid-template-columns:1fr;gap:12px;align-items:stretch;margin:0 0 12px}
.result-treasury.has-reward{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr)}
.result-modal .chapter-victory{margin:0;min-width:0;padding:14px;display:flex;align-items:center;border:1px solid #d3ad65;background:radial-gradient(ellipse at 24% 50%,#b47d3c44,transparent 70%),#0b1824f2}
.result-modal .victory-reward-art{width:clamp(67px,10vw,140px);flex:none;border:2px solid #f0c779}
.result-modal .chapter-victory strong{font-family:Cinzel,Georgia,serif;color:#ffebbd;line-height:1.25;overflow-wrap:anywhere}
.result-payout{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:0;gap:7px;align-items:stretch}
.result-modal .result-payout .stat{min-width:0;padding:10px 6px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px}
.result-token{font-size:24px;color:#efc981;line-height:1;display:grid;place-items:center}
.result-token .ico{width:24px;height:24px}
.result-payout .stat:nth-child(2) .result-token{color:#82d8fa}
.result-modal .result-payout .stat strong{font-size:clamp(18px,2.5vw,31px);color:#ffe4ae}
.result-journey{display:grid;gap:8px}
.result-journey .chapter-next,.result-journey .forge-medal{margin:0;padding:7px 10px;border:1px solid #bfa36b55;background:#081420d9}
.result-actions{justify-content:center;gap:8px}
.result-actions .btn{min-height:42px;white-space:normal}
@media(orientation:landscape) and (max-height:600px){
 .library-page .section-head{padding:3px 0 5px;margin-bottom:4px}
 .library-page .library-filters,.library-page .filters{padding:3px}
 .library-page .filters{margin:3px 0}
 .library-page .tcg-card::before{opacity:.9}
 .result-modal{padding:10px}
 .result-heading{margin:0 0 6px}
 .result-modal .result-heading h2{font-size:28px!important;margin:2px 0}
 .result-heading p{font-size:11px;margin:3px auto}
 .result-treasury{gap:7px;margin-bottom:6px}
 .result-modal .chapter-victory{padding:7px;gap:8px}
 .result-modal .victory-reward-art{width:55px;transform:none}
 .result-modal .result-payout .stat{padding:6px 4px;gap:2px}
 .result-token .ico{width:17px;height:17px}
 .result-modal .result-payout .stat strong{font-size:18px}
 .result-journey{gap:5px}
 .result-actions .btn{min-height:34px;font-size:10px}
 .result-journey .chapter-next,.result-journey .forge-medal{padding:4px;font-size:10px}
}
@media(orientation:portrait){
 .result-treasury.has-reward{grid-template-columns:1fr}
 .result-modal .victory-reward-art{width:90px}
 .result-actions .btn{flex:1 1 100%;min-height:44px}
}
@media(prefers-reduced-motion:no-preference){
 .result-modal.result-won .victory-reward-art{animation:relic-arrive .55s ease-out both}
 @keyframes relic-arrive{from{opacity:.2;transform:translateY(10px) scale(.92)}to{opacity:1;transform:translateY(0) scale(1)}}
}
