/* Dungeon Master demo page chrome */
.dm-page {
  color: #d9b36b;
}
.dm-page .dm-hero {
  padding: 3.5rem 0 1.5rem;
}
.dm-page .dm-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  margin: 0 0 0.75rem;
  color: #f4f1ea;
  max-width: 18ch;
}
.dm-page .dm-hero p {
  color: var(--ink-muted);
  max-width: 42rem;
  margin: 0 0 1rem;
}
.dm-layout {
  display: grid;
  gap: 1.25rem;
  padding-bottom: 3rem;
}
.dm-block {
  background: rgba(22, 18, 12, 0.92);
  border: 3px solid #5c4633;
  border-radius: 12px;
  padding: 1.15rem 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}
.dm-block h2 {
  font-family: "Bangers", var(--font-title), cursive;
  letter-spacing: 1px;
  color: #f4d48a;
  margin: 0 0 0.45rem;
  font-size: 1.65rem;
  font-weight: 400;
}
.dm-block .blurb {
  color: #a58a5f;
  font-size: 0.98rem;
  margin: 0 0 1rem;
  line-height: 1.45;
}
.dm-pipeline {
  border-color: rgba(232, 197, 71, 0.45);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(232,197,71,0.08), transparent 55%),
    rgba(22, 18, 12, 0.94);
}
.pipeline-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1rem;
}
.pipeline-chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #5c4633;
  color: #f4d48a;
  background: #1f1810;
}
.pipeline-chip.arrow {
  border: none;
  background: transparent;
  color: #a58a5f;
  padding: 0 0.15rem;
}
.pipeline-status {
  font-family: "VT323", monospace;
  font-size: 1.15rem;
  color: #c9e8c9;
  min-height: 1.5rem;
  margin-bottom: 0.75rem;
}
.pipeline-status .muted { color: #a58a5f; }
.pipeline-status .ok { color: #7dff7d; }
.pipeline-status .fail { color: #ff6b6b; }

.dm-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: flex-end;
  margin-bottom: 12px;
}
.dm-ctrl {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  flex: 1;
}
.dm-ctrl label {
  font-size: 0.9rem;
  color: #a58a5f;
  font-family: "VT323", monospace;
}
.dm-ctrl label span.val {
  color: #f4d48a;
  font-size: 1.1rem;
  font-weight: 700;
}
.dm-ctrl input[type="range"] {
  width: 100%;
  accent-color: #c9a227;
}
.dm-ctrl input[type="text"],
.dm-ctrl select {
  font-family: "VT323", monospace;
  font-size: 1.05rem;
  padding: 6px 10px;
  background: #0a2214;
  color: #d4f0d4;
  border: 2px solid #225522;
  border-radius: 4px;
}
.dm-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.dm-btn-row button,
.dm-block button.dm-btn {
  font-family: "Bangers", cursive;
  font-size: 1.05rem;
  letter-spacing: 1px;
  padding: 8px 16px;
  background: #3a2a20;
  color: #f4d48a;
  border: 2px solid #5c4633;
  border-radius: 4px;
  cursor: pointer;
}
.dm-btn-row button.primary,
.dm-block button.dm-btn.primary {
  background: linear-gradient(180deg, #2a5a2a, #1a3a1a);
  border-color: #225522;
  color: #e8f5e8;
}
.dm-btn-row button:hover,
.dm-block button.dm-btn:hover { background: #4a3a30; }
.dm-btn-row button.primary:hover { background: linear-gradient(180deg, #356535, #224422); }
.dm-btn-row button:disabled { opacity: 0.45; cursor: not-allowed; }

.stat-name-editor {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0 0 0.75rem;
}
.stat-name-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.stat-name-row label {
  font-family: "VT323", monospace;
  font-size: 0.95rem;
  color: #a58a5f;
}
.stat-name-row input {
  font-family: "VT323", monospace;
  font-size: 1.05rem;
  padding: 6px 8px;
  background: #0a2214;
  color: #d4f0d4;
  border: 2px solid #225522;
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 900px) {
  .stat-name-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .stat-name-editor { grid-template-columns: 1fr; }
}

.dm-jackpot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
  justify-content: flex-start;
}
.dm-stats-preview {
  width: 200px;
  background: #1e3d1e;
  border: 4px solid #225522;
  padding: 12px 14px;
  border-radius: 8px;
  font-family: "VT323", monospace;
  font-size: 1.2rem;
  line-height: 1.4;
  box-shadow: 0 4px 0 #0a1f0f, 0 0 0 1px #0a1f0f inset;
  flex-shrink: 0;
  color: #d4f0d4;
}
.dm-stats-preview .label { color: #8ab38a; }
.dm-stats-preview .value {
  color: #f4d48a;
  font-weight: 700;
  display: inline-block;
  min-width: 32px;
  text-align: right;
}
.dm-context-preview {
  width: min(100%, 920px);
  flex: 1 1 520px;
  background: #0f1a10;
  border: 3px solid #225522;
  padding: 10px;
  border-radius: 10px;
  min-height: 300px;
  overflow: visible;
}
.dm-last-result {
  margin-top: 10px;
  font-size: 1.1rem;
  font-family: "VT323", monospace;
  color: #a58a5f;
  min-height: 1.4rem;
}
.dm-last-result.ok { color: #7dff7d; }
.dm-last-result.fail { color: #ff6b6b; }

.dm-note {
  font-size: 0.9rem;
  color: #a58a5f;
  margin-top: 0.75rem;
}
.dm-math {
  background: #141a14;
  border: 3px solid #225522;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 12px;
  color: #c9e8c9;
  font-size: 0.95rem;
}
.dm-math h3 {
  font-family: "Bangers", cursive;
  color: #8ab38a;
  margin: 0 0 6px;
  font-size: 1.3rem;
  font-weight: 400;
}
.dm-math .formula {
  font-family: "VT323", monospace;
  background: #0a1f0f;
  border: 2px solid #225522;
  border-radius: 4px;
  padding: 8px 10px;
  color: #f4d48a;
  margin: 8px 0;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .dm-stats-preview { width: 100%; }
  .dm-context-preview { width: 100%; }
}
