/* Village HUD measured against the supplied 1917 × 1049 gameplay frame.
   All dimensions remain relative to the game container. Each HUD group is
   transformed once; this variable does not alter popup or village scaling. */
#game-container {--reference-hud-scale:1;--reference-book-width:22.2cqw}

#game-container .classic-topbar>.topbar-meter {
  transform:scale(var(--reference-hud-scale));transform-origin:left top;
}
#game-container .classic-topbar>.topbar-exp {left:2cqw;top:2.45cqh;width:12.1cqw}
#game-container .classic-topbar>.topbar-chakra {left:16.2cqw;top:2.65cqh;width:11.15cqw}
#game-container .classic-topbar>.topbar-ryo {
  right:18.35cqw;top:2.25cqh;width:10.25cqw;transform-origin:right top;
}
#game-container .classic-topbar>.topbar-gold {
  right:2.2cqw;top:2.25cqh;width:14.35cqw;transform-origin:right top;
}

#game-container .village-shell>:is(.topbar-map,.topbar-shortcuts) {
  left:50%;transform:translateX(-50%) scale(var(--reference-hud-scale));
  transform-origin:center top;
}
#game-container .village-shell>.topbar-map {top:9.2cqh}
#game-container .village-shell>.topbar-shortcuts {top:13.05cqh}
#game-container .village-shell>.topbar-quest {
  left:.35cqw;top:13.5cqh;width:6cqw;
  transform:scale(var(--reference-hud-scale));transform-origin:left top;
}

#game-container .village-shell>:is(.lower-leftbar,.left-missions-toggle,.lower-guide-callout) {
  transform:scale(var(--reference-hud-scale));transform-origin:left top;
}
#game-container .village-shell>.lower-leftbar {left:.35cqw;top:28.4cqh;width:7cqw}
#game-container .village-shell>.lower-guide-callout {left:7cqw;top:37.35cqh;width:11cqw;height:5.4cqh}
#game-container .village-shell>.left-missions-toggle {left:1.6cqw;top:78.2cqh}
#game-container[data-missions="hidden"] .village-shell>.left-missions-toggle {top:37.6cqh}

#game-container .village-shell>:is(.lower-rightbar,.lower-rightbar-toggle) {
  transform:scale(var(--reference-hud-scale));transform-origin:right top;
}
#game-container .village-shell>.lower-rightbar {right:2.6cqw;top:28.5cqh;width:7.5cqw;gap:.6cqh}
#game-container .lower-rightbar button {height:8.1cqh}
#game-container .lower-rightbar .lower-hud-art {width:4.25cqw;height:3.3cqw}
#game-container .village-shell>.lower-rightbar-toggle {right:4.3cqw;top:55.3cqh}

/* Each shortcut's complete art/label unit shares All's top and bottom edges. */
#game-container .village-shell>:is(.formation-power-panel,.lower-shortcuts) {
  transform:scale(var(--reference-hud-scale));transform-origin:left bottom;
}
#game-container .village-shell>.formation-power-panel {
  left:1cqw;bottom:0;width:21.9765cqw;height:auto;aspect-ratio:var(--profile-panel-aspect);
}
#game-container .village-shell>.lower-shortcuts {left:24cqw;right:auto;width:18cqw;transform-origin:left bottom}
#game-container .village-shell>.classic-book-dock {
  transform:scale(var(--reference-hud-scale));transform-origin:right bottom;
}
#game-container .village-shell>.classic-book-dock {
  right:.6cqw;bottom:0;width:var(--reference-book-width);
}
#game-container .village-shell>.village-land-controls {
  left:70.4%;bottom:1.4cqh;width:12.8cqw;height:4.5cqh;gap:.18cqw;
  transform:translateX(-50%) scale(var(--reference-hud-scale));transform-origin:center bottom;
}
#game-container .village-land-controls button {min-width:0;min-height:0;padding:0 .35cqw}
#game-container .village-land-controls button:is(:first-child,:last-child) {
  flex:0 0 2.1cqw;font-size:1.65cqw;line-height:1;padding:0;
}
#game-container .village-land-controls .village-land-open {
  flex:1;min-width:0;padding:.3cqh .35cqw;
}
#game-container[data-hud="hidden"] .village-shell>.village-land-controls {left:50%;bottom:.8cqh}
#game-container .village-shell>.kage-hud-toggle {
  transform:scale(var(--reference-hud-scale));transform-origin:left bottom;
}

/* Saved village variants use the same reference factor without transforming
   the world canvas. Existing visibility and pointer-event rules stay intact. */
#game-container .village-shell>:is(.village-hud:not(.classic-topbar),.village-tools) {
  transform:scale(var(--reference-hud-scale));transform-origin:left top;
}
#game-container .village-shell>.village-sign {
  transform:scale(var(--reference-hud-scale));transform-origin:left bottom;
}
#game-container .village-shell>:is(.village-settings,.village-dock) {
  transform:scale(var(--reference-hud-scale));transform-origin:right bottom;
}
#game-container .village-shell>.kage-gold {
  transform:scale(var(--reference-hud-scale));transform-origin:right top;
}
#game-container .village-shell>:is(.kage-quickhub,.kage-resume) {
  transform:translateX(-50%) scale(var(--reference-hud-scale));transform-origin:center top;
}
