/* Expedition diorama: ivory suit shells, navy base platforms and colored status lights. */
.loot-dialog{width:1020px;max-height:95vh;overflow:auto;padding:26px 38px 28px;background:radial-gradient(ellipse at 50% 5%,#263843ed,#0b1522f5 72%);border:1px solid #a4c7d240;box-shadow:0 35px 150px #000b,inset 0 1px #d0f7ed18;border-radius:22px}
.loot-dialog>p{text-align:center;margin:0 0 14px;color:#e3f0ed;font-size:17px;letter-spacing:.5px}
.loot-dialog .cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:26px;margin:0;padding:18px 3px 20px;perspective:1100px}
.loot-dialog .choice{--ink:#7ce9bc;--wash:#245f52;position:relative;isolation:isolate;display:block;aspect-ratio:300/460;min-height:0;padding:0;border:0;border-radius:25px;background:radial-gradient(ellipse at 50% 25%,var(--wash),#101c26 63%);box-shadow:0 18px 25px #0009;transform-origin:center 85%;transition:transform .22s,box-shadow .22s;overflow:visible;color:#e3f8f1;text-align:center}
.loot-dialog .choice[data-reward="armor"]{--ink:#92d6ff;--wash:#244971}
.loot-dialog .choice[data-reward="skill"]{--ink:#cc9fff;--wash:#4b3268}
.loot-dialog .choice[data-reward="hero"]{--ink:#ffd080;--wash:#614928}
.loot-dialog .choice:before{content:"";position:absolute;inset:0;background:none;z-index:4;pointer-events:none}
.loot-dialog .choice:after{content:"";position:absolute;inset:5px;border-radius:21px;background:linear-gradient(115deg,transparent 30%,#dffff518 43%,transparent 56%);opacity:0;z-index:5;pointer-events:none;transition:opacity .25s}
.loot-dialog .choice:hover,.loot-dialog .choice:focus-visible{transform:translateY(-9px) rotateX(2deg);background:radial-gradient(ellipse at 50% 25%,var(--wash),#101c26 63%);box-shadow:0 28px 38px #000b,0 0 28px color-mix(in srgb,var(--ink) 22%,transparent)}
.loot-dialog .choice:hover:after{opacity:1}
.loot-dialog .choice:focus-visible{outline:2px solid var(--ink);outline-offset:6px}
.loot-dialog .loot-art{position:absolute;left:10%;top:12%;width:80%;height:46%;display:block;border-radius:15px 15px 7px 7px;overflow:hidden;background:var(--wash);border:2px solid #637f8d;box-shadow:0 0 0 3px #0b1d2b,0 0 0 4px #b6d8d344,inset 0 0 20px #0009}
.loot-dialog .loot-art:after{content:"";position:absolute;inset:0;border-radius:inherit;box-shadow:inset 0 0 22px #020c1877;background:linear-gradient(0deg,#0b172b77,transparent 35%);pointer-events:none}
.loot-dialog .loot-art img{display:block;width:100%;height:100%;object-fit:cover;object-position:center;transition:transform .45s;filter:none}
.loot-dialog .choice:hover .loot-art img{transform:scale(1.055)}
.loot-dialog .choice .card-title{position:absolute;left:9%;top:58.7%;width:82%;height:8%;margin:0;display:flex;align-items:center;justify-content:center;font:650 clamp(17px,1.6vw,22px)/1.1 system-ui,sans-serif;letter-spacing:-.4px;color:#ebfaf6;text-shadow:0 2px 2px #000;z-index:5}
.loot-dialog .choice .card-description{position:absolute;left:14%;top:69%;width:72%;height:8%;display:flex;align-items:center;justify-content:center;color:#d2d8d4;font-size:12px;line-height:1.4;letter-spacing:.05px}
.loot-dialog .choice .pick{position:absolute;left:14%;bottom:8%;width:72%;height:8.7%;margin:0;padding:0;display:flex;align-items:center;justify-content:center;border-radius:7px;border:1px solid #719c99;background:linear-gradient(#315960,#173941);box-shadow:inset 0 1px #dffff530,0 3px 8px #0006;color:#dbfff2;font-size:12px;font-weight:650;letter-spacing:.5px;z-index:5}
.loot-dialog .choice:hover .pick{background:linear-gradient(#39877d,#20564f);border-color:var(--ink);color:#fff}
.loot-dialog .card-jewel{position:absolute;top:3.3%;left:calc(50% - 16px);width:32px;height:3px;z-index:6;font-size:0;background:var(--ink);border-radius:3px;box-shadow:0 0 10px var(--ink);pointer-events:none}
.loot-dialog .card-cost{position:absolute;left:-2%;top:7%;width:50px;height:56px;display:flex;align-items:center;justify-content:center;flex-direction:column;border:3px solid #b3dbd6;border-radius:14px;background:radial-gradient(circle at 30% 20%,#9bf7df,#237b83 50%,#15293f 90%);color:white;font:750 26px/1 system-ui,sans-serif;text-shadow:0 2px 3px #082124;box-shadow:0 0 0 2px #173544,0 6px 10px #0009,inset 0 0 0 2px #ffffff35;z-index:7}
.loot-dialog .card-cost span{font-size:10px;line-height:13px;color:#c7ffeb}
.loot-dialog .choice:disabled{opacity:1;cursor:not-allowed}
.loot-dialog .choice:disabled:hover{transform:none;box-shadow:0 18px 25px #0009}
.loot-dialog .choice:disabled:after{display:none}.loot-dialog .choice:disabled .pick{background:#252b30;border-color:#69706e;color:#aab2b3;letter-spacing:0}.loot-dialog .choice:disabled:hover .loot-art img{transform:none}
/* Keep the viewport backdrop independent of the scrolling catalogue. */
.overlay:has(> .shop-catalog){
  align-items:stretch;padding:0;overflow:hidden;background:none;backdrop-filter:none;-webkit-backdrop-filter:none
}
.overlay:has(> .shop-catalog)::before{
  content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;background:var(--modal-backdrop-color);
  backdrop-filter:var(--modal-backdrop-filter);-webkit-backdrop-filter:var(--modal-backdrop-filter)
}
.dialog.shop-dialog{background:none;border:0;box-shadow:none}
.shop-dialog h2{text-align:center;font:650 26px system-ui,sans-serif;color:#d6ece8;margin:0 0 18px}
.shop-status{display:flex;justify-content:space-between;align-items:center;color:#a9bcc6;margin-bottom:8px}.shop-status strong{color:#aaffd6;font-size:18px}
.shop-footer{display:flex;align-items:center;gap:12px;margin-top:10px}.shop-footer>span{margin-right:auto;color:#9eafb7;font-size:12px}
@media(prefers-reduced-motion:reduce){.loot-dialog .choice,.loot-dialog .loot-art img{transition:none}.loot-dialog .choice:hover,.loot-dialog .choice:focus-visible,.loot-dialog .choice:hover .loot-art img{transform:none}}

.loot-dialog .choice[data-reward="resource"]{--ink:#ff9fe8;--wash:#602c73}

.faction-dialog{width:800px}.faction-dialog h2{text-align:center;font-size:27px;margin:0 0 9px;color:#e6f2f4}.faction-dialog .cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:32px;max-width:650px;margin:auto}.faction-dialog .card-description{white-space:pre-line}.faction-dialog .choice:disabled .loot-art{filter:saturate(.45)}.faction-dialog .faction-note{margin:12px 0 0;font-size:12px;color:#8fa7b5}.faction-dialog .choice .card-title{font-size:22px}

/* New expedition: native radio options with small landscape previews. */
.setup-dialog{width:660px;background:linear-gradient(145deg,#20353e,#141e2a)}
.terrain-options{border:0;padding:0;margin:26px 0 12px;display:grid;grid-template-columns:1fr 1fr;gap:14px}
.terrain-options legend{font-weight:650;color:#dcebe7;margin-bottom:12px}
.terrain-option{position:relative;margin:0;padding:14px;border:1px solid #465d64;border-radius:14px;background:#0d1b25;cursor:pointer;overflow:hidden}
.terrain-option:has(input:checked){border-color:#91e9c9;box-shadow:0 0 0 1px #91e9c9,inset 0 0 28px #72dcb511}
.terrain-option:has(input:focus-visible){outline:3px solid #e6f4ff;outline-offset:4px}
.terrain-option input{position:absolute;right:14px;top:14px;accent-color:#91e9c9;width:18px;height:18px;z-index:2}
.terrain-preview{display:block;position:relative;height:100px;border-radius:8px;background:linear-gradient(#163846,#2e6170);overflow:hidden}
.terrain-preview:before,.terrain-preview:after{content:'';position:absolute;background:linear-gradient(130deg,#9dc67e,#426e4a);width:120%;height:75%;left:-10%;bottom:-28%;border-radius:50% 50% 0 0}
.terrain-preview.dynamic:before{transform:rotate(-18deg);bottom:-5%;left:-35%}
.terrain-preview.dynamic:after{transform:rotate(25deg);left:30%;bottom:-15%;background:linear-gradient(130deg,#7cae6a,#2d5c47)}
.terrain-preview.flat:before{border-radius:0;bottom:-20%;transform:rotate(-3deg)}
.terrain-preview.flat:after{display:none}
.terrain-preview>span{display:none}
.terrain-copy strong,.terrain-copy small{display:block}
.terrain-copy strong{font-size:16px;color:#edf9f2;margin:15px 0 8px}
.terrain-copy small{font-size:12px;line-height:1.5;color:#a4baba}

/* Approved concept A: shared raster ceramic shell, original illustration, live readable type. */
.loot-dialog .choice{aspect-ratio:2/3;border-radius:0;background:none;box-shadow:none;filter:drop-shadow(0 14px 12px #0009);margin-bottom:34px;color:#fff2d5}
.loot-dialog .choice:before{inset:0;background:none;z-index:1;clip-path:polygon(3% 8%,11% 3%,28% 3%,33% 4%,73% 4%,78% 3.5%,91% 3.5%,97% 8%,97% 23%,96% 27%,96% 59%,97% 62%,97% 90%,91% 95%,65% 95%,62% 96%,38% 96%,34% 95%,9% 95%,3% 91%,3% 62%,4% 59%,4% 19%,3% 16%)}
.loot-dialog .choice:after{inset:4% 4% 5%;border-radius:20px;background:linear-gradient(115deg,transparent 32%,#fff9df22 45%,transparent 58%);z-index:6}
.loot-dialog .choice:hover,.loot-dialog .choice:focus-visible{background:none;box-shadow:none;filter:drop-shadow(0 20px 16px #000a) drop-shadow(0 0 9px #63e9e942)}
.loot-dialog .loot-art{left:8.8%;top:13.2%;width:82.4%;height:54.5%;border:0;border-radius:0;box-shadow:none;background:#183447;z-index:2;clip-path:polygon(30% 0,100% 0,100% 86%,90% 100%,10% 100%,0 88%,0 7%,24% 7%)}
.loot-dialog .loot-art img{object-fit:cover;object-position:center}
.loot-dialog .loot-art:after{border-radius:0;background:none;box-shadow:inset 0 0 10px #001c3540}
.loot-dialog .choice .card-title{left:13%;top:72%;width:74%;height:7.5%;font:850 clamp(18px,1.9vw,27px)/1.03 system-ui,sans-serif;text-transform:uppercase;letter-spacing:.2px;color:#ffebbe;text-shadow:0 1px #fff6e6,0 2px 1px #86603c,0 4px 3px #000b;z-index:5}
.loot-dialog .choice .card-description{left:27%;top:81.7%;width:46%;height:7.1%;font-size:11px;font-weight:600;line-height:1.24;color:#e7fffa;z-index:5;text-shadow:0 2px 2px #001423;margin:0}
.loot-dialog .choice .pick{left:12%;bottom:-5%;width:76%;height:7%;font-size:12px;border:1px solid #619da0;border-radius:9px;background:linear-gradient(#214553,#102835);box-shadow:inset 0 1px #b2fcf329,0 4px 10px #0005;letter-spacing:.2px;z-index:7}
.loot-dialog .choice:hover .pick{background:linear-gradient(#33766f,#163d46);border-color:#baf7e7}
.loot-dialog .card-cost{left:7.5%;top:5.9%;width:22%;height:9%;flex-direction:row;gap:7%;border:0;border-radius:0;background:none;box-shadow:none;color:#ffebbe;font:850 32px/1 system-ui,sans-serif;text-shadow:0 2px 1px #946e39,0 4px 4px #000;z-index:5}
.loot-dialog .card-cost b{font:inherit}
.loot-dialog .card-cost.card-emblem{color:var(--ink);font-size:35px;text-shadow:0 0 10px color-mix(in srgb,var(--ink) 45%,transparent),0 3px 4px #000}
.cost-crystal{width:25%;height:70%;display:block;clip-path:polygon(55% 0,100% 30%,86% 78%,28% 100%,0 48%);background:conic-gradient(from 25deg at 48% 45%,#fff2ff,#ff7beb 22%,#b117c5 23%,#f969e5 49%,#7138b1 50%,#e694ff 74%,#fff2ff 75%);filter:drop-shadow(0 0 3px #f67ddd)}
.loot-dialog .choice:disabled{filter:drop-shadow(0 10px 10px #0007)}
.loot-dialog .choice:disabled:hover{box-shadow:none;filter:drop-shadow(0 10px 10px #0007)}
.loot-dialog .choice:disabled .pick{background:#17232c;border-color:#42515a;color:#a1b1b9}
.faction-dialog .choice .card-title{font-size:20px}
.faction-dialog .card-description{font-size:11px}
.loot-dialog .cards{padding-bottom:30px}

/* Recessed category tab and distinct material hues; artwork stays untinted. */
.loot-dialog .choice{--frame-tint:#39a4d8;--ink:#94ddff}
.loot-dialog .choice[data-reward="armor"]{--frame-tint:#329ddd;--ink:#94dcff}
.loot-dialog .choice[data-reward="skill"]{--frame-tint:#9952d8;--ink:#dcb3ff}
.loot-dialog .choice[data-reward="hero"]{--frame-tint:#d59a32;--ink:#ffe0a1}
.loot-dialog .choice[data-reward="resource"]{--frame-tint:#d943ad;--ink:#ffb6e8}
.loot-dialog .choice[data-reward="faction-red"]{--frame-tint:#d94a55}
.loot-dialog .choice[data-reward="faction-blue"]{--frame-tint:#367de3}
.loot-dialog .choice:before{background-image:linear-gradient(var(--frame-tint),var(--frame-tint));background-blend-mode:color}
.loot-dialog .choice .pick{border-color:color-mix(in srgb,var(--frame-tint) 60%,#8da7b6)}
.loot-dialog .choice:hover .pick{background:linear-gradient(color-mix(in srgb,var(--frame-tint) 40%,#193642),#132c39);border-color:var(--ink)}
.loot-dialog .choice:hover,.loot-dialog .choice:focus-visible{filter:drop-shadow(0 20px 16px #000a) drop-shadow(0 0 9px color-mix(in srgb,var(--frame-tint) 40%,transparent))}

.shop-dialog .shop-status{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:0 0 16px}
.shop-dialog .shop-status h2{margin:0;text-align:left}
.shop-dialog .shop-status strong{white-space:nowrap;font-size:24px;color:#ffc4ee}
.shop-dialog .shop-footer{justify-content:flex-end}
/* Reuse the raster lower shell as a taller panel for descriptive cards. */
.loot-dialog .choice .card-lower-frame{position:absolute;left:0;top:58%;width:100%;height:38%;z-index:3;pointer-events:none;background-image:linear-gradient(var(--frame-tint),var(--frame-tint));background-blend-mode:color;background-size:100% 303%;background-position:center bottom;clip-path:polygon(9% 0,91% 0,97% 10%,97% 87%,91% 100%,9% 100%,3% 87%,3% 10%)}
.loot-dialog .choice:is([data-reward="skill"],[data-reward="hero"]) .loot-art{height:45.5%}
.loot-dialog .choice:is([data-reward="skill"],[data-reward="hero"]) .card-title{top:63%;height:10%;font-size:clamp(17px,1.65vw,24px)}
.loot-dialog .choice:is([data-reward="skill"],[data-reward="hero"]) .card-description{top:75%;height:13%;left:25%;width:50%;font-size:12px;line-height:1.3;padding:4px 7px;box-sizing:border-box;background:linear-gradient(#08273bf2,#061e31f2);border-radius:10px;box-shadow:inset 0 1px 0 #b2faf526,inset 0 -1px 0 #020f24}


/* Textless raster panels: live type has no patches or solid backgrounds. */
.loot-dialog .choice{--frame-hue:0deg;--art-mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cmask%20id%3D%22m%22%3E%3Crect%20width%3D%22100%22%20height%3D%22100%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M74%2013.5H94V63.8L84%2068.8H20L10%2063.8V19H35V13.5H36V15L40%2018H66L72%2015Z%22%20fill%3D%22black%22%2F%3E%3C%2Fmask%3E%3C%2Fdefs%3E%3Crect%20width%3D%22100%22%20height%3D%22100%22%20fill%3D%22white%22%20mask%3D%22url%28%23m%29%22%2F%3E%3C%2Fsvg%3E");--atlas-position:0%}
.loot-dialog .choice[data-layout="long"]{--atlas-position:100%;--art-mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cmask%20id%3D%22m%22%3E%3Crect%20width%3D%22100%22%20height%3D%22100%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M74%2013.5H94V58.5L84%2063.5H20L10%2058.5V19H35V13.5H36V15L40%2018H66L72%2015Z%22%20fill%3D%22black%22%2F%3E%3C%2Fmask%3E%3C%2Fdefs%3E%3Crect%20width%3D%22100%22%20height%3D%22100%22%20fill%3D%22white%22%20mask%3D%22url%28%23m%29%22%2F%3E%3C%2Fsvg%3E")}
.loot-dialog .choice[data-reward="resource"]{--frame-hue:105deg}
.loot-dialog .choice[data-reward="hero"]{--frame-hue:140deg}
.loot-dialog .choice[data-reward="faction-red"]{--frame-hue:80deg}
.loot-dialog .choice[data-reward="faction-blue"]{--frame-hue:-40deg}
.loot-dialog .choice .card-underlay,.loot-dialog .choice .card-lower-frame{display:none}
.loot-dialog .choice:before{background-image:none;background-size:200% 100%;background-position:var(--atlas-position) center;background-blend-mode:normal;filter:hue-rotate(var(--frame-hue));mask-image:var(--art-mask);-webkit-mask-image:var(--art-mask);mask-size:100% 100%;-webkit-mask-size:100% 100%;z-index:3;clip-path:polygon(4% 8%,13% 3%,29% 3%,34% 4%,75% 4%,80% 3.5%,93% 3.5%,99% 9%,99% 91%,91% 96%,10% 96%,4% 91%)}
.loot-dialog .choice:is([data-reward="armor"],[data-reward="skill"]):before{mask-image:none;-webkit-mask-image:none}
.loot-dialog .choice .loot-art{left:10%;width:84%;top:13.5%;height:55.3%;background:none;z-index:2;clip-path:polygon(30% 0,100% 0,100% 91%,88% 100%,12% 100%,0 91%,0 10%,30% 10%)}
.loot-dialog .choice[data-layout="long"] .loot-art{height:50%}
.loot-dialog .choice:is([data-reward="armor"],[data-reward="skill"]) .loot-art{display:none}
.loot-dialog .choice .loot-art img{object-fit:cover;object-position:center;background:none}
.loot-dialog .choice:hover .loot-art img{transform:none}
.loot-dialog .choice[data-layout] .card-title{top:71.8%;left:20%;width:64%;height:8%;font-size:clamp(15px,1.3vw,19px);font-weight:750;letter-spacing:0;line-height:1.15;white-space:normal;overflow-wrap:normal;text-wrap:balance;background:none;border:0;box-shadow:none;text-shadow:0 2px 2px #0008;color:#ffe7b4;box-sizing:border-box;padding:0 3px}
.loot-dialog .choice[data-layout="long"] .card-title{top:64.5%;left:18%;width:66%;height:6.6%;font-size:clamp(15px,1.25vw,18px)}
.loot-dialog .choice[data-layout] .card-description{top:82.5%;left:27%;width:48%;height:6.8%;font-size:12px;font-weight:550;line-height:1.3;padding:0;box-sizing:border-box;background:none;border:0;border-radius:0;box-shadow:none;color:#eef5ff;text-shadow:0 1px 2px #0006}
.loot-dialog .choice[data-layout="long"] .card-description{top:74%;left:19%;width:64%;height:16%;padding:0 5px;font-size:12px;line-height:1.38;white-space:normal}
.loot-dialog .choice .card-cost{top:6%;left:9%;width:23%;height:10%;background:none;border:0;box-shadow:none;clip-path:none;font-size:29px}
.shop-dialog .shop-status{gap:14px;justify-content:flex-start}
.shop-dialog .shop-status h2{flex:0 0 auto}
.shop-dialog .shop-close{margin-left:auto}

.loot-dialog .choice .card-kind{
 position:absolute;
 z-index:7;
 left:54.3%;
 top:15.2%;
 width:31%;
 height:3.4%;
 transform:translate(-50%,-50%);
 display:flex;
 align-items:center;
 justify-content:center;
 box-sizing:border-box;
 margin:0;
 padding:0;
 font:750 9px/1 system-ui,sans-serif;
 letter-spacing:0;
 text-align:center;
 text-transform:uppercase;
 color:var(--ink);
 text-shadow:0 1px 2px #0008;
 background:none;
 border:0;
 box-shadow:none;
 clip-path:none;
}
/* The long-frame category socket sits farther left than the short-frame socket. */
.loot-dialog .choice[data-layout="long"] .card-kind{left:49.4%;top:15.1%;width:27%;height:3.3%}

/* One palette per gameplay card type, independent of where the card appears.
   Faction/resource cards intentionally retain their existing rules. */
.loot-dialog .choice[data-reward="armor"]{--type-color:#247fc7;--frame-tint:#247fc7;--ink:#a8dcff;--wash:#183f68}
.loot-dialog .choice[data-reward="skill"]{--type-color:#8a44c2;--frame-tint:#8a44c2;--ink:#e0bdff;--wash:#44225f}
.loot-dialog .choice[data-reward="hero"]{--type-color:#bf8b2f;--frame-tint:#bf8b2f;--ink:#ffe0a0;--wash:#624819}
.loot-dialog .choice:is([data-reward="armor"],[data-reward="skill"],[data-reward="hero"]):before{
 background-image:linear-gradient(var(--type-color),var(--type-color));
 background-blend-mode:color;filter:none;mask-image:var(--art-mask);-webkit-mask-image:var(--art-mask);
}
/* Keep the approved full-colour illustration beneath the separately tinted frame. */
.loot-dialog .choice:is([data-reward="armor"],[data-reward="skill"]) .card-underlay{
 display:block;position:absolute;inset:0;z-index:2;pointer-events:none;
 background-image:none;background-size:200% 100%;background-position:var(--atlas-position) center;
 clip-path:polygon(4% 8%,13% 3%,29% 3%,34% 4%,75% 4%,80% 3.5%,93% 3.5%,99% 9%,99% 91%,91% 96%,10% 96%,4% 91%);
}
.loot-dialog .choice:is([data-reward="armor"],[data-reward="skill"],[data-reward="hero"]) .card-title{color:var(--ink)}
.loot-dialog .choice:is([data-reward="armor"],[data-reward="skill"],[data-reward="hero"]) .pick{
 background:linear-gradient(color-mix(in srgb,var(--type-color) 38%,#142334),#111c2a);border-color:color-mix(in srgb,var(--ink) 55%,transparent);color:var(--ink);
}
.loot-dialog .choice:is([data-reward="armor"],[data-reward="skill"],[data-reward="hero"]):hover .pick{background:linear-gradient(color-mix(in srgb,var(--type-color) 65%,#142334),#17283b);border-color:var(--ink);color:#fff}

/* Approved focused artwork replaces the illustrations baked into the old atlas. */
.loot-dialog .choice:is([data-reward="armor"],[data-reward="skill"]) .card-underlay{display:none}
.loot-dialog .choice:is([data-reward="armor"],[data-reward="skill"]) .loot-art{display:block}

.loot-dialog .choice[data-reward="hero"] .loot-art{background:#99b7c1}
.loot-dialog .choice[data-reward="hero"] .loot-art img{object-fit:contain}

/* Equipment held at the base. */
.shop-storage{display:flex;flex-wrap:wrap;gap:8px;padding-top:14px;border-top:1px solid #7b97a330}
.shop-storage h3{flex-basis:100%;margin:0;font-size:15px;color:#d6ece8}
.shop-dialog .shop-storage p{flex-basis:100%;margin:0 0 4px;font-size:12px}

/* Shared catalogue artwork, prices and dialog controls. */
.loot-dialog.shop-catalog{--shop-inset:max(52px,calc((100% - 1024px) / 2));--shop-storage-padding:24px;position:relative;width:100%;padding:0 0 24px;border-radius:0;scrollbar-width:thin;scrollbar-color:#738aa04d transparent;max-height:100%;overscroll-behavior:contain}
.shop-catalog>.shop-close{position:absolute;top:12px;right:var(--shop-inset);z-index:1;margin:0}
.shop-catalog:has(> .shop-storage:not([hidden]))>.shop-close{top:var(--shop-storage-padding)}
.shop-catalog .shop-status h2{font-size:26px;letter-spacing:-.5px;color:#fff}
.shop-catalog .shop-status .astrolite-balance{font-size:20px}
.shop-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0}
.shop-item-art{position:relative;display:block;width:80px;height:86px;overflow:hidden;border-radius:9px;border:1px solid color-mix(in srgb,var(--shop-tone) 60%,transparent);background:#192b3b;box-shadow:inset 0 0 0 1px #0004}
.shop-item-art img{display:block;width:100%;height:100%;object-fit:cover;object-position:center}
.shop-item-legend{position:absolute;top:-7px;left:-7px;display:grid;place-items:center;width:22px;height:22px;border:1px solid #e3bd716e;border-radius:6px;background:#231e18db;color:#f5d38d;font-size:15px;line-height:1;box-shadow:0 2px 5px #0004}
.shop-item-price{display:inline-flex;flex:none;align-items:center;gap:4px;font-size:15px;line-height:1;color:#f2d0ef;font-variant-numeric:tabular-nums;white-space:nowrap}
.shop-item-price .astrolite-icon{width:15px;height:19px;object-fit:contain;filter:none}

/* Six selectable factions share the existing glass and card palette. */
.faction-select-dialog{width:min(1080px,calc(100vw - 48px));max-height:calc(100dvh - 40px);overflow:auto}
.faction-select-header{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px;margin-bottom:8px}
.faction-select-header h2{grid-column:2;margin:0;text-align:center;white-space:nowrap}
.faction-settings-back{display:inline-flex;align-items:center;justify-content:center;justify-self:start;gap:8px;padding:8px 11px;font-size:12px;white-space:nowrap}
.faction-settings-back svg{width:18px;height:18px;flex:none}
.faction-select-dialog>p{margin:0;color:#a6b5c8;font-size:13px;letter-spacing:0}
.faction-select-dialog .cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:stretch;margin:18px 0 0}
.faction-option{display:flex;flex-direction:column;gap:12px;padding:16px;text-align:left;border:1px solid color-mix(in srgb,var(--faction) 42%,transparent);border-radius:16px;background:linear-gradient(140deg,color-mix(in srgb,var(--faction) 14%,#0d1726),#0b1320);box-shadow:inset 0 1px 0 #ffffff16;min-height:240px;white-space:normal;color:#edf0f4;transition:border-color .18s,transform .18s,box-shadow .18s}
.faction-option:not(:disabled):hover,.faction-option:focus-visible{border-color:var(--faction);box-shadow:0 0 26px color-mix(in srgb,var(--faction) 16%,transparent);transform:translateY(-2px)}
.faction-option:disabled{opacity:.38;filter:grayscale(.9);cursor:default}
.faction-option-head{display:flex;align-items:center;gap:12px;min-width:0}
.faction-option-head img{width:112px;height:132px;flex:none;object-fit:cover;border-radius:10px;border:1px solid #ffffff24}
.faction-option-head small{display:block;font-size:11px;letter-spacing:.10em;text-transform:uppercase;color:var(--faction);margin-bottom:6px}
.faction-option-head strong{display:block;font-size:17px;line-height:1.2;overflow-wrap:anywhere}
.faction-description{font-size:12px;line-height:1.5;color:#b7c3d2;font-weight:400}
.faction-availability{margin-top:auto;padding-top:10px;border-top:1px solid #ffffff13;font-size:11px;line-height:1.4;color:#dbe2ec;font-weight:400}
.shop-original-price{font-size:11px;font-weight:400;color:#8f9aa9}

/* Three columns for items, two full-width columns for legendary heroes. */
.shop-section{margin:20px 0 24px;--section-color:#8bd1ff}
.shop-section[data-kind="skill"]{--section-color:#d3b4ff}
.shop-section[data-kind="hero"]{--section-color:#f1d291}
.shop-section[data-kind="hero"] .shop-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.shop-section-title{display:flex;align-items:center;gap:10px;margin:0 0 12px;font-size:15px;font-weight:600;color:var(--section-color);letter-spacing:.1px}
.shop-catalog .shop-item{grid-template-columns:64px minmax(0,1fr);gap:10px;align-items:start;min-height:124px}
.shop-catalog .shop-item-art{width:64px;height:80px}
.shop-catalog .shop-item-copy{justify-content:flex-start;gap:6px}
.shop-catalog .shop-item[data-kind="equipment"]{min-height:0}
.shop-catalog .shop-item[data-kind="equipment"] .shop-item-copy{height:80px;align-self:start}
.shop-catalog .shop-item-footer{margin-top:auto;padding-top:4px}
.shop-catalog .shop-item-action{padding:4px 6px;text-align:right}

.shop-order{display:inline-flex;align-items:center;padding:8px 12px;border:1px solid #86b6c72e;border-radius:8px;background:#8ec9e008;font-size:12px;line-height:1.4;color:#bdd9e2}

/* A purchase is confirmed by choosing its recipient in this small popover. */
.shop-hero-menu{position:fixed;inset:auto;margin:0;width:300px;max-width:calc(100vw - 20px);max-height:calc(100dvh - 20px);overflow:auto;padding:12px;border:1px solid #a4baca55;border-radius:14px;background:linear-gradient(140deg,#203345f7,#111e2efa);color:#e7eff6;box-shadow:0 16px 50px #0009,0 0 0 1px #ffffff06;backdrop-filter:blur(24px);text-align:left}
.shop-hero-menu:popover-open{display:grid;gap:7px}
.shop-hero-menu-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.shop-hero-menu-head>strong{font-size:14px;line-height:1.3}
.shop-hero-option{display:flex;align-items:center;justify-content:flex-start;gap:10px;width:100%;margin:0;padding:11px 10px;border:1px solid #9abfd624;border-radius:9px;background:#90bdd409;color:#ecf5f8;text-align:left}
.shop-hero-option:hover:not(:disabled){background:#8bbdd323;border-color:#9ddfdf77}
.shop-hero-option:focus-visible,.shop-hero-menu-close:focus-visible{outline:2px solid #a8e8dd;outline-offset:2px}
.shop-hero-option:disabled{opacity:.42;cursor:not-allowed}
.shop-hero-option-copy{display:grid;gap:4px;min-width:0}
.shop-hero-option-art{position:relative;display:block;flex:none;width:40px;height:40px}
.shop-hero-option-art>img{display:block;width:100%;height:100%;object-fit:cover;border-radius:8px}
.shop-hero-option-art .shop-item-legend{width:18px;height:18px;top:-5px;left:-5px;font-size:12px;border-radius:5px}
.shop-hero-option-name{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px}
.shop-hero-option-strength{display:inline-flex;align-items:center;gap:2px;white-space:nowrap;font-size:13px}
.shop-hero-option-strength .strength-icon{width:16px;height:20px}
.shop-hero-option-copy strong{font-size:13px;line-height:1.3}
.shop-hero-option-copy small{font-size:10px;line-height:1.4;font-weight:400;color:#aabfce;white-space:normal}

/* Shop catalogue with separators and explicit purchase controls. */
.shop-catalog .shop-status{justify-content:center;min-height:40px;margin:0 var(--shop-inset) 20px}
.shop-catalog .shop-storage[hidden]+.shop-status{margin-top:12px;padding-inline:44px}
.shop-catalog .shop-section{margin:0 var(--shop-inset) 24px}
.shop-catalog .shop-section-title{margin-bottom:0;font-size:15px}
.shop-catalog .shop-grid{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:32px;row-gap:0}
.shop-entry{--shop-accent:#8bd1ff;--shop-tone:#3d8fb5;position:relative;isolation:isolate;display:grid;grid-template-columns:80px minmax(0,1fr);align-items:start;gap:16px;min-width:0;padding:18px 0;border:0;border-bottom:1px solid #afc5df20;background:none;box-shadow:none;border-radius:0}
.shop-entry[data-kind="skill"]{--shop-accent:#d3b4ff;--shop-tone:#9670c5}
.shop-entry[data-kind="hero"]{--shop-accent:#f1d291;--shop-tone:#b99b58;border-bottom:0}
.shop-catalog .shop-entry{grid-template-columns:64px minmax(0,1fr)}
.shop-catalog .shop-entry .shop-item-art{border:0;background:none;box-shadow:none;border-radius:10px}
.shop-catalog .shop-entry[data-kind="hero"] .shop-item-art{overflow:visible}
.shop-catalog .shop-entry[data-kind="hero"] .shop-item-art img{border-radius:inherit}
.shop-entry-copy{display:flex;flex-direction:column;align-self:stretch;align-items:flex-start;gap:6px;min-width:0}
.shop-entry-title{font-size:15px;font-weight:650;line-height:1.3;color:#f2f6fb}
.shop-entry-description{font-size:12px;line-height:1.45;color:#bdcbda}
.shop-entry-purchase{display:flex;align-items:center;justify-content:flex-start;gap:12px;margin-top:auto;padding-top:8px;min-height:36px}
.shop-entry-buy{display:inline-flex;align-items:center;justify-content:center;min-height:30px;padding:5px 12px;border:1px solid #9fbcd43b;border-radius:7px;background:#253c50a6;box-shadow:inset 0 1px #ffffff08;color:#e0edf8;font-size:11px;font-weight:600;line-height:1.3;white-space:nowrap}
/* Extend the native purchase button over its card, including disabled behavior. */
.shop-entry-buy{position:static}
.shop-entry .shop-entry-buy::after{content:"";position:absolute;inset:0 -10px;z-index:1;border-radius:12px;cursor:inherit}
.shop-entry-buy:hover:not(:disabled){background:#31546d;border-color:#9bdfe078;color:#fff}
.shop-entry-buy:focus-visible{outline:2px solid var(--shop-accent,#8bd1ff);outline-offset:3px}
.shop-entry-buy:disabled{opacity:1;background:#7a8ca90a;border-color:#91a5bc22;color:#8798ab;cursor:not-allowed}
.shop-entry .shop-item-price{font-size:14px;gap:4px;color:#edc7ec}
.shop-entry .shop-item-price .astrolite-icon{width:13px;height:16px}
.shop-entry:has(.shop-entry-buy:disabled) .shop-item-price{opacity:.45}
.shop-entry[data-acquired] .shop-item-art{filter:grayscale(1);opacity:.45}
.shop-entry[data-acquired] .shop-entry-title,.shop-entry[data-acquired] .shop-entry-description{color:#8392a6}
.shop-entry[data-acquired] .shop-item-price{filter:grayscale(1)}
.shop-catalog .shop-storage{margin:0 0 32px;padding:var(--shop-storage-padding) var(--shop-inset) 32px;border:0;border-bottom:1px solid #afc5df30;background:#17263d80}
.shop-storage .ability-icon{width:14px;height:14px;margin-inline-end:6px}
.shop-catalog .shop-storage h3{display:grid;place-items:center;min-height:36px;padding:0 44px;margin:0 0 12px;color:#a9bddb;font-size:22px;line-height:1.2;letter-spacing:-.5px;text-align:center}
.shop-reserve-grid{flex-basis:100%;min-width:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding-top:4px}
.shop-reserve-grid:empty{display:none}
.shop-reserve-grid>:only-child{grid-column:1/-1}
.shop-entry-buy.shop-reserve-hero{min-width:0;justify-content:flex-start;gap:8px;padding:5px 8px;white-space:normal;text-align:left}
.shop-reserve-avatar{width:24px;height:24px;flex:none;border-radius:5px;object-fit:cover}
.shop-reserve-copy{display:grid;gap:3px;min-width:0;overflow-wrap:anywhere}
.shop-reserve-name{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px}
.shop-reserve-strength,.shop-stock-strength{display:inline-flex;align-items:center;gap:2px;white-space:nowrap}
.shop-reserve-strength .strength-icon,.shop-stock-strength .strength-icon{width:13px;height:16px}
.shop-stock-strength{margin-inline:5px;flex:none}
.shop-reserve-copy small{font-size:10px;font-weight:450}
.shop-reserve-action{color:#ffe08a}

/* Each faction offers one ordinary hero and two legends in a single row. */
.shop-catalog .shop-section[data-kind="hero"] .shop-grid{grid-template-columns:repeat(3,minmax(0,1fr));column-gap:24px}
.shop-entry[data-kind="hero"] .shop-entry-purchase{margin-top:0;padding-top:0;min-height:30px}
.shop-hero-strength{display:inline-flex;align-items:center;gap:3px;vertical-align:middle;white-space:nowrap}
.shop-hero-strength .strength-icon{width:22px;height:26px}
.shop-hero-power{display:block;margin-top:4px}
.shop-hero-rarity{color:var(--shop-accent)}
.shop-catalog .shop-section:is([data-kind="skill"],[data-kind="equipment"]) .shop-grid{grid-template-columns:repeat(3,minmax(0,1fr));column-gap:24px}
.shop-catalog .shop-section:is([data-kind="skill"],[data-kind="equipment"]) .shop-entry{gap:12px;padding:14px 0}
.shop-catalog .shop-section:is([data-kind="skill"],[data-kind="equipment"]) .shop-entry-title{font-size:14px}
.shop-catalog .shop-section:is([data-kind="skill"],[data-kind="equipment"]) .shop-entry-description{font-size:11px;line-height:1.4}
.shop-catalog .shop-section:is([data-kind="skill"],[data-kind="equipment"]) .shop-entry-purchase{gap:8px;padding-top:6px}
.shop-catalog .shop-section:is([data-kind="skill"],[data-kind="equipment"]) .shop-entry-buy{padding:5px 8px}


/* Full-row emphasis keeps catalogue geometry and separators stable. */
.shop-entry::before{content:"";position:absolute;inset:4px -10px;z-index:-1;pointer-events:none;border:1px solid transparent;border-radius:12px;background:transparent;box-shadow:none;transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease}
@media(hover:hover){
 .shop-entry:hover::before{background:color-mix(in srgb,var(--shop-tone) 12%,transparent);border-color:color-mix(in srgb,var(--shop-tone) 55%,transparent);box-shadow:inset 0 1px #ffffff08}
 .shop-entry:has(.shop-entry-buy:disabled):hover::before{background:#b0c5df08;border-color:#afc5df24;box-shadow:none}
}
.shop-entry:has(.shop-entry-buy:focus-visible)::before{background:color-mix(in srgb,var(--shop-tone) 12%,transparent);border-color:color-mix(in srgb,var(--shop-tone) 65%,transparent);box-shadow:inset 0 1px #ffffff08}
/* Keep the chosen card distinct from hover while its recipient menu is open. */
.shop-entry:has(.shop-entry-buy[aria-expanded="true"])::before{background:color-mix(in srgb,var(--shop-tone) 24%,transparent);border-color:color-mix(in srgb,var(--shop-accent) 70%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--shop-tone) 18%,transparent),inset 0 1px #ffffff14}
.shop-entry:has(.shop-entry-buy:active:not(:disabled))::before{background:color-mix(in srgb,var(--shop-tone) 32%,transparent);border-color:color-mix(in srgb,var(--shop-accent) 85%,transparent);box-shadow:inset 0 2px 8px #0004}
@media(prefers-reduced-motion:reduce){.shop-entry::before{transition:none}}

/* Equipment silhouettes stay fully visible with a little background on both sides. */
.shop-catalog .shop-entry[data-kind="equipment"] .shop-item-art img{height:100%;object-fit:contain;object-position:center;transform:scale(1.12)}
/* These two silhouettes sit slightly high within their blue backdrop. */
.shop-catalog .shop-entry[data-kind="equipment"] .shop-item-art img:is([src$="anticore-shop.png"],[src$="singulator-shop.png"]){transform:translateY(3px) scale(1.12)}

/* Keep the existing catalogue entries readable on a phone. */
@media(max-width:700px){
 .loot-dialog.shop-catalog{--shop-inset:30px;padding-bottom:18px}
 .shop-catalog .shop-section[data-kind] .shop-grid{grid-template-columns:minmax(0,1fr);column-gap:0}
 .shop-catalog .shop-entry-copy{overflow-wrap:anywhere}
}
@media(max-width:520px){
 .shop-reserve-grid{gap:12px}
 .shop-storage .shop-entry-buy{white-space:normal}
}
