/* builtin/statblock.css */

.statblock {
  --statblock-primary-color: #7a200d;
  --statblock-rule-color: #922610;
  --statblock-bg: #fdf1dc;
  --statblock-heading-font: "Libre Baskerville", "Lora", Georgia, serif;
  --statblock-content-font: "Noto Sans", Calibri, Helvetica, Arial, sans-serif;

  background: var(--statblock-bg);
  color: #000;
  border: 1px solid #ddd;
  box-shadow: 0 0 1.5em #ddd;
  padding: 0.6rem 0.75rem;
  margin: 1rem 0;
  font-family: var(--statblock-content-font);
  font-size: 14px;
  line-height: 1.4;
}
.statblock p { margin: 0.15rem 0; }
.statblock-name {
  font-family: var(--statblock-heading-font);
  font-size: 1.6rem;
  font-variant: small-caps;
  font-weight: 700;
  color: var(--statblock-primary-color);
  margin: 0;
  line-height: 1.1;
}
.statblock-subheading {
  font-style: italic;
  font-size: 0.9rem;
  margin: 0.1rem 0 0;
}
.statblock-rule {
  height: 5px;
  background: var(--statblock-rule-color);
  border: none;
  margin: 0.4rem 0;
  clip-path: polygon(0 0, 100% 0, 100% 30%, 0 100%);
}
.statblock-rule-tapered {
  clip-path: polygon(0 0, 100% 0, 95% 100%, 5% 100%);
}
.statblock-block { margin: 0.3rem 0; }
.statblock-property {
  color: var(--statblock-primary-color);
}
.statblock-property strong {
  font-weight: bold;
}
.statblock-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.25rem;
  text-align: center;
  color: var(--statblock-primary-color);
  margin: 0.3rem 0;
}
.statblock-stat-name {
  font-weight: bold;
  font-variant: small-caps;
}
.statblock-section { margin-top: 0.6rem; }
.statblock-section-heading {
  font-family: var(--statblock-heading-font);
  font-variant: small-caps;
  font-weight: normal;
  font-size: 1.3rem;
  color: var(--statblock-primary-color);
  border-bottom: 1px solid var(--statblock-primary-color);
  margin: 0.5rem 0 0.3rem;
}
.statblock-trait {
  margin: 0.3rem 0;
  text-indent: -1rem;
  padding-left: 1rem;
}
.statblock-trait strong em {
  font-weight: bold;
  font-style: italic;
}
.statblock-spell-level {
  margin: 0.15rem 0 0.15rem 1rem;
  text-indent: -1rem;
  padding-left: 1rem;
}
.statblock-section-intro {
  font-style: italic;
  margin: 0.3rem 0;
}
.statblock-error {
  background: #fde7e3;
  color: #7a200d;
  border-color: #7a200d;
}
.statblock-image {
  float: right;
  width: 75px;
  height: 75px;
  object-fit: cover;
  margin: 0 0 0.4rem 0.5rem;
  border: 2px solid var(--statblock-rule-color);
  border-radius: 2px;
}
.statblock-source,
.statblock-note {
  font-size: 0.85rem;
  margin-top: 0.4rem;
  color: #555;
}


/* builtin/battlemap.css */

.vaults-battlemap { margin: 1rem 0; }
.vaults-bm-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.vaults-bm-levels, .vaults-bm-tools { display: flex; flex-wrap: wrap; gap: .25rem; }
.vaults-battlemap button { font: inherit; font-size: .85rem; line-height: 1.2; padding: .3rem .7rem; border: 1px solid var(--rule, #ccc); border-radius: 4px; background: var(--bg, #fff); color: var(--fg, #222); cursor: pointer; }
.vaults-battlemap button:hover { border-color: var(--accent, #888); }
.vaults-bm-level[aria-selected="true"], .vaults-bm-grid[aria-pressed="true"] { background: var(--accent, #333); color: var(--accent-fg, #fff); border-color: var(--accent, #333); }
.vaults-bm-stage { position: relative; line-height: 0; border: 1px solid var(--rule, #ccc); border-radius: 4px; overflow: hidden; background: #15151a; }
.vaults-bm-pane { display: none; position: relative; }
.vaults-bm-pane.is-active { display: block; }
.vaults-bm-pane img { display: block; width: 100%; height: auto; -webkit-user-drag: none; user-select: none; }
.vaults-bm-pane img:not(:first-child) { position: absolute; inset: 0; }
.vaults-bm-grid-overlay { position: absolute; inset: 0; display: none; pointer-events: none; background-image: linear-gradient(to right, rgba(0,0,0,.5) 0 1px, transparent 1px), linear-gradient(to bottom, rgba(0,0,0,.5) 0 1px, transparent 1px); }
.vaults-battlemap.show-grid .vaults-bm-grid-overlay { display: block; }
.vaults-bm-error { padding: .5rem .75rem; border: 1px solid #b94a3a; border-radius: 4px; color: #b94a3a; font-size: .85rem; }


/* builtin/gallery.css */

.vaults-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; margin: 1.25rem 0; }
.vaults-gallery-item { display: block; text-decoration: none; color: inherit; cursor: zoom-in; }
.vaults-gallery-item img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; }
.vaults-gallery-caption { display: block; margin-top: .25rem; font-size: .8rem; text-align: center; opacity: .8; }
.vaults-gallery-error { padding: .5rem .75rem; border: 1px solid #b94a3a; border-radius: 4px; color: #b94a3a; font-size: .85rem; }
.vaults-lightbox { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 2rem; background: rgba(0,0,0,.85); cursor: zoom-out; }
.vaults-lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 4px 30px rgba(0,0,0,.5); }


/* ./dice-equivalents.css (/home/jared/projects/wizzlethorpe/spellcraft/.vaults/handlers/dice-equivalents.css) */
/* Styling for the interactive dice-equivalents widget. The placeholder
   div carries class="dice-equivalents"; the runtime fills it with an
   <input> and a <table> whose Equivalent cells are dice-roll buttons. */

div.dice-equivalents {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

div.dice-equivalents .de-input {
  width: 12rem;
  padding: 0.25rem 0.5rem;
  font: inherit;
  font-variant-numeric: tabular-nums;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 4px;
  background: var(--bg, white);
  color: inherit;
}

div.dice-equivalents .de-summary {
  margin: 0.5rem 0 0.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

div.dice-equivalents .de-table {
  width: auto;
  margin: 0;
  font-variant-numeric: tabular-nums;
  border-collapse: collapse;
}

div.dice-equivalents .de-table th,
div.dice-equivalents .de-table td {
  text-align: left;
  vertical-align: middle;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
}

div.dice-equivalents .de-table th { font-weight: 600; }

div.dice-equivalents .de-input-mark { color: var(--accent); font-style: normal; }

div.dice-equivalents .de-error { color: #b94a3a; }

/* Per-row probability histogram. All histograms in a single table share
   the same X-axis range, so a wide spread vs. tight peak is visible at
   a glance — the visual proxy for standard deviation. */
div.dice-equivalents .de-histogram {
  display: inline-block;
  vertical-align: middle;
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  border-radius: 2px;
}

div.dice-equivalents .de-histogram rect {
  fill: var(--accent);
}

/* Numeric labels under the bars (min/max at the corners + σ values at
   the tick positions). The σ labels are smaller and fade with the same
   opacity ramp as their tick lines so the visual hierarchy is clear:
   absolute extremes loudest, ±3σ faintest. */
div.dice-equivalents .de-histogram .de-label {
  font-size: 14px;
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}
div.dice-equivalents .de-histogram .de-label-sigma { font-size: 14px; }
div.dice-equivalents .de-histogram .de-label-sigma-1 { fill-opacity: 0.85; }
div.dice-equivalents .de-histogram .de-label-sigma-2 { fill-opacity: 0.6; }
div.dice-equivalents .de-histogram .de-label-sigma-3 { fill-opacity: 0.4; }

/* ±1/2/3σ tick marks. Stroke uses currentColor so it contrasts with the
   accent-tinted bars; opacity fades from inner to outer to suggest "rarer
   the further you go from the mean." */
div.dice-equivalents .de-histogram .de-sigma {
  stroke: currentColor;
  stroke-width: 0.6;
}
div.dice-equivalents .de-histogram .de-sigma-1 { stroke-opacity: 0.65; }
div.dice-equivalents .de-histogram .de-sigma-2 { stroke-opacity: 0.4; }
div.dice-equivalents .de-histogram .de-sigma-3 { stroke-opacity: 0.2; stroke-dasharray: 1.5 1; }

div.dice-equivalents .de-shape-word {
  border-bottom: 1px dotted var(--muted);
  cursor: help;
}


/* ./rolltable.css (/home/jared/projects/wizzlethorpe/spellcraft/.vaults/handlers/rolltable.css) */
/* Styling for the `rolltable` code-block handler — a wiki-side render
   of a Foundry RollTable defined in frontmatter. Dropped into the wiki
   bundle and (when opted in via assets.targets.foundry.styles) into
   the Foundry module's per-vault stylesheet too. */

table.rolltable {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

table.rolltable caption {
  caption-side: top;
  text-align: left;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}

table.rolltable thead th {
  text-align: left;
  padding: 0.4rem 0.75rem;
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  font-weight: 600;
}

table.rolltable tbody td {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
  vertical-align: top;
}

table.rolltable tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}

table.rolltable td.rolltable-roll {
  width: 5em;
  white-space: nowrap;
  font-weight: 600;
  color: var(--accent);
}
