.dice-bar { display: flex; align-items: center; gap: 6px; padding: 4px 12px 6px; background: #1c1612; border-bottom: 1px solid #8a7040; }
.dice-bar-row { display: flex; flex-wrap: wrap; gap: 4px; }
.dice-bar-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 36px; padding: 2px 4px; border: 1px solid #8a7040; border-radius: 3px; background: #2a2118; color: #f3e6c8; cursor: pointer; font-family: var(--label, inherit); font-size: 10px; letter-spacing: .04em; }
.dice-bar-btn .die-face { width: 40px; height: 40px; }
.dice-bar-btn img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.dice-bar-map { background: #16130f; border: 0; padding: 4px 8px; }
.dice-bar-map .dice-bar-btn { background: #3a3228; }
.dice-stage { display: flex; align-items: center; gap: 10px; padding: 6px 12px 8px; background: #241c16; color: #f3e6c8; }
.dice-stage[hidden] { display: none; }
.dice-stage-line { margin: 0; font-size: 14px; }
.die-face { position: relative; display: inline-block; width: 84px; height: 84px; vertical-align: middle; line-height: 0; }
.die-face img { width: 100%; height: 100%; object-fit: contain; display: block; }
.die-face .die-num { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.die-inline { width: 36px; height: 36px; vertical-align: -12px; display: inline-block; margin: 0 2px; }
.art-thumb { width: 72px; height: 24px; object-fit: contain; display: block; margin-bottom: 4px; background: #fffaf3; border: 1px solid #c4b497; }
.gear-art-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.gear-art { margin: 0; width: 180px; }
.gear-art img { width: 100%; aspect-ratio: 3 / 1; object-fit: contain; background: #fffaf3; border: 1px solid #c4b497; display: block; }
.gear-art figcaption { font-size: 11px; color: #6b5438; }
.focus-photo { margin: 8px 0; }
.dm-only-art { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.dm-only-art figure { margin: 0; width: min(280px, 100%); }
.dm-only-art img { width: 100%; aspect-ratio: 3 / 1; object-fit: contain; background: #1c1612; border: 1px solid #8a7040; display: block; }
.dm-only-art figcaption { font-size: 12px; color: #c4b497; }
.d4-die { background: transparent; border: 0; padding: 0; }
.d4-die .die-face { width: 120px; height: 120px; }
.ssdns-map .dice-bar-map { flex: none; }
button.d20 {
  background: transparent url("../img/dice/d20.webp") center / 28px 28px no-repeat;
  color: #1a120c;
  text-shadow: 0 0 2px #fff6e4;
}
@media (max-width: 700px) {
  .dice-bar, .dice-bar-row { flex-wrap: wrap; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .dice-bar-btn { min-width: 40px; min-height: 40px; }
}
@media (max-width: 520px) {
  .dice-bar { padding-left: 8px; padding-right: 8px; }
  .dice-stage { flex-wrap: wrap; max-width: 100%; }
  .die-face { width: 64px; height: 64px; }
}
/* 0.3.54 roll builder: ×N and +M steppers, mixed pool. */
.dice-builder { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #f3e6c8; font-size: 13px; }
.dice-step { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; }
.dice-step button { width: 22px; height: 22px; padding: 0; border: 1px solid #8a7040; border-radius: 3px; background: #2a2118; color: #f3e6c8; cursor: pointer; font-size: 10px; line-height: 1; }
.dice-step output { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.dice-pool { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border: 1px dashed #c9a24a; border-radius: 4px; background: #2a2118; }
.dice-pool[hidden] { display: none; }
.dice-pool-roll, .dice-pool-clear { border: 1px solid #8a7040; border-radius: 3px; background: #6b2a1c; color: #fff4dc; cursor: pointer; padding: 1px 8px; font-size: 12px; }
.dice-pool-clear { background: #2a2118; padding: 1px 6px; }
.die-group { display: inline; }
.die-group .die-extra { display: none; }
.die-group.die-open .die-extra { display: inline-block; }
.die-group.die-open .die-more { display: none; }
.die-more { border: 1px solid #8a7040; border-radius: 10px; background: #2a2118; color: #f3e6c8; font-size: 11px; font-weight: 700; padding: 0 6px; margin: 0 2px; cursor: pointer; vertical-align: middle; }
.dice-stage { flex-wrap: wrap; }
@media (max-width: 520px) { .dice-builder { font-size: 12px; } .dice-step button { width: 28px; height: 28px; } }

/* 0.3.54: locked die size, wrap past it; big western roll line */
.dice-stage { flex-wrap: wrap; align-items: center; }
.dice-stage .die-face { flex: none; }
.dice-stage-line { flex-basis: 100%; font-family: "Rye", "Smokum", "Rockwell", "Georgia", serif; font-size: 26px; line-height: 1.2; letter-spacing: .02em; color: #f6e7c1; text-shadow: 0 1px 0 #000; margin: 4px 0 0; }
@media (max-width: 520px) { .dice-stage-line { font-size: 20px; } }

/* 0.3.59 chat totals: final numbers as gold-ringed badges, same size as the inline die icon */
.roll-total { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 7px; box-sizing: border-box;
  vertical-align: middle; margin: 0 3px; border-radius: 11px; border: 3px solid #e1b24a; background: radial-gradient(circle at 50% 35%, #3a2c18, #1a130b);
  box-shadow: 0 0 0 1px #1A1A1A, 0 0 9px rgba(225, 178, 74, .45); font: 900 18px/1 "Arial Black", Arial, Helvetica, sans-serif; color: #ffe3a0;
  text-shadow: -1.5px -1.5px 0 #1A1A1A, 1.5px -1.5px 0 #1A1A1A, -1.5px 1.5px 0 #1A1A1A, 1.5px 1.5px 0 #1A1A1A; }
.roll-total.dmg { border-radius: 50%; }
.roll-total.crit { border-color: #ffcf4a; color: #fff2c4; box-shadow: 0 0 0 1px #1A1A1A, 0 0 15px rgba(255, 207, 74, .8); }
.roll-total.miss { border-color: #8b7a5c; color: #d9ccb0; box-shadow: 0 0 0 1px #1A1A1A; }
.die-used { display: inline-block; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 207, 74, .55); }
/* 0.3.60 advantage / disadvantage: kept d20 ringed green (adv) or red (dis); dropped d20 gets a thin faint red X */
.die-kept.adv { box-shadow: 0 0 0 2px #46c46a, 0 0 6px rgba(70, 196, 106, .55); }
.die-kept.dis { box-shadow: 0 0 0 2px #e0524a, 0 0 6px rgba(224, 82, 74, .55); }
.die-dropped { position: relative; display: inline-block; opacity: .72; }
.die-dropped::after { content: ""; position: absolute; inset: 4px; pointer-events: none;
  background:
    linear-gradient(45deg, transparent calc(50% - 1px), rgba(255, 140, 140, .75) calc(50% - 1px), rgba(255, 140, 140, .75) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(-45deg, transparent calc(50% - 1px), rgba(255, 140, 140, .75) calc(50% - 1px), rgba(255, 140, 140, .75) calc(50% + 1px), transparent calc(50% + 1px)); }
/* 0.3.60: attack (d20) total: no ring, the d20 face's light blue */
.roll-total-atk { color: #4FDCCB; font-weight: 800; }
.roll-total-atk.crit { color: #7ff3e6; }

/* 0.3.80 (DMCC 0.2.93): one dice tray everywhere. The rolled die art and "1d4 = 4" sit inline to the right of the dice
   buttons (Jessey's UI note 1, 2026-10-19), and the space is reserved so a roll never pushes anything down.
   - .dice-tray: the DMCC and player-sheet top bar (#diceBar + #diceStage)
   - .dice-stage-inline: the map's own dice lane (normal and full screen, DM and player) */
.dice-tray { display: flex; align-items: center; background: #1c1612; border-bottom: 1px solid #8a7040; min-width: 0; }
.dice-tray #diceBar { flex: none; }
.dice-tray #diceBar.dice-bar { border-bottom: 0; background: transparent; }
.dice-tray .dice-stage,
.dice-bar .dice-stage-inline { flex: 1 1 0; align-self: stretch; min-width: 0; flex-wrap: nowrap; align-items: center; gap: 4px; padding: 0 12px; background: transparent; height: auto; max-height: none; overflow: hidden; margin: 0; }
.dice-bar .dice-stage-inline { min-width: 120px; padding: 0 8px; }
.dice-tray .dice-stage[hidden],
.dice-bar .dice-stage-inline[hidden] { display: flex !important; visibility: hidden; }
.dice-tray .dice-stage .die-face,
.dice-bar .dice-stage-inline .die-face { width: 40px !important; height: 40px !important; flex: 0 1 40px; min-width: 16px; }
.dice-tray .dice-stage .die-face img,
.dice-bar .dice-stage-inline .die-face img { width: 100%; height: 100%; object-fit: contain; }
.dice-tray .dice-stage-line,
.dice-bar .dice-stage-inline .dice-stage-line { flex: none; flex-basis: auto; margin: 0 0 0 4px; font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 800px) {
  .dice-tray { flex-wrap: wrap; }
  .dice-tray .dice-stage { flex-basis: 100%; padding: 0 8px 4px; }
  .dice-tray .dice-stage[hidden] { display: none !important; }
  .dice-bar .dice-stage-inline .dice-stage-line { font-size: 18px; }
}
