[v-cloak] { display: none; }

/* Colour themes. Each [data-theme] block sets a palette; the rules below only use the variables.
   data-bs-theme (dark/light) picks Bootstrap's base colours. */
:root, [data-theme="amethyst"] {
  --bg: #16121f; --bg-rgb: 22, 18, 31; --surface: #1d1729; --surface-2: #251d35; --surface-3: #2a2139; --tertiary: #211a2e; --border: #3b2f52;
  --accent: #9b6dff; --accent-rgb: 155, 109, 255; --accent-2: #b08cff; --accent-3: #cbb2ff; --heading: #d4c2ff;
  --strong: #7c4dff; --strong-rgb: 124, 77, 255; --strong-hover: #8f63ff; --strong-active: #6a3ce6; --on-strong: #fff;
  --dim: #3a2d55; --chip: #4a3a6b; --chip-dim: #2f2645; --accent-border: #5b468a; --disabled-text: #8a7da3;
}
[data-theme="midnight"] {
  --bg: #0e131d; --bg-rgb: 14, 19, 29; --surface: #141b28; --surface-2: #1a2333; --surface-3: #1f2a3d; --tertiary: #172030; --border: #2b3a54;
  --accent: #5b9dff; --accent-rgb: 91, 157, 255; --accent-2: #7fb3ff; --accent-3: #a9cbff; --heading: #c2dbff;
  --strong: #2f7bf0; --strong-rgb: 47, 123, 240; --strong-hover: #4a8df5; --strong-active: #2266d0; --on-strong: #fff;
  --dim: #22324d; --chip: #2c4166; --chip-dim: #1d2a40; --accent-border: #3d5888; --disabled-text: #7d8ca6;
}
[data-theme="forest"] {
  --bg: #0f1612; --bg-rgb: 15, 22, 18; --surface: #141f19; --surface-2: #1a2820; --surface-3: #1f2f26; --tertiary: #17231c; --border: #2c4235;
  --accent: #4ccf8a; --accent-rgb: 76, 207, 138; --accent-2: #6edca1; --accent-3: #9ce8bf; --heading: #b8eecf;
  --strong: #23995b; --strong-rgb: 35, 153, 91; --strong-hover: #2bb06a; --strong-active: #1c7f4b; --on-strong: #fff;
  --dim: #22402f; --chip: #2b5a40; --chip-dim: #1d3326; --accent-border: #3b7352; --disabled-text: #7f9a8a;
}
[data-theme="crimson"] {
  --bg: #170f10; --bg-rgb: 23, 15, 16; --surface: #201416; --surface-2: #2a191c; --surface-3: #311d21; --tertiary: #241618; --border: #4a2a2f;
  --accent: #ff6b7a; --accent-rgb: 255, 107, 122; --accent-2: #ff8a96; --accent-3: #ffb0b8; --heading: #ffc9ce;
  --strong: #c92f42; --strong-rgb: 201, 47, 66; --strong-hover: #db4054; --strong-active: #a82536; --on-strong: #fff;
  --dim: #4a2229; --chip: #6b2d37; --chip-dim: #3a1d22; --accent-border: #8a3b47; --disabled-text: #a68288;
}
[data-theme="ember"] {
  --bg: #15110d; --bg-rgb: 21, 17, 13; --surface: #1e1812; --surface-2: #272017; --surface-3: #2d251b; --tertiary: #221b14; --border: #47392a;
  --accent: #ffb04a; --accent-rgb: 255, 176, 74; --accent-2: #ffc06e; --accent-3: #ffd39c; --heading: #ffe0b5;
  --strong: #d9811c; --strong-rgb: 217, 129, 28; --strong-hover: #e89432; --strong-active: #b86b12; --on-strong: #1a1209;
  --dim: #4a3720; --chip: #6b4d26; --chip-dim: #36291a; --accent-border: #8a6533; --disabled-text: #a6937c;
}
[data-theme="abyss"] {
  --bg: #0c1416; --bg-rgb: 12, 20, 22; --surface: #111c1f; --surface-2: #162428; --surface-3: #1a2b30; --tertiary: #142023; --border: #26403f;
  --accent: #2dd4bf; --accent-rgb: 45, 212, 191; --accent-2: #5eead4; --accent-3: #99f6e4; --heading: #b6f5ea;
  --strong: #0f9e8c; --strong-rgb: 15, 158, 140; --strong-hover: #14b8a3; --strong-active: #0b8273; --on-strong: #fff;
  --dim: #1b3d3b; --chip: #205652; --chip-dim: #163130; --accent-border: #2f6f69; --disabled-text: #7b9a97;
}
[data-theme="parchment"] {
  --bg: #f4ead5; --bg-rgb: 244, 234, 213; --surface: #fbf5e8; --surface-2: #efe2c6; --surface-3: #e9dabb; --tertiary: #efe4cc; --border: #d4c09a;
  --accent: #8b4a1c; --accent-rgb: 139, 74, 28; --accent-2: #7a3f15; --accent-3: #6b3410; --heading: #5a2c0c;
  --strong: #8b4a1c; --strong-rgb: 139, 74, 28; --strong-hover: #9c5626; --strong-active: #733c14; --on-strong: #fff;
  --dim: #e8d6b4; --chip: #8b4a1c; --chip-dim: #ead9b8; --accent-border: #c09a6a; --disabled-text: #9a8466;
  --bs-body-color: #2e2215; --bs-body-color-rgb: 46, 34, 21; --bs-secondary-color: rgba(46, 34, 21, .7);
}
[data-theme="daylight"] {
  --bg: #f6f6fb; --bg-rgb: 246, 246, 251; --surface: #ffffff; --surface-2: #efedf8; --surface-3: #e7e4f5; --tertiary: #f0eff7; --border: #d6d2ea;
  --accent: #5b3fd9; --accent-rgb: 91, 63, 217; --accent-2: #4f33c8; --accent-3: #4329b0; --heading: #3a2399;
  --strong: #5b3fd9; --strong-rgb: 91, 63, 217; --strong-hover: #6a50e0; --strong-active: #4a30c0; --on-strong: #fff;
  --dim: #e6e1fa; --chip: #5b3fd9; --chip-dim: #e6e1fa; --accent-border: #a99ce6; --disabled-text: #8e88a8;
}

/* Bootstrap, re-coloured from the active palette. */
[data-theme] {
  --bs-body-bg: var(--bg);
  --bs-body-bg-rgb: var(--bg-rgb);
  --bs-tertiary-bg: var(--tertiary);
  --bs-secondary-bg: var(--surface-3);
  --bs-border-color: var(--border);
  --bs-primary: var(--accent);
  --bs-primary-rgb: var(--accent-rgb);
  --bs-link-color: var(--accent-2);
  --bs-link-color-rgb: var(--accent-rgb);
  --bs-link-hover-color: var(--accent-3);
  --bs-link-hover-color-rgb: var(--accent-rgb);
  --bs-focus-ring-color: rgba(var(--accent-rgb), 0.35);
}
body { background-color: var(--bg); }

.card { --bs-card-bg: var(--surface); --bs-card-cap-bg: var(--surface-2); }
.accordion { --bs-accordion-bg: var(--surface); --bs-accordion-active-bg: var(--surface-2); --bs-accordion-active-color: var(--heading); --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem rgba(var(--accent-rgb), .25); }

.btn-primary {
  --bs-btn-bg: var(--strong);
  --bs-btn-border-color: var(--strong);
  --bs-btn-color: var(--on-strong);
  --bs-btn-hover-bg: var(--strong-hover);
  --bs-btn-hover-border-color: var(--strong-hover);
  --bs-btn-hover-color: var(--on-strong);
  --bs-btn-active-bg: var(--strong-active);
  --bs-btn-active-border-color: var(--strong-active);
  --bs-btn-active-color: var(--on-strong);
  --bs-btn-disabled-bg: var(--dim);
  --bs-btn-disabled-border-color: var(--dim);
  --bs-btn-disabled-color: var(--disabled-text);
  --bs-btn-disabled-opacity: 1;
  --bs-btn-focus-shadow-rgb: var(--accent-rgb);
}

.btn-outline-primary {
  --bs-btn-color: var(--accent-2);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--strong);
  --bs-btn-hover-border-color: var(--strong);
  --bs-btn-hover-color: var(--on-strong);
  --bs-btn-active-bg: var(--strong-active);
  --bs-btn-active-border-color: var(--strong-active);
  --bs-btn-active-color: var(--on-strong);
  --bs-btn-disabled-color: var(--accent);
  --bs-btn-disabled-border-color: var(--accent);
  --bs-btn-focus-shadow-rgb: var(--accent-rgb);
}

/* Secondary buttons: readable text and a visible border, so they don't look disabled. */
.btn-outline-secondary {
  --bs-btn-color: var(--bs-body-color);
  --bs-btn-border-color: var(--accent-border);
  --bs-btn-hover-bg: var(--dim);
  --bs-btn-hover-border-color: var(--accent);
  --bs-btn-hover-color: var(--bs-emphasis-color);
  --bs-btn-active-bg: var(--dim);
  --bs-btn-active-border-color: var(--accent);
  --bs-btn-active-color: var(--bs-emphasis-color);
  --bs-btn-disabled-color: var(--disabled-text);
  --bs-btn-disabled-border-color: var(--border);
  --bs-btn-focus-shadow-rgb: var(--accent-rgb);
}

.nav-pills { --bs-nav-pills-link-active-bg: var(--strong); --bs-nav-pills-link-active-color: var(--on-strong); --bs-nav-link-color: var(--accent-2); --bs-nav-link-hover-color: var(--accent-3); }
.nav-tabs { --bs-nav-link-color: var(--accent-2); --bs-nav-link-hover-color: var(--accent-3); }
.list-group { --bs-list-group-bg: var(--surface); --bs-list-group-active-bg: var(--strong); --bs-list-group-active-color: var(--on-strong); --bs-list-group-active-border-color: var(--strong); --bs-list-group-action-hover-bg: var(--surface-3); }
.form-check-input:checked { background-color: var(--strong); border-color: var(--strong); }
.form-control:focus,
.form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 .25rem rgba(var(--accent-rgb), .25); }
.badge.text-bg-secondary { background-color: var(--chip) !important; color: #fff !important; }
.modal { --bs-modal-bg: var(--surface); }
.theme-select { width: auto; }

h1, .sheet h2 { color: var(--heading); }

.sheet .score { width: 4rem; text-align: center; font-weight: 600; font-size: 1.1rem; }

.list-group-item:disabled { opacity: 0.45; }

/* Reordering ability scores. */
.drag-handle { cursor: grab; user-select: none; color: var(--bs-secondary-color); padding: 0 .4rem 0 0; font-size: 1.1rem; }
.drag-handle:active { cursor: grabbing; }
.score-chip { display: inline-block; min-width: 2.5rem; text-align: center; font-weight: 600; padding: .1rem .4rem; border-radius: .375rem; background: var(--bs-secondary-bg); border: 1px solid var(--bs-border-color); }
.score-input { width: 4.5rem; }
.arrow { text-decoration: none; line-height: 1; }
.drag-over > td { background-color: rgba(var(--accent-rgb), 0.25) !important; }

/* Thief skills. */
.points-input { width: 4rem; }
.step-btn { min-width: 2.4rem; padding-left: .3rem; padding-right: .3rem; margin: 0 .1rem; }
.skills-sheet { max-width: 22rem; }
.skills-sheet th { font-weight: normal; }

/* Up to eight wizard steps: keep the tabs compact so they fit on one line on desktop. */
.nav-pills .nav-link { padding: .35rem .6rem; font-size: .95rem; }

/* Proficiencies. */
.weapon-item { padding: .25rem .5rem; border: 1px solid var(--bs-border-color); border-radius: .375rem; min-height: 2.2rem; }
.weapon-item.chosen { border-color: var(--strong); background: rgba(var(--accent-rgb), 0.12); }
.spec-btn { font-size: .75rem; white-space: nowrap; }
.weapon-item.not-allowed { opacity: .35; border-style: dashed; }
.weapon-item.not-allowed label { text-decoration: line-through; }

/* Reference material and kits. */
/* Keep Bootstrap's left padding: the checkbox sits in it (overriding it pushed the box out of the card). */
.source-item { padding-top: .2rem; padding-bottom: .2rem; margin-bottom: 0; }
.source-code { display: inline-block; min-width: 3.6rem; font-weight: 600; color: var(--accent-3); font-size: .85rem; }
.kit-item { cursor: pointer; }
/* Bootstrap disables clicks on .disabled items; keep them so the info icon still works. */
.kit-item.disabled { opacity: .5; cursor: not-allowed; pointer-events: auto; }
.kit-item.active .info-btn { border-color: var(--on-strong); color: var(--on-strong); }

/* Spells. */
.school-tag { font-size: .7rem; white-space: nowrap; }
.info-btn {
  flex: none; width: 1.15rem; height: 1.15rem; padding: 0; border-radius: 50%;
  border: 1px solid var(--accent); background: transparent; color: var(--accent-2);
  font: italic 700 .72rem/1 Georgia, serif; display: inline-flex; align-items: center; justify-content: center;
  vertical-align: middle; cursor: pointer;
}
.info-btn:hover, .info-btn:focus-visible { background: var(--strong); color: var(--on-strong); outline: none; }
.spell-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .5rem 1rem; margin-bottom: 1rem; }
.spell-stats dt { font-size: .75rem; font-weight: 500; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: .03em; }
.spell-stats dd { margin: 0; }
.spell-faq dt { margin-top: .6rem; color: var(--heading); }
.spell-faq dd { margin-bottom: 0; }

/* Languages. */
.lang-badge { background: var(--chip); font-weight: 500; font-size: .85rem; display: inline-flex; align-items: center; }
.lang-badge.free { background: var(--chip-dim); color: var(--accent-3); }
.lang-remove { width: .55em; height: .55em; padding: 0; }
.lang-btn.suggested { border-color: var(--strong); background: rgba(var(--accent-rgb), 0.08); }
.lang-btn:disabled.btn-primary { opacity: .75; background: var(--dim); border-color: var(--accent-border); color: var(--accent-3); }
.custom-lang { max-width: 26rem; }

/* Suggested nonweapon proficiencies: a faint purple tint and accent, nothing louder. */
.rec-mark { color: var(--accent-2); font-size: .8em; }
tr.recommended > td { background-color: rgba(var(--accent-rgb), 0.08) !important; }
tr.recommended > td:first-child { box-shadow: inset 3px 0 0 var(--strong) !important; }
.nwp-note { width: 12rem; }
.nwp-sheet td:last-child { width: 4rem; }
.nwp-table-wrap { max-height: 28rem; overflow-y: auto; }
.nwp-table-wrap thead th { position: sticky; top: 0; background: var(--bs-card-bg, var(--bs-body-bg)); z-index: 1; }

/* Ability or skill row that breaks a rule. */
.ability-problem > td { background-color: rgba(220, 53, 69, 0.22) !important; }
.ability-problem > td.text-muted { color: var(--bs-danger-text-emphasis) !important; }

.modal-backdrop-custom { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 1050; }

/* Print in light mode so the sheet doesn't waste ink. */
@media print {
  .no-print { display: none !important; }
  .col-lg-9 { width: 100%; }
  .card { border: none; }
  body, .card, .table { background: #fff !important; color: #000 !important; --bs-table-bg: #fff; --bs-table-color: #000; --bs-card-bg: #fff; }
  h1, .sheet h2 { color: #000; }
}

/* Weapon options (fighting styles, groups, unarmed). */
.weapon-option { cursor: pointer; }

/* Class accordion: the chosen class is highlighted and opens to show its kits. */
.class-accordion .accordion-button { padding: .6rem .9rem; }
.class-accordion .accordion-button:disabled { opacity: .45; }
.class-accordion .accordion-item.class-chosen > .accordion-header .accordion-button { background: rgba(var(--strong-rgb), .25); color: var(--bs-emphasis-color); box-shadow: inset 3px 0 0 var(--strong); }
.class-accordion .accordion-button.no-caret::after { display: none; }

/* Race accordion: one section per book/setting. */
.race-accordion .accordion-button { padding: .6rem .9rem; }
.race-accordion.single-group .accordion-item { border: 0; }
.race-accordion .list-group-item { border-left: 0; border-right: 0; }

/* Psionics. */
.discipline-btn { white-space: normal; }
.weapon-option.option-blocked { opacity: .5; cursor: not-allowed; }

/* Equipment. */
.equip-summary { position: sticky; top: 0; z-index: 5; }
.shop-accordion .accordion-button { padding: .55rem .9rem; }
.shop-table td { padding-top: .25rem; padding-bottom: .25rem; }
.bought-list li { padding: .1rem 0; border-bottom: 1px solid var(--bs-border-color); }
@media print { .equip-summary { position: static; } }

/* Play mode. */
.play-view .card-body { padding: .9rem 1rem; }
.money-input { max-width: 18rem; }
.inventory li { padding: .15rem 0; border-bottom: 1px solid var(--bs-border-color); }
.inv-qty { display: inline-block; min-width: 1.6rem; text-align: center; }
.spell-level-label { min-width: 4rem; }
.level-up-btn { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, .6); } 50% { box-shadow: 0 0 0 .4rem rgba(25, 135, 84, 0); } }
@media (prefers-reduced-motion: reduce) { .level-up-btn { animation: none; } }
.lu-section { border-bottom: 1px solid var(--bs-border-color); padding-bottom: .75rem; margin-bottom: .75rem; }
.lu-section:last-child { border-bottom: 0; margin-bottom: 0; }
.lu-roll { width: 5rem; }
.lu-spell-level { max-width: 8rem; }

/* Characters page. */
.home-link { color: inherit; text-decoration: none; }
.home-link:hover { color: var(--heading); }
.wizard-col { max-width: 1000px; margin: 0 auto; }
.character-card .card-body { padding: 1rem; }

/* Nonweapon proficiencies and languages share one panel. */
.nwp-subhead { border-top: 1px solid var(--bs-border-color); padding-top: .75rem; color: var(--heading); }
.nwp-panel-head { position: sticky; top: 0; z-index: 3; background: var(--bs-card-bg); padding: .25rem 0; }
.gold-roll { width: auto; }

/* Character-sheet header: labelled fields like the top of a printed sheet. */
.char-header { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; margin: 0; }
.char-header > div { min-width: 6rem; }
.char-header dt { font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color); }
.char-header dd { margin: 0; }
@media print { .char-header dt { color: #555; } }

/* Play tables. */
.play-table th { font-weight: 500; }
.play-table td, .play-table th { padding: .2rem .35rem; }
.weapon-chart th { font-size: .8rem; white-space: nowrap; }
.use-boxes { margin-top: .2rem; }

.shop-table tr.prof-weapon > td { background-color: rgba(var(--strong-rgb), .14) !important; }
.shop-table tr.prof-weapon > td:first-child { box-shadow: inset 3px 0 0 var(--strong) !important; }

/* Dice roller. */
.dice-fab { position: fixed; right: 1rem; bottom: 1rem; z-index: 1040; border-radius: 2rem; box-shadow: 0 .25rem 1rem rgba(0, 0, 0, .4); }
.dice-panel { position: fixed; right: 1rem; bottom: 4rem; z-index: 1040; width: min(22rem, calc(100vw - 2rem)); max-height: calc(100vh - 6rem); overflow-y: auto; box-shadow: 0 .5rem 2rem rgba(0, 0, 0, .5); }
.die-btn { min-width: 3rem; }
.dice-num { width: 4.5rem; }
.dice-log { max-height: 14rem; overflow-y: auto; }
.dice-log li { padding: .2rem 0; border-bottom: 1px solid var(--bs-border-color); }
.dice-total { display: inline-block; min-width: 2.2rem; text-align: center; font-weight: 700; border-radius: .3rem; background: var(--bs-secondary-bg); }
.dice-total.roll-good { background: rgba(25, 135, 84, .35); }
.dice-total.roll-bad { background: rgba(220, 53, 69, .3); }
.dice-total.crit-high { background: var(--strong); color: var(--on-strong); }
.dice-total.crit-low { background: #dc3545; color: #fff; }
.play-view { padding-bottom: 4rem; } /* room for the floating dice button */

/* Export menu (native <details>, no JS needed). */
.export-menu { position: relative; display: inline-block; }
.export-menu > summary { list-style: none; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-options { position: absolute; right: 0; z-index: 20; min-width: 12rem; margin-top: .25rem; padding: .25rem 0;
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: .375rem; box-shadow: 0 .5rem 1rem rgba(0,0,0,.4); }
.export-options .dropdown-item { color: var(--bs-body-color); }
.export-options .dropdown-item:hover { background: var(--dim); color: var(--bs-emphasis-color); }

/* Play header buttons sit at the top right, with Export last. */
.play-actions { margin-left: auto; }

/* Inventory: equip checkbox, use boxes (buttons styled as boxes), trash. */
.equip-check { flex: none; cursor: pointer; }
.equip-spacer { flex: none; width: 1em; }
.use-box { width: .9rem; height: .9rem; padding: 0; margin: 0; border: 1px solid var(--accent-border); border-radius: .2rem; background: var(--bs-body-bg); cursor: pointer; }
.use-box:hover { border-color: var(--accent); }
.use-box.used { background: var(--strong); border-color: var(--strong); }
.use-box:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.trash-btn { color: var(--bs-secondary-color); line-height: 1; }
.trash-btn:hover, .trash-btn:focus-visible { color: var(--bs-danger); }
.add-results { max-height: 16rem; overflow-y: auto; }

/* Weapons chart: rolls are off until the weapon is equipped. */
.roll-btn { padding: .05rem .5rem; font-size: .78rem; }
.speed-btn { font-weight: 600; text-decoration: underline dotted; }
.speed-btn:disabled { text-decoration: none; color: var(--bs-body-color); opacity: .7; }
.weapon-chart tr.not-equipped > td { color: var(--bs-secondary-color); }

/* Roll dialog: the die tumbles, slows, then lands with a little bounce. */
.die-stage { height: 140px; display: flex; align-items: center; justify-content: center; margin-bottom: .5rem; }
.die { overflow: visible; }
.die-face { fill: var(--strong); stroke: var(--accent-3); stroke-width: 2; stroke-linejoin: round; }
.die-edge { fill: none; stroke: var(--accent-3); stroke-opacity: .55; stroke-width: 1.2; stroke-linejoin: round; }
.die-num { fill: var(--on-strong); font: 700 22px/1 system-ui, sans-serif; text-anchor: middle; dominant-baseline: middle; }
.die.rolling { animation: die-tumble .5s linear infinite; }
.die.landed { animation: die-land .45s cubic-bezier(.2, 1.6, .4, 1); }
.die.tone-good .die-face { fill: #198754; }
.die.tone-bad .die-face { fill: #b02a37; }
.die.tone-crit-high .die-face { fill: #d4a017; }
.die.tone-crit-low .die-face { fill: #6c1a22; }
@keyframes die-tumble {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  25% { transform: translateY(-14px) rotate(90deg) scale(.92); }
  50% { transform: translateY(0) rotate(180deg) scale(1); }
  75% { transform: translateY(-8px) rotate(270deg) scale(.95); }
  100% { transform: translateY(0) rotate(360deg) scale(1); }
}
@keyframes die-land { 0% { transform: scale(.7); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .die.rolling, .die.landed { animation: none; } }
.die { transform-origin: 50% 50%; transform-box: fill-box; }
.roll-headline { font-size: 1.35rem; font-weight: 700; color: var(--heading); }
.roll-headline.tone-good { color: #3fbf7f; }
.roll-headline.tone-bad { color: #e35d6a; }
.roll-headline.tone-crit-high { color: #e0b030; }
.roll-headline.tone-crit-low { color: #e35d6a; }
[data-bs-theme="light"] .roll-headline.tone-good { color: #146c43; }
[data-bs-theme="light"] .roll-headline.tone-bad, [data-bs-theme="light"] .roll-headline.tone-crit-low { color: #b02a37; }
[data-bs-theme="light"] .roll-headline.tone-crit-high { color: #8a6500; }
[data-bs-theme="light"] .dice-total.roll-good { background: rgba(25, 135, 84, .2); }
.die-count { position: absolute; top: -.45rem; right: -.45rem; font-size: .65rem; }
.dice-expr { font-variant-numeric: tabular-nums; }
.inv-count { flex: none; min-width: 1.8rem; padding: 0 .35rem; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums;
  border-radius: 1rem; background: var(--surface-3); border: 1px solid var(--border); line-height: 1.35; }
.kit-reminder { padding: .4rem .6rem; border-left: 3px solid var(--strong); background: rgba(var(--accent-rgb), .08); border-radius: .25rem; }

/* Attack dialog: damage result. */
.damage-result { border-top: 1px solid var(--border); padding-top: .5rem; }
.damage-total { font-size: 1.8rem; font-weight: 700; line-height: 1.1; color: var(--heading); font-variant-numeric: tabular-nums; }
.damage-result.landed .damage-total { animation: die-land .4s cubic-bezier(.2, 1.6, .4, 1); }

/* Dice log: the newest roll flashes in, then keeps a soft highlight. */
.dice-log li { border-radius: .3rem; padding-left: .25rem; padding-right: .25rem; }
.dice-log li.newest { background: rgba(var(--accent-rgb), .14); box-shadow: inset 3px 0 0 var(--strong); animation: roll-in .9s ease-out; }
@keyframes roll-in {
  0% { transform: translateX(-8px); opacity: 0; background: rgba(var(--accent-rgb), .55); }
  30% { transform: translateX(0); opacity: 1; background: rgba(var(--accent-rgb), .45); }
  100% { background: rgba(var(--accent-rgb), .14); }
}
.dice-log li.newest .dice-total { animation: die-land .5s cubic-bezier(.2, 1.6, .4, 1); }
@media (prefers-reduced-motion: reduce) { .dice-log li.newest, .dice-log li.newest .dice-total, .damage-result.landed .damage-total { animation: none; } }

/* Login page. */
.login-card { max-width: 24rem; }
