/* 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-read);font-weight:800;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}
}

/* Flat readable chrome: retain control geometry and all labels/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:none;background:#19334bee;border:1px solid #91b8b2;border-radius:7px;
 box-shadow:inset 0 2px #dceace1f,0 2px #14354b50;
}
body.playing #hud-options .hud-icon{background-image:none;background-color:#19334be8;border:1px solid #91b8b2;border-radius:8px}
body.playing #hud-left .synergy-entry.inactive{background:#183248dc;border-color:#739d9b}
body.playing #hud-left .synergy-entry.active{border-color:var(--syn-color,#8fc1bc);box-shadow:inset 3px 0 var(--syn-color,#8fc1bc)}
#world-tour-btn svg{width:25px;height:25px}
/* Start / proceed / confirm controls opt into this shared action treatment.
   The route prompt and battle start deliberately share one unchanged handler. */
body.playing :is(#battle-btn,.progress-action){
 border-image:none;border:2px solid #e9b476;border-radius:8px;
 background:linear-gradient(#af393f,#78232c);color:#fff8e4;opacity:1;
 box-shadow:inset 0 2px #ffce9b66,inset 0 -3px #471b2b88,0 3px 0 #421d2b,0 4px 9px #14243355;
 text-shadow:0 1px 1px #481522;font-weight:900;
 transition:background .12s,box-shadow .12s,transform .09s,border-color .12s;
}
body.playing :is(#battle-btn,.progress-action) small{display:block;color:#ffedc8;opacity:1;font-size:10px;line-height:1.1;letter-spacing:.05em;text-shadow:0 1px #481522}
@media(hover:hover){body.playing :is(#battle-btn,.progress-action):not(:disabled):hover{background:linear-gradient(#bf454b,#912833);border-color:#ffe0a0;filter:none;box-shadow:inset 0 2px #ffe4b780,inset 0 -3px #471b2b88,0 3px 0 #421d2b,0 0 10px #ed9a6140}}
body.playing :is(#battle-btn,.progress-action):not(:disabled):active{transform:translateY(2px);background:linear-gradient(#74212b,#9a3039);box-shadow:inset 0 3px 4px #42152888,0 1px 0 #421d2b;filter:none}
body.playing :is(#battle-btn,.progress-action):focus-visible{outline:2px solid #fff3c5;outline-offset:3px}
body.playing :is(#battle-btn,.progress-action):disabled{background:#61434a;border-color:#91766d;color:#c4b9ba;opacity:.65;box-shadow:inset 0 1px #c2a7a422;transform:none;text-shadow:none;cursor:not-allowed}
body.playing :is(#battle-btn,.progress-action):disabled small{color:#c4b9ba;text-shadow:none}
@media(prefers-reduced-motion:reduce){body.playing :is(#battle-btn,.progress-action){transition:none}}
#world-tour-menu{z-index:3300;background:#102b3b99}
.tour-menu{width:min(760px,94vw);max-height:92dvh;overflow:auto;padding:18px;border:2px solid #a8cbbb;border-radius:16px;background:#18364b;color:#eff5e8;box-shadow:0 10px 40px #10233066}
.tour-menu header{display:flex;align-items:center;justify-content:space-between;gap:16px}.tour-menu h2{font-family:var(--font-read);font-weight:800;font-size:24px;margin:0 0 12px}.tour-menu header button{width:38px;height:38px;font-size:24px}
.tour-destinations{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.tour-destinations button{padding:0 0 12px;overflow:hidden;background:#274b5b;border:1px solid #96bdb4;border-radius:10px;color:#f3f6df;text-align:left}
.tour-destinations img{display:block;width:100%;aspect-ratio:3/2;object-fit:cover}.tour-destinations strong,.tour-destinations small{display:block;padding:8px 12px 0}.tour-destinations strong{font-family:var(--font-read);font-weight:800;font-size:18px}.tour-destinations small{color:#d0e2dc;font-size:12px}
.tour-menu p{margin:12px 0 0;font-size:13px;color:#cde3d8}#tour-message{display:block;color:#ffe1a5;font-size:13px;margin-top:6px}
#world-tour-bar{position:fixed;z-index:3200;left:50%;bottom:max(12px,env(safe-area-inset-bottom));transform:translateX(-50%);display:flex;align-items:center;gap:9px;background:#163448f2;border:1px solid #b0ccba;border-radius:12px;padding:8px 12px;box-shadow:0 4px 16px #142f4540;color:#f2f6dc;max-width:96vw}
#world-tour-bar[hidden]{display:none}#world-tour-bar>div{min-width:150px;margin-right:12px}#world-tour-bar strong,#world-tour-bar small{display:block}#world-tour-bar strong{font-family:var(--font-read);font-weight:800;font-size:17px}#world-tour-bar small{font-size:11px;color:#c7e1d8;margin-top:5px}#world-tour-bar button{height:40px;white-space:nowrap;padding:5px 12px;background:#315b68;border:1px solid #9ebca9;border-radius:8px;color:#f7f3d4;font-size:16px}#world-tour-bar button span{font-size:13px}#world-tour-bar button:disabled{opacity:.45}
.world-tour-active #hud-left,.world-tour-active #hud-right,.world-tour-active #hud-round,.world-tour-active #hud-items,.world-tour-active #hud-bottom,.world-tour-active #hud-progress,.world-tour-active #combat-result,.world-tour-active #gold-interest-side,.world-tour-active #world-tour-btn{visibility:hidden;pointer-events:none}
/* v0.12.21 친선전: 방문 중 #app이 inert라 안 눌리는 HUD 단추를 숨김(장소 바꾸기·돌아가기는 아래 띠) */
.world-tour-active #hud-options,.world-tour-active #journey-btn,.world-tour-active #type-chart-btn,.world-tour-active #hud-settings,.world-tour-active #speed-btn,.world-tour-active #mobile-menu-toggle,.world-tour-active #mobile-stage,.world-tour-active #mobile-synergy,.world-tour-active #mobile-guide,.world-tour-active #pc-bag-count,.world-tour-active #pc-crafting-book{visibility:hidden!important;pointer-events:none}
@media(max-width:1100px) and (max-height:780px){.tour-menu{padding:10px;width:min(620px,94vw)}.tour-menu h2{font-size:19px;margin:0}.tour-destinations{gap:9px}.tour-destinations img{max-height:190px}.tour-destinations strong{font-size:15px}.tour-menu p{font-size:11px}#world-tour-bar{padding:6px 8px;bottom:7px;gap:6px}#world-tour-bar strong{font-size:13px}#world-tour-bar>div{min-width:120px;margin-right:2px}#world-tour-bar button{height:34px;padding:4px 8px}#world-tour-bar button span{font-size:11px}}

@media(max-width:1100px) and (max-height:780px){body.playing #battle-btn{height:36px;min-height:36px;width:92px;min-width:92px;padding:2px 3px;gap:1px;line-height:1.1}body.playing #battle-btn small{font-size:10px;letter-spacing:0}}

/* The dock masks only the non-playable ground apron. */
body.playing #bench{position:relative;z-index:2;background:#182c3ee8;border:1px solid #9eb5b5;border-radius:9px;box-shadow:0 3px 0 #102332,0 -2px 0 #d6dfba33}
.world-tour-active #hud-bottom .footer-head{visibility:visible;position:fixed;left:50%;bottom:85px;transform:translateX(-50%);width: min(684px,74vw);pointer-events:none}
.world-tour-active #hud-bottom .footer-head #battle-btn,.world-tour-active #hud-deploy-count{visibility:hidden}
@media(max-width:1100px) and (max-height:780px){.world-tour-active #hud-bottom .footer-head{bottom:66px;width:min(531px,70vw)}}
/* Shared merge/awakening grade art: never inherit portrait image dimensions. */
.battle-grade{display:inline-flex!important;align-items:center;justify-content:center;gap:0;vertical-align:middle;line-height:1;white-space:nowrap}
.battle-grade>img{display:block!important;width:14px!important;height:14px!important;min-width:14px;max-width:none!important;object-fit:contain!important;position:static!important;transform:none!important;filter:none!important;margin:0!important;image-rendering:auto!important}
.battle-grade.grade-4{filter:drop-shadow(0 0 2px #33d5ae66)}
.battle-grade.grade-5{filter:drop-shadow(0 0 3px #ffd46f88)}
.battle-grade.grade-l5{filter:drop-shadow(0 0 3px #b48cffaa)} /* 12코 전설 5성 보라 별(사용자 결정 B) */
.battle-grade.grade-5>img{width:21px!important;height:21px!important;min-width:21px}
.enemy-portrait .battle-grade>img{width:10px!important;height:10px!important;min-width:10px}
.enemy-portrait .battle-grade.grade-5>img{width:15px!important;height:15px!important;min-width:15px}
.mega-roster{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.mega-roster article{max-width:none;background:#112a3c80;border-color:#78abac}
.mega-roster article>img{display:none}.mega-roster article>b{display:flex;gap:6px;align-items:center}
.mega-preview{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;padding:8px 0}
.mega-preview>img{width:68px;height:68px;object-fit:contain;image-rendering:pixelated}
.mega-preview>div{flex-basis:100%;text-align:center}.mega-preview small{display:block;line-height:1.6;margin-top:5px}
#mega-btn{color:#c0ffeb;border-color:#66b49f}
.tour-destinations{grid-template-columns:repeat(3,minmax(0,1fr))}.tour-destinations img{aspect-ratio:3/2}
@media(max-height:500px){.tour-menu{width:min(830px,94vw)}.tour-destinations img{max-height:108px}.tour-destinations strong{font-size:13px}.tour-destinations small{font-size:11px;padding-top:4px}.tour-destinations button{padding-bottom:7px}.mega-roster{grid-template-columns:repeat(2,minmax(220px,1fr))}}
@media(max-width:600px) and (orientation:portrait){.tour-destinations{grid-template-columns:1fr 1fr}}
/* Title-only photographs/illustrations; no changes to battle or laboratory scenery. */
#title-cover{background:#142338;isolation:isolate}
#title-cover .title-background{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .32s ease;z-index:-3;pointer-events:none}
#title-cover .title-background.ready{opacity:1}
#title-cover:before{content:'';position:absolute;inset:0;background:linear-gradient(90deg,#08142622,#08142655 35%,#08142655 65%,#08142622),linear-gradient(0deg,#08142672,transparent 35%,#08142635);z-index:-2;pointer-events:none}
#title-cover .title-grid,#title-cover .title-rays,#title-cover .title-partners{display:none}
#title-cover .title-heading{filter:drop-shadow(0 2px 4px #081526bb)}
#title-cover .title-heading>small,#title-cover .title-heading>p{color:#fffef0;text-shadow:0 1px 3px #061021,0 0 6px #061021}
#title-cover .title-menu button{background:linear-gradient(#263f59ee,#14283dee);border-color:#94b9c4;backdrop-filter:blur(3px)}
#title-cover .title-menu #title-start{background:linear-gradient(#b94540f0,#82262bf0);border-color:#efb481}
@media(prefers-reduced-motion:reduce){#title-cover .title-background{transition:none}}
