/* ============================================================
   manpage.css — shared How-to-Play overlay (Unix-manpage style)
   Requires shared.css tokens.
   ============================================================ */

.man-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: man-fade 0.18s ease-out;
}
@keyframes man-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .man-backdrop { animation: none; } }

.man-window {
  width: 100%;
  max-width: 640px;
  max-height: min(90dvh, 760px);
  background: var(--panel);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-md);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: man-rise 0.2s ease-out;
}
@keyframes man-rise {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .man-window { animation: none; } }

.man-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.man-titlebar .man-id {
  color: var(--accent);
  font-weight: 500;
}
.man-titlebar .man-hint {
  color: var(--dim);
  font-size: var(--fs-xs);
}
.man-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 2px 10px;
  min-height: 28px;
  min-width: 32px;
  font-family: inherit;
  font-size: var(--fs-md);
  line-height: 1;
  cursor: pointer;
  border-radius: var(--r-sm);
}
.man-close:hover { color: var(--fg); border-color: var(--border-hi); }

.man-body {
  padding: 18px 22px 24px;
  overflow-y: auto;
  flex: 1;
  line-height: 1.6;
}

.man-body h2 {
  margin: 18px 0 8px;
  font-size: var(--fs-sm);
  letter-spacing: 1.5px;
  color: var(--accent);
  font-weight: 500;
  text-transform: uppercase;
}
.man-body h2:first-child { margin-top: 0; }
.man-body h2::after {
  content: "";
  display: inline-block;
  width: 100%;
  height: 1px;
  margin-left: 10px;
  vertical-align: middle;
  background: linear-gradient(to right, var(--border), transparent);
}

.man-body p, .man-body ul, .man-body ol {
  margin: 0 0 10px;
  color: var(--fg);
}
.man-body ul, .man-body ol {
  padding-left: 22px;
}
.man-body li { margin-bottom: 4px; }
.man-body li::marker { color: var(--dim); }

.man-body code, .man-body .k {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-family: inherit;
  white-space: nowrap;
}
.man-body pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin: 8px 0 14px;
  overflow-x: auto;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.4;
}
.man-body .muted { color: var(--muted); }
.man-body strong { color: var(--accent-2); font-weight: 500; }

.man-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-size: var(--fs-xs);
  letter-spacing: 0.5px;
  text-align: right;
  flex-shrink: 0;
}

.man-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.man-trigger .q { color: var(--accent); font-weight: 500; }

@media (max-width: 560px) {
  .man-window { max-height: 96dvh; }
  .man-body { padding: 14px 16px 18px; }
  .man-titlebar .man-hint { display: none; }
}
