:root{
  --night:#06171e;--night2:#0a252e;--panel:rgba(5,19,25,.90);--panel2:rgba(9,31,38,.96);
  --cream:#f4eedc;--gold:#e8c77d;--gold2:#ffe1a0;--silver:#bde8e5;--muted:#9db4b4;
  --red:#ff8178;--green:#9bd79f;--line:rgba(202,224,219,.18);--violet:#c9a7e8;
}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:var(--night);color:var(--cream);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}body{-webkit-tap-highlight-color:transparent;user-select:none}button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation;-webkit-appearance:none;appearance:none}button:focus-visible{outline:2px solid var(--gold2);outline-offset:3px}button svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linejoin:round;stroke-linecap:round}.svg-library,.hidden-controls{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;opacity:0!important;pointer-events:none!important}[hidden]{display:none!important}
#app{position:relative;width:100%;height:100%;height:100dvh;overflow:hidden;background:#071a21}#world{display:block;width:100%;height:100%;touch-action:none}

/* TITLE */
#title-screen{position:absolute;inset:0;display:flex;align-items:center;background:linear-gradient(90deg,rgba(2,12,18,.96) 0%,rgba(2,12,18,.80) 34%,rgba(2,12,18,.14) 70%,rgba(2,12,18,.03));overflow:hidden}
.title-brand{position:absolute;top:max(26px,env(safe-area-inset-top));left:max(32px,5vw);display:flex;align-items:center;gap:12px;font-size:10px;letter-spacing:3.2px;color:#c7d5d1}.title-brand svg{width:28px;height:28px;color:var(--gold)}
.title-copy{margin-left:max(36px,8vw);width:min(520px,82vw);transform:translateY(-2vh)}.eyebrow{margin:0 0 18px;color:var(--gold);font-size:10px;letter-spacing:3px;font-weight:800}.title-copy h1{margin:0;font-family:Georgia,"Times New Roman",serif;font-size:clamp(74px,10vw,142px);font-weight:400;line-height:.88;letter-spacing:-5px;text-shadow:0 8px 40px rgba(0,0,0,.3)}.subtitle{margin:15px 0 31px;font-family:Georgia,"Times New Roman",serif;font-size:clamp(17px,2vw,25px);letter-spacing:7px;color:var(--gold)}
.title-menu{display:flex;flex-direction:column;align-items:flex-start;gap:9px;width:280px;max-width:100%}.menu-primary,.menu-secondary{width:100%;min-height:52px;border-radius:9px;padding:0 17px;display:flex;align-items:center;justify-content:space-between}.menu-primary{border:1px solid #f0cf87;background:linear-gradient(180deg,#efd38e,#dcb76e);color:#13262c;font-weight:800;box-shadow:0 12px 40px rgba(0,0,0,.25)}.menu-primary:hover{filter:brightness(1.07);transform:translateY(-1px)}.menu-secondary{border:1px solid rgba(217,230,222,.18);background:rgba(8,30,36,.70);color:#dce6e1;justify-content:flex-start}.menu-secondary:hover{background:rgba(23,54,60,.86);border-color:rgba(229,209,156,.4)}
.title-caption{margin:18px 0 0;font-size:10px;letter-spacing:.7px;color:#8ea8a8}.title-corner{position:absolute;right:max(26px,4vw);bottom:max(25px,env(safe-area-inset-bottom));text-align:right;font-size:9px;letter-spacing:2px;color:#829fa2}.title-corner span,.title-corner b{display:block}.title-corner b{color:var(--gold);font-weight:600;margin-top:5px}.title-sound{position:absolute;right:max(26px,4vw);top:max(22px,env(safe-area-inset-top))}.title-controls{position:absolute;left:max(32px,5vw);bottom:max(24px,env(safe-area-inset-bottom));border:0;background:none;color:#96acad;font-size:11px;padding:8px 0}

.icon-button{border:1px solid var(--line);background:rgba(6,23,29,.76);border-radius:11px;width:42px;height:42px;display:inline-flex;align-items:center;justify-content:center;backdrop-filter:blur(10px)}.icon-button:hover{background:rgba(27,57,63,.9);border-color:rgba(234,211,157,.35)}

/* HUD */
#hud{position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,rgba(1,8,13,.62),transparent 150px,transparent calc(100% - 115px),rgba(1,8,13,.56));}
#hud button{pointer-events:auto}.combat-hud{position:absolute;left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));top:max(14px,env(safe-area-inset-top));display:flex;justify-content:space-between;align-items:flex-start}.player-card{width:300px;max-width:46vw;display:flex;align-items:center;gap:10px;padding:9px 11px;border:1px solid var(--line);border-radius:14px;background:linear-gradient(180deg,rgba(5,19,24,.93),rgba(6,27,32,.84));box-shadow:0 9px 30px rgba(0,0,0,.28);backdrop-filter:blur(10px)}.portrait-chip{width:39px;height:39px;flex:0 0 auto;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle at 35% 30%,#6f9996,#294750 70%);border:1px solid rgba(220,239,228,.28);font:18px Georgia,serif}.player-bars{flex:1;min-width:0}.bar-row{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:7px;letter-spacing:1.4px;font-weight:800}.bar-row span:last-child{font-size:8px;letter-spacing:.1px;color:#d7e1dc}.hp-row{color:#ffb4aa}.light-row{margin-top:6px;color:#c3efeb}#health-meter,#light-meter{height:7px;margin-top:4px;border-radius:999px;overflow:hidden;background:rgba(255,255,255,.09)}#health-fill,#light-fill{height:100%;width:100%;border-radius:999px;transition:width .12s}#health-fill{background:linear-gradient(90deg,#b84554,#ff8979);box-shadow:0 0 12px rgba(255,96,93,.25)}#light-fill{background:linear-gradient(90deg,#4c91a6,#c9eee8);box-shadow:0 0 13px rgba(146,229,224,.2)}.low-health #health-fill{animation:hpPulse .65s ease-in-out infinite alternate}@keyframes hpPulse{to{filter:brightness(1.55)}}.hud-menu{width:40px;height:40px}

.objective-strip{position:absolute;top:max(15px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);max-width:min(430px,42vw);min-width:280px;padding:8px 14px;border:1px solid rgba(232,203,136,.17);border-radius:12px;background:rgba(5,18,23,.76);text-align:center;box-shadow:0 8px 28px rgba(0,0,0,.2);backdrop-filter:blur(10px)}.objective-strip>span:first-child{display:block;font-size:6px;letter-spacing:2.2px;color:var(--gold)}.objective-strip strong{display:block;margin:2px 0;font:400 16px Georgia,serif}.objective-strip #quest-detail{display:block;font-size:9px;color:#a8bdb9}.objective-strip #quest-checks{display:flex;justify-content:center;gap:9px;margin-top:5px;font-size:7px;color:#8ea7a4}.objective-strip #quest-checks .done{color:var(--gold2)}
#boss-hud{position:absolute;left:50%;top:94px;transform:translateX(-50%);width:min(500px,58vw);padding:7px 12px 9px;text-align:center;background:rgba(10,8,17,.78);border:1px solid rgba(202,160,235,.24);border-radius:11px;backdrop-filter:blur(10px)}#boss-name{font-size:9px;letter-spacing:2.3px;color:#e0c1f2}#boss-meter{height:7px;background:#2d2036;border-radius:999px;overflow:hidden;margin:6px 0 4px}#boss-fill{height:100%;width:100%;background:linear-gradient(90deg,#8756a8,#d6a3ef);border-radius:999px;transition:width .15s}#boss-phase{font-size:8px;color:#b5a9bf}
#guidance{position:absolute;top:85px;right:max(14px,env(safe-area-inset-right));display:flex;align-items:center;gap:6px;padding:6px 9px;border-radius:999px;background:rgba(6,22,27,.70);border:1px solid rgba(225,199,132,.18);font-size:10px;color:var(--gold);backdrop-filter:blur(8px)}#guidance-arrow{display:inline-flex;width:17px;height:17px;align-items:center;justify-content:center;font-size:16px}#guidance-distance{font-size:8px;color:#8ba8a8;margin-left:3px}
#combo-readout{position:absolute;right:24px;top:142px;display:flex;flex-direction:column;align-items:flex-end;text-shadow:0 3px 14px #000}#combo-readout strong{font:400 31px Georgia,serif;color:#f3d78f}#combo-readout span{font-size:7px;letter-spacing:2.2px;color:#b9cfca}#perfect-dodge{position:absolute;left:50%;top:34%;transform:translate(-50%,-50%);font-size:11px;font-weight:900;letter-spacing:3px;color:#d9ffff;text-shadow:0 0 18px #9de9ef,0 3px 8px #000;animation:pop .25s ease-out}@keyframes pop{from{transform:translate(-50%,-50%) scale(.7);opacity:0}to{transform:translate(-50%,-50%) scale(1);opacity:1}}
#tutorial-tip{position:absolute;left:50%;bottom:135px;transform:translateX(-50%);display:flex;align-items:center;gap:9px;padding:7px 11px;border-radius:9px;background:rgba(5,18,23,.88);border:1px solid rgba(233,213,160,.25);box-shadow:0 8px 28px rgba(0,0,0,.25);font-size:10px}#tutorial-tip strong{font-size:8px;letter-spacing:1px;color:#14282f;background:var(--gold);border-radius:5px;padding:4px 7px}#tutorial-tip span{color:#dce7e2}
#context-action{position:absolute;left:50%;bottom:118px;transform:translateX(-50%);min-height:42px;padding:8px 14px;border-radius:999px;border:1px solid rgba(232,203,136,.35);background:rgba(5,20,25,.92);display:flex;align-items:center;gap:10px;font-size:11px;box-shadow:0 8px 26px rgba(0,0,0,.25)}#context-action .key{color:#172a30;background:var(--gold);border-radius:5px;padding:3px 7px;font-size:9px;font-weight:900}#context-action svg{width:15px;color:var(--gold)}
#toast{position:absolute;left:50%;top:93px;transform:translateX(-50%) translateY(-8px);max-width:520px;padding:9px 17px;border-radius:999px;border:1px solid rgba(202,218,188,.22);background:rgba(9,31,36,.93);font-size:11px;text-align:center;box-shadow:0 8px 28px rgba(0,0,0,.3);opacity:0;transition:.2s}#toast.show{opacity:1;transform:translateX(-50%)}#location-toast{position:absolute;left:50%;top:20%;transform:translateX(-50%);font:27px Georgia,serif;letter-spacing:2px;text-shadow:0 2px 18px #000;opacity:0;transition:opacity .8s}#location-toast.show{opacity:1}#banter{position:absolute;left:50%;bottom:155px;transform:translateX(-50%);max-width:560px;width:max-content;padding:11px 17px;border-radius:12px;border:1px solid var(--line);background:rgba(5,20,25,.92);font:15px/1.45 Georgia,serif;text-align:center;box-shadow:0 8px 26px rgba(0,0,0,.3)}#banter strong{display:block;margin-bottom:4px;font:800 8px system-ui,sans-serif;letter-spacing:2px;color:var(--gold)}

.bottom-hud{position:absolute;left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right));bottom:max(15px,env(safe-area-inset-bottom));display:flex;justify-content:center;align-items:flex-end}.desktop-actions{display:flex;gap:4px;padding:5px;border-radius:14px;border:1px solid var(--line);background:rgba(5,20,26,.88);backdrop-filter:blur(10px);box-shadow:0 10px 34px rgba(0,0,0,.32)}.ability{position:relative;width:78px;height:62px;border:0;border-radius:9px;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;color:#d8ece8;transition:.14s}.ability:hover{background:rgba(91,126,125,.18)}.ability.flash{transform:scale(.96);background:rgba(142,194,184,.24)}.ability svg{width:22px}.ability>span:not(.ability-number):not(.ability-cost){font-size:8px}.ability-number{position:absolute;left:5px;top:4px;font-size:7px;color:#7f9c9f}.ability-cost{font-size:6px!important;color:#8ea7a5}.combat-primary{color:#f0f9f7;background:linear-gradient(180deg,rgba(91,150,158,.16),transparent)}.combat-bolt{color:#d5f0ff}.combat-dodge{color:#d7dcff}.combat-heal{color:#bce9bf}.combat-burst{color:#f6d786}.desktop-hint{position:absolute;left:0;bottom:4px;display:flex;gap:10px;font-size:8px;color:#88a4a5}.desktop-hint span{display:flex;align-items:center;gap:4px}kbd{font:8px system-ui,sans-serif;letter-spacing:.7px;padding:3px 5px;border-radius:4px;border:1px solid rgba(155,184,184,.28);background:rgba(12,42,48,.7);color:#c9d9d5}

/* TOUCH */
#touch-controls{display:none}.touch-actions{position:absolute;right:max(13px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));width:230px;height:210px;pointer-events:none}.touch-actions button{pointer-events:auto;position:absolute;border-radius:50%;border:1px solid rgba(219,230,214,.28);background:rgba(14,45,51,.88);color:#eef3e8;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;box-shadow:0 8px 25px rgba(0,0,0,.32);backdrop-filter:blur(7px)}.touch-actions button svg{width:22px}.touch-actions button span{font-size:7px}.touch-actions #touch-attack{right:0;bottom:0;width:82px;height:82px;color:#ffe5a8;border-color:rgba(255,224,163,.5);background:rgba(40,79,85,.93)}.touch-actions #touch-dodge{right:92px;bottom:8px;width:58px;height:58px;color:#dde0ff}.touch-actions #touch-bolt{right:96px;bottom:78px;width:56px;height:56px;color:#d8efff}.touch-actions #touch-heal{right:28px;bottom:92px;width:55px;height:55px;color:#c4eec4}.touch-actions #touch-burst{right:160px;bottom:72px;width:55px;height:55px;color:#f6d786}.touch-actions #touch-interact{right:92px;bottom:145px;width:50px;height:50px;color:#efd38c;opacity:.75}.touch-actions #touch-interact.ready{opacity:1;border-color:rgba(238,207,137,.65);box-shadow:0 0 0 4px rgba(234,202,129,.08),0 8px 24px rgba(0,0,0,.3)}
#joystick{position:absolute;left:max(22px,env(safe-area-inset-left));bottom:max(30px,env(safe-area-inset-bottom));width:120px;height:120px;border-radius:50%;border:1px solid rgba(200,223,216,.15);background:radial-gradient(circle,rgba(40,78,81,.25),rgba(4,19,25,.32));box-shadow:inset 0 0 22px rgba(0,0,0,.18);touch-action:none}#joystick:before{content:"";position:absolute;inset:36%;border-radius:50%;background:rgba(195,225,217,.08)}#joystick-knob{position:absolute;left:50%;top:50%;width:50px;height:50px;margin:-25px;border-radius:50%;background:radial-gradient(circle at 35% 30%,rgba(207,239,231,.55),rgba(64,107,109,.62));border:1px solid rgba(224,239,231,.22);box-shadow:0 5px 17px rgba(0,0,0,.27)}

/* DIALOGUE + MODALS */
#dialogue{position:absolute;left:50%;bottom:max(25px,env(safe-area-inset-bottom));transform:translateX(-50%);z-index:30;width:min(890px,92vw);min-height:175px;display:flex;gap:20px;padding:20px 23px;border:1px solid rgba(213,193,141,.35);border-radius:16px;background:rgba(5,20,26,.97);box-shadow:0 25px 100px rgba(0,0,0,.62);backdrop-filter:blur(13px)}.portrait-wrap{width:86px;height:105px;flex:0 0 auto;align-self:center;overflow:hidden;border-radius:13px;background:linear-gradient(#2d5159,#17323a);border:1px solid rgba(161,205,198,.22)}#portrait{width:106px;height:106px;transform:translateX(-10px)}.dialogue-main{flex:1;min-width:0;display:flex;flex-direction:column}.dialogue-heading{display:flex;justify-content:space-between;gap:20px;font-size:9px;letter-spacing:2px;color:var(--gold);font-weight:800}.dialogue-heading span:last-child{color:#6f8e90}#dialogue-text{margin:11px 0 16px;font:18px/1.55 Georgia,serif;color:#f0ebd9}.dialogue-next{align-self:flex-end;border:0;background:none;color:var(--gold);display:flex;align-items:center;gap:8px;font-size:10px;letter-spacing:1px}.dialogue-next svg{width:15px}#dialogue-choices{display:flex;flex-wrap:wrap;gap:8px;margin-top:auto}#dialogue-choices button{border:1px solid rgba(230,203,141,.28);background:rgba(37,61,62,.65);border-radius:8px;padding:10px 12px;font-size:11px}
#modal-backdrop{position:absolute;inset:0;z-index:40;display:grid;place-items:center;padding:20px;background:rgba(0,8,12,.68);backdrop-filter:blur(5px)}#modal{position:relative;width:min(760px,94vw);max-height:min(760px,90dvh);overflow:auto;border:1px solid rgba(207,219,194,.22);border-radius:17px;background:linear-gradient(180deg,rgba(9,29,35,.99),rgba(5,20,26,.99));box-shadow:0 25px 110px rgba(0,0,0,.7);padding:28px}.modal-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:21px}.secondary,.primary{min-height:43px;border-radius:8px;padding:9px 14px}.secondary{border:1px solid rgba(203,219,211,.2);background:rgba(32,62,67,.58)}.primary{border:1px solid #e2c078;background:#e4c681;color:#172b31;font-weight:800}.primary svg{width:16px}.lead{font:18px/1.6 Georgia,serif;color:#eee8d5}.small,#modal-content p{font-size:12px;line-height:1.65;color:#adc1bc}#modal-title{font:400 31px Georgia,serif;margin:4px 45px 15px 0}#modal-eyebrow{font-size:8px;margin-bottom:0}#modal-close{position:absolute;right:18px;top:18px}.setting-row{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:13px 0;border-bottom:1px solid rgba(207,223,217,.1)}.setting-row button{min-width:110px}.notes-list{display:grid;gap:10px;margin-top:18px}.note-entry{padding:15px;border:1px solid rgba(194,214,207,.14);border-radius:10px;background:rgba(28,55,59,.32)}.note-entry h3{font:400 19px Georgia,serif;margin:5px 0}.note-entry.locked{opacity:.45}.full-map{width:100%;height:auto;border:1px solid rgba(206,221,209,.14);border-radius:10px}.map-legend{display:flex;gap:15px;justify-content:center;margin-top:9px;font-size:9px;color:#91aaaa}.chapter-quote{margin:22px 0;padding:19px;border-left:2px solid var(--gold);background:rgba(232,199,125,.06);font:18px/1.55 Georgia,serif;color:#efe2bd}.end-stats{display:flex;gap:12px}.end-stats div{flex:1;padding:12px;border:1px solid var(--line);border-radius:9px;font-size:10px}.end-stats strong{display:block;font:22px Georgia,serif;color:var(--gold)}
#fatal{position:absolute;inset:0;z-index:100;background:#071b22;display:grid;place-content:center;text-align:center;padding:30px}#fatal button{justify-self:center;padding:12px 18px;border-radius:8px;background:var(--gold);color:#13282e;border:0}

@media(pointer:coarse){#touch-controls{display:block}.desktop-actions,.desktop-hint{display:none}.objective-strip{top:max(62px,calc(env(safe-area-inset-top) + 52px));max-width:72vw;min-width:210px;padding:6px 9px}.objective-strip strong{font-size:13px}.objective-strip #quest-detail,.objective-strip #quest-checks{display:none!important}#guidance{top:max(105px,calc(env(safe-area-inset-top) + 94px));right:10px}.combat-hud{left:10px;right:10px}.player-card{width:205px;max-width:58vw;padding:7px 8px}.portrait-chip{width:32px;height:32px;font-size:15px}.hud-menu{width:34px;height:34px}#boss-hud{top:max(109px,calc(env(safe-area-inset-top) + 102px));width:70vw}#context-action{display:none!important}#tutorial-tip{bottom:215px}#banter{bottom:220px;max-width:84vw;font-size:13px}#toast{top:auto;bottom:218px;max-width:80vw}.bottom-hud{display:none}}
@media(max-width:700px){#title-screen{background:linear-gradient(180deg,rgba(2,12,18,.58),rgba(2,12,18,.95) 70%)}.title-brand{left:20px;top:max(18px,env(safe-area-inset-top))}.title-copy{margin:0 20px;width:calc(100% - 40px);align-self:flex-end;margin-bottom:max(90px,calc(env(safe-area-inset-bottom) + 65px));transform:none}.title-copy h1{font-size:clamp(68px,20vw,105px)}.subtitle{font-size:16px;margin:10px 0 24px}.title-menu{width:100%}.title-caption{font-size:9px}.title-corner{display:none}.title-controls{left:20px}.title-sound{right:18px}.objective-strip{min-width:190px}.player-card{width:190px}.portrait-chip{display:none}.bar-row{font-size:6px}.bar-row span:last-child{font-size:7px}#dialogue{bottom:max(14px,env(safe-area-inset-bottom));width:95vw;padding:15px;gap:12px;min-height:145px}.portrait-wrap{width:62px;height:78px}#portrait{width:82px;height:82px}#dialogue-text{font-size:15px;margin:8px 0 10px}.dialogue-heading{font-size:7px}#joystick{left:14px;width:108px;height:108px}.touch-actions{right:8px;transform:scale(.9);transform-origin:bottom right}}
@media(max-height:540px) and (pointer:coarse){.objective-strip{top:8px;left:52%;max-width:45vw}.combat-hud{top:8px}.player-card{width:180px}.touch-actions{bottom:5px;transform:scale(.72);transform-origin:bottom right}#joystick{bottom:8px;transform:scale(.78);transform-origin:bottom left}#banter,#toast{bottom:115px}#tutorial-tip{bottom:100px}#guidance{display:none!important}#boss-hud{top:58px;width:45vw}.portrait-chip{display:none}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}
.control-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:18px 0}.control-grid>div{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:10px 12px;border:1px solid rgba(202,221,214,.12);border-radius:8px;background:rgba(29,55,60,.28);font-size:11px;color:#bfd0cc}.danger{border-color:rgba(255,130,130,.28)!important;color:#ffb0aa!important}.micro{font-size:8px;letter-spacing:1.6px;color:#93aaa8}.note-entry .eyebrow{display:block;font-size:7px;margin:0;color:var(--gold)}small{color:#8fa8a7}.reduce-motion #world{image-rendering:auto}@media(max-width:620px){.control-grid{grid-template-columns:1fr}.setting-row{align-items:flex-start;flex-direction:column}.setting-row>div{display:flex;flex-wrap:wrap;gap:5px}}

/* v5.1 mobile-input hotfix: force a dedicated touch layer on narrow screens and
   keep legacy/desktop controls out of the iPhone layout. */
#touch-controls{position:absolute;inset:0;z-index:26;pointer-events:none}
#joystick{z-index:2;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;overscroll-behavior:none}
.touch-actions{z-index:3}
@media (max-width:900px){
  #touch-controls{display:block!important}
  .desktop-actions,.desktop-hint,.bottom-hud{display:none!important}
  #joystick{pointer-events:auto!important}
}
@media (hover:none){
  #touch-controls{display:block!important}
  .desktop-actions,.desktop-hint{display:none!important}
}


/* v5.2 iOS/Safari input + layout hardening */
html,body,#app{overscroll-behavior:none;-webkit-overflow-scrolling:auto}
body.touch-device #touch-controls{display:block!important}
body.touch-device .desktop-actions,body.touch-device .desktop-hint,body.touch-device .bottom-hud{display:none!important}
#touch-controls{position:absolute;inset:0;z-index:26;pointer-events:none}
#joystick,.touch-actions button{pointer-events:auto!important;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.touch-actions button{touch-action:manipulation!important;isolation:isolate}
.touch-actions button:active{filter:brightness(1.22);transform:scale(.94)}
@media(max-width:900px){body.touch-device #touch-controls{display:block!important}}
@media(max-height:540px){
 body.touch-device .touch-actions{bottom:6px;transform:scale(.85);transform-origin:bottom right}
 body.touch-device #joystick{bottom:9px;transform:scale(.88);transform-origin:bottom left}
 body.touch-device #banter{bottom:110px;max-width:64vw;font-size:12px}
 body.touch-device #tutorial-tip{bottom:92px}
 body.touch-device #toast{bottom:105px}
}

body.touch-device .touch-actions #touch-interact{min-width:52px;min-height:52px}

/* v6 loot + progression */
.currency-mini{display:flex;gap:8px;margin:5px 0 0 42px;font-size:9px;letter-spacing:.7px;color:#dac98f}.currency-mini span{display:inline-flex;align-items:center;gap:4px;padding:3px 7px;border:1px solid rgba(226,199,132,.15);border-radius:999px;background:rgba(4,20,27,.42)}.currency-mini b{font-size:10px;color:#f3e6bc}
.currency-row{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 18px}.currency-row span{padding:8px 11px;border-radius:999px;border:1px solid rgba(224,202,144,.18);background:rgba(25,51,56,.45);font-size:11px;color:#efe0b1}.upgrade-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.upgrade-card{padding:15px;border:1px solid rgba(196,218,210,.14);border-radius:12px;background:rgba(30,57,61,.35)}.upgrade-card h3{font:400 20px Georgia,serif;margin:4px 0 7px}.upgrade-card p{min-height:42px}.upgrade-card button{width:100%;margin-top:8px}.maxed{display:block;margin-top:14px;color:#d8c27f;font-size:10px;letter-spacing:1.2px}.relic-title{margin:24px 0 10px;font:400 23px Georgia,serif}.relic-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.relic-card{padding:13px;border:1px solid rgba(194,216,210,.14);border-radius:10px;background:rgba(24,49,55,.38);display:flex;flex-direction:column;gap:5px}.relic-card strong{color:#efe1ae}.relic-card span{font-size:10px;line-height:1.45;color:#a9c0bb}.relic-card.mythic{border-color:rgba(240,199,105,.35);box-shadow:inset 0 0 24px rgba(240,199,105,.05)}.relic-card.locked{opacity:.55}.ability .ability-number{white-space:nowrap}.combat-primary .ability-number{font-size:7px}
@media(max-width:700px){.currency-mini{margin-left:0;margin-top:4px}.upgrade-grid,.relic-grid{grid-template-columns:1fr}.currency-mini span{padding:2px 6px;font-size:8px}.currency-mini b{font-size:9px}}

/* v7 combat/world overhaul */
#app{position:fixed;left:0;top:0;right:auto;bottom:auto}
#rotation-shield{position:absolute;inset:0;z-index:95;display:grid;place-items:center;background:#06171ef2;backdrop-filter:blur(8px)}
#rotation-shield>div{display:flex;flex-direction:column;align-items:center;gap:8px;color:var(--cream);text-align:center}
#rotation-shield svg{width:38px;height:38px;fill:none;stroke:var(--gold);stroke-width:1.5}
#rotation-shield strong{font:400 22px Georgia,serif}
#rotation-shield span{font-size:10px;color:var(--muted);letter-spacing:1px}

body.combat-active .objective-strip{min-width:0;width:auto;max-width:44vw;padding:5px 10px;background:rgba(4,16,21,.72)}
body.combat-active .objective-strip>span:first-child,body.combat-active .objective-strip #quest-detail,body.combat-active .objective-strip #quest-checks{display:none!important}
body.combat-active .objective-strip strong{font:600 11px/1.1 system-ui,sans-serif;letter-spacing:.2px;margin:0;color:#e9e4d5}
body.combat-active #location-toast{display:none!important}
body.combat-active #banter{top:max(78px,calc(env(safe-area-inset-top) + 66px));bottom:auto;max-width:min(520px,56vw);padding:6px 11px;font:12px/1.32 Georgia,serif;background:rgba(4,18,23,.78);border-color:rgba(219,201,150,.15);box-shadow:none;pointer-events:none}
body.combat-active #banter strong{display:inline;margin:0 6px 0 0;font-size:7px}
body.combat-active #toast{top:max(112px,calc(env(safe-area-inset-top) + 100px));bottom:auto;padding:6px 11px;font-size:9px;max-width:45vw;background:rgba(6,23,29,.78)}

.ability-modal{width:min(560px,92vw)!important;text-align:center;overflow:hidden!important}
.ability-unlock{display:grid;justify-items:center;gap:10px;padding:10px 4px 4px}
.ability-glyph{width:76px;height:76px;border-radius:50%;display:grid;place-items:center;font-size:35px;color:#ffe2a1;border:1px solid rgba(240,205,132,.32);background:radial-gradient(circle,rgba(234,199,125,.17),rgba(11,33,39,.18));box-shadow:0 0 50px rgba(232,199,125,.12)}
.ability-control{margin:0;padding:7px 12px;border-radius:999px;background:#e2c37d;color:#152a31;font-size:9px;font-weight:900;letter-spacing:1.2px}
.ability-unlock .lead{margin:3px 0 0;max-width:460px}.ability-unlock .primary{margin-top:7px;min-width:150px}

.ability.locked,.touch-actions button.locked{opacity:.3;filter:saturate(.25);pointer-events:none!important}

@media(pointer:coarse){
 body.combat-active #banter{top:max(118px,calc(env(safe-area-inset-top) + 104px));max-width:58vw;font-size:10px;padding:5px 8px}
 body.combat-active #toast{top:max(148px,calc(env(safe-area-inset-top) + 136px));max-width:58vw}
 body.combat-active #guidance{opacity:.72}
}

/* iPhone/phone landscape: fixed sizes instead of scaled HUD groups */
@media (orientation:landscape) and (max-height:560px){
 .combat-hud{top:max(6px,env(safe-area-inset-top));left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right))}
 .player-card{width:174px!important;max-width:31vw!important;padding:5px 7px!important;border-radius:10px}.portrait-chip{display:none!important}.currency-mini{margin:3px 0 0!important;gap:4px}.currency-mini span{padding:1px 4px!important;font-size:7px!important}.currency-mini b{font-size:8px!important}
 .bar-row{font-size:5px!important}.bar-row span:last-child{font-size:6px!important}#health-meter,#light-meter{height:5px!important;margin-top:2px!important}.light-row{margin-top:3px!important}
 .hud-menu{width:32px!important;height:32px!important;border-radius:9px}
 .objective-strip{top:max(7px,env(safe-area-inset-top))!important;left:50%!important;max-width:37vw!important;min-width:0!important;padding:4px 8px!important}.objective-strip strong{font-size:11px!important}.objective-strip>span:first-child{font-size:5px!important}
 #boss-hud{top:max(47px,calc(env(safe-area-inset-top) + 42px))!important;width:42vw!important;padding:4px 8px!important}
 #guidance{top:max(49px,calc(env(safe-area-inset-top) + 43px))!important;right:max(8px,env(safe-area-inset-right))!important;padding:4px 7px!important;font-size:8px!important}
 #joystick{left:max(12px,env(safe-area-inset-left))!important;bottom:max(12px,env(safe-area-inset-bottom))!important;width:92px!important;height:92px!important;transform:none!important}#joystick-knob{width:40px!important;height:40px!important;margin:-20px!important}
 .touch-actions{right:max(8px,env(safe-area-inset-right))!important;bottom:max(8px,env(safe-area-inset-bottom))!important;width:198px!important;height:164px!important;transform:none!important}
 .touch-actions #touch-attack{width:70px!important;height:70px!important}.touch-actions #touch-dodge{right:76px!important;bottom:4px!important;width:51px!important;height:51px!important}.touch-actions #touch-bolt{right:79px!important;bottom:60px!important;width:49px!important;height:49px!important}.touch-actions #touch-heal{right:20px!important;bottom:75px!important;width:48px!important;height:48px!important}.touch-actions #touch-burst{right:137px!important;bottom:55px!important;width:48px!important;height:48px!important}.touch-actions #touch-interact{right:76px!important;bottom:113px!important;width:46px!important;height:46px!important;min-width:46px!important;min-height:46px!important}
 .touch-actions button svg{width:18px!important}.touch-actions button span{font-size:6px!important}
 #banter{bottom:100px!important;max-width:56vw!important;font-size:10px!important;padding:5px 9px!important}body.combat-active #banter{top:max(49px,calc(env(safe-area-inset-top) + 44px))!important;bottom:auto!important;max-width:42vw!important;left:52%!important}
 #toast{bottom:98px!important;max-width:55vw!important;font-size:8px!important;padding:5px 9px!important}body.combat-active #toast{top:max(80px,calc(env(safe-area-inset-top) + 74px))!important;bottom:auto!important;max-width:40vw!important}
 #tutorial-tip{bottom:94px!important}.bottom-hud{display:none!important}
}

/* v7.5 COMPLETE PROTOTYPE PASS */
/* Objective is deliberately one line during play. Full detail remains in pause/map. */
.objective-strip{min-width:0!important;width:auto!important;max-width:min(420px,44vw)!important;padding:6px 11px!important}
.objective-strip>span:first-child,.objective-strip #quest-detail,.objective-strip #quest-checks{display:none!important}
.objective-strip strong{font:600 12px/1.15 system-ui,sans-serif!important;letter-spacing:.15px!important;margin:0!important;color:#eee9db!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Dialogue banter is a subtitle, never a center-screen card. */
#banter,body.combat-active #banter{top:auto!important;left:50%!important;bottom:max(92px,calc(env(safe-area-inset-bottom) + 82px))!important;transform:translateX(-50%)!important;width:auto!important;max-width:min(720px,74vw)!important;padding:6px 12px!important;border-radius:8px!important;background:rgba(3,14,19,.82)!important;border:1px solid rgba(224,207,158,.12)!important;font:12px/1.35 Georgia,serif!important;box-shadow:0 4px 18px rgba(0,0,0,.26)!important;text-align:center!important;pointer-events:none}
#banter strong,body.combat-active #banter strong{display:inline!important;margin:0 7px 0 0!important;font:800 7px system-ui,sans-serif!important;letter-spacing:1.5px!important;color:var(--gold)!important}

/* General notifications live high and to the side. Loot has its own feed. */
#toast,body.combat-active #toast{left:auto!important;right:max(14px,env(safe-area-inset-right))!important;top:max(70px,calc(env(safe-area-inset-top) + 58px))!important;bottom:auto!important;transform:translateY(-5px)!important;max-width:min(300px,38vw)!important;padding:6px 10px!important;border-radius:8px!important;font-size:9px!important;text-align:right!important;background:rgba(6,22,28,.84)!important}
#toast.show{transform:translateY(0)!important}
#loot-feed{position:absolute;right:max(14px,env(safe-area-inset-right));top:max(112px,calc(env(safe-area-inset-top) + 100px));z-index:24;display:grid;gap:5px;width:min(250px,34vw);pointer-events:none}
.loot-feed-item{justify-self:end;max-width:100%;padding:5px 9px;border-radius:7px;background:rgba(5,20,26,.78);border:1px solid rgba(207,219,194,.12);box-shadow:0 5px 15px rgba(0,0,0,.22);font-size:9px;line-height:1.2;color:#e7dfc6;animation:lootIn .16s ease-out}
.loot-feed-item.rare{color:#ffe0a0;border-color:rgba(240,204,127,.26)}
@keyframes lootIn{from{opacity:0;transform:translateX(12px)}to{opacity:1;transform:none}}

#world-event{position:absolute;right:max(14px,env(safe-area-inset-right));top:max(176px,calc(env(safe-area-inset-top) + 164px));z-index:23;width:min(225px,32vw);padding:8px 10px;border-radius:10px;border:1px solid rgba(211,160,238,.22);background:rgba(20,13,31,.82);box-shadow:0 8px 25px rgba(0,0,0,.24);pointer-events:none}
#world-event .event-kicker{display:block;font-size:6px;letter-spacing:1.8px;color:#d4a8ed}#world-event strong{display:block;margin:2px 0;font:400 13px Georgia,serif;color:#f0d8ff}#world-event small{font-size:8px;color:#b7a7c1}

#reward-card{position:absolute;left:50%;top:max(92px,calc(env(safe-area-inset-top) + 80px));transform:translate(-50%,-10px);z-index:25;display:grid;justify-items:center;gap:3px;min-width:220px;max-width:66vw;padding:9px 16px;border-radius:11px;border:1px solid rgba(238,205,128,.28);background:linear-gradient(180deg,rgba(35,37,30,.94),rgba(9,27,31,.94));box-shadow:0 10px 34px rgba(0,0,0,.34);opacity:0;transition:.22s;pointer-events:none}
#reward-card.show{opacity:1;transform:translate(-50%,0)}#reward-card span{font-size:6px;letter-spacing:2px;color:#e8c87e}#reward-card strong{font:400 17px Georgia,serif;color:#fff1c5}#reward-card small{font-size:8px;color:#afc1bb}

/* Ability screens read like game tutorials and pause the world. */
.ability-meta{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin:2px 0 4px}.ability-meta span{padding:5px 8px;border-radius:999px;border:1px solid rgba(219,205,165,.16);background:rgba(29,50,52,.42);font-size:8px;color:#c7d6d1}.ability-unlock .primary{min-width:170px}

/* Boss health stays above gameplay and is never displaced by subtitles. */
#boss-hud{z-index:24}

/* Aggro cue visual style is canvas-driven; this handles the text accessibility chip. */
body.combat-active #guidance{opacity:.55}

/* On mobile, keep the subtitle above controls and loot on the opposite edge. */
@media(pointer:coarse){
  .objective-strip{top:max(58px,calc(env(safe-area-inset-top) + 50px))!important;max-width:56vw!important}
  .objective-strip strong{font-size:11px!important}
  #banter,body.combat-active #banter{bottom:max(176px,calc(env(safe-area-inset-bottom) + 166px))!important;max-width:82vw!important;font-size:11px!important;padding:5px 9px!important}
  #loot-feed{top:max(104px,calc(env(safe-area-inset-top) + 92px));width:44vw;right:max(8px,env(safe-area-inset-right))}.loot-feed-item{font-size:8px;padding:4px 7px}
  #world-event{top:max(156px,calc(env(safe-area-inset-top) + 144px));width:42vw;right:max(8px,env(safe-area-inset-right));padding:6px 8px}
  #reward-card{top:max(96px,calc(env(safe-area-inset-top) + 84px));max-width:78vw;min-width:190px}
}

/* Dedicated landscape HUD. No scaling of whole groups. */
@media (orientation:landscape) and (max-height:560px){
  .objective-strip{left:50%!important;top:max(7px,env(safe-area-inset-top))!important;max-width:34vw!important}
  #banter,body.combat-active #banter{bottom:max(72px,calc(env(safe-area-inset-bottom) + 62px))!important;max-width:48vw!important;font-size:9px!important;padding:4px 8px!important}
  #loot-feed{top:max(46px,calc(env(safe-area-inset-top) + 40px))!important;width:28vw!important}.loot-feed-item{font-size:7px!important}
  #world-event{top:max(92px,calc(env(safe-area-inset-top) + 86px))!important;width:27vw!important}
  #reward-card{top:max(48px,calc(env(safe-area-inset-top) + 42px))!important}
  #toast,body.combat-active #toast{top:max(46px,calc(env(safe-area-inset-top) + 40px))!important;max-width:27vw!important;font-size:7px!important}
}

/* Mild cinematic bars are rendered by canvas; keep controls in safe areas. */
body.orientation-paused #touch-controls{opacity:.18}

/* Final mobile notification lanes: keep the center of play clear. */
@media(pointer:coarse){
  #loot-feed{left:max(8px,env(safe-area-inset-left))!important;right:auto!important;top:max(118px,calc(env(safe-area-inset-top) + 106px))!important;width:min(42vw,210px)!important}
  .loot-feed-item{justify-self:start!important;text-align:left!important}
  body.combat-active #guidance{opacity:.38!important}
}
@media (orientation:landscape) and (max-height:560px){
  #loot-feed{left:max(8px,env(safe-area-inset-left))!important;right:auto!important;top:max(78px,calc(env(safe-area-inset-top) + 72px))!important;width:min(25vw,180px)!important}
  #world-event{right:max(8px,env(safe-area-inset-right))!important;left:auto!important}
}


/* v7.7 first-launch settings notice */
.welcome-modal{width:min(650px,92vw)!important}.welcome-modal #modal-title{margin-bottom:8px}.welcome-lead{margin:0 0 15px!important;text-align:center}.welcome-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:14px 0}.welcome-grid article{padding:12px 13px;border:1px solid rgba(207,223,217,.13);border-radius:11px;background:rgba(27,54,59,.38);display:flex;flex-direction:column;gap:5px}.welcome-grid strong{font-size:11px;color:#efe2b9}.welcome-grid span{font-size:9px;line-height:1.45;color:#a9c0bb}.settings-anytime{text-align:center!important;margin:14px 0 8px!important;padding:12px;border-radius:10px;background:rgba(226,192,120,.07);border:1px solid rgba(226,192,120,.18);color:#d6e3df!important}.settings-anytime strong{color:#f1dda8}.menu-glyph{display:inline-block;margin-right:3px;color:#e8cb86;font-size:16px;vertical-align:-1px}.welcome-actions{justify-content:center}.welcome-actions button{min-width:160px}@media(max-width:560px){.welcome-grid{grid-template-columns:1fr}.welcome-modal{padding:22px!important}.welcome-actions{flex-direction:column}.welcome-actions button{width:100%}}

/* V8 interface. One information lane per purpose; the centre remains gameplay. */
.build-badge{position:absolute;left:max(32px,5vw);bottom:max(57px,calc(env(safe-area-inset-bottom) + 52px));font-size:9px;letter-spacing:1.5px;color:#a9c4bd;pointer-events:none}
.title-brand svg{fill:none;stroke:var(--gold);stroke-width:1.4}
#link-action{position:absolute;left:max(14px,env(safe-area-inset-left));top:92px;display:flex;align-items:center;gap:8px;width:176px;min-height:49px;border:1px solid #b8d3c32e;border-radius:11px;padding:7px 10px;background:#081d25ed;color:#aebfba;z-index:28;pointer-events:auto;touch-action:none!important}
#link-action svg{width:25px;height:25px;flex-shrink:0;color:#cbcf9b}.link-copy{display:grid;text-align:left;gap:4px;flex:1}.link-copy b{font-size:8px;letter-spacing:1.2px;white-space:nowrap}.link-copy small{font-size:8px;line-height:1}.link-track{height:4px;border-radius:5px;background:#68858733;overflow:hidden}.link-track>span{display:block;width:0;height:100%;background:linear-gradient(90deg,#a6e2df,#e8c582);transition:width .1s}#link-action kbd{font-size:9px}#link-action.ready{color:#162c32;background:linear-gradient(135deg,#ffdda3,#dcc683);border-color:#fff0c0;box-shadow:0 0 22px #f1cf8138}#link-action.ready svg{color:#385653}#link-action.ready .link-track{background:#84663b44}#link-action.ready .link-track>span{background:#213f42}#link-action.linking{opacity:.6}
#world-event{max-width:180px}body.combat-active #world-event{display:none!important}body.combat-active #banter,body.combat-active #location-toast,body.combat-active #reward-card,body.combat-active #tutorial-tip{display:none!important}
body.combat-active #guidance{display:none!important}
#loot-feed{top:160px!important;width:186px!important;right:auto!important;left:max(14px,env(safe-area-inset-left))!important}
.loot-feed-item{font-size:10px!important;line-height:1.3;max-width:185px;white-space:normal;background:#061a22d9}.loot-feed-item:not(.rare){opacity:.82}
#toast,body.combat-active #toast{max-width:186px!important;font-size:10px!important;left:max(14px,env(safe-area-inset-left))!important;right:auto!important;top:218px!important;padding:7px 9px!important;line-height:1.35!important}
#banter{max-width:580px!important;font:13px/1.4 Georgia,serif!important;padding:6px 12px!important}
#banter strong{display:inline!important;margin-right:8px;font-size:8px!important}
#boss-hud{top:max(58px,calc(env(safe-area-inset-top) + 52px))!important;width:min(410px,40vw)!important;max-width:410px;pointer-events:none}#boss-name{font-size:10px;letter-spacing:2px}#boss-phase{font-size:8px}
.ability.cooling{filter:saturate(.5);opacity:.6}.touch-combat.cooling{filter:saturate(.6);opacity:.72}
#modal{max-height:calc(100dvh - 32px);overscroll-behavior:contain}#modal-content{line-height:1.5}#modal button:disabled{opacity:.42;cursor:default}.techniques-section{margin:28px 0;border-top:1px solid #bdd8bf20;padding-top:24px}.techniques-section>.eyebrow{margin:0 0 8px}.techniques-section>h3{font:26px Georgia,serif;margin:0 0 7px;color:#efd59f}.tech-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:16px}.tech-card{border:1px solid #bcd7c328;border-radius:12px;padding:16px;background:linear-gradient(140deg,#233e42,#12292f)}.tech-card.learned{border-color:#d9c4876b;background:linear-gradient(140deg,#2b433b,#172b2c)}.tech-card .eyebrow{font-size:8px;margin-bottom:9px;letter-spacing:1.5px}.tech-card h3{font:22px Georgia,serif;margin:0 0 9px;color:#f0d8a3}.tech-card p{font-size:12px;line-height:1.55;min-height:57px;color:#bdcfcb}.tech-card button{width:100%;font-size:12px;min-height:42px}.volume-row input{max-width:210px;width:40%;accent-color:#e7c98a;touch-action:auto;min-height:42px}.map-destinations{display:flex;gap:8px;flex-wrap:wrap}.map-destinations>p{flex-basis:100%;margin:8px 0 0}.map-destinations button{font-size:12px;min-height:42px}
.setting-row small{font-size:11px!important;line-height:1.4}.setting-row button{font-size:12px!important;min-height:38px}.setting-row strong{font-size:13px}.setting-row{gap:16px}
body.touch-device .desktop-actions,body.touch-device .desktop-hint{display:none!important}
body.touch-device #touch-controls{display:block!important}
body.touch-device .touch-actions{transform:none!important;right:max(10px,env(safe-area-inset-right))!important;bottom:max(12px,env(safe-area-inset-bottom))!important;width:188px!important;height:185px!important}
body.touch-device .touch-actions button{touch-action:none!important}
body.touch-device .touch-actions #touch-attack{right:0!important;bottom:0!important;width:74px!important;height:74px!important}
body.touch-device .touch-actions #touch-dodge{right:85px!important;bottom:5px!important;width:54px!important;height:54px!important}
body.touch-device .touch-actions #touch-bolt{right:122px!important;bottom:72px!important;width:54px!important;height:54px!important}
body.touch-device .touch-actions #touch-heal{right:24px!important;bottom:85px!important;width:53px!important;height:53px!important}
body.touch-device .touch-actions #touch-burst{right:85px!important;bottom:132px!important;width:53px!important;height:53px!important}
body.touch-device .touch-actions #touch-interact{right:0!important;bottom:145px!important;width:48px!important;height:48px!important;min-width:48px!important;min-height:48px!important}
body.touch-device .touch-actions button span{font-size:9px!important;line-height:1.1}body.touch-device .touch-actions button svg{width:21px!important;height:21px!important}
body.touch-device #joystick{left:max(12px,env(safe-area-inset-left))!important;bottom:max(16px,env(safe-area-inset-bottom))!important;width:100px!important;height:100px!important;transform:none!important}
body.touch-device #link-action{left:max(12px,env(safe-area-inset-left));top:auto;bottom:max(133px,calc(env(safe-area-inset-bottom) + 127px));width:104px;min-height:49px;padding:7px;gap:4px}body.touch-device #link-action svg{width:18px;height:18px}body.touch-device #link-action kbd{display:none}body.touch-device .link-copy b{font-size:6.5px;letter-spacing:.35px}body.touch-device .link-copy small{font-size:7px}body.touch-device #link-action.ready{width:114px}
body.touch-device .combat-hud{top:max(10px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right))}body.touch-device .player-card{max-width:65vw;width:230px}.hud-menu{min-width:42px;min-height:42px}.bar-row{font-size:8px!important;letter-spacing:.8px}.bar-row span:last-child{font-size:9px!important}.currency-mini{font-size:9px}
body.touch-device .objective-strip{top:max(79px,calc(env(safe-area-inset-top) + 70px))!important;max-width:70vw!important;padding:5px 10px!important;min-width:0!important}body.touch-device .objective-strip strong{font-size:11px!important}
body.touch-device #boss-hud{top:max(106px,calc(env(safe-area-inset-top) + 98px))!important;width:66vw!important}
body.touch-device #loot-feed{top:max(117px,calc(env(safe-area-inset-top) + 109px))!important;left:10px!important;width:130px!important;max-height:90px;overflow:hidden}body.touch-device .loot-feed-item{font-size:8px!important;max-width:130px;padding:4px 6px!important}
body.touch-device #toast{left:10px!important;top:210px!important;max-width:130px!important;font-size:9px!important}
body.touch-device #banter{bottom:max(209px,calc(env(safe-area-inset-bottom) + 203px))!important;font-size:11px!important;max-width:85vw!important}
body.touch-device #world-event{top:136px!important;max-width:150px!important;right:10px!important;font-size:9px}body.touch-device #guidance{top:103px!important;max-width:170px;font-size:9px}
body.touch-device #context-action{display:none!important}
@media(max-width:560px){.tech-grid{grid-template-columns:1fr}.tech-card p{min-height:0}.tech-card{padding:13px}.setting-row{flex-direction:column;align-items:flex-start!important;gap:9px}.setting-row input{width:100%;max-width:none}.setting-row>div{display:flex;gap:5px;flex-wrap:wrap}.build-badge{left:20px;bottom:max(52px,calc(env(safe-area-inset-bottom) + 48px));font-size:8px}.title-copy{margin-bottom:max(98px,calc(env(safe-area-inset-bottom) + 75px))}}
@media(orientation:landscape) and (max-height:560px){
 body.touch-device .player-card{width:200px;max-width:30vw;padding:6px 8px}.bar-row{font-size:6px!important}.bar-row span:last-child{font-size:8px!important}.light-row{margin-top:3px}#health-meter,#light-meter{height:5px;margin-top:3px}
 body.touch-device .combat-hud{top:max(6px,env(safe-area-inset-top))!important}.currency-mini{font-size:8px}
 body.touch-device .objective-strip{top:max(8px,env(safe-area-inset-top))!important;max-width:35vw!important}
 body.touch-device #link-action{left:50%!important;transform:translateX(-50%);bottom:max(8px,env(safe-area-inset-bottom))!important;top:auto!important;width:136px!important;min-height:41px!important}
 body.touch-device .touch-actions{height:161px!important;width:176px!important;bottom:max(7px,env(safe-area-inset-bottom))!important}
 body.touch-device .touch-actions #touch-attack{width:68px!important;height:68px!important}
 body.touch-device .touch-actions #touch-dodge{right:76px!important;bottom:0!important;width:50px!important;height:50px!important}
 body.touch-device .touch-actions #touch-bolt{right:122px!important;bottom:55px!important;width:48px!important;height:48px!important}
 body.touch-device .touch-actions #touch-heal{right:42px!important;bottom:76px!important;width:48px!important;height:48px!important}
 body.touch-device .touch-actions #touch-burst{right:99px!important;bottom:111px!important;width:48px!important;height:48px!important}
 body.touch-device .touch-actions #touch-interact{right:0!important;bottom:122px!important;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important}
 body.touch-device .touch-actions button span{font-size:8px!important}body.touch-device #joystick{width:89px!important;height:89px!important}
 body.touch-device #boss-hud{top:48px!important;width:38vw!important}#boss-name{font-size:9px}#boss-phase{font-size:7px}
 body.touch-device #loot-feed{top:71px!important;width:135px!important;max-height:56px}body.touch-device #toast{top:130px!important;max-width:130px!important}
 body.touch-device #banter{bottom:58px!important;font-size:10px!important;max-width:47vw!important}
 body.touch-device #world-event{top:50px!important;max-width:144px!important;font-size:8px}
 .title-copy h1{font-size:78px!important}.title-copy{margin-left:6vw!important;align-self:center!important;margin-bottom:0!important;transform:none!important}.title-copy .eyebrow{margin-bottom:10px;font-size:8px}.subtitle{margin:8px 0 13px;font-size:17px}.title-menu{gap:5px;width:245px}.menu-primary,.menu-secondary{min-height:38px!important;font-size:12px}.title-brand{font-size:7px;top:12px;left:6vw}.title-brand svg{width:18px}.title-caption{font-size:8px}.build-badge{left:auto;right:22px;bottom:18px;font-size:7px}.title-corner{display:none}#modal{padding:18px 22px!important;max-height:calc(100dvh - 16px);width:min(690px,88vw)!important}#modal-title{font-size:25px!important}.ability-glyph{display:none}.ability-unlock p{margin:7px 0!important}.welcome-grid{grid-template-columns:1fr 1fr!important;gap:6px}.welcome-grid article{padding:7px}.welcome-modal .welcome-lead{font-size:12px!important}
}
@media(max-width:350px) and (orientation:portrait){body.touch-device .touch-actions{right:6px!important;transform:scale(.92)!important;transform-origin:bottom right!important}body.touch-device #joystick{left:8px!important;width:88px!important;height:88px!important}body.touch-device #link-action{width:100px;left:8px;bottom:123px}body.touch-device #link-action.ready{width:105px}body.touch-device .player-card{width:204px;max-width:68vw}.title-copy h1{font-size:68px!important}}
body.reduce-motion *{animation:none!important;transition:none!important}

/* Boss encounters reserve a dedicated upper-centre lane. */
@media(orientation:portrait){body.touch-device.boss-active #loot-feed{top:max(186px,calc(env(safe-area-inset-top) + 178px))!important;max-height:54px!important;width:120px!important}body.touch-device.boss-active #toast{top:242px!important}body.touch-device #boss-hud{padding:7px 10px!important}body.touch-device #boss-name{font-size:9px!important;letter-spacing:1.2px}body.touch-device #boss-phase{font-size:7px!important}}
/* Compact boss strip: inline text must not inherit a large HUD line box. */
#boss-hud{line-height:1.15!important}#boss-name,#boss-phase{display:block;line-height:1.2!important}#boss-meter{height:6px;margin:5px 0 4px}
