/* Collapsing controls travel toward the edge where they rest. Keep the
   moving content separate from its toggle so reopening stays available. */
#mobileHud {
  --mobile-hud-tab-width:28px;
  /* The viewport owns both states; the edge toggle never moves. */
  position:fixed;left:0;
  transform:none;
  transition:background-color .18s ease,border-color .18s ease,box-shadow .18s ease;
}
#mobileHudLevel {padding-left:20px}
#mobileHudContent {visibility:visible;transform:translateX(0);transition:transform .18s ease,visibility 0s}
#mobileHudToggle {
  /* Compensate for the HUD's one-pixel border to meet the screen edge. */
  position:absolute;top:0;left:-1px;right:auto;display:grid;place-items:center;
  width:var(--mobile-hud-tab-width);height:28px;min-width:0;min-height:0;
  padding:0;border:1px solid color-mix(in srgb,#806340 50%,transparent);
  background:color-mix(in srgb,#191510 50%,transparent);background-clip:padding-box;
  color:var(--gold);box-shadow:none;cursor:pointer;pointer-events:auto;
}
#mobileHudToggle svg {width:12px;height:16px;pointer-events:none}
#mobileHudToggle:hover {color:var(--text)}
#mobileHudToggle:focus-visible {outline:2px solid var(--gold);outline-offset:2px}
#mobileHud.mobileHudCollapsed {
  background:transparent;border-color:transparent;box-shadow:none;
}
#mobileHud.mobileHudCollapsed #mobileHudContent {
  /* Include the content's padding and border inset when sliding off screen. */
  transform:translateX(calc(-100% - 9px));visibility:hidden;transition-delay:0s,.18s;
}
/* The theme tray contracts into its right-hand toggle. */
@media (max-width:760px) {
  .siteToolbar .themeChoicesClip {
    transition:max-width .18s ease,visibility 0s .18s;
  }
  .siteToolbar .backgroundPicker.expanded .themeChoicesClip {
    transition-delay:0s;
  }
  .siteToolbar .themeChoicesClip .backgroundChoices {transform:translateX(12px);transition:transform .18s ease}
  .siteToolbar .backgroundPicker.expanded .themeChoicesClip .backgroundChoices {transform:translateX(0)}
}
@media (min-width:761px) and (max-width:1100px) and (max-height:600px) and (orientation:landscape) {
  .siteToolbar .themeChoicesClip {transition:max-width .18s ease,visibility 0s .18s}
  .siteToolbar .backgroundPicker.expanded .themeChoicesClip {transition-delay:0s}
  .siteToolbar .themeChoicesClip .backgroundChoices {transform:translateX(12px);transition:transform .18s ease}
  .siteToolbar .backgroundPicker.expanded .themeChoicesClip .backgroundChoices {transform:translateX(0)}
}

/* Zones and Areas retract upward under their divider. The inner wrapper
   lets CSS animate their natural height without hard-coded row sizes. */
#battleAreaRows {display:grid;grid-template-rows:1fr;transition:grid-template-rows .18s ease}
#battleAreaRows[hidden] {display:none}
.areaPickerMotionContent {min-height:0;overflow:hidden;transform:translateY(0);transition:transform .18s ease}
#battleAreaPicker.areaPickerCollapsed #battleAreaRows {grid-template-rows:0fr}
#battleAreaPicker.areaPickerCollapsed .areaPickerMotionContent {transform:translateY(-12px)}
.areaPickerToggleArt {transition:transform .18s ease}

@media (prefers-reduced-motion:reduce) {
  #mobileHud,#mobileHudContent,#mobileHudToggle svg,
  .siteToolbar .themeChoicesClip,.siteToolbar .themeChoicesClip .backgroundChoices,
  #battleAreaRows,.areaPickerMotionContent,.areaPickerToggleArt {
    transition:none;
  }
}
