/* Hearth roll result (Addendum 12E): the ONE result card (ui/roll-result.js). It stays until the player dismisses it.
   Root tokens for sizes, theme tokens for colours, so Dark (black leather and gold) and Light (parchment) both read. */
.rr {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 100000;
  width: max-content; max-width: calc(100vw - var(--sp-5)); box-sizing: border-box;
  padding: var(--sp-3) calc(var(--sp-5) + var(--sp-4)) var(--sp-3) var(--sp-5);
  border-radius: var(--rad-4); text-align: center; cursor: pointer;
  background: var(--c-night-07); color: var(--ink);
  border: var(--sp-hair) solid rgb(from var(--gold) r g b / 0.55);
  box-shadow: var(--shadow-pop) rgb(from var(--c-black) r g b / 0.45), inset 0 var(--sp-hair) 0 rgb(from var(--ink) r g b / 0.08);
  -webkit-tap-highlight-color: transparent; animation: rr-in .18s ease-out;
}
@keyframes rr-in { from { opacity: 0; } to { opacity: 1; } }
.rr-n20 { border-color: var(--gold); box-shadow: var(--shadow-pop) rgb(from var(--c-black) r g b / 0.45), 0 0 var(--sp-5) rgb(from var(--gold) r g b / 0.45); }
.rr-n1 { border-color: rgb(from var(--oxblood, var(--c-red-41)) r g b / 0.85); }
.rr-num { font: 700 min(13vmin, calc(var(--fs-xl) * 3)) / 1 var(--serif, Georgia, serif); color: var(--ink); }
.rr-n20 .rr-num { color: var(--gold); }
.rr-n1 .rr-num { color: var(--oxblood, var(--c-red-61)); }
.rr-lbl { margin-top: var(--sp-1); font: 600 var(--fs-md) / var(--lh-body) var(--sans, system-ui, sans-serif); color: rgb(from var(--ink) r g b / 0.86); }
.rr-bd { margin-top: var(--sp-1); font: 500 var(--fs-sm) / var(--lh-body) var(--sans, system-ui, sans-serif); color: rgb(from var(--ink) r g b / 0.72); overflow-wrap: anywhere; }
.rr-x {
  position: absolute; top: 0; right: 0; width: var(--tap); height: var(--tap); padding: 0; border: 0; background: none;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: rgb(from var(--ink) r g b / 0.75);
  font: 400 var(--fs-xl) / 1 var(--sans, system-ui, sans-serif); -webkit-tap-highlight-color: rgb(from var(--gold) r g b / 0.2);
}
.rr-x:focus-visible, .rr-act:focus-visible { outline: var(--sp-half) solid var(--gold); outline-offset: calc(var(--sp-half) * -1); }
.rr-acts { margin-top: var(--sp-2); display: flex; justify-content: center; gap: var(--sp-2); flex-wrap: wrap; }
.rr-act {
  min-height: var(--tap-visual); padding: 0 var(--sp-4); border-radius: var(--rad-pill); cursor: pointer;
  border: var(--sp-hair) solid rgb(from var(--gold) r g b / 0.55); background: rgb(from var(--gold) r g b / 0.1); color: var(--ink);
  font: 600 var(--fs-sm) / 1 var(--sans, system-ui, sans-serif);
}
/* (A15 B1) the extras the player's roll dialog used to show in its own big modal, kept small on the one card */
.rr-tag { margin-top: var(--sp-1); display: inline-block; padding: 0 var(--sp-2); border-radius: var(--rad-pill); font: 700 var(--fs-xs, var(--fs-sm)) / 1.8 var(--sans, system-ui, sans-serif); letter-spacing: .04em; color: var(--gold); border: var(--sp-hair) solid rgb(from var(--gold) r g b / 0.55); }
.rr-n1 .rr-tag { color: var(--oxblood, var(--c-red-61)); border-color: rgb(from var(--oxblood, var(--c-red-61)) r g b / 0.6); }
.rr-note { margin-top: var(--sp-1); font: 500 var(--fs-sm) / var(--lh-body) var(--sans, system-ui, sans-serif); color: rgb(from var(--ink) r g b / 0.72); }
.rr-act.rr-pri { background: linear-gradient(var(--oak-brass-hi, var(--gold)), var(--gold)); color: var(--on-gold, var(--c-black)); border-color: var(--gold); font-weight: 700; }
.rr-act.rr-sm { min-height: var(--tap); padding: 0 var(--sp-3); background: none; border-color: rgb(from var(--ink) r g b / 0.25); color: rgb(from var(--ink) r g b / 0.8); font-weight: 500; }
.rr-acts { max-width: min(26rem, calc(100vw - var(--sp-5) * 2)); margin-left: auto; margin-right: auto; }
/* (fix-1121, Tom 21 Nov 19:05-19:06) the GM attack result's look for EVERY roll result and the choices on it, player and GM:
   a dark rounded card with a thin accent border and a close x, a huge serif result, a bold subtitle, a small breakdown, over a
   dimmed backdrop on a live map. The choices on the card (Roll damage, Smite, Adv / Dis, crit, rerolls, Back to the roll,
   Roll log) are small dark rounded panels with the same thin accent edge and a serif label: no pills, no other sheet look. */
.rr-dim { position: fixed; inset: 0; z-index: 99999; pointer-events: none; background: rgb(from #000000 r g b / 0.42); animation: rr-in .18s ease-out; }
html:root[data-look] body .rr, html:root[data-theme] body .rr { background: #181717; color: #fff6e6; border: 1px solid rgb(from var(--rr-gold, #e9bd62) r g b / 0.7); border-radius: var(--rad-4); }
html:root body .rr .rr-num { color: #fff6e6; }
html:root body .rr.rr-n20 .rr-num { color: var(--rr-gold, #e9bd62); }
html:root body .rr .rr-lbl { font-weight: 700; color: rgb(from #fff6e6 r g b / 0.92); }
html:root body .rr .rr-bd, html:root body .rr .rr-note { color: rgb(from #fff6e6 r g b / 0.72); }
html:root body .rr .rr-x { color: rgb(from #fff6e6 r g b / 0.75); }
html:root body .rr .rr-act, html:root body .rr .rr-act.rr-sm {
  border-radius: var(--rad-3, 12px); background: rgb(from #000000 r g b / 0.35); border: 1px solid rgb(from var(--rr-gold, #e9bd62) r g b / 0.55);
  color: #fff6e6; font: 600 var(--fs-sm) / 1 var(--serif, Georgia, serif);
}
html:root body .rr .rr-act.rr-pri { background: rgb(from var(--rr-gold, #e9bd62) r g b / 0.18); border-color: var(--rr-gold, #e9bd62); color: var(--rr-gold, #e9bd62); font-weight: 700; }
/* Choices tied to a roll: the first-crit rule, Death Strike's target-save answer and the roll's own follow-up sheet.
   They keep their own wiring (commit-once and shared-table crit gate), but use exactly the result's dark card skin. */
html:root[data-palette][data-palette][data-palette][data-palette][data-palette][data-palette] body :is(.hcrit-layer .u-sheet, .hcrit-layer .u-hx-sh, .rr-choice .dialog, .roll-dialog) {
  background: #181717 !important; background-image: none !important; color: #fff6e6 !important;
  border: 1px solid var(--rr-gold, #e9bd62) !important; border-radius: var(--rad-4) !important;
}
html:root[data-palette][data-palette][data-palette][data-palette][data-palette][data-palette] body :is(.hcrit-layer, .rr-choice, .roll-dialog) :is(h2,h3,p,.u-t-body,.u-t-h2,.t-body,.t-h2,.dialog-helper,.dialog-title,.roll-label,.roll-detail) { color: #fff6e6 !important; }
html:root[data-palette][data-palette][data-palette][data-palette][data-palette][data-palette] body :is(.hcrit-layer .u-hcrit-b, .hcrit-layer .hcrit-b, .rr-choice button, .roll-dialog button, .rr-choice .dm-tie-row, .rr-choice [data-dm-tie-pick]) {
  background: #121010 !important; color: #fff6e6 !important; border: 1px solid var(--rr-gold, #e9bd62) !important;
  border-radius: var(--rad-3,12px) !important; font-family: var(--serif,Georgia,serif) !important;
}
/* The old form's inner beige rows/buttons used palette-specific !important rules. Re-skin those too, not just its shell. */
html:root[data-palette][data-palette][data-palette][data-palette][data-palette][data-palette][data-palette][data-palette] body :is(.roll-dialog, .rr-choice .dialog, .hcrit-layer .u-sheet, .hcrit-layer .u-hx-sh) :is(button,.btn,.u-btn,.roll-line,.roll-row,.roll-layer-option,.dialog-actions,.roll-line-main,.roll-line-result,.roll-options) {
  background: #121010 !important; background-image: none !important; color: #fff6e6 !important; border-color: var(--rr-gold,#e9bd62) !important; box-shadow: none !important;
}
html:root[data-palette][data-palette][data-palette][data-palette][data-palette][data-palette][data-palette][data-palette] body :is(.roll-dialog, .rr-choice .dialog, .hcrit-layer .u-sheet, .hcrit-layer .u-hx-sh) :is(h1,h2,h3,h4,p,b,small,span,label,.dialog-title,.roll-line-label,.roll-dialog-title,.roll-dialog-sub,.roll-formula,.roll-hint,.roll-line-formula,.roll-dialog-hint,.u-t-h2,.u-t-body) { color: #fff6e6 !important; }
/* Light mode paints titles via -webkit-text-fill-color, which beats color: set both. */
html:root[data-palette][data-palette][data-palette][data-palette][data-palette][data-palette][data-palette][data-palette] body :is(.roll-dialog, .rr-choice .dialog, .hcrit-layer .u-sheet, .hcrit-layer .u-hx-sh) :is(.dialog-title,.dialog-helper,.dialog-body,.roll-dialog-hint,h1,h2,h3,h4,p) { -webkit-text-fill-color: currentColor !important; color: #fff6e6 !important; }
