/* Raster nine-slice chrome; all existing controls retain their IDs and handlers. */
body.playing #hud-round,body.playing .hud-weather,body.playing #hud-shop-controls,
body.playing #hud-items.gear-rail,body.playing .shop-card,
body.playing .bench-slot,body.playing #battle-btn,body.playing #reroll-btn,body.playing #xp-btn,
body.playing .synergy-entry,body.playing .item-slot{
 border-image-source:url('assets/world-art/hud-frame.webp');border-image-slice:74 fill;border-image-width:9px;border-image-outset:0;border-image-repeat:stretch;
 background:none;box-shadow:none;border-radius:4px;
}
body.playing .shop-card{border-color:var(--rarity-color,#b6c1c9);border-image-width:7px;padding:5px 7px;color:#e6eef5;isolation:isolate}
body.playing .shop-card:before{opacity:.12}
body.playing .shop-top{background:none;border:0;box-shadow:none}
body.playing .shop-name{font-family:var(--font-game);font-size:14px;color:#f3f3dd;text-shadow:0 2px #091524}
body.playing .shop-top>img{filter:drop-shadow(0 3px 2px #07132188)}
body.playing .shop-cost{background:#132333;color:#ffed9c;border-color:#bd9955}
body.playing .shop-price{font-size:11px;color:#aac7c2}
body.playing .shop-card.locked{filter:saturate(.55);opacity:.75}
body.playing .shop-card:not(.locked):hover{filter:brightness(1.15)}
body.playing .merge-hint{font-size:10px;color:#c5eccd;background:#172c38e8;border:0}
body.playing #hud-left .synergy-entry{border-image-width:6px}
body.playing #hud-left .synergy-entry.inactive{opacity:.84}
body.playing #hud-left .synergy-entry.active{box-shadow:inset 3px 0 var(--syn-color,#6dced0)}
body.playing #hud-options .hud-icon{background-image:url('assets/world-art/hud-frame.webp');background-size:100% 100%;background-color:transparent;border:0;box-shadow:none}
/* Device coordinates match the transparent display cutout of the raster bezel. */
.guide-device{position:relative;display:block;width:min(960px,96vw);height:min(640px,94dvh);background:transparent url('assets/world-art/dex-frame.webp') center/100% 100%;border:0;box-shadow:none;border-radius:22px;padding:0}
.guide-device:before,.dex-device:before{content:'';position:absolute;left:15.5%;right:7.6%;top:21%;bottom:14%;background:#102238;border-radius:10px;pointer-events:none}
.guide-device>header{position:absolute;left:26%;right:9%;top:9%;height:10%;border:0;padding:0;background:none}
.guide-device>header strong{font-size:20px;color:#fff1e8;text-shadow:0 2px #572630}
.guide-device>header .dex-lens{display:none}
.guide-device>nav{position:absolute;left:4.5%;top:24%;bottom:17%;width:10%;background:none;padding:0;display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:3px}
.guide-device>nav button{width:40px;height:40px;min-height:0;flex-shrink:1;background:#193142ed;border-color:#bbc6c577;box-shadow:none}
.guide-device>nav button[aria-selected=true]{background:#325f6eee;border-color:#fbdda0;box-shadow:inset 0 0 0 1px #d4be7e}
#guide-screen{position:absolute;left:16%;right:7.6%;top:23%;bottom:14%;margin:0;padding:12px;background:#0e2133f5;border:1px solid #54748270;border-radius:8px;font-size:14px;line-height:1.6;min-height:0;overflow:auto}
.gear-panel,.strategy-panel,.event-scene{border-image:url('assets/world-art/hud-frame.webp') 74 fill / 12px / 0 stretch;background:none;box-shadow:0 12px 35px #07132180}
#guide-screen .strategy-panel{border-image:none;background:none;box-shadow:none}
body.playing .shop-card{box-shadow:inset 0 -3px var(--tier,#688392)}
body.playing .bench-slot.selected,body.playing .item-slot.selected{box-shadow:inset 0 0 0 2px #fce4a1}
body.playing .synergy-entry.active{box-shadow:inset 3px 0 var(--badge-color,#6dced0)}
@media(max-width:1100px) and (max-height:780px){
 body.playing .shop-card{padding:3px 5px;border-image-width:5px}
 body.playing .shop-name{font-size:11px}body.playing .shop-price{font-size:10px}
 .guide-device{width:min(780px,96vw);height:94dvh}
 .guide-device>header strong{font-size:15px}
 .guide-device>nav{top:22%;bottom:13%}.guide-device>nav button{width:30px;height:30px;padding:4px}
 #guide-screen{font-size:12px;padding:8px}
}
body.playing #battle-btn{color:#f7edd2;text-shadow:0 2px #071321}
body.playing #battle-btn small{color:#a7cbd2}
body.playing #hud-stats .hp-resource,body.playing #hud-topstats #journey-btn{border-image:url('assets/world-art/hud-frame.webp') 74 fill / 5px / 0 stretch;background:none;padding:2px 8px}
body.playing #field-guide-btn{background:transparent url('assets/world-art/dex-frame.webp') center/100% auto no-repeat;width:62px;height:48px}
#field-guide-btn svg{visibility:hidden}
body.playing #result-description{border-image:url('assets/world-art/hud-frame.webp') 74 fill / 10px / 0 stretch;background:none;padding:15px;line-height:1.65}
body.playing #result-rewards span{border:0;background:#12273dec;box-shadow:inset 0 -2px #a8bed15c;border-radius:5px;font-weight:700}
.event-choice{border-image:url('assets/world-art/hud-frame.webp') 74 fill / 8px / 0 stretch;background:none}
.gear-panel .gear-material,.gear-panel .gear-result{background:#112638b8;border-color:#718c9980}
.dex-device{position:relative;width:min(1040px,96vw);height:min(694px,94dvh);padding:0;border:0;box-shadow:none;background:transparent url('assets/world-art/dex-frame.webp') center/100% 100%;display:block}
.dex-device>header{position:absolute;left:26%;right:9%;top:9%;height:10%;padding:0;background:none;border:0}
.dex-device>header>i{display:none}.dex-device>header h2{font-size:20px;margin:0;color:#fff1e8}
.dex-device .dex-toolbar{position:absolute;left:16%;right:8%;top:22%;height:8%;padding:3px 7px;background:#13293a;border:0;gap:6px}
.dex-device .dex-panels{position:absolute;left:16%;right:8%;top:30%;bottom:15%;height:auto;padding:0;min-height:0;background:#102238;border:0}
.dex-device>footer{position:absolute;left:16%;right:8%;bottom:5.5%;height:8%;padding:5px 0;background:none;color:#ffe8ce;font-size:11px}
@media(max-width:1100px) and (max-height:780px){
 body.playing #field-guide-btn{width:43px;height:37px}
 .dex-device{width:min(850px,96vw);height:94dvh}.dex-device>header h2{font-size:15px}
 .dex-device .dex-toolbar{top:22%;height:10%;gap:4px;font-size:11px}.dex-device .dex-toolbar>*{min-width:0;font-size:11px}
 .dex-device .dex-panels{top:32%}.dex-device>footer{font-size:10px;line-height:1.2}
 body.playing #result-description{padding:10px}
}
