:root {
  --bg: #120e0a;
  --bg-panel: #1a1410;
  --phosphor: #d4a574;
  --phosphor-dim: #8a6340;
  --phosphor-glow: rgba(212, 165, 116, 0.32);
  --amber: #e8b060;
  --muted: #8a7060;
  --player: #3a2a1c;
  --companion: #221810;
  --border: #4a3424;
  --radius: 0.9rem;
  --font: "IBM Plex Mono", "Cascadia Code", "SF Mono", Consolas, monospace;
  --font-display: "Jacquard 12", Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--phosphor);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 50% 0%, #2a1c12 0%, transparent 55%),
    linear-gradient(180deg, #0a0806 0%, var(--bg) 40%, #0a0806 100%);
}

a {
  color: var(--amber);
  text-decoration: underline;
  text-decoration-color: var(--phosphor-dim);
  text-underline-offset: 0.15em;
}

a:hover {
  color: #f0c090;
  text-decoration-color: var(--phosphor);
  text-shadow: 0 0 8px var(--phosphor-glow);
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.14) 2px,
    rgba(0, 0, 0, 0.14) 4px
  );
  opacity: 0.45;
}

.crt-flicker {
  animation: flicker 6s infinite;
}

@keyframes flicker {
  0%,
  100% {
    opacity: 1;
  }
  92% {
    opacity: 1;
  }
  93% {
    opacity: 0.92;
  }
  94% {
    opacity: 1;
  }
  97% {
    opacity: 0.88;
  }
  98% {
    opacity: 1;
  }
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  position: relative;
  z-index: 1;
}

.banner {
  white-space: pre;
  overflow-x: auto;
  font-size: clamp(7px, 1.8vw, 11px);
  line-height: 1.15;
  text-align: center;
  margin: 0 0 1.25rem;
  text-shadow: 0 0 12px var(--phosphor-glow);
}

.pitch {
  text-align: center;
  margin: 0 0 1.75rem;
  color: var(--phosphor);
  font-size: 1rem;
}

.pitch strong {
  color: #f0c090;
}

.section {
  margin: 0 0 1.75rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  box-shadow: inset 0 0 40px rgba(40, 24, 8, 0.4);
}

.section h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 6vw, 2.85rem);
  line-height: 1.05;
  letter-spacing: 0.02em;

  color: var(--amber);
  font-weight: 400;
}

.section p,
.section li {
  color: #c4a88a;
  margin: 0 0 0.65rem;
}

.section ul,
.section ol {
  margin: 0;
  padding-left: 1.2rem;
}

.section code {
  color: #e8c8a0;
  background: rgba(212, 165, 116, 0.1);
  padding: 0.05em 0.3em;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
}

.accordion {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.accordion > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.55rem 0.75rem;
  font-family: var(--font-display);
  color: var(--amber);
  font-weight: 400;
  letter-spacing: 0.02em;

  font-size: clamp(1.7rem, 4.5vw, 2.2rem);
  line-height: 1.1;
  user-select: none;
}

.accordion > summary::-webkit-details-marker {
  display: none;
}

.accordion > summary::before {
  content: "▸ ";
  color: var(--phosphor-dim);
}

.accordion[open] > summary::before {
  content: "▾ ";
}

.accordion > summary:hover {
  color: #f0c090;
  text-shadow: 0 0 8px var(--phosphor-glow);
}

.accordion-body {
  padding: 0 0.75rem 0.85rem;
  border-top: 1px solid var(--border);
}

.accordion-body h3 {
  margin: 0.85rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.5vw, 1.7rem);
  line-height: 1.1;
  letter-spacing: 0.02em;

  color: var(--phosphor-dim);
  font-weight: 400;
}

.cmd-list {
  margin: 0;
  padding: 0;
}

.cmd-list > div {
  display: grid;
  gap: 0.1rem 0.75rem;
  margin: 0 0 0.45rem;
}

@media (min-width: 520px) {
  .cmd-list > div {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: baseline;
  }
}

.cmd-list dt {
  margin: 0;
  color: #e8c8a0;
}

.cmd-list dd {
  margin: 0;
  color: #c4a88a;
  font-size: 0.9rem;
}

.cmd-note {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* --- Fake DM thread (grayscale UI; emojis stay colored) --- */

.dm {
  --dm-bg: #0e0e0e;
  --dm-panel: #161616;
  --dm-border: #4a4a4a;
  --dm-border-soft: #3a3a3a;
  --dm-text: #c8c8c8;
  --dm-text-bright: #e8e8e8;
  --dm-muted: #888;
  --dm-player: #1c2430;
  --dm-player-border: #3a4a5c;
  --dm-companion: #1a1a1a;
  --dm-glow: rgba(180, 180, 180, 0.18);

  /* Handheld-sized chat frame — scroll inside, don't stretch the page. */
  display: flex;
  flex-direction: column;
  width: min(100%, 22.5rem);
  max-width: 100%;
  height: min(32rem, 72vh);
  margin: 0 auto 1.75rem;
  border: 1px solid var(--dm-border);
  border-radius: 1.15rem;
  background: var(--dm-bg);
  color: var(--dm-text);
  box-shadow:
    0 0 24px var(--dm-glow),
    inset 0 0 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.dm-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--dm-border-soft);
  flex-shrink: 0;
}

.dm-avatar {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--dm-border);
  border-radius: 0.45rem;
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.dm-meta {
  min-width: 0;
}

.dm-meta .name {
  font-weight: 600;
  color: var(--dm-text-bright);
}

.dm-meta .sub {
  font-size: 0.75rem;
  color: var(--dm-muted);
}

.dm-thread {
  display: flex;
  flex-direction: column;
  padding: 0;
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Grows to fill unused height so the log sits on the bottom of the frame
   (like a real mobile DM). Shrinks away once the log overflows. */
.dm-spacer {
  flex: 1 1 auto;
  min-height: 0.75rem;
}

.dm-log {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 0 0 auto;
  padding: 0.35rem 0.7rem 0.85rem;
}

.bubble {
  display: none;
  max-width: 88%;
  padding: 0.06rem 0.55rem;
  line-height: 1.3;
  border: 1px solid var(--dm-border-soft);
  border-radius: 0.55rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble.visible {
  display: block;
  animation: dm-bubble-in 0.35s ease both;
}

@keyframes dm-bubble-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bubble.player {
  align-self: flex-end;
  background: var(--dm-player);
  border-color: var(--dm-player-border);
  color: var(--dm-text-bright);
}

.bubble.companion {
  align-self: flex-start;
  background: var(--dm-companion);
  border-color: #555;
  color: var(--dm-text);
}

.bubble.tip {
  align-self: flex-start;
  background: #141414;
  border-style: dashed;
  border-color: #666;
  color: var(--dm-muted);
  font-size: 0.85rem;
}

.bubble .who {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dm-muted);
  margin-bottom: 0;
}

.dm .mark {
  color: #b0b0b0;
}

.mark {
  color: var(--amber);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.links a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid var(--phosphor-dim);
}

.links a:hover {
  color: #f0c090;
  border-bottom-color: var(--phosphor);
  text-shadow: 0 0 8px var(--phosphor-glow);
}

.footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.footer a {
  color: var(--amber);
}

@media (max-width: 480px) {
  .banner {
    font-size: 5.5px;
  }

  .dm {
    width: 100%;
    height: min(28rem, 70vh);
    border-radius: 1rem;
  }

  .bubble {
    max-width: 94%;
  }
}
