/* ── Help overlay ── */

#help-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--color-overlay-background);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#help-overlay[hidden] { display: none !important; }

.help-panel {
  background: var(--color-surface);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-lg);
  max-width: 440px;
  width: 100%;
  max-height: 80dvh;
  overflow-y: auto;
  padding: 28px 24px 24px;
  position: relative;
}

.help-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  color: var(--color-text);
  opacity: .35;
  transition: opacity var(--duration-fast) var(--ease-standard);
}
.help-close:hover { opacity: 1; }
.help-close:focus-visible { opacity: 1; outline: 2px solid var(--accent-strong); outline-offset: 2px; }

.help-title {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-bottom: 20px;
}

.help-section { margin-bottom: 18px; }
.help-section:last-child { margin-bottom: 0; }

.help-section-title {
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-text-lighter);
  margin-bottom: 10px;
}

.help-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.help-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: .6rem;
  line-height: 1.4;
}

.help-key {
  flex-shrink: 0;
  min-width: 76px;
  background: var(--color-key-background);
  border-radius: var(--radius-key);
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: .55rem;
  color: var(--color-text-muted);
  text-align: center;
}

.help-description { color: var(--ink-muted); }

/* ── Loading screen ── */

#loading-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--color-background);
  opacity: 1;
  transition: opacity 0.5s ease;
}

.first-visit #loading-screen { display: flex; }

/* hstry-mark positions itself via `position: fixed` inside its shadow DOM,
   so its size/inset can only be steered from here via the --hstry-inset
   custom property and a scale transform anchored at the corner it pins to. */
#loading-screen hstry-mark {
  --hstry-inset: 1.25rem;
  transform: scale(0.3);
  transform-origin: bottom right;
}

#loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

