.dm-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 640px;
  margin: 1.5rem auto 2.5rem;
}

.dm-status {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-drip);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dm-status-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.dm-status-label {
  color: var(--muted);
  min-width: 4.5rem;
  flex-shrink: 0;
}

.dm-hp {
  display: flex;
  gap: 0.3rem;
}

.dm-hp-pip {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
}

.dm-hp-pip.filled {
  background: var(--spray-pink);
  border-color: var(--spray-pink);
}

.dm-threat-bar {
  flex: 1;
  height: 0.6rem;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  overflow: hidden;
}

.dm-threat-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--spray-yellow), var(--spray-pink));
  transition: width 0.3s ease;
}

.dm-inventory {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.dm-inventory-chip {
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--paper);
}

.dm-narration-log {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-drip);
  padding: 1rem;
  height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dm-msg {
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.5;
}

.dm-msg--narration {
  color: var(--paper);
}

.dm-msg--action {
  align-self: flex-end;
  max-width: 80%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--spray-pink), var(--spray-purple));
  color: var(--paper);
}

.dm-msg--system {
  color: var(--muted);
  font-style: italic;
  font-size: 0.8rem;
  text-align: center;
}

.dm-msg--typing {
  color: var(--muted);
  font-style: italic;
}

.dm-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dm-option-btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--paper);
  cursor: pointer;
}

.dm-option-btn:hover {
  border-color: var(--line-strong);
}

.dm-action-controls {
  display: flex;
  gap: 0.5rem;
}

.dm-action-controls textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  font-family: var(--font-body);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--paper);
  padding: 0.5rem 0.7rem;
}

.dm-victory-overlay {
  text-align: center;
  padding: 1.5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-drip);
}

.dm-victory-overlay h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  color: var(--paper);
  text-shadow: 0 0 10px var(--spray-acid);
}

.dm-controls {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 576px) {
  .dm-narration-log {
    height: 300px;
  }

  /* Side-by-side squeezes the button off-screen next to the keyboard on
     phones - stack it below instead, full width, so it's always reachable. */
  .dm-action-controls {
    flex-direction: column;
  }

  .dm-action-controls button {
    width: 100%;
  }
}
