/* Lane 496: town HUD layer (own look; layout principles in docs/design/WOW_REFERENCE_NOTES_2026-11-06.md).
   Selectors start with `html body.wow-hud` so they beat the older HUD skins (css/wowframes.css, css/wowbars.css, css/hud-minimal.css) whatever the load order.
   Variables --wowhud-bar-left / --wowhud-bar-w / --wowhud-bar-top are measured from #action-bar by js/wowhud.js. Touch layout and narrow screens are left as they were. */

/* ---- nameplates ---- */
#wow-plates { position: fixed; inset: 0; z-index: 27; pointer-events: none; overflow: hidden; }
.wow-plate { position: absolute; left: 0; top: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 4px; max-width: 190px; padding: 1px 6px 2px; border-radius: 4px; background: rgba(12, 16, 24, .55); color: var(--wow-plate-color, #fff); font: 600 11px/1.25 system-ui, sans-serif; text-shadow: 0 1px 2px #000, 0 0 3px #000; white-space: nowrap; will-change: transform, opacity; }
.wow-plate[hidden] { display: none; }
.wow-plate .wow-plate-level { font-weight: 500; font-size: 10px; opacity: .8; }
.wow-plate .wow-plate-title { flex-basis: 100%; text-align: center; font-weight: 400; font-size: 10px; color: #cfd6e4; opacity: .85; }
.wow-plate .wow-plate-title:empty, .wow-plate .wow-plate-level:empty, .wow-plate .wow-plate-mark:empty { display: none; }
.wow-plate .wow-plate-mark { font-size: 15px; font-weight: 800; line-height: 1; }
.wow-plate .wow-plate-mark.tone-gold { color: #ffd34d; }
.wow-plate .wow-plate-mark.tone-grey { color: #9aa3b2; }
.wow-plate[data-kind="hostile"] { background: rgba(40, 10, 10, .55); }
html body.hud-hidden #wow-plates, html body.hud-hidden #wow-mini-line, html body.hud-hidden #wow-mini-track { visibility: hidden !important; }
@media (max-width: 700px) { .wow-plate { font-size: 10px; max-width: 150px; } }

/* ---- minimap zone/clock line and tracking toggles ---- */
#wow-mini-line { position: fixed; z-index: 30; display: flex; justify-content: space-between; gap: 6px; box-sizing: border-box; padding: 0 6px; height: 18px; color: #f1e3b0; font: 600 11px/18px Georgia, serif; text-shadow: 0 1px 2px #000, 0 0 4px #000; pointer-events: none; }
#wow-mini-line .wow-mini-zone { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#wow-mini-line .wow-mini-clock { font-variant-numeric: tabular-nums; white-space: nowrap; }
#wow-mini-line[hidden], #wow-mini-track[hidden] { display: none; }
#wow-mini-track { position: fixed; z-index: 30; display: flex; justify-content: center; gap: 6px; }
#wow-mini-track .wow-track { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1px solid #8a7a4a; background: rgba(14, 20, 32, .78); color: #f1e3b0; font: 13px/1 system-ui, sans-serif; cursor: pointer; touch-action: manipulation; }
#wow-mini-track .wow-track[aria-pressed="false"] { opacity: .45; }
#wow-mini-track .wow-track:focus-visible { outline: 2px solid #facc15; outline-offset: 1px; }
html body.touch-controls #wow-mini-track .wow-track { flex: 0 0 44px; width: 44px; height: 44px; }
#wow-mini-track .wow-track { flex: 0 0 auto; }
html body.hud-minimal.hud-minimal.hud-idle #wow-mini-line, html body.hud-minimal.hud-minimal.hud-idle #wow-mini-track { opacity: .28; transition: opacity .8s ease; }

/* ---- quest tracker: the counter sits on its own line under each objective ---- */
html body.wow-hud .quest-tracker .quest-tracker-objective { display: block; text-align: right; }
html body.wow-hud .quest-tracker .quest-tracker-objective .quest-tracker-count { display: block; margin-left: auto; width: max-content; }
html body.wow-hud .quest-tracker .quest-tracker-head strong { letter-spacing: .02em; }

/* ---- desktop: unit frame low-centre-left above the action bar; target frame beside it; XP bar glued to the bar's top edge ---- */
@media (min-width: 701px) {
  html body.wow-hud:not(.touch-controls) #hud-top .msh-player-frame { left: var(--wowhud-bar-left, 30vw) !important; top: auto !important; bottom: calc(var(--wowhud-bar-top, 70px) + 14px) !important; width: 232px !important; z-index: 36; }
  html body.wow-hud:not(.touch-controls) #target-frame { left: calc(var(--wowhud-bar-left, 30vw) + 246px) !important; top: auto !important; bottom: calc(var(--wowhud-bar-top, 70px) + 14px) !important; width: 210px !important; }
  html body.wow-hud:not(.touch-controls) #hud-top .msh-health-bar, html body.wow-hud:not(.touch-controls) #hud-top .msh-resource-bar { height: 9px !important; min-height: 9px !important; border-radius: 3px !important; }
  html body.wow-hud:not(.touch-controls) #hud-xpbar { left: var(--wowhud-bar-left, 30vw) !important; transform: none !important; width: var(--wowhud-bar-w, 600px) !important; bottom: calc(var(--wowhud-bar-top, 70px) + 2px) !important; height: 5px !important; border-radius: 3px 3px 0 0; }
}

/* ---- minimap: room above for the zone/clock line (margins, so the saved HUD positions still apply) ---- */
html body.wow-hud #mmo-minimap { margin-top: 18px; }
html body.wow-hud .quest-tracker { margin-top: var(--wowhud-tracker-margin, 18px); }

/* Touch layouts keep their lane 336/226 positions: only a thin margin, and the line is shorter, so nothing moves into the touch action menu. */
html body.touch-controls.wow-hud #mmo-minimap { margin-top: 6px; }
html body.touch-controls #wow-mini-line { height: 14px; font-size: 10px; line-height: 14px; }
