/* Character creator, character sheet and bestiary. Palette: client/css/main.css. */

.creator { display: grid; grid-template-rows: auto auto 1fr auto; height: 100%; min-height: 0; background: var(--bg); }
.creator-head { display: flex; align-items: center; gap: 16px; padding: 12px 18px 4px; }
.creator-head h1 { margin: 0; font-size: 1.5rem; }
.creator-head .btn-link { margin-left: auto; }
.creator-steps { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 14px 10px; border-bottom: 1px solid var(--border); }
.step { background: none; border: 1px solid transparent; border-radius: 999px; color: var(--muted); padding: 4px 12px; font-size: 0.88rem; }
.step:hover { color: var(--text); border-color: var(--border); }
.step.done { color: var(--ok); }
.step.active { color: var(--accent-ink); background: var(--accent); font-weight: 600; }
/* The frame fills the screen (.creator has its height): only the content of the step scrolls, the footer stays.
   The body and the footer have their rows even when the steps bar is hidden (the pickers). */
.creator-body { grid-row: 3; display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 26vw, 360px); min-height: 0; }
.creator-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 14px 20px 0; }
.creator-main > h2 { flex: none; font-family: var(--font-title); font-size: 1.35rem; margin: 0 0 8px; }
.creator-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; gap: 12px; align-content: start; padding: 0 6px 20px 0; }
.creator-side { min-height: 0; overflow-y: auto; padding: 14px; background: var(--panel); border-left: 1px solid var(--border); }
.creator-foot { grid-row: 4; display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--border); background: var(--panel); }
.creator-status { flex: 1; text-align: center; }
.btn-big { padding: 11px 22px; font-size: 1.05rem; justify-self: start; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.pick-card {
  display: grid; gap: 4px; align-content: start; text-align: left; color: var(--text);
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
.pick-card:hover { border-color: var(--accent); }
.pick-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(212, 162, 76, 0.35); }
.pick-card strong { font-family: var(--font-title); font-size: 1.05rem; }
.pick-body { font-size: 0.85rem; color: var(--muted); }
.detail { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: grid; gap: 10px; }
.detail h3, .detail h4 { margin: 0; }
.detail.pending { border-color: var(--danger); }
.named-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 0.92rem; }
.fact { margin: 0; }

.choice { display: grid; gap: 8px; }
.choice-head { display: flex; align-items: baseline; gap: 10px; }
.choice-head h3 { margin: 0; }
.badge-ok { color: var(--ok); border-color: var(--ok); }
.option-rows { display: grid; gap: 6px; }
.option-row { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.option-row.on { border-color: var(--accent); }
.option-row input { margin-top: 3px; }
.option-text { display: grid; gap: 2px; }
.option-text .parts { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.pick-inline { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.pick-inline select { padding: 3px 6px; max-width: 260px; }

.method-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ability-table { border-collapse: collapse; width: min(780px, 100%); }
.ability-table th, .ability-table td { padding: 4px 10px; border-bottom: 1px solid var(--border); text-align: center; }
.ability-table th[scope='col'] { color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.ability-table th[scope='col']:first-child { text-align: left; }
.ability-table th[scope='row'] { text-align: left; font-weight: 600; }
.ability-table select { padding: 6px 10px; font-size: 1.05rem; }
.ability-table .short { display: none; }
.ability-table tr.main-ability th[scope='row'] .ab-name { color: var(--accent); }
.ab-name { display: inline-flex; align-items: center; gap: 8px; }
.ab-hint { display: block; font-weight: 400; font-size: 0.78rem; }
.stepper { display: inline-flex; align-items: center; gap: 10px; }
.score { min-width: 2ch; font-size: 1.3rem; }
.step-btn { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-size: 1.35rem; line-height: 1; }
.step-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.step-btn:disabled { opacity: 0.3; cursor: default; }
.bonus-toggle { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 2px solid var(--border); background: transparent; color: var(--accent-ink); font-weight: 700; }
.bonus-toggle:hover:not(:disabled) { border-color: var(--accent); }
.bonus-toggle:disabled { opacity: 0.35; cursor: default; }
.bonus-toggle.on { background: var(--accent); border-color: var(--accent); }
.points { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; width: min(780px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 16px; }
.points-left { display: flex; align-items: baseline; gap: 10px; color: var(--muted); }
.points-left strong { font-size: 2.3rem; line-height: 1; color: var(--accent); }
.points-left.done strong { color: var(--ok); }
.points-left.over strong { color: var(--danger); }
.points-actions { display: flex; gap: 8px; }
.bonus-note { margin: 0; }

.swatches { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; }
.swatch.on { border-color: var(--text); }
.token-preview { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.5rem; border: 4px solid var(--accent); }
.token-preview.square { border-radius: 12px; }

.character-sheet { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.character-sheet h2 { font-family: var(--font-title); margin: 0; }
.character-sheet h4 { margin: 4px 0; }
.character-sheet p { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.stat { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; display: grid; }
.stat strong { font-size: 1.1rem; }
.ability-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.ability-box { display: grid; justify-items: center; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 4px 2px; font-size: 0.8rem; }
.ability-box strong { font-size: 1.1rem; }
.ability-box.save { border-color: var(--accent); }
.attack-list, .inventory { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 0.92rem; }
.skill-list { list-style: none; margin: 0; padding: 4px 0; columns: 2; font-size: 0.88rem; }
.skill-list .proficient { color: var(--text); font-weight: 600; }
.hp-now { font-size: 1.4rem; font-weight: 700; margin: 0; }
.character-row { display: grid; gap: 4px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }

}
/* A fixed height: a scrolling grid item would otherwise collapse to nothing in the (scrolling) panel. */
.monster-list { list-style: none; margin: 0; padding: 0; display: grid; align-content: start; gap: 4px; height: 34vh; min-height: 180px; overflow-y: auto; }
.monster-row { width: 100%; display: grid; gap: 1px; text-align: left; color: var(--text); background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; cursor: grab; }
.monster-row:hover, .monster-row.selected { border-color: var(--accent); }
.bestiary-controls { align-items: center; }
.stat-block { display: grid; gap: 6px; font-size: 0.92rem; }
.stat-block h3, .stat-block h4 { margin: 4px 0 0; font-family: var(--font-title); }
.stat-entry { margin: 0; }

/* F21: ready-made characters and the player's library. */
.pick-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.pick-card { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); }
.pick-card strong { font-family: var(--font-title); color: var(--accent); font-size: 1.05rem; }
.pick-card p { margin: 4px 0 8px; flex: 1; }
.pick-card .btn { align-self: flex-start; }

/* F21: the equipment shop with points. */
.gear-shop h3 { display: flex; align-items: center; gap: 10px; }
.gear-shop h4 { margin: 10px 0 4px; color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.gear-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.gear-row { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; }
.gear-row.on { border-color: var(--accent); }
.gear-name { flex: 1; }
.badge-danger { background: var(--danger); color: #fff; }

/* F3 (creator overhaul): BG3-style steps. A list on one side (a name and a line each, nothing cut with "…"),
   the details of the picked one beside it; each scrolls by itself, so the footer never leaves the screen. */
.creator-scroll.is-split { overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; }
.creator-intro { flex: none; margin: 0; }
.split { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(210px, min(30%, 340px)) minmax(0, 1fr); gap: 16px; }
.opt-list, .opt-detail { min-height: 0; overflow-y: auto; }
.opt-list { position: relative; display: grid; gap: 4px; align-content: start; padding-right: 6px; }
.opt-row { display: grid; gap: 1px; text-align: left; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; }
.opt-row:hover { border-color: var(--accent); }
.opt-row.selected { border-color: var(--accent); background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); }
.opt-row strong { font-family: var(--font-title); font-size: 1rem; }
.opt-row small { font-size: 0.8rem; line-height: 1.3; }
.opt-sub { display: grid; gap: 4px; margin: 0 0 4px 14px; padding-left: 10px; border-left: 2px solid var(--border); }
.opt-row.sub { background: var(--bg); }
.opt-row.sub.selected { background: var(--panel-2); }
.opt-detail { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: grid; gap: 10px; align-content: start; }
.opt-detail h3 { margin: 0; font-family: var(--font-title); font-size: 1.25rem; color: var(--accent); }
.opt-detail h4 { margin: 4px 0 0; color: var(--muted); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.opt-detail p { margin: 0; }
.opt-detail header p { font-size: 0.9rem; }
.notice { border: 1px dashed var(--accent); border-radius: 8px; padding: 8px 12px; color: var(--accent); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0; font-size: 0.92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* Spells: a dense grid; the text of each is one click away. */
.spell-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.spell-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.spell-item.on { border-color: var(--accent); }
.spell-item.open { grid-column: 1 / -1; }
.spell-pick { flex-direction: row; align-items: flex-start; gap: 8px; color: var(--text); font-size: 0.95rem; cursor: pointer; }
.spell-pick input { flex: none; margin-top: 3px; }
.spell-text { display: grid; gap: 1px; min-width: 0; }
.spell-text small { font-size: 0.76rem; line-height: 1.3; }
.spell-info { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); font: italic 0.8rem var(--font-title); }
.spell-info:hover, .spell-info[aria-expanded='true'] { border-color: var(--accent); color: var(--accent); }
.spell-desc { grid-column: 1 / -1; margin: 2px 0 0; font-size: 0.85rem; color: var(--muted); }
.creator-sheet-btn { display: none; }
