/* ==========================================================================
   doom.css — the /doom/ page only
   ========================================================================== */

.page-doom {
  --accent: #ff6b52;
  --accent-dim: #d9452c;
  --accent-glow: rgb(255 107 82 / 16%);
}

[data-theme="light"] .page-doom {
  --accent: #b3341c;
  --accent-dim: #b3341c;
  --accent-glow: rgb(179 52 28 / 12%);
}

.doom-head {
  padding-block: var(--space-7) var(--space-6);
}

.doom-head h1 {
  font-size: var(--step-3);
  letter-spacing: 0.02em;
}

.doom-head .lede {
  margin-top: var(--space-3);
}

/* --------------------------------------------------------------------------
   Start gate
   Nothing heavy is fetched until this button is pressed. On a metered mobile
   connection an unprompted multi-megabyte autoload would be hostile.
   -------------------------------------------------------------------------- */

.gate {
  display: grid;
  place-items: center;
  gap: var(--space-4);
  text-align: center;
  padding: var(--space-8) var(--space-5);
  border: 1px dashed var(--border-bright);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
}

.gate__art {
  font-size: var(--step--1);
  line-height: 1.15;
  color: var(--accent);
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
  margin: 0;
}

.gate__note {
  color: var(--fg-faint);
  font-size: var(--step--1);
  max-width: 42ch;
}

.gate__btn {
  font-size: var(--step-1);
  padding: var(--space-4) var(--space-7);
}

/* --------------------------------------------------------------------------
   Stage
   A bare, explicitly sized box. js-dos fills its container and misbehaves
   with auto height. Keeping it neutral is also what lets the emulator be
   swapped without touching this page.
   -------------------------------------------------------------------------- */

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 78vh;
  margin-inline: auto;
  background: #000;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  overflow: hidden;
}

.stage[hidden] {
  display: none;
}

#doom-root {
  width: 100%;
  height: 100%;
}

.status {
  margin-top: var(--space-4);
  font-size: var(--step--1);
  color: var(--fg-dim);
  min-height: 1.5em;
}

.status--error {
  color: var(--danger);
}

.status__retry {
  margin-top: var(--space-3);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.toolbar button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Controls legend
   -------------------------------------------------------------------------- */

.keys {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-3) var(--space-5);
  margin: 0;
}

.keys div {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.keys dt {
  flex: none;
}

.keys dd {
  margin: 0;
  color: var(--fg-dim);
  font-size: var(--step--1);
}

kbd {
  display: inline-block;
  padding: 0.05rem var(--space-2);
  font: inherit;
  font-size: var(--step--1);
  color: var(--fg);
  background: var(--bg-sunken);
  border: 1px solid var(--border-bright);
  border-bottom-width: 2px;
  border-radius: var(--radius);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Notices and legal
   -------------------------------------------------------------------------- */

.notice {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--amber);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--fg-dim);
  font-size: var(--step--1);
}

.notice--touch {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .notice--touch {
    display: block;
  }
}

.legal {
  font-size: var(--step--1);
  color: var(--fg-faint);
  max-width: var(--measure);
}

.legal > * + * {
  margin-top: var(--space-3);
}

.legal a {
  color: var(--fg-dim);
}

.legal a:hover,
.legal a:focus-visible {
  color: var(--accent);
}
