/* G92 landscape HUD fixes. Loads after e32.css. Phones in landscape (874x402, 874x350) first, portrait second. */

/* dev-only links and the phase jump bar: only with ?dev */
html:not(.dev) #phaseJump,html:not(.dev) .subtle-link[href="art.html"]{display:none !important}

/* 44px touch targets for menu and tool buttons */
.menu-btn,.tools button,#campBack,body.run16 .tools button,body.run16 #campBack{min-height:44px}
.cs .cs-back,.cs .cs-classic{min-height:44px}
.cs .cs-arrow,.cs.short .cs-arrow{width:48px;height:48px;min-height:48px}
.cs-bodyrow button{min-height:44px}

/* party frames: taller rows, bigger text and hp bar; the healer's pick gets a thick green ring */
body.run16 .pf{min-height:44px;font-size:12.5px;padding:5px 8px}
body.run16 .pf b{font-size:12.5px}
body.run16 .pf-hp{height:10px;border-radius:5px}
body.run16 .pf{grid-template-columns:24px minmax(0,1fr) 70px}
body.run16 .pf.heal-pick{box-shadow:0 0 0 3px #7fd38f,0 0 12px rgba(127,211,143,.45);border-color:#7fd38f}

/* switch target: at least 48px */
#switchTarget{--t:max(48px,calc(var(--b) * .74))}

/* enemy list: 44px rows, a wider column */
#enemyList{width:150px}
#enemyList .el{min-height:44px;font-size:11px;padding:4px 7px 5px;grid-template-rows:auto 6px}
#enemyList .el .eb{height:6px}

/* hall mini map: small square around you, or the whole hall. Tap to switch. */
body.run16 #minimap{width:90px;height:90px;cursor:pointer;touch-action:none;pointer-events:auto}
html[data-hud-map="large"] body.run16 #minimap{width:150px;height:min(320px,72vh);opacity:.95}

/* cooldowns: a dark sweep plus big whole seconds; a short flash when ready */
#touchControls button[data-cd]{position:absolute;overflow:hidden}
#touchControls button[data-cd]::before{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:conic-gradient(rgba(0,0,0,.62) calc(var(--cdp,0) * 360deg),transparent 0)}
#touchControls button[data-cd]::after{content:attr(data-cd);position:absolute;inset:0;display:grid;place-content:center;pointer-events:none;
  font:800 22px/1 'IBM Plex Sans',system-ui,sans-serif;color:#fff;text-shadow:0 1px 3px #000,0 0 6px #000}
#touchControls button.g92-ready{animation:g92ready .45s ease-out}
@keyframes g92ready{0%{box-shadow:0 0 0 0 rgba(255,231,168,.9)}100%{box-shadow:0 0 0 14px rgba(255,231,168,0)}}
.g92-dim{opacity:.7}
@media (prefers-reduced-motion:reduce){#touchControls button.g92-ready{animation:none}}

/* objective: one line in landscape */
@media (orientation:landscape) and (max-height:540px){
  body.run16 #objective{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:46vw;font-size:11.5px}
}

/* short landscape (iPhone 874x402 and 874x350): bigger thumb buttons, 2-row enemy list, quick chat beside the stick */
@media (orientation:landscape) and (max-height:540px){
  body.run16 #touchControls{--a:76px;--b:58px;--o:66px}
  #enemyList .el{min-height:40px}
  body.run16 #qcBtn{left:calc(max(18px,env(safe-area-inset-left)) + 120px);bottom:max(12px,calc(env(safe-area-inset-bottom) + 6px))}
}
@media (orientation:landscape) and (max-height:380px){
  body.run16 #touchControls{--a:70px;--b:54px;--o:60px}
  body.run16 #minimap{width:78px;height:78px}
  #campCard .intro,#campCard .fine{display:none}
}

/* portrait: keep the diamond clear of the home indicator */
@media (orientation:portrait){
  body.run16 #touchControls{--cy:calc(var(--o) + var(--b) / 2 + env(safe-area-inset-bottom))}
}

/* camp: round action button on phones, in the attack spot; desktop keeps the full line */
.camp-prompt .cp-verb,.camp-prompt .cp-name{display:none}
@media (pointer:coarse){
  .camp-prompt{left:auto;transform:none;right:max(22px,calc(env(safe-area-inset-right) + 14px));bottom:max(22px,calc(env(safe-area-inset-bottom) + 14px));
    width:84px;height:84px;min-height:84px;padding:0;border-radius:50%;display:grid;place-content:center;justify-items:center;gap:2px;white-space:normal;
    border-width:3px;background:radial-gradient(circle at 32% 28%,#4a3e26,#1d1810)}
  .camp-prompt:active:not(:disabled){transform:translateY(1px)}
  .camp-prompt .cp-long{display:none}
  .camp-prompt .cp-verb{display:block;font-size:18px;line-height:1;color:#fff3d2}
  .camp-prompt .cp-name{display:block;font-size:9.5px;line-height:1.1;max-width:70px;text-align:center;color:var(--gold-pale);font-weight:600}
  .camp-hint{bottom:max(116px,calc(env(safe-area-inset-bottom) + 108px))}
}

/* View settings */
.g92-camp-right{display:flex;gap:6px;align-items:center;pointer-events:auto}
.g92-view-btn{min-height:44px}
.g92-view-btn.camp-view-btn{min-height:44px;padding:7px 12px;font-size:13px;background:rgba(16,19,17,.86)}
.g92-view{position:fixed;z-index:40;left:50%;top:50%;transform:translate(-50%,-50%);width:min(360px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;
  padding:12px 14px;border-radius:12px;background:linear-gradient(180deg,#1c1f1b,#121411);border:1px solid var(--stone-edge,#3d3a30);box-shadow:0 14px 40px rgba(0,0,0,.6);color:var(--ink,#eee)}
.g92-view[hidden]{display:none}
.g92-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.g92-head strong{font-size:16px;color:var(--gold-pale,#f3dfae)}
.g92-head .g92-x{min-height:44px;padding:6px 14px;font-size:13px}
.g92-rows{display:flex;flex-direction:column;gap:8px}
.g92-row{display:flex;flex-direction:column;gap:4px}
.g92-row>span{font-size:12px;color:var(--ink-mid,#bbb)}
.g92-seg{display:flex;border:1px solid var(--stone-edge,#3d3a30);border-radius:10px;overflow:hidden}
.g92-seg button{flex:1;min-height:44px;border:0;border-radius:0;margin:0;background:rgba(255,255,255,.03);color:var(--ink,#eee);font-size:13px;font-weight:600;box-shadow:none}
.g92-seg button+button{border-left:1px solid var(--stone-edge,#3d3a30)}
.g92-seg button.on{background:#3a3220;color:#fff3d2;box-shadow:inset 0 -3px 0 var(--gold,#d9b25c)}
.g92-tip{margin:4px 0 0;font-size:11.5px;color:var(--ink-mid,#bbb)}
@media (orientation:landscape) and (max-height:540px){.g92-rows{display:grid;grid-template-columns:1fr 1fr;gap:8px 10px}.g92-view{width:min(560px,calc(100vw - 24px))}}

/* floating stick */
#stick.g92-float{transition:none}

/* one-time "turn sideways" card */
#g92Rotate{position:fixed;z-index:30;left:50%;top:max(72px,calc(env(safe-area-inset-top) + 60px));transform:translateX(-50%);width:min(330px,calc(100vw - 24px));
  display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:12px;background:rgba(18,20,18,.95);border:1px solid var(--gold,#d9b25c);box-shadow:0 10px 30px rgba(0,0,0,.55)}
#g92Rotate p{margin:0;flex:1;display:flex;flex-direction:column;gap:2px;font-size:13px}
#g92Rotate small{font-size:11.5px;color:var(--ink-mid,#bbb)}
#g92Rotate button{min-height:44px;padding:6px 14px}
.g92-rot-ico{width:30px;height:20px;border:2px solid var(--gold,#d9b25c);border-radius:4px;transform:rotate(-20deg);flex:none}

/* portrait phones: the square map goes under the enemy list (beside it, it would cover the party hp bars) */
@media (orientation:portrait) and (max-width:760px){
  body.run16 #minimap,body.run16 #sideCol:has(#enemyList[hidden]) #minimap{position:static;order:3;align-self:flex-end}
}

/* short landscape: the large map stops above the Target button; the open menu uses two columns so it clears the thumb buttons */
@media (orientation:landscape) and (max-height:540px){
  html[data-hud-map="large"] body.run16 #minimap{width:130px;height:calc(100dvh - 222px)}
  body.run16.menu16 .tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;width:200px}
  body.run16.menu16 .tools button{min-height:44px}
}

/* v2: no overlapping thumb buttons. Spacing (--o) is at least half of attack + half of a side button + 4px. */
body.run16 #touchControls{--o:72px}
@media (orientation:landscape) and (max-height:540px){ body.run16 #touchControls{--a:76px;--b:58px;--o:72px} }
@media (orientation:landscape) and (max-height:380px){ body.run16 #touchControls{--a:70px;--b:54px;--o:67px} }
@media(max-width:350px) and (orientation:portrait){ body.run16 #touchControls{--a:64px;--b:56px;--o:65px} }
/* camp: quick chat sits beside the camp stick instead of on top of it */
@media (pointer:coarse){ body:has(#campView:not([hidden])) #qcBtn{left:calc(max(18px,env(safe-area-inset-left)) + 124px);bottom:max(22px,calc(env(safe-area-inset-bottom) + 14px))} }

/* solid backing behind the mini map: the hall's framed side rooms must never read as part of it */
body.run16 #minimap{background:#0c0f0e;opacity:1;border:1.5px solid var(--stone-edge,#3d3a30);border-radius:8px;box-shadow:0 0 0 3px #0c0f0e,0 8px 22px rgba(0,0,0,.6)}
html[data-hud-map="large"] body.run16 #minimap{opacity:1}

/* G94: the cooldown seconds take the icon's place (top half), so the skill name below stays readable (dimmed) */
#touchControls button[data-cd]::after{inset:0 0 50% 0;place-content:end center;padding-bottom:1px;font-size:20px}
#touchControls button[data-cd] > span{visibility:hidden}
#touchControls button[data-cd] > b{opacity:.62;position:relative;z-index:1}
