/* The map and the battlefield are edge-to-edge; inventory and skill pages retain their own UI. */
#riftView[data-screen="map"],#riftView[data-screen="battle"] { position:fixed; inset:0; width:100%; height:100dvh; z-index:80; }
#riftView:is([data-screen="map"],[data-screen="battle"])>.rift-header { display:none; }
#riftView[data-screen="map"] .rift-main { padding:0 0 78px; width:100%; max-width:1440px; }
#riftView[data-screen="map"] .rift-scroll { background:#111d2c; }
.rift-map-canvas { width:100%; }
.rift-building-region { position:relative; width:100%; aspect-ratio:16/9; isolation:isolate; }
.rift-building-region>img { display:block; width:100%; height:100%; object-fit:fill; pointer-events:none; }
#riftView .rift-building-button { position:absolute; border:0; border-radius:0; padding:0; min-height:0; background:none; box-shadow:none; overflow:visible; }
.rift-building-button::before { content:""; position:absolute; inset:-8px; min-width:44px; min-height:44px; }
.rift-building-art { display:block; position:absolute; inset:0; background-repeat:no-repeat; clip-path:polygon(0 26%,22% 17%,45% 0,71% 17%,100% 23%,97% 100%,3% 100%); transition:filter .2s; pointer-events:none; }
.rift-building-button[aria-disabled=true] .rift-building-art { filter:saturate(.45) brightness(.65); }
.rift-building-button:is(:hover,:focus-visible):not([aria-disabled=true]) .rift-building-art,.rift-building-button[aria-current] .rift-building-art { filter:brightness(1.2) drop-shadow(0 0 8px #ffe7a4); }
#riftView .rift-building-button:focus-visible { outline:2px solid #ffe8ac; outline-offset:3px; }
.rift-map-utilities { position:fixed; z-index:5; top:max(12px,env(safe-area-inset-top)); left:max(12px,env(safe-area-inset-left)); right:max(12px,env(safe-area-inset-right)); display:flex; justify-content:space-between; pointer-events:none; }
.rift-map-dock { position:fixed; z-index:5; bottom:max(14px,env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); display:flex; gap:18px; }
#riftView :is(.rift-map-utilities,.rift-map-dock,.rift-action-top)>button { display:grid; place-items:center; padding:0; width:48px; height:48px; min-height:44px; border:1px solid #d9c59099; border-radius:13px; background:linear-gradient(145deg,#293948e8,#0d1c2ce8); color:#f3e1af; box-shadow:0 3px 12px #06111d88; backdrop-filter:blur(8px); }
#riftView :is(.rift-map-utilities,.rift-map-dock)>button { pointer-events:auto; }
#riftView :is(.rift-map-utilities,.rift-map-dock,.rift-action-top)>button svg { width:25px; height:25px; }
#riftView[data-screen="battle"] .rift-scroll.action-game { padding:0; }
#riftView[data-screen="battle"] .rift-action-shell { position:relative; padding:0; gap:0; max-width:none; margin:0; height:100%; }
#riftView[data-screen="battle"] .rift-action-stage { border:0; border-radius:0; min-height:0; max-height:none; width:100%; height:100%; flex:1; }
#riftView[data-screen="battle"] .rift-action-top { position:absolute; top:max(10px,env(safe-area-inset-top)); right:max(12px,env(safe-area-inset-right)); z-index:6; gap:9px; }
#riftView[data-screen="battle"] .rift-action-top>div { display:none; }
#riftView[data-screen="battle"] :is(.rift-action-route,.rift-action-equipment,.rift-action-message) { display:none; }
#riftView .rift-action-controls :is(.rift-abilities,.rift-spellbar) { display:contents; }
#riftView .rift-action-controls button { max-width:none; max-height:none; margin:0; border-radius:50%; }
#riftView .rift-action-controls .rift-skill-jump,#riftView .rift-action-controls .rift-skill-dodge { width:auto; }
.rift-boss-track>.rift-boss-chip { position:absolute; left:2px; top:2px; height:calc(100% - 4px); max-width:calc(100% - 4px); opacity:.6; background:#fff2bd; pointer-events:none; border-radius:8px; }
.rift-boss-track>i { position:relative; z-index:1; }
.rift-boss-hud>.rift-boss-track { overflow:visible; }
.rift-settings { position:fixed; inset:0; margin:auto; z-index:10000; color:#edf2f7; background:linear-gradient(145deg,#263749,#101d2d); border:1px solid #aa956c; border-radius:17px; width:min(720px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); padding:18px; overflow:auto; font:14px/1.5 system-ui; box-sizing:border-box; }
.rift-settings::backdrop { background:#03101cbb; backdrop-filter:blur(5px); }
.rift-settings header,.rift-settings footer,.rift-layout-tools,.rift-size-control { display:flex; align-items:center; gap:10px; }
.rift-settings header { justify-content:space-between; }
.rift-settings h2 { font-size:20px; margin:0; }
.rift-settings button,.rift-settings select { font:inherit; color:#e9f2f9; border:1px solid #697f96; border-radius:8px; background:#20364c; padding:7px 13px; min-height:38px; cursor:pointer; }
.rift-settings button:focus-visible { outline:2px solid #f6d390; outline-offset:2px; }
.rift-settings header button { padding:0; width:38px; font-size:24px; }
.rift-settings nav { display:flex; gap:8px; margin:14px 0; }
.rift-settings button[aria-selected=true],.rift-settings button[aria-pressed=true],.rift-settings button[data-capturing=true] { background:#9b7b41; border-color:#f0d49b; color:#fff2c9; }
.rift-key-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; }
.rift-key-grid label { display:flex; align-items:center; justify-content:space-between; gap:5px; padding:7px; background:#0c1a2977; border-radius:8px; }
.rift-key-grid button { min-width:65px; font-weight:700; }
.rift-settings-hint { font-size:12px; color:#a9bdce; margin:12px 0; }
.rift-settings footer { justify-content:space-between; border-top:1px solid #73829855; padding-top:13px; }
.rift-settings footer button:last-child { background:#c4a15b; border-color:#ddbf81; color:#191d25; font-weight:750; }
.rift-layout-tools select { margin-left:auto; max-width:45%; }
.rift-layout-preview { position:relative; width:100%; aspect-ratio:16/9; margin-top:12px; border:1px solid #728da4; border-radius:10px; background:linear-gradient(#13263855,#14262633),url(images/rift-hunt/scenes-v13/stage-01.webp) center/cover; touch-action:none; overflow:hidden; }
.rift-layout-preview[data-mode=portrait] { width:min(230px,100%); aspect-ratio:9/16; margin-inline:auto; }
.rift-settings .rift-layout-preview button { position:absolute; transform:translate(-50%,-50%); padding:0; min-height:0; border-radius:50%; font-size:clamp(8px,1.5vw,11px); background:#142c45d9; border-color:#a8c5da; touch-action:none; user-select:none; }
.rift-settings .rift-layout-preview button[data-layout-action=joystick] { color:#cce2ed; background:radial-gradient(circle,#5f91acb8 0 28%,#19394eb8 30% 65%,#6c9dbf99 66%); }
.rift-settings .rift-layout-preview button[data-selected=true] { outline:2px solid #ffda85; outline-offset:2px; }
.rift-size-control { margin-top:13px; }
.rift-size-control input { flex:1; min-width:40px; accent-color:#dfbd74; }
.rift-size-control output { width:45px; }
@media(max-width:600px){.rift-key-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.rift-settings{padding:12px;}#riftView[data-screen="battle"] .rift-vital-hud{width:min(255px,calc(100% - 128px));}.rift-map-dock{gap:13px;}}
@media(max-height:500px) and (orientation:landscape){.rift-settings{padding:10px 16px;}.rift-settings .rift-layout-preview{max-height:220px;width:auto;aspect-ratio:16/9;margin-inline:auto;}.rift-settings .rift-layout-preview[data-mode=portrait]{height:200px;aspect-ratio:9/16;}.rift-map-utilities{top:6px;}#riftView[data-screen="battle"] .rift-action-top{top:6px;}#riftView :is(.rift-map-utilities,.rift-action-top)>button{height:42px;width:42px;min-height:42px;}}
@media(prefers-reduced-motion:reduce){.rift-building-art{transition:none;}}
