/* Creador de personajes: un muro de caras para elegir, la ficha de papel a la derecha. */
.steps.seven button { padding: 10px 6px; gap: 7px; font-size: .9rem; line-height: 1.15; text-align: left; }
.creator-step .lede { max-width: 64ch; margin: 0 0 18px; }
.creator-step h4 { margin: 22px 0 8px; font: 600 1.02rem var(--caps); text-transform: lowercase; letter-spacing: .03em; color: #d9c49a; }

.face-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.face-wall.classes { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.face { position: relative; display: block; padding: 0; min-height: 0; aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid var(--edge); border-radius: 8px; background: var(--bg); text-align: left; }
.face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; filter: saturate(.75) brightness(.78); transition: filter .25s, transform .4s; }
.face span { position: absolute; inset: auto 0 0 0; padding: 26px 9px 8px; background: linear-gradient(transparent, #14100cee 55%); display: flex; flex-direction: column; }
.face strong { font: 600 1.05rem/1.1 var(--serif); color: var(--text); }
.face small { color: var(--muted); font-size: .76rem; }
.face:hover img, .face:focus-visible img { filter: saturate(1) brightness(.95); }
.face.selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.face.selected img { filter: none; }
.face.selected strong { color: var(--gold); }
@media (prefers-reduced-motion: no-preference) { .face:hover img { transform: scale(1.04); } }

.lore-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 22px; margin-top: 22px; padding: 20px 22px; background: var(--panel); border: 1px solid var(--edge); border-left: 3px solid var(--gold); border-radius: 4px 10px 10px 4px; }
.lore-detail h3 { margin: 0 0 6px; font: 500 1.55rem var(--serif); }
.lore-detail h4 { margin-top: 0; }
.lore-detail .choose-bonus { grid-column: 1 / -1; }
.lore-detail .chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; }
.lore-detail .chips i { font-style: normal; font-size: .8rem; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--edge); color: var(--muted); }
.trait-list { margin: 8px 0 0; padding-left: 18px; line-height: 1.5; color: #d8d0bf; }
.trait-list.compact { max-height: 210px; overflow: auto; font-size: .9rem; }
.trait-list b { color: var(--gold); margin-right: 4px; font-variant-numeric: tabular-nums; }

.option-list { display: grid; gap: 6px; }
.option-list.two-col { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.option-list.subclasses { max-height: 460px; overflow: auto; padding-right: 4px; }
.option-list.locked { opacity: .55; }
.option { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; min-height: 0; text-align: left; background: var(--panel); border: 1px solid var(--edge); border-radius: 8px; color: var(--text); }
.option strong { font: 600 1.02rem var(--serif); }
.option small { color: var(--muted); font-size: .76rem; align-self: center; }
.option span { grid-column: 1 / -1; color: var(--muted); font-size: .86rem; line-height: 1.4; }
.option ul { grid-column: 1 / -1; margin: 6px 0 0; padding-left: 16px; font-size: .84rem; line-height: 1.45; color: #d8d0bf; }
.option ul b { color: var(--gold); margin-right: 4px; }
.option .granted { grid-column: 1 / -1; margin: 6px 0 0; font-size: .84rem; color: var(--mint); }
.option.selected { border-color: var(--gold); background: var(--panel); }
.option.selected strong { color: var(--gold); }
.option:disabled { cursor: not-allowed; }

.level-detail input[type=range] { width: 100%; accent-color: var(--gold); margin: 6px 0 4px; }
.level-detail output { color: var(--gold); font-variant-numeric: tabular-nums; }

.equipment { margin: 14px 0 0; color: #d8d0bf; }
.alignment-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; max-width: 520px; }
.alignment-grid button { min-height: 42px; padding: 6px; font-size: .9rem; background: var(--panel); border: 1px solid var(--edge); border-radius: 6px; color: var(--muted); }
.alignment-grid button.on { color: var(--gold); border-color: var(--gold); background: var(--panel); }

.score-table { display: grid; gap: 6px; max-width: 520px; }
.score-row { display: grid; grid-template-columns: 1fr 120px 74px; align-items: center; gap: 12px; padding: 6px 10px; background: var(--panel); border: 1px solid var(--edge); border-radius: 8px; }
.score-name { font: 500 1.05rem var(--serif); }
.score-final { display: flex; align-items: baseline; gap: 6px; justify-content: flex-end; }
.score-final b { font: 600 1.35rem var(--serif); }
.score-final small { color: var(--gold); }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper button { width: 34px; min-height: 34px; padding: 0; }
.stepper b { min-width: 24px; text-align: center; font: 600 1.15rem var(--serif); }
.improvement { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.improvement > b { min-width: 72px; color: var(--gold); font-weight: 600; }
.improvement select { min-width: 150px; }

.spell-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 8px; }
.spell-filters input { flex: 1 1 240px; }
.spell-filters .method-tabs { margin: 0; flex-wrap: wrap; }
.spell-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; max-height: 560px; overflow: auto; padding: 2px 4px 2px 2px; }
.spell-grid.granted { max-height: none; }
.spell-option { --el: #9b9187; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 10px 14px; min-height: 0; text-align: left; background: var(--panel); border: 1px solid var(--edge); border-left: 4px solid var(--el); border-radius: 6px; color: var(--text); }
.spell-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.spell-head strong { font: 600 1rem var(--serif); }
.spell-head small, .spell-meta { color: var(--muted); font-size: .76rem; }
.spell-text { font-size: .84rem; line-height: 1.4; color: #cfc7b6; }
.spell-option.on { background: var(--edge-soft); border-color: var(--mint); border-left-color: var(--el); }
.spell-option.on .spell-head strong::before { content: '● '; color: var(--mint); }
.spell-option[disabled]:not(.on) { opacity: .45; }
.spell-grid.granted .spell-option { opacity: 1; background: #1c2521; cursor: default; }
.el-fire { --el: #ff8a3d; } .el-cold { --el: #8fdcff; } .el-lightning { --el: #f5ef6a; } .el-thunder { --el: #c9b8ff; }
.el-acid { --el: #b6ea3a; } .el-poison { --el: #7fcf5a; } .el-necrotic { --el: #9b7fb8; } .el-radiant { --el: #ffe7a0; }
.el-psychic { --el: #ff7ad1; } .el-force { --el: #d6a8ff; } .el-heal { --el: #7ef0b0; } .el-nature { --el: #8cc070; }
.el-arcane { --el: #a7b8ff; } .el-eldritch { --el: #c084fc; } .el-shadow { --el: #8c7a69; } .el-earth { --el: #c49a6c; } .el-air { --el: #cfe8ef; }

.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.portrait-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 520px; overflow: auto; }
.portrait-wall button { padding: 0; min-height: 0; aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid var(--edge); border-radius: 6px; }
.portrait-wall img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.portrait-wall button.selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }

/* El creador también abre a pantalla completa dentro de la mesa. */
dialog#modal.creator-dialog { width: min(1400px, 96vw); max-width: none; max-height: 94vh; padding: 0; }
dialog#modal.creator-dialog .modal-heading { position: sticky; top: 0; z-index: 2; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--edge); }
dialog#modal.creator-dialog .creator { padding: 16px 24px 24px; }
dialog#modal.creator-dialog .creator-top { display: none; }
dialog#modal.creator-dialog .creator-preview { top: 64px; }

@media (max-width: 900px) {
  .lore-detail, .two-fields { grid-template-columns: 1fr; }
  .face-wall, .face-wall.classes { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .score-row { grid-template-columns: 1fr 110px 64px; }
}
.improvement select { width: auto; flex: 0 1 230px; min-width: 150px; }
.creator > * { min-width: 0; }
@media (max-width: 900px) {
  .creator { grid-template-columns: minmax(0, 1fr); }
  .steps.seven { overflow-x: auto; }
  .lore-detail { padding: 14px; }
  .option-list.two-col, .spell-grid { grid-template-columns: 1fr; }
  .alignment-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .alignment-grid button { font-size: .8rem; }
}
.step-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.step-head h2 { margin: 0; }
.kit { margin-top: 16px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--edge); border-left: 3px solid var(--mint); border-radius: 4px 10px 10px 4px; }
.kit p { margin: 4px 0; color: #d8d0bf; }
.personality-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.personality-head h4 { margin: 10px 0 4px; }
.suggest-field { display: flex; flex-direction: column; }
.suggest-field .text-button { align-self: flex-end; font-size: .82rem; margin-top: -4px; }
.carta-origin { margin: -4px 0 0; color: var(--ink-soft); font-size: .86rem; font-style: italic; }
.portrait-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 8px; }
.portrait-head h4 { margin: 0; }
dialog.cropper { width: min(460px, 94vw); padding: 20px; background: var(--panel); color: var(--text); border: 1px solid var(--edge); border-radius: 14px; }
dialog.cropper::backdrop { background: #000a; }
dialog.cropper h2 { margin: 0 0 4px; }
.crop-frame { position: relative; width: 100%; aspect-ratio: 4 / 5; margin: 12px 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--edge); }
.crop-frame canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.crop-guide { position: absolute; inset: 12% 18% 30%; border: 2px dashed #f4d58d99; border-radius: 50%; pointer-events: none; }
.crop-zoom { display: grid; gap: 4px; margin-bottom: 12px; }
.crop-zoom input { accent-color: var(--gold); }
.usage-line { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; }
.usage-line meter { width: 120px; }
.library-upload { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.upload-label.primary { background: var(--gold); color: var(--panel); border-color: var(--gold); font-weight: 700; }
.campaign-questions { margin: 18px 0 6px; padding: 14px 16px; border: 1px solid #6b5a3a; border-radius: 10px; background: var(--panel); }
.campaign-questions h4 { margin: 0 0 6px; }
.campaign-questions label { display: block; margin-top: 10px; color: #d9c49a; }
.campaign-questions textarea { width: 100%; }
