/* The controls card (src/panels/hud.rs): shown while playing with the mouse free (until a click captures
   it), so it sits in the middle of the view, where the click goes. Grouped by what you are doing,
   each row a key and its action; the details are a quiet second line, dropped on short screens.
   Clicks go through it to the canvas. */
#help {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 5;
  width: min(1040px, calc(100vw - 48px)); max-height: calc(100dvh - 48px); overflow: hidden;
  padding: 22px 28px 20px 30px; pointer-events: none; font: 15px/1.35 var(--face);
  &[hidden] { display: none; }
  header {
    display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    svg.logo { width: 42px; height: 42px; }
    p { margin: 0; font: 600 15px/1.2 var(--face); letter-spacing: 0.26em; text-transform: uppercase; }
    small { display: block; margin-top: 4px; font: italic 400 14px/1.3 var(--face); letter-spacing: 0;
      text-transform: none; color: var(--muted); }
  }
  .groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px 32px; }
  @media (max-height: 620px) { dd small, footer { display: none; } header { margin-bottom: 10px; padding-bottom: 10px; } }
  @media (max-height: 480px) { header small { display: none; } .keys { gap: 2px 10px; } }
}
/* One dialog at a time: the Esc menu takes the card's place. */
body:has(#game-menu[open]) #help { display: none; }
/* The card's lists, which the menu's Controls page shows too. */
:is(#help, #game-menu [data-menu-controls]) h3 { margin: 0 0 6px; }
:is(#help, #game-menu [data-menu-controls]) .keys { gap: 5px 12px; }
:is(#help, #game-menu [data-menu-controls]) footer { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line);
  font: italic 400 13px/1.35 var(--face); color: var(--muted); }

/* The resume hint: a subtle bottom-edge prompt after the player has captured once, instead
   of the full controls card every time. Fades in, then out after a few seconds. */
#resume-hint {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 5;
  pointer-events: none; font: 500 15px/1.4 var(--face); color: var(--muted); text-align: center;
  opacity: 0; transition: opacity 0.3s ease;
  &[data-show] { opacity: 1; }
  &[data-fading] { opacity: 0; transition: opacity 1.2s ease; }
}
body:has(#game-menu[open]) #resume-hint { display: none; }
