/* The Spellbook (/ttrpg/spellbook/, 17 Nov 2026). Colours come from site.css's tokens, so it keeps the Asar look. */
.ttrpg .sp-filters { display: grid; gap: 0.6em; }
.ttrpg .sp-row { display: flex; flex-wrap: wrap; gap: 0.5em 1em; align-items: center; }
.ttrpg .sp-row input[type="search"] { flex: 1 1 16em; min-inline-size: 0; min-block-size: 40px; padding: 0.4em 0.6em; font-size: 1em; }
.ttrpg .sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5em, 1fr)); gap: 0.5em 0.75em; }
.ttrpg .sp-grid label { display: grid; gap: 0.2em; font-weight: 600; }
.ttrpg .sp-grid select { inline-size: 100%; }
.ttrpg .sp-filters .tick { display: inline-flex; gap: 0.4em; align-items: center; min-block-size: 40px; }
.ttrpg .sp-list { list-style: none; margin: 0.75em 0; padding: 0; display: grid; gap: 0.4em; }
.ttrpg .sp-item details { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.ttrpg .sp-item.own details { border-inline-start: 4px solid var(--accent); }
.ttrpg .sp-item summary { cursor: pointer; padding: 0.55em 0.75em; display: flex; flex-wrap: wrap; gap: 0.15em 0.75em; align-items: baseline; }
.ttrpg .sp-name { font-weight: 700; font-size: 1.05em; }
.ttrpg .sp-sub { color: var(--muted); }
.ttrpg .sp-src { margin-inline-start: auto; font-size: 0.75em; font-weight: 700; padding: 0.05em 0.5em; border-radius: 999px; border: 1px solid var(--line); }
.ttrpg .sp-src.own { border-color: var(--accent); color: var(--accent); }
.ttrpg .sp-snip { flex-basis: 100%; color: var(--muted); font-size: 0.92em; }
.ttrpg .sp-card { padding: 0 0.9em 0.75em; border-top: 1px solid var(--line); }
.ttrpg .sp-card p { margin: 0.45em 0; line-height: 1.5; }
.ttrpg .sp-card h3 { margin: 0.8em 0 0.2em; font-size: 1em; color: var(--accent); }
.ttrpg .sp-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(13em, 1fr)); gap: 0.3em 1em; margin: 0.6em 0; }
.ttrpg .sp-facts div { margin: 0; }
.ttrpg .sp-facts dt { font-size: 0.8em; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.ttrpg .sp-facts dd { margin: 0; }
.ttrpg .sp-higher { border-inline-start: 3px solid var(--line); padding-inline-start: 0.6em; }
.ttrpg button.roll { min-block-size: 0; min-inline-size: 0; padding: 0.05em 0.4em; margin: 0.1em 0.05em; font-size: 1em; font-weight: 700;
  border: 2px solid var(--accent-bg); border-radius: 6px; background: rgba(140, 68, 173, 0.18); color: var(--text); cursor: pointer; }
.ttrpg button.roll:hover { background: var(--accent-bg); }
/* The Rolls box stays on screen while the list scrolls. On the live site it did not at first (found 24 Nov 2026, the
   same fault the combat tracker's turn bar had): the Asar template wraps every page in #pageOpen, which the site's
   stylesheet gives overflow: hidden, and nothing sticks inside a box that hides its overflow. On this page only (this
   file is loaded by the Spellbook alone) the box lets its content show, clipped sideways as before. The box stops just
   under the site's fixed menu (--site-top, set by site-top.js) and is opaque, so the list does not show through it. */
#pageOpen { overflow: visible; overflow-x: clip; }
.ttrpg .sp-rolls { position: sticky; top: calc(var(--site-top, 0px) + 0.4em); z-index: 20;
  background-color: var(--bg); background-image: linear-gradient(var(--panel), var(--panel)); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45); }
.ttrpg .sp-rolls h2 { margin: 0 0 0.3em; font-size: 1em; }
.ttrpg .sp-rolls ol { list-style: none; margin: 0; padding: 0; max-block-size: 7.5em; overflow: auto; }
.ttrpg .sp-rolls li { padding: 0.15em 0; border-bottom: 1px solid var(--line); }
.ttrpg .sp-rolls .log-total { display: inline-block; min-inline-size: 2.2em; font-weight: 800; font-size: 1.15em; color: var(--accent); }
@media print { .ttrpg .sp-filters, .ttrpg .sp-rolls { display: none !important; } }
