/* Páginas de autor: Inicio, Aventuras, Personajes. Mismo lenguaje que la mesa:
   noche y latón para la interfaz, papel para lo que pertenece a la ficción. */

/* Cabecera */
header { position: sticky; top: 0; z-index: 40; height: 64px; padding: 0 28px; display: flex; align-items: center; gap: 36px;
  background: #121821eb; backdrop-filter: blur(10px); border-bottom: 1px solid #2a3442; }
.room-page header { position: static; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-glyph { font-size: 1.15rem; }
.studio-nav { display: flex; gap: 4px; align-self: stretch; align-items: stretch; flex: 1; }
.studio-nav a { display: flex; align-items: center; padding: 0 14px; color: #b9b3a6; text-decoration: none; font-size: .98rem; position: relative; transition: color .15s; }
.studio-nav a:hover { color: var(--text); }
.studio-nav a[aria-current=page] { color: var(--gold); }
.studio-nav a[aria-current=page]::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--gold); box-shadow: 0 0 12px #d6a24a; border-radius: 2px; }
.studio-nav a span { margin-left: 6px; font: 600 .62rem var(--caps); text-transform: lowercase; color: var(--mint); border: 1px solid #3b4a4a; border-radius: 4px; padding: 1px 5px; }
.header-tools { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.tables-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: #1f2a2a; color: #bfe3d6; text-decoration: none; font-size: .85rem; }
.join-button { min-height: 38px; padding: 6px 14px; background: transparent; border: 1px solid #6b5a3a; color: #f1dcb1; border-radius: 8px; }
.join-button:hover { border-color: var(--gold); background: #d6a24a14; }
.site-page #connection, .editor-page #connection, .library-page #connection { display: none; }
.room-page .header-tools .join-button, .room-page .tables-pill { display: none; }
.join-dialog { display: grid; gap: 8px; }

/* Entrada de página: una sola secuencia, escalonada. */
@media (prefers-reduced-motion: no-preference) {
  #app.page-enter > * { animation: page-rise .55s cubic-bezier(.2,.7,.2,1) both; }
  #app.page-enter > *:nth-child(2) { animation-delay: .07s; }
  #app.page-enter > *:nth-child(3) { animation-delay: .14s; }
  #app.page-enter > *:nth-child(4) { animation-delay: .21s; }
  @keyframes page-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}

.site-page main { max-width: none; padding: 0 0 72px; }
.site-page footer { display: none; }

/* Inicio: la aventura como escenario. */
.home-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: end;
  min-height: min(78vh, 680px); padding: 64px 56px 56px; overflow: hidden; isolation: isolate; }
.hero-art { position: absolute; inset: 0; z-index: -2; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; transform-origin: 60% 40%; }
@media (prefers-reduced-motion: no-preference) {
  .hero-art img { animation: drift 48s ease-in-out infinite alternate; }
  @keyframes drift { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.14) translate(-2.5%, 1.5%); } }
}
.home-hero::before { content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #121821 0%, #121821ee 32%, #12182199 58%, #12182155 100%), linear-gradient(0deg, #121821 0%, transparent 38%); }
.hero-content { max-width: 640px; }
.kicker { margin: 0 0 14px; font: 500 1.05rem var(--caps); text-transform: lowercase; letter-spacing: .05em; color: var(--gold); }
.hero-content h1 { margin: 0; font: 500 clamp(2.6rem, 5vw, 4.4rem)/1.02 var(--serif); letter-spacing: -.01em; text-wrap: balance; }
.hero-lede { margin: 20px 0 26px; max-width: 54ch; font: 400 1.18rem/1.55 var(--serif); color: #ddd4c2; }
.party-row { display: flex; align-items: center; margin-bottom: 30px; }
.party-row img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; object-position: top; border: 3px solid #121821; margin-right: -12px; transition: transform .2s; }
.party-row img:hover { transform: translateY(-4px); z-index: 1; }
.party-row span { margin-left: 26px; color: var(--muted); font-size: .95rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions button { min-height: 48px; padding: 10px 22px; font-size: 1rem; }
.hero-tables { align-self: end; padding: 20px; border-radius: 14px; background: #1a222dcc; border: 1px solid #3a4655; backdrop-filter: blur(12px); }
.hero-tables h2 { margin: 0 0 12px; font: 500 1.15rem var(--serif); }
.hero-tables article { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid #334050; }
.hero-tables article strong { display: block; font-size: .95rem; }
.hero-tables article small { color: var(--muted); }
.hero-tables p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.hero-tables button { min-height: 34px; padding: 4px 12px; flex: none; }

/* Estanterías */
.shelf { max-width: 1320px; margin: 48px auto 0; padding: 0 56px; }
.shelf-heading { display: flex; align-items: baseline; gap: 18px; margin-bottom: 18px; }
.shelf-heading h2 { margin: 0; font: 500 1.7rem var(--serif); }
.shelf-heading p { margin: 0; color: var(--muted); flex: 1; }
.shelf-heading .button { flex: none; }
.shelf-row { display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 14px; scroll-snap-type: x mandatory; }
.mini-card { flex: none; width: 176px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 2px; padding: 0 0 12px; text-align: left; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; transition: transform .2s, border-color .2s; }
.mini-card:hover { transform: translateY(-4px); border-color: #6b5a3a; }
.mini-card img { width: 100%; aspect-ratio: 4/5; object-fit: cover; margin-bottom: 8px; transition: transform .4s; }
.mini-card:hover img { transform: scale(1.04); }
.mini-card strong, .mini-card small, .mini-class { padding: 0 12px; }
.mini-card strong { font: 500 1.08rem var(--serif); }
.mini-card small { color: var(--muted); font-size: .82rem; }
.mini-class { font: 500 .8rem var(--caps); text-transform: lowercase; color: var(--gold); }
.mini-card.add { justify-content: center; align-items: center; text-align: center; gap: 8px; padding: 18px; min-height: 290px; border-style: dashed; background: transparent; }
.mini-card.add span { font: 400 2.4rem var(--serif); color: var(--gold); }
.mini-card.add small { padding: 0; }
.cover-row, .cover-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.cover-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; background: var(--panel); border: 1px solid var(--edge); transition: transform .2s, border-color .2s; }
.cover-card:hover { transform: translateY(-3px); border-color: #4f5e70; }
.cover-card.active { border-color: #8a6a2e; }
.cover-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; transition: transform .5s; }
.cover-card:hover img { transform: scale(1.03); }
.cover-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.cover-tag { font: 500 .85rem var(--caps); text-transform: lowercase; color: var(--muted); }
.cover-card.active .cover-tag { color: var(--gold); }
.cover-body h3 { margin: 0; font: 500 1.35rem/1.2 var(--serif); }
.cover-body p { margin: 0; color: var(--muted); font-size: .9rem; }
.cover-actions { display: flex; gap: 8px; margin-top: 10px; }
.cover-actions button { min-height: 36px; padding: 6px 14px; }
.cover-card.ghost { align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 24px; min-height: 280px; background: transparent; border-style: dashed; color: var(--text); }
.cover-card.ghost span { font: 400 2.4rem var(--serif); color: var(--gold); }
.cover-card.ghost small { color: var(--muted); }

/* Subpáginas */
.site-heading { max-width: 1320px; margin: 0 auto; padding: 48px 56px 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.site-heading h1 { margin: 0 0 8px; font: 500 clamp(2.2rem, 3.6vw, 3.2rem)/1.05 var(--serif); }
.site-heading p { margin: 0; color: var(--muted); max-width: 60ch; font-size: 1.02rem; }
.adventures-page .cover-grid, .roster-grid { max-width: 1320px; margin: 0 auto; padding: 0 56px; }
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.roster-card { display: flex; flex-direction: column; gap: 10px; }
.roster-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.roster-actions button, .roster-actions .button { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.roster-actions .quiet { background: transparent; border-color: transparent; color: var(--muted); }
.empty-roster { grid-column: 1/-1; padding: 56px; border: 1px dashed var(--edge); border-radius: 14px; text-align: center; }
.empty-roster h2 { font: 500 1.6rem var(--serif); margin: 0 0 8px; }
.empty-roster p { color: var(--muted); margin: 0 0 18px; }

/* La carta: ficha en papel. */
.carta { background: var(--paper); color: var(--ink); border-radius: 12px; padding: 12px; border: 1px solid var(--paper-edge);
  box-shadow: 0 1px 0 #fff9 inset, 0 16px 40px #0008; display: flex; flex-direction: column; gap: 10px; }
.carta > img, .carta-placeholder { width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid #c9b994; }
.carta-placeholder { display: grid; place-items: center; text-align: center; padding: 20px; color: var(--ink-soft); background: repeating-linear-gradient(135deg, #e8dcc2 0 10px, #eee3cb 10px 20px); }
.carta-name strong { display: block; font: 600 1.45rem/1.15 var(--serif); }
.carta-name span { color: var(--ink-soft); font-size: .92rem; }
.carta-vitals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.carta-vitals span { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; background: #f7f0e1; border: 1px solid #d8c9a6; border-radius: 6px; font-size: .72rem; color: var(--ink-soft); }
.carta-vitals b { font: 600 1.3rem var(--serif); color: var(--ink); }
.carta-abilities { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.carta-abilities span { display: flex; flex-direction: column; align-items: center; padding: 4px 0; border-bottom: 2px solid #d8c9a6; }
.carta-abilities small { font: 600 .7rem var(--caps); text-transform: lowercase; color: var(--ink-soft); }
.carta-abilities b { font: 600 1.1rem var(--serif); }
.carta-abilities i { font-style: normal; font-size: .72rem; color: var(--ink-soft); }
.carta-section h4 { margin: 0 0 2px; font: 600 .95rem var(--caps); text-transform: lowercase; color: #8a5a12; }
.carta-section p { margin: 0; font-size: .88rem; line-height: 1.45; }
.carta-hint { margin: 4px 2px; color: var(--ink-soft); font: italic 1rem var(--serif); }
@media (prefers-reduced-motion: no-preference) {
  .carta .changed { animation: ink-flash .9s ease-out; }
  @keyframes ink-flash { from { background: #d6a24a66; border-radius: 4px; } to { background: transparent; } }
}

/* Creador */
.creator { max-width: 1320px; margin: 0 auto; padding: 36px 56px 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
.creator-top { display: flex; align-items: baseline; gap: 16px; }
.creator-top h1 { margin: 0; font: 500 2.3rem var(--serif); }
.back-link { color: var(--muted); text-decoration: none; }
.back-link::before { content: '← '; }
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 22px 0 26px; counter-reset: step; }
.steps li { flex: 1; }
.steps button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 0; background: transparent; border: 0; border-top: 3px solid var(--edge); border-radius: 0; color: var(--muted); font-size: .95rem; text-align: left; }
.steps b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid currentColor; font: 600 .85rem var(--serif); flex: none; }
.steps .done button { border-top-color: #7b6234; color: #d9c49a; }
.steps .current button { border-top-color: var(--gold); color: var(--gold); }
.steps .current b { background: var(--gold); color: #231a0c; border-color: var(--gold); }
.creator-step h2 { margin: 0 0 4px; font: 500 1.7rem var(--serif); }
.creator-step > p { margin: 0 0 18px; }
.creator-nav { display: flex; align-items: center; gap: 14px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--edge); }
.creator-nav span { flex: 1; text-align: center; }
.creator-nav button { min-height: 46px; padding: 10px 22px; }
.creator-preview { position: sticky; top: 84px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.choice-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; min-height: 0; text-align: left; background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; }
.choice-card strong { font: 500 1.25rem var(--serif); }
.choice-card small { color: var(--muted); font-size: .9rem; line-height: 1.4; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips i { font-style: normal; font-size: .78rem; padding: 2px 8px; border-radius: 999px; background: #263241; color: #cfe4de; }
.choice-card.selected, .class-card.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 10px 30px #d6a24a1f; }
.choice-card:hover, .class-card:hover { border-color: #6b5a3a; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.class-card { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; padding: 8px; min-height: 0; text-align: left; background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; }
.class-card img { width: 76px; height: 92px; object-fit: cover; object-position: top; border-radius: 8px; }
.class-card strong { display: block; font: 500 1.2rem var(--serif); }
.class-card small { display: block; color: var(--muted); font-size: .86rem; line-height: 1.35; margin: 2px 0 4px; }
.class-card em { font-style: normal; font-size: .78rem; color: #cfe4de; }
.method-tabs { display: inline-flex; gap: 2px; padding: 3px; background: #0f141c; border: 1px solid var(--edge); border-radius: 10px; margin: 8px 0 10px; }
.method-tabs button { min-height: 36px; padding: 6px 14px; border: 0; background: transparent; color: var(--muted); }
.method-tabs button[aria-selected=true] { background: #2c3646; color: var(--gold); }
.ability-editor { display: grid; gap: 6px; max-width: 620px; }
.ability-row { display: grid; grid-template-columns: 1fr 150px 140px; align-items: center; gap: 12px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--edge); border-radius: 10px; }
.ability-label { font: 500 1.1rem var(--serif); }
.ability-row select { min-height: 38px; }
.stepper { display: inline-flex; align-items: center; gap: 10px; }
.stepper button { min-height: 34px; width: 34px; padding: 0; }
.stepper b { width: 26px; text-align: center; font: 600 1.1rem var(--serif); }
.ability-result { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; }
.ability-result small { color: var(--mint); font-size: .78rem; }
.ability-result b { font: 600 1.3rem var(--serif); }
.ability-result em { font-style: normal; color: var(--gold); font-weight: 700; min-width: 28px; text-align: right; }
.skill-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.skill-chip { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 8px 12px; text-align: left; background: var(--panel); border: 1px solid var(--edge); border-radius: 10px; }
.skill-chip small { color: var(--muted); }
.skill-chip.on { border-color: var(--mint); background: #1f2f2d; }
.skill-chip.on strong::before { content: '● '; color: var(--mint); }
.skill-chip[disabled]:not(.on) { opacity: .45; }
.identity { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.identity textarea, .identity input { width: 100%; }
.field-label { display: block; margin-bottom: 8px; font-size: .8rem; color: #c0cbca; }
.portrait-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; max-height: 420px; overflow-y: auto; padding: 2px; }
.portrait-wall button { padding: 0; aspect-ratio: 4/5; overflow: hidden; border-radius: 8px; min-height: 0; }
.portrait-wall img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.portrait-wall button[aria-pressed=true] { outline: 3px solid var(--gold); outline-offset: 1px; }
.saved-character { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: start; }
.saved-character .row { flex-wrap: wrap; gap: 8px; }

/* Taller y biblioteca: misma cabecera, más aire. */
.editor-page main, .library-page main { max-width: 1400px; }

@media (max-width: 1100px) {
  .home-hero { grid-template-columns: 1fr; padding: 48px 32px; }
  .hero-tables { max-width: 480px; }
  .cover-row, .cover-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .creator { grid-template-columns: 1fr; padding: 28px 32px 0; }
  .creator-preview { position: static; max-width: 380px; }
  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shelf, .site-heading, .adventures-page .cover-grid, .roster-grid { padding-left: 32px; padding-right: 32px; }
  .studio-nav a { padding: 0 9px; }
}
@media (max-width: 760px) {
  header { gap: 12px; padding: 0 14px; overflow-x: auto; }
  .studio-nav a { padding: 0 7px; font-size: .9rem; }
  .join-button { padding: 6px 10px; font-size: .85rem; white-space: nowrap; }
  .tables-pill { display: none; }
  .home-hero { min-height: 0; padding: 36px 18px; }
  .shelf, .site-heading, .adventures-page .cover-grid, .roster-grid { padding-left: 18px; padding-right: 18px; }
  .site-heading { flex-direction: column; align-items: flex-start; }
  .shelf-heading { flex-wrap: wrap; }
  .cover-row, .cover-grid, .choice-grid, .identity, .saved-character { grid-template-columns: 1fr; }
  .creator { padding: 20px 18px 0; }
  .steps { overflow-x: auto; }
  .steps button { font-size: 0; gap: 0; justify-content: center; }
  .steps b { font-size: .85rem; }
  .ability-row { grid-template-columns: 1fr auto; }
  .ability-result { grid-column: 1/-1; justify-content: flex-start; }
}
body.site-page.studio-page main { max-width: none; padding: 0 0 72px; margin: 0; }
.cover-card.ghost.starter { position: relative; justify-content: flex-end; align-items: flex-start; text-align: left; padding: 22px; border-style: solid; overflow: hidden; isolation: isolate; }
.cover-card.ghost.starter img { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; z-index: -2; opacity: .55; }
.cover-card.ghost.starter::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, #121821 20%, #12182133); }
.cover-card.ghost.starter strong { font: 500 1.4rem var(--serif); }
@media (max-width: 760px) { .shelf-heading p { flex-basis: 100%; order: 3; } }

/* Biblioteca por secciones */
.library-section { margin-top: 34px; }
.library-section h2 { font: 500 1.5rem var(--serif); margin: 0 0 14px; display: flex; align-items: baseline; gap: 10px; }
.library-section h2 small { font: 500 .95rem var(--sans); color: var(--muted); }
.library-page .library-section .asset-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.library-page .library-section.maps .asset-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.library-page .library-section .asset-card { border-radius: 10px; transition: transform .2s, border-color .2s; }
.library-page .library-section .asset-card:hover { transform: translateY(-3px); border-color: #6b5a3a; }
.library-page .library-section .asset-card img { transition: transform .4s; }
.library-page .library-section .asset-card:hover img { transform: scale(1.04); }
.library-page .library-section .portrait-asset img, .library-page .library-section:not(.maps) .asset-card img { aspect-ratio: 4/5; height: auto; object-fit: cover; object-position: top; }
.library-page .library-section.maps .asset-card img { aspect-ratio: 3/2; height: auto; object-fit: cover; }

/* Cuenta */
.account { display: flex; align-items: center; gap: 8px; padding-left: 12px; border-left: 1px solid #2a3442; }
.account-name { font-size: .9rem; color: #d9cfbd; white-space: nowrap; }
.account .quiet { min-height: 32px; padding: 4px 10px; background: transparent; border-color: transparent; color: var(--muted); }
.login-page header .studio-nav { visibility: hidden; }
.login-stage { position: relative; min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 18px; overflow: hidden; isolation: isolate; }
.login-art { position: absolute; inset: 0; z-index: -2; }
.login-art img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85); }
.login-stage::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at center, #121821aa, #121821f2 70%); }
.login-card { width: min(440px, 100%); padding: 32px; border-radius: 16px; background: var(--paper); color: var(--ink); border: 1px solid var(--paper-edge); box-shadow: 0 30px 80px #000c; }
.login-card h1 { margin: 0 0 6px; font: 600 2rem var(--serif); color: var(--ink); }
.login-card .muted { color: var(--ink-soft); margin: 0 0 18px; }
.account-form { display: grid; gap: 6px; }
.account-form label { color: var(--ink-soft); font-size: .85rem; margin-top: 6px; }
.account-form input { background: #fffaf0; color: var(--ink); border: 1px solid #c9b994; }
.account-form button { margin-top: 14px; min-height: 46px; }
.login-card .text-button { margin-top: 12px; color: #7b4d0e; }
.login-join { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #d8c9a6; color: var(--ink-soft); font-size: .9rem; }
.login-join button { background: transparent; color: var(--ink); border-color: #c9b994; min-height: 36px; }
.claim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 10px 0 16px; }
.claim-card { display: flex; flex-direction: column; gap: 2px; padding: 0 0 8px; overflow: hidden; text-align: left; min-height: 0; }
.claim-card img { width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: top; margin-bottom: 6px; }
.claim-card strong, .claim-card small { padding: 0 8px; }
.claim-card small { color: var(--muted); font-size: .78rem; }
.choice-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Compendio */
.compendium { max-width: 1320px; margin: 0 auto; padding: 0 56px; }
.compendium-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--edge); margin-bottom: 18px; overflow-x: auto; }
.compendium-tabs a { padding: 10px 16px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 1.02rem; }
.compendium-tabs a small { color: #7f8896; margin-left: 4px; }
.compendium-tabs a[aria-current=page] { color: var(--gold); border-bottom-color: var(--gold); }
.compendium-tools { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.compendium-tools input { flex: 1; min-width: 220px; }
.compendium-tools select { width: auto; }
.compendium-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.spell-card, .lore-card, .stat-block { background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; padding: 16px; }
.spell-card { border-top: 3px solid var(--school); }
.spell-card .spell-head { display: flex; gap: 12px; align-items: center; }
.spell-badge { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--school) 28%, #121821); color: #fff3df; font: 600 1rem var(--serif); border: 1px solid var(--school); }
.spell-card h3, .lore-card h3, .stat-block h3 { margin: 0; font: 500 1.25rem var(--serif); }
.spell-card small { color: var(--muted); }
.spell-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.spell-card dt { font: 600 .78rem var(--caps); text-transform: lowercase; color: var(--muted); }
.spell-card dd { margin: 0; font-size: .86rem; }
.spell-card p, .lore-card p, .stat-block p { margin: 6px 0; font-size: .92rem; line-height: 1.5; }
.spell-card .spell-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.spell-card .spell-foot span { font-size: .76rem; padding: 2px 8px; border-radius: 999px; background: #263241; color: #cfe4de; }
.spell-card .spell-foot b { margin-left: auto; font-size: .82rem; color: var(--gold); }
.stat-block { display: grid; grid-template-columns: 96px 1fr; gap: 14px; background: var(--paper); color: var(--ink); border-color: var(--paper-edge); }
.stat-block:not(:has(img)) { grid-template-columns: 1fr; }
.stat-block img { width: 96px; aspect-ratio: 4/5; object-fit: cover; object-position: top; border-radius: 8px; }
.stat-block h3 { color: #6b1f12; }
.stat-type { font-style: italic; color: var(--ink-soft); }
.stat-line { display: flex; gap: 14px; font-size: .9rem; padding: 6px 0; border-top: 2px solid #a8462e; border-bottom: 2px solid #a8462e; }
.stat-abilities { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 8px 0; font-size: .8rem; text-align: center; }
.stat-abilities small { display: block; font: 600 .7rem var(--caps); color: #6b1f12; }
.stat-block ul { margin: 6px 0 0; padding-left: 18px; font-size: .9rem; }
.lore-card ul { margin: 8px 0 0; padding-left: 18px; color: #d7d0c2; font-size: .92rem; }
.class-lore { display: grid; grid-template-columns: 84px 1fr; gap: 14px; }
.class-lore img { width: 84px; aspect-ratio: 4/5; object-fit: cover; object-position: top; border-radius: 8px; }
.attribution { margin: 30px 0 0; font-size: .78rem; color: #7f8896; max-width: 90ch; }
.picker-title { margin-top: 26px !important; }
.spell-chip.on { border-color: var(--gold); background: #2c2a1f; }
.spell-chip.on strong::before { content: '✦ '; color: var(--gold); }
@media (max-width: 760px) { .compendium { padding: 0 18px; } }
.level-ready { color: var(--gold); font-weight: 600; font-size: .85rem; margin: 6px 0 0; }
.level-feature { background: #263241; border-left: 3px solid var(--gold); padding: 8px 12px; border-radius: 6px; }
.sheet-edit.features ul { margin: 8px 0 0; padding-left: 18px; font-size: .88rem; line-height: 1.5; }
.sheet-edit.features li { margin-bottom: 6px; }
.sheet-edit.features .subclass-sep { list-style: none; margin-left: -18px; color: var(--gold); }
.shelf-title { font: 500 1.45rem var(--serif); margin: 30px 0 14px; }
.cover-card.ready { border-color: #4a4032; }
.cover-card.ready .cover-tag { color: var(--gold); }
.cover-card.ready .cover-body p { color: #c9beac; }
