/* ui-hud.css - the in-run HUD (original layout): hero plate top-left, route and boss bar top-centre, minimap and purse top-right,
   attributes bottom-left, one action bar bottom-centre. Touch controls at the end of the file. */
#hud { position: absolute; inset: 0; padding: .6em; pointer-events: none; }
#hud.off { display: none; }
.ui[data-screen="title"] #hud, .ui[data-screen="hub"] #hud { display: none; }
#hud > div { position: absolute; }
.hud-tl { top: .6em; left: .6em; width: min(23em, 46%); }
.plate { display: flex; gap: .55em; align-items: flex-start; padding: .45em; background: linear-gradient(rgba(16, 12, 8, .86), rgba(8, 6, 4, .86)); border: 1px solid #5a4b2e; border-radius: .35em; box-shadow: 0 .2em .8em rgba(0, 0, 0, .5); }
.plate .portrait .ico.l { width: 3.8em; height: 3.8em; border: 2px solid #8a7440; border-radius: .25em; }
.vitals { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35em; }
.vitals .bar.hp { height: 1.55em; }
.rrow { display: flex; align-items: center; gap: .5em; min-height: .8em; }
.pips { display: flex; gap: .2em; } .pp { width: .8em; height: .8em; border-radius: 50%; background: #2a2318; border: 1px solid #5a4b2e; } .pp.full { background: radial-gradient(#ffe69a, #d49a22); border-color: #f0c84b; box-shadow: 0 0 .35em rgba(240, 200, 75, .6); }
.rrow .bar { flex: 1; }
.flask { display: flex; gap: .25em; min-height: .9em; } .fp { width: .9em; height: 1.15em; border-radius: .25em .25em .4em .4em; background: #2a1414; border: 1px solid #5a2a2a; } .fp.full { background: linear-gradient(#ff6a5a, #b3261e); border-color: #ff9a8a; box-shadow: 0 0 .3em rgba(255, 90, 70, .5); }
.ui .lowhp .bar.hp { animation: lowhp .8s ease-in-out infinite; } @keyframes lowhp { 50% { box-shadow: 0 0 0 1px #ff6b5a, 0 0 .8em #ff2a1a; } }

.hud-tc { top: .6em; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .4em; width: min(26em, 30%); min-width: 14em; }
.biome { display: flex; gap: .8em; align-items: baseline; padding: .25em .9em; background: rgba(10, 8, 5, .78); border: 1px solid #4a3d25; border-radius: 1em; font: 700 max(10.5px, .85em) var(--serif); letter-spacing: .06em; color: #e8d9a8; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.biome .timer { color: #9a927f; font-family: var(--sans); font-weight: 600; }
.boss { width: 100%; text-align: center; } .boss-name { font: 700 .9em var(--serif); color: #ffd0ea; text-shadow: 0 1px 3px #000; margin-bottom: .2em; letter-spacing: .08em; }
.boss .bar { height: 1.3em; }

.hud-tr { top: .6em; right: .6em; display: flex; flex-direction: column; align-items: flex-end; gap: .4em; }
.mmwrap { padding: .3em; background: rgba(10, 8, 5, .8); border: 1px solid #5a4b2e; border-radius: .35em; } .mm { display: block; width: 14em; height: 5.8em; image-rendering: pixelated; }
.purse { display: flex; gap: .9em; align-items: center; padding: .3em .7em; background: rgba(10, 8, 5, .8); border: 1px solid #5a4b2e; border-radius: .35em; font-weight: 700; }
.purse-gold { color: #ffe27a; display: inline-flex; align-items: center; gap: .3em; } .purse .coin { width: 1.05em; height: 1.05em; background: url("../assets/ui/coin-gold.png") center / contain no-repeat; display: inline-block; }
.purse-marks { color: #a9d0ff; display: inline-flex; align-items: center; gap: .3em; } .purse-marks span { font-size: max(10.5px, .75em); font-weight: 600; opacity: .8; } .purse-marks .mkimg { width: 1.2em; height: 1.2em; border-radius: .15em; }

.hud-bl { left: .6em; bottom: .6em; display: flex; flex-direction: column; gap: .3em; }
.line { display: flex; align-items: center; gap: .4em; padding: .15em .6em .15em .15em; background: rgba(10, 8, 5, .8); border: 1px solid #4a3d25; border-radius: .3em; font-weight: 700; min-width: 7em; }
.line .ico.s { width: 1.5em; height: 1.5em; } .line .ln { font-size: max(10.5px, .72em); color: var(--muted); letter-spacing: .1em; } .line b { margin-left: auto; color: #fff3c0; }

.hud-bc { left: 50%; bottom: .6em; transform: translateX(-50%); }
.actionbar { display: flex; gap: .9em; align-items: flex-end; padding: .45em .7em; background: linear-gradient(rgba(16, 12, 8, .86), rgba(8, 6, 4, .9)); border: 1px solid #5a4b2e; border-radius: .45em; box-shadow: 0 .2em .8em rgba(0, 0, 0, .5); }
.grp { display: flex; gap: .3em; align-items: flex-end; } .grp + .grp { padding-left: .9em; border-left: 1px solid #3d3322; }
.slot { position: relative; width: 3.3em; height: 3.3em; flex: none; }
.slot.mini { width: 2.2em; height: 2.2em; } .slot.cons, .slot.flask { width: 2.7em; height: 2.7em; }
.slot .sback { position: absolute; inset: 0; background: url("../assets/ui/slot-back.png") center / 100% 100% no-repeat; }
.slot img { position: absolute; inset: 9%; width: 82%; height: 82%; display: block; border-radius: .2em; } .slot.empty img { display: none; }
.slot .sborder { position: absolute; inset: 0; background: url("../assets/ui/slot-border.png") center / 100% 100% no-repeat; }
.slot.weapon .sborder { filter: drop-shadow(0 0 .15em var(--q, transparent)); box-shadow: inset 0 0 0 .12em var(--q, transparent); border-radius: .35em; }
.slot.weapon.on .sborder { box-shadow: inset 0 0 0 .14em #fff3b0, 0 0 .5em rgba(255, 240, 160, .6); }
.slot .sweep { position: absolute; inset: 9%; border-radius: .2em; background: conic-gradient(rgba(0, 0, 0, .72) calc(var(--cd, 0) * 1turn), transparent 0); display: none; } .slot.cooling .sweep { display: block; }
.slot .count { position: absolute; right: 12%; bottom: 8%; font: 700 max(10.5px, .8em)/1 var(--sans); color: #fff; text-shadow: 0 0 3px #000, 0 1px 1px #000; }
.slot .key { position: absolute; left: 50%; top: 100%; transform: translate(-50%, -30%); min-width: 1.4em; padding: .08em .35em; font: 700 max(10.5px, .68em)/1.2 var(--sans); text-align: center; color: #e8d9a8; background: #15110c; border: 1px solid #5a4b2e; border-radius: .25em; }
.slot .key:empty { display: none; } .slot.mini .key { font-size: max(10.5px, .6em); }
.grp.g-items .slot { filter: saturate(.9); }

/* ---- touch controls ---- */
.touch { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.stick-zone { position: absolute; left: 0; bottom: 0; width: 46%; height: 52%; pointer-events: auto; touch-action: none; }
.stick { position: absolute; width: 8em; height: 8em; margin: -4em 0 0 -4em; border-radius: 50%; background: rgba(20, 16, 10, .55); border: 2px solid rgba(240, 200, 100, .55); pointer-events: none; }
.knob { position: absolute; left: 50%; top: 50%; width: 3.6em; height: 3.6em; margin: -1.8em 0 0 -1.8em; border-radius: 50%; background: radial-gradient(#f3d98b, #9a772a); border: 2px solid #3a2c10; }
.tbtn { position: absolute; pointer-events: auto; touch-action: none; border-radius: 50%; border: 2px solid #8a7440; background: radial-gradient(#4a3c20, #1b150c); color: #ffe9a8; font: 700 max(10.5px, .72em) var(--sans); display: flex; align-items: center; justify-content: center; padding: 0; user-select: none; -webkit-user-select: none; box-shadow: 0 .2em .6em rgba(0, 0, 0, .6); }
.tbtn.down { filter: brightness(1.5); transform: scale(.94); }
.tcluster { position: absolute; right: .6em; bottom: .6em; width: 12.4em; height: 12em; pointer-events: none; }
.tbtn.fire { width: 5.8em; height: 5.8em; right: .3em; bottom: .3em; font-size: .95em; background: radial-gradient(#8e3a2a, #3a120c); border-color: #d6a050; }

.ui.has-touch .stick-zone::after { content: ""; position: absolute; left: 4.2em; bottom: 3.4em; width: 7em; height: 7em; margin: 0; border-radius: 50%; border: 2px dashed rgba(240, 200, 100, .3); }
.tpause { position: absolute; right: .6em; top: 9.9em; width: 2.6em; height: 2.6em; border-radius: .4em; pointer-events: auto; background: rgba(20, 16, 10, .8); color: #ffe9a8; border: 1px solid #8a7440; font: 700 1em var(--sans); padding: 0; }

/* phones: the HUD makes room for the thumbs */
.ui.narrow .hud-tl { width: calc(100% - 14.2em); } .ui.narrow .plate .portrait .ico.l { width: 3em; height: 3em; }
.ui.narrow .hud-tc { top: 6.5em; left: .6em; transform: none; width: calc(100% - 14.2em); min-width: 0; align-items: flex-start; } .ui.narrow .boss { text-align: left; }
.ui.narrow .mm { width: 8em; height: 4.4em; } .ui.narrow .hud-tr { right: .4em; } .ui.narrow .purse { gap: .5em; padding: .25em .5em; }
.ui.narrow .hud-bl { flex-direction: row; bottom: 16.2em; gap: .3em; } .ui.narrow .line { min-width: 0; } .ui.narrow .line .ln { display: none; }
.ui.narrow .hud-bc { bottom: 12.3em; max-width: 100%; }
.ui.narrow .actionbar { gap: .4em; padding: .35em .45em; flex-wrap: nowrap; } .ui.narrow .grp + .grp { padding-left: .4em; }
.ui.narrow .slot { width: 2.5em; height: 2.5em; } .ui.narrow .slot.mini { width: 1.8em; height: 1.8em; } .ui.narrow .slot.cons, .ui.narrow .slot.flask { width: 2.1em; height: 2.1em; }
.ui.narrow .slot .key { display: none; }
.ui.narrow .tpause { top: 10.2em; }
.ui.narrow .tbtn.use { right: 12.6em; bottom: 1.6em; }
.ui.short .hud-bc { left: .5em; bottom: .4em; transform: none; } .ui.short .actionbar { transform: scale(.78); transform-origin: left bottom; }   /* landscape phone: the hotbar hugs the left thumb zone, clear of Flask / Use */
.ui.short .hud-tc { top: 2.4em; left: 50%; transform: translateX(-50%); width: min(22em, 26%); min-width: 12em; align-items: center; } .ui.short .boss { text-align: center; }   /* landscape phone: the boss bar sits under the title, clear of the hero plate */
.ui.short .hud-bl { display: none; } .ui.short .mm { width: 9em; height: 4.4em; }
.slot.empty { opacity: .5; }

/* touch cluster: every button carries its action name (rule 17) */
.tbtn.jump { width: 4em; height: 4em; right: 6.4em; bottom: .6em; } .tbtn.roll { width: 3.6em; height: 3.6em; right: 6.9em; bottom: 4.9em; }

.tbtn.sk1 { width: 3.3em; height: 3.3em; right: 3.9em; bottom: 6.6em; } .tbtn.sk2 { width: 3.3em; height: 3.3em; right: .5em; bottom: 6.9em; }
.tbtn.fire2 { display: block; width: 3.6em; height: 3.6em; right: .5em; bottom: 6.1em; top: auto; margin: 0; transform: translateY(-3.9em); }
.tbtn.ult { width: 3em; height: 3em; right: 10.7em; bottom: 6.8em; }
.tbtn.use { right: 21em; bottom: 1.6em; width: 3.2em; height: 3.2em; } .tbtn.flask { position: absolute; right: 21em; bottom: 5.4em; width: 3.2em; height: 3.2em; }
.tbtn span { font-size: max(10px, .62em); line-height: 1.05; text-align: center; white-space: nowrap; }
/* cooldown number + refused flash + key caps */
.slot .cdn { position: absolute; inset: 0; display: grid; place-items: center; font: 700 max(11px, .95em)/1 var(--sans); font-style: normal; color: #fff; text-shadow: 0 0 3px #000, 0 1px 2px #000; pointer-events: none; }
.slot.refuse .sborder { animation: refuse .35s; } @keyframes refuse { 0%,60% { box-shadow: inset 0 0 0 .2em #e23b2e, 0 0 .7em #e23b2e; } 100% { box-shadow: none; } }
.ui.narrow .slot .key { display: block; }
/* context prompt + teaching sign */
.ctx-prompt { position: fixed; transform: translate(-50%, 0); display: flex; gap: .45em; align-items: center; padding: .25em .6em .25em .3em; border-radius: .4em; background: rgba(18, 14, 8, .88); border: 1px solid #a98a45; color: #ffe9a8; font: 600 max(12px, .8em)/1.1 var(--sans); pointer-events: none; z-index: 5; white-space: nowrap; }
.ctx-prompt .cap, .sg-board .cap { min-width: 1.5em; padding: .15em .4em; text-align: center; border: 1px solid #d6b86a; border-radius: .25em; background: #3a2d14; color: #fff; }
.sign { position: fixed; transform: translate(-50%, -100%); z-index: 6; pointer-events: none; }
.sign .sg-board { pointer-events: auto; max-width: 17em; padding: .5em .7em; background: #4a361c; border: 2px solid #8a6a34; border-radius: .3em; color: #ffe9a8; font: 600 max(12px, .8em)/1.25 var(--sans); display: grid; gap: .25em; box-shadow: 0 2px 0 #1b1208; }
.sign .sg-title { color: #f2c75a; font-size: .85em; } .sign .sg-skip { justify-self: end; font: inherit; font-size: .8em; color: #cdb98a; background: none; border: 0; text-decoration: underline; cursor: pointer; }
.sign .sg-post { display: block; width: .5em; height: 1.6em; margin: 0 auto; background: #3a2810; }
.controls-page .ctl-table { width: 100%; border-collapse: collapse; font-size: .9em; } .ctl-table th, .ctl-table td { padding: .3em .6em; text-align: left; border-bottom: 1px solid rgba(255,255,255,.08); }
.ctl-table .rebind { font: inherit; padding: .15em .6em; background: #2a2012; color: #ffe9a8; border: 1px solid #8a7440; border-radius: .25em; cursor: pointer; } .ctl-table .rebind.on { background: #6b2b1c; }
.ui.has-touch .slot .key { display: none; }

/* floor items (js/ui/groundPlates.js): icon in its quality ring over a pulsing glow, name plate when the hero is close */
.ground-plates { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.gp { position: fixed; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; gap: .15em; }
.gp-ico { display: block; filter: drop-shadow(0 0 .35em var(--glow, #fff)) drop-shadow(0 0 .8em var(--glow, #fff)); animation: gp-pulse 1.4s ease-in-out infinite; }
.gp-ico .ico { transform: scale(var(--k, 1)); transform-origin: 50% 100%; }
.gp-name { display: none; padding: .1em .45em; border-radius: .3em; background: rgba(12, 10, 6, .86); border: 1px solid var(--glow, #a98a45); font: 600 max(11px, .72em)/1.15 var(--sans); white-space: nowrap; color: var(--glow, #fff); }
.gp.near .gp-name { display: block; }
@keyframes gp-pulse { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .gp-ico { animation: none; } }
