/* ── Cheatsheet ── */
/* Reveal panel for the spellable secrets, plus the small corner button that
   reopens it once discovered. */
.cheatsheet-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease-out;
}
.cheatsheet-overlay.visible {
  opacity: 1;
}
.cheatsheet-panel {
  position: relative;
  max-width: 760px;
  width: calc(100vw - 3rem);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  padding: 1.4rem 1.6rem;
  background: rgba(var(--ink-rgb), 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #fff;
}
.cheatsheet-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  padding: 4px;
  transition: color 0.2s;
}
.cheatsheet-close:hover {
  color: #fff;
}
.cheatsheet-close svg {
  width: 14px;
  height: 14px;
}
.cheatsheet-title {
  font-family: "Syne", sans-serif;
  font-size: 1rem;
  margin: 0 0 0.3rem;
}
.cheatsheet-intro {
  margin: 0 0 1.2rem;
  font-family: "DM Mono", monospace;
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.03em;
}
.cheatsheet-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
}
.cheatsheet-section-title {
  font-family: "Syne", sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.45);
  margin: 0 0 0.7rem;
}
.cheatsheet-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem 0.8rem;
  margin: 0;
  align-items: baseline;
}
.cheatsheet-list dt {
  font-family: "DM Mono", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
/* The effect/theme glyph that travels with each entry, inline before its name. */
.cheatsheet-icon {
  display: inline-block;
  width: 1.05rem;
  height: 1.05rem;
  margin-right: 0.4rem;
  vertical-align: -0.24rem;
  color: inherit;
}
.cheatsheet-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
.cheatsheet-list dd {
  margin: 0;
  font-size: 0.66rem;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.62);
}
.cheatsheet-note {
  margin: 1.4rem 0 0;
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.04em;
}
/* Unlabelled konami glyphs at the foot — faint on purpose, a puzzle not a
   caption. */
.cheatsheet-konami {
  margin: 0.9rem 0 0;
  text-align: center;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.22);
  letter-spacing: 0.35em;
  user-select: none;
}
body.light-appearance .cheatsheet-konami {
  color: rgba(var(--ink-rgb), 0.3);
}
body.light-appearance .cheatsheet-panel {
  background: rgba(240, 247, 255, 0.97);
  color: rgba(var(--ink-rgb), 0.9);
  border-color: rgba(0, 0, 0, 0.12);
}
body.light-appearance .cheatsheet-close {
  color: rgba(var(--ink-rgb), 0.45);
}
body.light-appearance .cheatsheet-intro,
body.light-appearance .cheatsheet-section-title,
body.light-appearance .cheatsheet-list dd,
body.light-appearance .cheatsheet-note {
  color: rgba(var(--ink-rgb), 0.6);
}
/* Single-column below the panel's comfortable two-column width, so the term
   and description stop squeezing and the sections stack. */
@media (max-width: 600px) {
  .cheatsheet-body {
    grid-template-columns: 1fr;
  }
}
/* Tucked-away corner button — faint until hovered so it never competes with
   the page; only mounted after the cheatsheet has been discovered. */
.cheatsheet-toggle {
  position: fixed;
  left: 0.9rem;
  bottom: 0.9rem;
  z-index: var(--z-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: rgba(var(--ink-rgb), 0.5);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.55);
  opacity: 0.35;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    opacity 0.2s,
    color 0.2s,
    transform 0.2s;
}
.cheatsheet-toggle:hover {
  opacity: 1;
  color: #fff;
  transform: translateY(-1px);
}
.cheatsheet-toggle svg {
  width: 16px;
  height: 16px;
}
body.light-appearance .cheatsheet-toggle {
  color: rgba(var(--ink-rgb), 0.6);
  border-color: rgba(0, 0, 0, 0.14);
}
