/* Interactive Damage Text demo (damage-text.js). */
.dmg-chapter .chapter-heading p { color: var(--muted); max-width: 720px; margin-inline: auto; }
.dmg-demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 0; max-width: 1080px; margin: 0 auto; border: 1px solid #5a4a3370; background: #13110f; }
.dmg-stage { position: relative; min-height: 460px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 85%, #6b4a2233, transparent 60%), radial-gradient(ellipse at 50% 30%, #2b2118, #0f0c09 75%); }
.dmg-target { position: absolute; left: 50%; bottom: 0; height: 82%; width: auto; transform: translateX(-50%); filter: drop-shadow(0 10px 24px #000c); pointer-events: none; }
.dmg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.dmg-panel { display: flex; flex-direction: column; max-height: 560px; overflow: auto; padding: 16px 16px 14px; border-left: 1px solid #5a4a3370; background: #110e0b; }
.dmg-panel h3 { margin: 0 0 10px; font: 500 20px/1.2 var(--display); color: var(--gold); }
.dmg-head { margin: 12px 0 6px; padding-bottom: 4px; border-bottom: 1px solid #9d784040; font: 500 13px var(--display); letter-spacing: .05em; color: #e2c98d; }
.dmg-general { display: grid; gap: 6px; }
.dmg-general .dmg-head { margin-top: 0; }
.dmg-check { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); font-size: 13.5px; cursor: pointer; }
.dmg-check input { width: 15px; height: 15px; margin: 0; accent-color: #c4a35e; flex-shrink: 0; }
.dmg-check span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmg-size { display: grid; grid-template-columns: auto minmax(0, 1fr) 42px; align-items: center; gap: 10px; color: var(--text); font-size: 13.5px; }
.dmg-size input { accent-color: #c4a35e; min-width: 0; }
.dmg-size output { color: var(--gold); font-size: 12.5px; text-align: right; }
.dmg-list { list-style: none; display: grid; gap: 3px; margin: 0; padding: 0; }
.dmg-row { display: grid; grid-template-columns: minmax(0, 1fr) 62px 58px 46px; align-items: center; gap: 6px; padding: 4px 6px; background: #17130e; border: 1px solid #5a4a3333; }
.dmg-row-self { grid-template-columns: minmax(0, 1fr) 46px; }
.dmg-row.is-off .dmg-scale, .dmg-row.is-off .dmg-rowbtn, .dmg-row.is-off .dmg-swatch { opacity: .35; }
.dmg-scale select, .dmg-rowbtn { width: 100%; height: 24px; padding: 0 4px; border: 1px solid #4a3d2b; background: #0e0b08; color: #e9d9b5; font-size: 12px; }
.dmg-rowbtn { cursor: pointer; white-space: nowrap; }
.dmg-rowbtn:hover { border-color: #c4a35e; }
.dmg-swatch { position: relative; display: flex; align-items: center; gap: 3px; }
.dmg-color { position: relative; display: block; width: 26px; height: 24px; border: 1px solid #6a5636; cursor: pointer; overflow: hidden;
  background: var(--c, #0e0b08); }
.dmg-color::before { content: ''; position: absolute; left: 2px; top: 0; width: 20px; height: 22px; pointer-events: none;
  background: var(--sheet, none) no-repeat -160px -9px / 220px 40px; }
.dmg-color:hover { border-color: #e5bc6d; }
.dmg-color input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.dmg-default { width: 16px; height: 24px; padding: 0; border: 0; background: none; color: #c9b892; font-size: 13px; cursor: pointer; }
.dmg-default:hover { color: var(--gold); }
.dmg-reset { align-self: flex-start; margin-top: 12px; padding: 7px 12px; border: 1px solid #8a7046; background: #211a12; color: #e9d9b5; font-size: 12.5px; cursor: pointer; }
.dmg-reset:hover { border-color: #c4a35e; color: var(--gold); }
@media (max-width: 900px) {
  .dmg-demo { grid-template-columns: minmax(0, 1fr); }
  .dmg-stage { min-height: 340px; }
  .dmg-panel { max-height: none; border-left: 0; border-top: 1px solid #5a4a3370; }
}
