/* Umbral · identidad v2 (5 oct 2026): una mesa de roble a la luz de las velas.
   Se carga la última. Madera ahumada de fondo, vitela para el texto, latón solo para lo principal,
   lacre para «ahora» y para lo peligroso, verdín para lo bueno y violeta arcano para lo secreto.
   Las superficies se separan por tono, no por bordes: los bordes quedan para lo que se puede tocar. */
:root {
  --bg: #17120e;
  --panel: #211a14;
  --raised: #2c231b;
  --sunken: #120e0a;
  --edge: #463a2d;
  --edge-soft: #33291f;
  --text: #f0e6d2;
  --muted: #b3a58f;
  --gold: #d9a441;
  --gold-deep: #a8792a;
  --wax: #b03a2e;
  --mint: #6aa58c;
  --purple: #a397dc;
  --pink: #d27a64;
  --paper: #f1e7d0;
  --paper-edge: #cdbb94;
  --ink: #2b2118;
  --ink-soft: #6e5f4c;
  --radius: 10px;
}
body { background: radial-gradient(ellipse 90% 55% at 50% -12%, #3a2a1a66, transparent 65%), var(--bg); color: var(--text); }
::selection { background: #d9a44155; color: var(--text); }

/* ——— Botones y campos: tres pesos claros ——— */
button, .button, .upload-label { background: var(--raised); border: 1px solid transparent; color: var(--text); border-radius: 8px;
  transition: background .15s, border-color .15s, color .15s; }
button:hover:not(:disabled), .button:hover { background: #3a2e23; border-color: var(--edge); }
button.primary, .button.primary, .primary { background: linear-gradient(180deg, #e3b356, var(--gold) 60%, #c58f33); border-color: #b78431;
  color: #24180b; font-weight: 700; box-shadow: 0 1px 0 #fff4 inset, 0 2px 8px #0005; }
button.primary:hover:not(:disabled) { background: linear-gradient(180deg, #ecc068, #e0ad4d 60%, #cc9739); border-color: #c69040; }
button.quiet, .quiet { background: transparent; border-color: transparent; color: var(--muted); }
button.quiet:hover:not(:disabled) { background: #ffffff0d; color: var(--text); border-color: transparent; }
button.danger, .danger { background: transparent; border-color: #b03a2e88; color: #e59a8c; }
button.danger:hover:not(:disabled) { background: #b03a2e26; border-color: var(--wax); }
button:disabled { opacity: .5; }
input, textarea, select { background: var(--sunken); border: 1px solid var(--edge-soft); color: var(--text); border-radius: 8px; }
input:hover, textarea:hover, select:hover { border-color: var(--edge); }
input:focus, textarea:focus, select:focus { border-color: var(--gold-deep); outline: none; box-shadow: 0 0 0 3px #d9a44122; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.muted { color: var(--muted); }

/* ——— Cabecera del sitio: la marca, cinco secciones y la cuenta ——— */
body > header { position: sticky; top: 0; z-index: 30; height: 64px; padding: 0 max(20px, calc((100vw - 1320px) / 2)); gap: 28px;
  background: linear-gradient(180deg, #120d0a, #15100c); border-bottom: 1px solid #5a452b66; box-shadow: 0 8px 24px #0006; }
body > header .brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.3rem var(--caps); letter-spacing: .1em; text-transform: lowercase; color: var(--gold); }
body > header .brand-glyph { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: .85rem; color: #f3d9b0;
  background: radial-gradient(circle at 35% 30%, #c0392b, #7d1d14 70%); box-shadow: 0 2px 6px #0007, inset 0 0 0 2px #9c2a1e; }
.studio-nav { gap: 2px; }
.studio-nav a { padding: 0 14px; color: #c2b49d; font-size: 1rem; letter-spacing: .01em; }
.studio-nav a:hover { color: var(--text); }
.studio-nav a[aria-current=page] { color: var(--text); }
.studio-nav a[aria-current=page]::after { left: 50%; right: auto; width: 8px; height: 8px; bottom: 8px; margin-left: -4px; border-radius: 1px;
  background: var(--gold); box-shadow: 0 0 10px #d9a441aa; transform: rotate(45deg); }
.header-tools { display: flex; align-items: center; gap: 10px; }
.header-tools .join-button { background: transparent; border: 1px solid #d9a44166; color: #f0d8a8; }
.header-tools .join-button:hover { background: #d9a4411a; border-color: var(--gold); }
.tables-pill { border-radius: 999px; background: #6aa58c1f; color: #a8d4c1; border: 1px solid #6aa58c44; }
.account { position: relative; display: flex; align-items: center; border-left: 0; padding-left: 0; }
.account-button { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; background: transparent; border: 1px solid transparent; }
.account-button:hover, .account-button[aria-expanded=true] { background: #ffffff0d; border-color: var(--edge-soft); }
.account-button.current { border-color: #d9a44155; }
.account-initial { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #3a2c1e; color: var(--gold); font: 700 1rem var(--serif); border: 1px solid #6b5333; }
.account-name { color: var(--text); font-size: .95rem; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-caret { color: var(--muted); font-size: .7rem; }
.account-menu { position: absolute; z-index: 40; right: 0; top: calc(100% + 10px); display: grid; min-width: 270px; padding: 6px; border-radius: 12px;
  background: #1d1611; border: 1px solid var(--edge); box-shadow: 0 24px 50px #000c; }
.account-menu[hidden] { display: none; }
.account-menu a { display: grid; gap: 1px; padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.account-menu a small { color: var(--muted); font-size: .78rem; }
.account-menu a:hover, .account-menu a[aria-current=page] { background: #2c231b; }
.account-menu a[aria-current=page] strong { color: var(--gold); }
.account-logout { margin-top: 4px; padding: 9px 12px; text-align: left; background: transparent; border-top: 1px solid var(--edge-soft) !important; border-radius: 0 0 8px 8px; color: var(--muted); }
@media (max-width: 760px) {
  body > header { height: auto; min-height: 56px; flex-wrap: wrap; padding: 8px 14px; gap: 6px 12px; }
  .account-name, .account-caret { display: none; }
  .account-button { padding: 2px; }
}

/* ——— Páginas de autor: superficies por tono ——— */
.site-heading h1, .workspace-heading .title-input { color: var(--text); }
.editor-tabs { border-bottom: 1px solid var(--edge-soft); }
.editor-tabs button { background: transparent; border: 0; color: var(--muted); border-radius: 0; }
.editor-tabs button[aria-pressed=true] { color: var(--text); box-shadow: inset 0 -2px var(--gold); }
.editor-tabs button span { background: var(--raised); color: var(--muted); }
.editor-list .editor-item { background: var(--panel); border: 1px solid transparent; }
.editor-list .editor-item.active { background: var(--raised); border-color: #d9a44166; box-shadow: inset 3px 0 var(--gold); }
.edit-visual, .editor-detail > .edit-fields, .editor-detail .edit-panel { background: var(--panel); border-color: var(--edge-soft); }
.lore-card, .spell-card, .stat-block, .roster-card, .cover-card, .mini-card { border-color: var(--edge-soft); }
.compendium-tabs a[aria-current=page] { color: var(--text); box-shadow: inset 0 -2px var(--gold); }

/* ——— La mesa: tres zonas en la cabecera, pestañas legibles, bandeja de dados ——— */
.room-page .board-head { padding: 6px 4px 10px; border-bottom: 1px solid var(--edge-soft); margin-bottom: 8px; }
.room-page .board-title .board-brand { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #f3d9b0; text-decoration: none;
  background: radial-gradient(circle at 35% 30%, #c0392b, #7d1d14 70%); box-shadow: inset 0 0 0 2px #9c2a1e; font-size: .8rem; }
.room-page .board-title h1 { font-size: 1.35rem; }
.room-page .board-title h2 { color: var(--muted); }
.room-page .board-actions { gap: 4px; }
.room-page .board-actions button { background: transparent; border-color: transparent; color: #d8cbb3; padding: 6px 11px; }
.room-page .board-actions button:hover:not(:disabled) { background: #ffffff0f; border-color: var(--edge-soft); color: var(--text); }
.room-page .board-actions button.primary { background: linear-gradient(180deg, #e3b356, var(--gold) 60%, #c58f33); color: #24180b; border-color: #b78431; }
.room-page .board-actions button[aria-pressed=true] { background: #d9a4411f; color: var(--gold); border-color: #d9a44155; }
.room-page .board-actions .agenda-chip { border: 1px dashed #d9a44166; }
.room-page .board-actions .agenda-chip.pending { border-style: solid; border-color: var(--wax); box-shadow: 0 0 0 3px #b03a2e33; }
.room-page .board-actions .agenda-chip.pending small { color: #f0a090; }
.room-page .view-as { color: var(--muted); }
.room-page .view-as select { background: transparent; border-color: var(--edge-soft); }
.room-page .presence { color: #a8d4c1; }
.room-page .game-dock, .room-page .map-workspace { background: var(--panel); border-color: var(--edge-soft); }
.room-page .dock-tabs { background: #1b1510; border-bottom: 1px solid var(--edge-soft); }
.room-page .dock-tabs button { background: transparent; border: 0; border-radius: 0; color: var(--muted); font: 500 .9rem var(--sans); letter-spacing: 0; text-transform: none; }
.room-page .dock-tabs button[aria-pressed=true] { color: var(--text); background: transparent; box-shadow: inset 0 -2px var(--gold); }
.room-page .dock-tabs .badge { background: var(--wax); color: #fff; }
.room-page .tool-rail { background: #1a1410ee; border-color: var(--edge-soft); }
.room-page .tool-rail .tool[aria-pressed=true] { background: #d9a4411f; color: var(--gold); box-shadow: inset 2px 0 var(--gold); }
.room-page .turn-strip { background: #1d1611; border-bottom-color: var(--edge-soft); }
.room-page .turn-strip.mine { background: linear-gradient(90deg, #b03a2e33, #1d1611 60%); box-shadow: inset 4px 0 var(--wax); }
.room-page .turn-strip.mine .turn-label { color: #f3c2a0; }
.room-page .map-help { background: #1a1410; border-top-color: var(--edge-soft); }
.room-page .game-dock .dice-tray { background: #1b1510; border-top-color: var(--edge-soft); }
.room-page .dice-buttons button { background: var(--sunken); border-color: var(--edge-soft); }
.room-page .dice-buttons button.d20 { border-color: #d9a44188; color: var(--gold); }
.room-page .character-card { background: #2a2119; border-color: transparent; }
.chat-message { background: #2a2119; }
.chat-message.mine { background: #33291e; }
.chat-message.whisper { background: #2a2433; outline-color: #a397dc88; }
.chat-message .msg-head span { color: var(--purple); }

/* Móvil: la cabecera de la mesa se desliza en vez de cortarse. */
@media (max-width: 760px) {
  .room-page .board-actions { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .room-page .board-actions::-webkit-scrollbar { display: none; }
  .room-page .board-actions > * { flex: none; }
}
.room-page .board-actions { display: flex; align-items: center; gap: 0; }
.room-page .ba-group { display: flex; align-items: center; gap: 4px; padding: 0 10px; }
.room-page .ba-group + .ba-group { border-left: 1px solid var(--edge-soft); }
.room-page .ba-group:empty { display: none; }
.room-page .board-actions .dock-toggle[aria-pressed] { background: transparent; border-color: transparent; color: var(--muted); }
.macro-bar .macro.tables small { font-family: var(--sans); }
/* Título de la mesa en dos líneas: la aventura y, debajo, la escena. */
.room-page .board-title { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; row-gap: 0; align-items: center; min-width: 200px; flex: 1 1 260px; padding-left: 4px; }
.room-page .board-title .board-brand { grid-row: 1 / 3; flex: none; }
.room-page .board-title h1 { font-size: 1.2rem; line-height: 1.2; }
.room-page .board-title h2 { font-size: .82rem; line-height: 1.25; }
.room-page .board-head { gap: 8px; }
.room-page .board-actions { flex: 0 1 auto; min-width: 0; }
/* Compendio: el nombre del conjuro manda; la marca de revisión solo cuando está revisado. */
.spell-card .spell-head { justify-content: flex-start; }
.spell-card h3 { color: var(--text); }
.spell-card .spell-foot span { background: #3a2d21; color: #e3d5bd; }
.spell-card .spell-foot .review:not(.ok) { display: none; }
.header-tools .install-button { background: transparent; border: 1px solid #6aa58c66; color: #a8d4c1; }
.header-tools .install-button:hover { background: #6aa58c1f; border-color: var(--mint); }
.room-page .board-actions .call-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; text-decoration: none;
  background: #6aa58c1f; border: 1px solid #6aa58c66; color: #bfe3d3; font-size: .9rem; white-space: nowrap; }
.room-page .board-actions .call-link:hover { background: #6aa58c33; border-color: var(--mint); }

/* ——— Taller: el libro de la aventura ———
   Índice como el de un libro (capítulo, miniatura y título; se arrastra para reordenar) y, en la página,
   el texto para leer en voz alta en pergamino, como en los módulos, y las notas de dirección al margen en lacre. */
.editor-list { display: grid; gap: 2px; align-content: start; }
.editor-list .editor-item { position: relative; display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 8px; border-radius: 8px; background: transparent; border: 1px solid transparent; cursor: grab; }
.editor-list .editor-item:hover { background: #ffffff08; }
.editor-list .editor-item.active { background: var(--raised); border-color: transparent; box-shadow: inset 3px 0 var(--gold); }
.editor-list .editor-item .item-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 0; background: transparent; border: 0; text-align: left; }
.editor-list .editor-item img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; box-shadow: 0 2px 6px #0007; }
.editor-list .editor-item .item-main span { display: grid; min-width: 0; }
.editor-list .editor-item .item-main small { font: 600 .74rem var(--serif); color: var(--gold); letter-spacing: .04em; }
.editor-list .editor-item .item-main strong { font: 500 .95rem/1.25 var(--serif); color: var(--text); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.editor-list .editor-item:not(.active) .item-main strong { color: #d8cbb3; }
.editor-list .item-move { display: grid; gap: 2px; opacity: 0; transition: opacity .15s; }
.editor-list .editor-item:hover .item-move, .editor-list .editor-item:focus-within .item-move { opacity: 1; }
.editor-list .item-move button { min-height: 0; width: 22px; height: 18px; padding: 0; font-size: .6rem; background: var(--sunken); }
.editor-list .editor-item.dragging { opacity: .4; }
.editor-list .editor-item.drop-before { box-shadow: 0 -2px 0 var(--gold); }
.editor-list .editor-item.drop-after { box-shadow: 0 2px 0 var(--gold); }
.editor-list .add-item { margin-top: 8px; background: transparent; border: 1px dashed var(--edge); color: var(--muted); }
.editor-list .add-item:hover { color: var(--gold); border-color: var(--gold-deep); }

.read-aloud, .dm-note { display: grid; gap: 6px; margin: 4px 0 14px; }
.read-aloud > label { display: flex; align-items: center; gap: 8px; font: 500 .9rem var(--serif); font-style: italic; color: #e8d6b0; }
.read-aloud > label::before { content: '❦'; color: var(--gold); font-style: normal; }
.read-aloud textarea { background: linear-gradient(180deg, #f3e9d3, #ead9b8); color: var(--ink); border: 1px solid var(--paper-edge); border-left: 5px solid #8a6a32;
  border-radius: 4px; padding: 16px 18px; font: 400 1.05rem/1.7 var(--serif); box-shadow: inset 0 1px 0 #fff8, 0 8px 22px #0007; min-height: 170px; }
.read-aloud textarea:focus { border-color: #8a6a32; box-shadow: inset 0 1px 0 #fff8, 0 0 0 3px #d9a44144, 0 8px 22px #0007; }
.dm-note > label { display: flex; align-items: center; gap: 8px; font: 600 .82rem var(--sans); color: #e8a092; }
.dm-note > label::before { content: '◈'; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: .55rem; color: #f3d9b0;
  background: radial-gradient(circle at 35% 30%, #c0392b, #7d1d14 70%); }
.dm-note textarea { background: #1a120e; border: 1px solid #5a2a22; border-left: 4px solid var(--wax); border-radius: 4px; padding: 14px 16px; font: 400 .95rem/1.65 var(--sans); color: #ead9c6; min-height: 150px; }
.dm-note textarea:focus { border-color: #8a3a2e; box-shadow: 0 0 0 3px #b03a2e33; }

/* Bienvenida guiada: foco de luz sobre lo que se explica y una nota de pergamino al lado. */
#guide { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.guide-spot { position: fixed; left: var(--x, 0); top: var(--y, 0); width: var(--w, 0); height: var(--h, 0); border-radius: 12px;
  box-shadow: 0 0 0 9999px #0b0806b3, 0 0 0 2px var(--gold), 0 0 26px #d9a44166; }
.guide-spot[hidden] { display: block; box-shadow: 0 0 0 9999px #0b0806b3; width: 0; height: 0; }
.guide-bubble { position: fixed; left: var(--bx, 12px); top: var(--by, 12px); width: var(--bw, 320px); pointer-events: auto; padding: 16px 18px 14px; border-radius: 6px;
  color: var(--ink); background: linear-gradient(180deg, #f3ead6, #e8dcc0); border: 1px solid var(--paper-edge); box-shadow: 0 24px 50px #000c; }
.guide-count { margin: 0; font: 600 .74rem var(--sans); color: #8a5a12; }
.guide-bubble h2 { margin: 2px 0 6px; font: 600 1.3rem var(--serif); color: var(--ink); }
.guide-text { margin: 0 0 12px; font: 400 .98rem/1.55 var(--serif); color: #4a3d2e; }
.guide-actions { display: flex; align-items: center; gap: 6px; }
.guide-actions span { flex: 1; }
.guide-actions button { min-height: 34px; padding: 6px 12px; }
.guide-actions .quiet { color: #6e5f4c; }
.guide-actions [data-guide="back"] { background: #ffffff66; color: var(--ink); }

/* Roles en la mesa: el espectador mira (sin herramientas ni dados) y una insignia dice quién es quién. */
.role-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.role-badge.spectator { background: #a397dc22; color: #cfc6f4; border: 1px solid #a397dc66; }
.role-badge.codirector { background: #b03a2e22; color: #f0b4a8; border: 1px solid #b03a2e66; }
.room-page.role-spectator .tool-rail, .room-page.role-spectator .dice-tray, .room-page.role-spectator .focus-bar { display: none; }
.spectator-note { margin: 4px 0 12px; line-height: 1.55; }
.assignment.role-spectator label { color: #cfc6f4; }
.assignment.role-director label { color: #f0b4a8; }
.assignment .seat-role { max-width: 130px; }
.invite-modal .invite-row { padding: 10px 0; border-top: 1px solid var(--edge-soft); }
.invite-modal .invite-row:first-of-type { border-top: 0; }
.invite-modal .invite-row h3 { margin: 0 0 2px; font: 600 1.05rem var(--serif); }
.invite-modal .invite-row p { margin: 0 0 8px; font-size: .88rem; }
.invite-modal .invite-copy { display: flex; gap: 8px; }
.invite-modal .invite-copy input { flex: 1; min-width: 0; }
.admin-seats { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.admin-seats li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-seats select { max-width: 160px; }
.invite-note { margin: 10px 0 0; font-size: .85rem; }

/* Crónica: pergamino al principio del Diario; «La última vez…» al entrar. Estadísticas de dados en el Registro. */
.chronicle { margin-bottom: 14px; }
.chronicle-write { width: 100%; margin-bottom: 10px; }
.chronicle-entry { margin-bottom: 8px; padding: 12px 14px; border-radius: 6px; color: var(--ink); background: linear-gradient(180deg, #f3ead6, #e8dcc0); border: 1px solid var(--paper-edge); }
.chronicle-entry:not(.latest) { opacity: .88; }
.chronicle-entry header { display: flex; align-items: baseline; gap: 8px; }
.chronicle-entry header strong { font: 600 1.05rem var(--serif); flex: 1; }
.chronicle-entry time { font-size: .75rem; color: var(--ink-soft); }
.chronicle-entry p { margin: 6px 0 0; font: 400 .95rem/1.6 var(--serif); white-space: pre-wrap; }
.chronicle-entry .icon-button { min-height: 0; padding: 0 6px; color: var(--ink-soft); background: transparent; }
.chronicle-form textarea { font: 400 1rem/1.65 var(--serif); }
.previously .kicker { margin: 0 0 6px; }
.previously p:last-child { margin: 0; font: 400 1.1rem/1.7 var(--serif); white-space: pre-wrap; }
.dice-stats { margin-bottom: 14px; }
.dice-stats .dock-heading { align-items: center; }
.stats-scope { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--sunken); }
.stats-scope button { min-height: 0; padding: 3px 10px; border-radius: 999px; font-size: .78rem; background: transparent; }
.stats-scope button[aria-pressed=true] { background: var(--raised); color: var(--gold); }
.dice-stats table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.dice-stats th, .dice-stats td { padding: 6px 6px; text-align: right; border-bottom: 1px solid var(--edge-soft); }
.dice-stats th:first-child, .dice-stats tbody th { text-align: left; font-weight: 500; }
.dice-stats thead th { color: var(--muted); font-weight: 500; font-size: .76rem; }
.dice-stats tbody th small { display: block; font-size: .7rem; }
.dice-stats tr.blessed th small { color: var(--gold); }
.dice-stats tr.cursed th small { color: #e59a8c; }
.dice-stats td b { font: 600 1rem var(--serif); }
.chronicle-actions { display: flex; gap: 6px; margin-bottom: 10px; }
.chronicle-actions button { flex: 1; }
/* Libro de la campaña */
.book-modal { width: min(860px, 94vw); }
.campaign-book { display: grid; gap: 22px; }
.campaign-book .book-cover { position: relative; padding: 26px 24px; text-align: center; border: 1px solid var(--paper-edge); border-radius: 4px; background: #efe1c2; }
.campaign-book .book-cover h1 { margin: 4px 0; font: 600 clamp(1.8rem, 4vw, 2.6rem)/1.1 var(--serif); color: var(--ink); }
.campaign-book .book-cover .wax-seal { right: 18px; bottom: 14px; width: 44px; height: 44px; }
.book-span { margin: 0; color: var(--ink-soft); font-style: italic; }
.campaign-book h2 { margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--paper-edge); font: 600 1.4rem var(--serif); color: var(--ink); }
.book-party { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.book-party figure { margin: 0; text-align: center; }
.book-party img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 20%; border-radius: 4px; border: 1px solid var(--paper-edge); }
.book-party figcaption { display: grid; margin-top: 4px; }
.book-party small { color: var(--ink-soft); font-size: .78rem; }
.book-entry { margin: 0 0 14px; }
.book-entry h3 { margin: 0; font: 600 1.1rem var(--serif); color: var(--ink); }
.book-entry time { font-size: .78rem; color: var(--ink-soft); }
.book-entry p { margin: 4px 0 0; font: 400 1rem/1.65 var(--serif); white-space: pre-wrap; color: var(--ink); }
@media print {
  body.print-book > *:not(dialog) { display: none !important; }
  body.print-book dialog#modal { position: static; max-width: none; width: 100%; max-height: none; overflow: visible; border: 0; box-shadow: none; background: #fff; }
  body.print-book dialog#modal::backdrop { background: #fff; }
  body.print-book .modal-heading, body.print-book .book-actions { display: none !important; }
  body.print-book .book-entry, body.print-book .book-party figure { break-inside: avoid; }
}
/* Mesas donde juegas (inicio). */
.hall-playing-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.playing-card { display: grid; grid-template-rows: 120px auto auto; overflow: hidden; border-radius: 12px; background: var(--panel); border: 1px solid var(--edge-soft); box-shadow: 0 14px 30px #0007; }
.playing-card.is-closed { opacity: .85; }
.playing-scene { width: 100%; height: 120px; object-fit: cover; }
.playing-body { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px 4px; }
.playing-face { width: 52px; height: 52px; margin-top: -32px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; border: 2px solid var(--gold); background: var(--sunken); flex: none; }
.playing-body strong { display: block; font: 500 1.15rem var(--serif); }
.playing-body small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.playing-chronicle { font-style: italic; }
.playing-card > button { margin: 10px 14px 14px; }
.hall-playing:first-child { padding-top: 48px; }
/* Conjuro en el aire (Contrahechizo). */
.pending-cast { position: absolute; z-index: 6; left: 50%; top: 64px; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); padding: 14px 16px;
  border-radius: 12px; background: #1d1611f2; border: 1px solid #a397dc88; box-shadow: 0 0 0 4px #a397dc22, 0 18px 40px #000b; }
.pending-title { margin: 0 0 8px; font: 400 1.05rem var(--serif); }
.pending-title small { color: var(--muted); font-family: var(--sans); }
.pending-glyph { color: var(--purple); margin-right: 6px; }
@media (prefers-reduced-motion: no-preference) { .pending-glyph { display: inline-block; animation: pending-spin 2.4s linear infinite; } @keyframes pending-spin { to { transform: rotate(360deg); } } }
.pending-choice { display: grid; gap: 6px; padding: 8px 0; border-top: 1px solid var(--edge-soft); }
.pending-choice small { color: var(--muted); }
.pending-cast .row { flex-wrap: wrap; gap: 6px; }
.pending-move { border-color: #b03a2e88; box-shadow: 0 0 0 4px #b03a2e22, 0 18px 40px #000b; } .pending-move .pending-glyph { color: #e59a8c; }
.shield-offer { border-color: #6aa58c88; box-shadow: 0 0 0 4px #6aa58c22, 0 18px 40px #000b; } .shield-offer .pending-glyph { color: var(--mint); }
/* El mercader */
.shop-modal { width: min(640px, 94vw); }
.shop-purse { margin: 0 0 10px; }
.shop-purse b { color: var(--gold); font: 600 1.1rem var(--serif); }
.shop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.shop-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--raised); }
.shop-list li small { display: block; color: var(--muted); font-size: .76rem; }
.shop-list.editing li { grid-template-columns: minmax(0, 1fr) 110px 90px auto; }
.shop-list.editing label { display: grid; font-size: .72rem; color: var(--muted); }
.shop-price { text-align: right; font: 600 1rem var(--serif); color: var(--gold); }
.room-page .board-actions .shop-button { border: 1px solid #d9a44166; color: #f0d8a8; }
/* La campaña (6 oct 2026): pestaña del panel, relojes, avisos sobre el mapa y diálogos. */
.camp-block { padding: 12px 0 14px; border-top: 1px solid var(--edge-soft); }
.camp-block:first-of-type { border-top: 0; padding-top: 0; }
.camp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.camp-head h3 { margin: 0; font: 500 1.02rem var(--serif); color: var(--paper); }
.world-now { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 10px; margin: 0 0 8px; }
.world-now b { font: 600 1.15rem var(--serif); color: var(--paper); }
.world-now small { color: var(--muted); }
.world-now .world-clock { grid-row: span 2; justify-self: end; font: 600 1.7rem var(--serif); color: var(--gold); font-variant-numeric: tabular-nums; }
.world-now em { color: var(--muted); font-size: .84rem; }
.world-advance { flex-wrap: wrap; gap: 5px; }
.world-advance button { padding: 5px 9px; font-size: .78rem; }
.world-chip { display: inline-flex; gap: 5px; align-items: baseline; padding: 4px 9px; border-radius: 999px; background: var(--sunken); color: var(--muted); font-size: .78rem; white-space: nowrap; }
.world-chip b { color: var(--paper); font-weight: 600; }
.quest { padding: 10px 12px; margin-bottom: 8px; border-radius: 9px; background: var(--raised); border-left: 3px solid var(--gold-deep); }
.quest.quest-done { border-left-color: var(--mint); opacity: .85; }
.quest.quest-failed { border-left-color: var(--wax); opacity: .75; }
.quest-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.quest-head strong { font: 500 1rem var(--serif); flex: 1; min-width: 0; }
.quest p { margin: 6px 0; font-size: .84rem; line-height: 1.5; color: var(--text); }
.quest-giver, .quest-reward { display: block; color: var(--muted); font-size: .76rem; }
.quest-reward { color: #e8c98a; margin-top: 4px; }
.is-hidden { outline: 1px dashed #a397dc66; outline-offset: -1px; }
.secret-pill { background: #a397dc22; color: var(--purple); }
.objectives { list-style: none; margin: 6px 0 2px; padding: 0; display: grid; gap: 4px; }
.objectives li { display: flex; gap: 8px; align-items: flex-start; font-size: .84rem; }
.objectives li.done span:last-child { text-decoration: line-through; color: var(--muted); }
.objective-toggle, .objective-mark { flex: none; min-height: 0; min-width: 0; display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; border-radius: 5px;
  border: 1px solid var(--edge); background: var(--sunken); color: var(--mint); font-size: .75rem; }
.quests-closed summary { cursor: pointer; color: var(--muted); font-size: .84rem; margin: 4px 0 8px; }
.contact-filter { display: flex; gap: 4px; margin-bottom: 8px; }
.contact-filter button { flex: 1; padding: 5px 4px; font-size: .78rem; background: transparent; color: var(--muted); }
.contact-filter button[aria-pressed=true] { background: var(--raised); color: var(--paper); border-color: var(--edge); }
.contact-filter small { color: var(--gold); }
.contact { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; padding: 10px; margin-bottom: 8px; border-radius: 9px; background: var(--raised); }
.contact > img, .contact-initial { width: 56px; height: 68px; border-radius: 7px; object-fit: cover; object-position: 50% 20%; cursor: zoom-in; }
.contact-initial { display: grid; place-items: center; background: var(--sunken); font: 600 1.6rem var(--serif); color: var(--muted); cursor: default; }
.contact-head { display: flex; gap: 6px; align-items: baseline; justify-content: space-between; }
.contact-head strong { font: 500 1rem var(--serif); }
.contact > div > small { display: block; color: var(--muted); font-size: .76rem; }
.contact p { margin: 5px 0; font-size: .82rem; line-height: 1.5; }
.contact .private { padding: 7px 9px; font-size: .78rem; }
.attitude { font-size: .7rem; padding: 2px 7px; border-radius: 999px; background: var(--sunken); color: var(--muted); white-space: nowrap; }
.attitude-friendly .attitude { color: var(--mint); background: #6aa58c1f; }
.attitude-hostile .attitude { color: #e59a8c; background: #b03a2e22; }
.attitude-neutral .attitude { color: #e8c98a; }
.contact-note { display: grid; gap: 3px; margin-top: 6px; }
.contact-note span { font-size: .7rem; color: var(--muted); }
.contact-note textarea { font-size: .8rem; padding: 6px 8px; resize: vertical; min-height: 0; }
.contact-preview { max-height: 140px; border-radius: 8px; object-fit: cover; justify-self: start; }
.clock-grid { display: grid; gap: 8px; }
.clock-card { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; background: var(--raised); }
.clock-card strong { display: block; font: 500 .95rem var(--serif); }
.clock-card small { color: var(--muted); font-size: .74rem; }
.clock-card .row { gap: 4px; margin-top: 4px; }
.clock-card .row button { padding: 2px 9px; }
.clock-face { flex: none; }
.clock-face path { fill: var(--sunken); stroke: var(--panel); stroke-width: 1.5; }
.clock-face .rim { fill: none; stroke: var(--edge); stroke-width: 1.5; }
.clock-face.tone-threat path.on { fill: var(--wax); }
.clock-face.tone-progress path.on { fill: var(--mint); }
.clock-rail { position: absolute; z-index: 4; right: 12px; top: 76px; display: grid; gap: 6px; justify-items: end; pointer-events: none; }
.clock-mini { pointer-events: auto; display: flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 999px; background: #17120ee6; border: 1px solid var(--edge-soft); }
.clock-mini span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; color: var(--text); }
.safety-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.safety-lists h4 { margin: 0 0 4px; font: 500 .9rem var(--serif); }
.safety-lists h4 small { display: block; color: var(--muted); font: .7rem var(--sans); }
.safety-lists ul { margin: 0; padding-left: 16px; font-size: .8rem; line-height: 1.5; }
.safety-note { font-size: .8rem; color: var(--muted); font-style: italic; }
.xcard-button { display: block; width: 100%; margin: 10px 0 4px; border: 1px solid #b03a2e88; color: #f0b3a6; background: #b03a2e1a; font-weight: 600; }
.map-help .xcard-quick { color: #e59a8c; }
.camp-banners { position: absolute; z-index: 7; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(620px, calc(100% - 24px)); display: grid; gap: 8px; }
.camp-banner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 14px; border-radius: 12px;
  background: #1d1611f2; border: 1px solid var(--edge); box-shadow: 0 14px 34px #000a; }
.camp-banner strong { font: 500 1rem var(--serif); white-space: nowrap; }
.camp-banner span { font-size: .84rem; color: var(--text); }
.camp-banner .row { gap: 6px; flex-wrap: nowrap; }
.xcard-banner { border-color: var(--wax); box-shadow: 0 0 0 4px #b03a2e2e, 0 14px 34px #000a; }
.xcard-banner strong { color: #f0b3a6; }
.pause-banner strong { color: var(--gold); }
.pause-banner b { font: 600 1.1rem var(--serif); color: var(--gold); font-variant-numeric: tabular-nums; }
.loot-banner strong { color: var(--gold); }
.seat-banner strong { color: var(--mint); }
.role-badge.carrying { background: #6aa58c22; color: var(--mint); }
.camp-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.camp-form fieldset { border: 1px solid var(--edge-soft); border-radius: 9px; padding: 8px 10px; display: grid; gap: 6px; }
.camp-form legend { color: var(--muted); font-size: .8rem; padding: 0 4px; }
.objective-row { gap: 6px; flex-wrap: nowrap; }
.objective-row input:not([type=checkbox]) { flex: 1; }
.camp-form .dm-field { border-color: #a397dc55; }
.coin-row { grid-template-columns: repeat(5, 1fr); display: grid; }
.coin-row label { display: grid; gap: 2px; font-size: .74rem; color: var(--muted); text-transform: uppercase; }
.absent-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.absent-list li { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 9px; background: var(--raised); }
.absent-list img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; }
.absent-list small { display: block; color: var(--muted); font-size: .76rem; }
.pause-minutes button { flex: 1; }
@media (max-width: 700px) {
  .camp-banner { grid-template-columns: minmax(0, 1fr); }
  .camp-banners { bottom: 70px; }
  .clock-mini span { display: none; }
  .clock-mini { padding: 3px; }
  .safety-lists, .camp-form .two { grid-template-columns: 1fr; }
}
.map-stage:has(.focus-bar) .camp-banners { bottom: 100px; }
@media (max-width: 700px) { .map-stage:has(.focus-bar) .camp-banners { bottom: 150px; } }
.party-notes textarea { width: 100%; font-size: .84rem; line-height: 1.5; resize: vertical; }
.party-notes .row { margin-top: 6px; }
.party-notes-read { white-space: pre-wrap; font-size: .84rem; color: var(--text); }
.spot-banner strong { color: var(--purple); }
.spotlight { position: absolute; z-index: 8; inset: 0; display: grid; place-items: center; padding: 24px; background: #0b0806d9; backdrop-filter: blur(3px); }
.spotlight figure { margin: 0; max-width: min(760px, 100%); max-height: 100%; display: grid; gap: 12px; justify-items: center; }
.spotlight img { max-width: 100%; max-height: min(64vh, 640px); border-radius: 12px; box-shadow: 0 0 0 1px var(--paper-edge), 0 24px 60px #000c; object-fit: contain; }
.spotlight figcaption { text-align: center; }
.spotlight strong { display: block; font: 500 1.6rem var(--serif); color: var(--paper); }
.spotlight p { margin: 6px 0 0; color: var(--muted); }
.spotlight > button { position: absolute; top: 14px; right: 14px; }
@media (prefers-reduced-motion: no-preference) { .spotlight figure { animation: spot-in .35s ease-out; } @keyframes spot-in { from { opacity: 0; transform: scale(.96); } } }
.chat-message.mention { box-shadow: inset 3px 0 0 var(--gold); background: #d9a4411a; }
.up-next { padding: 3px 9px; border-radius: 999px; background: #d9a44122; color: var(--gold); font-size: .78rem; white-space: nowrap; }
.book-contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.book-contacts figure { margin: 0; display: grid; grid-template-columns: 64px 1fr; gap: 10px; }
.book-contacts img { width: 64px; height: 80px; object-fit: cover; object-position: 50% 20%; border-radius: 6px; }
.book-contacts small { display: block; color: var(--ink-soft); }
.book-contacts p { margin: 4px 0 0; font-size: .86rem; }
.reminders { margin-top: 10px; }
.reminders h4 { margin: 0; color: var(--muted); font: 500 .84rem var(--sans); }
.reminders h4 small { color: var(--gold); }
.reminders ul { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 4px; }
.reminders li { display: flex; gap: 6px; align-items: baseline; font-size: .82rem; }
.reminders li b { color: var(--gold); font-weight: 600; white-space: nowrap; }
.reminders li button { margin-left: auto; }
.reminder-form { display: grid; grid-template-columns: 56px 92px minmax(0, 1fr) auto; gap: 4px; margin: 4px 0; }
.reminder-form input { padding: 5px 6px; font-size: .8rem; min-width: 0; }
.reminder-banner strong { color: var(--purple); }
.away-chip { margin-left: 6px; color: #e8c98a; white-space: nowrap; }
.away-chip::before { content: '· '; color: var(--muted); }
.room-page .board-actions .away-toggle { font-size: .8rem; }
.away-toggle[aria-pressed=true] { color: var(--gold); }
.playing-quests { color: #e8c98a !important; }
/* Cabecera de la mesa: si no cabe, cede el grupo de sesión (chips informativos), nunca los botones. */
@media (min-width: 601px) {
  .room-page .board-actions { flex: 0 1 auto; min-width: 0; flex-wrap: nowrap; }
  .room-page .board-title { flex: 1 1 140px; min-width: 120px; }
  .room-page .ba-admin .view-as, .room-page .ba-admin .view-as span { white-space: nowrap; }
  .room-page .ba-session { flex: 0 1 auto; min-width: 0; overflow: hidden; }
  .room-page .ba-session > * { flex: none; }
  .room-page .ba-play, .room-page .ba-admin { flex: none; flex-wrap: nowrap; }
}
/* Administración: estado del servidor, aviso general, registro y cuentas. */
.admin-desk { display: grid; gap: 18px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; background: var(--edge-soft); border-radius: 12px; overflow: hidden; }
.admin-stats .stat { display: grid; align-content: start; gap: 2px; padding: 16px 18px; background: var(--panel); }
.admin-stats .stat b { font: 600 2rem/1 var(--serif); color: var(--paper); font-variant-numeric: tabular-nums; }
.admin-stats .stat span { color: var(--text); }
.admin-stats .stat small { color: var(--muted); font-size: .8rem; }
.admin-stats .stat.live b { color: var(--mint); }
.admin-stats meter { width: 100%; height: 6px; margin: 6px 0 2px; }
.admin-live { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); }
.admin-live b { color: var(--text); font-weight: 500; }
.admin-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.admin-forms { display: grid; gap: 18px; }
.admin-desk .surface h2 { margin: 0 0 10px; font: 500 1.2rem var(--serif); }
.admin-announcement { padding: 10px 12px; border-radius: 8px; background: #d9a4411a; color: #f0d8a8; }
.admin-announcement small { display: block; color: var(--muted); }
.admin-log ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 420px; overflow: auto; }
.admin-log li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--edge-soft); font-size: .88rem; }
.admin-log time { color: var(--muted); font-size: .8rem; }
.admin-log b { font-weight: 600; }
.admin-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.admin-section-head h2 { margin: 0; font: 500 1.5rem var(--serif); }
.admin-section-head input { max-width: 300px; }
.admin-users { display: grid; gap: 1px; background: var(--edge-soft); border-radius: 12px; overflow: hidden; }
.admin-user { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; background: var(--panel); }
.admin-user[hidden], .admin-rooms [hidden] { display: none; }
.admin-user .account-initial { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--raised); font: 600 1.1rem var(--serif); color: var(--gold); }
.admin-user-name { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.admin-user h3 { margin: 0; font: 500 1.05rem var(--serif); }
.admin-user small { display: block; color: var(--muted); font-size: .8rem; }
.admin-user .pill { font-style: normal; font-size: .7rem; }
.admin-user .pill.off { color: #e59a8c; }
.admin-user.is-disabled { opacity: .7; }
.admin-user .row { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.admin-user .row button { padding: 6px 10px; font-size: .82rem; }
.live-pill { display: inline-flex; gap: 5px; align-items: center; font-style: normal; color: var(--mint); font-size: .75rem; }
.site-announcement { padding: 10px max(20px, calc((100vw - 1320px) / 2)); background: #3a2a14; border-bottom: 1px solid #d9a44155; color: #f0d8a8; }
.site-announcement b { color: var(--gold); margin-right: 8px; }
.announce-banner { border-color: var(--gold-deep); }
.announce-banner strong { color: var(--gold); }
@media (max-width: 800px) {
  .admin-columns { grid-template-columns: 1fr; }
  .admin-user { grid-template-columns: 40px minmax(0, 1fr); }
  .admin-user .row { grid-column: 1 / -1; justify-content: flex-start; }
  .admin-section-head { flex-wrap: wrap; }
}
.hands-banner strong { color: #e8c98a; }
.hand-queue { display: flex; gap: 6px; flex-wrap: wrap; }
.hand-queue button { padding: 4px 10px; font-size: .84rem; }
.room-page .board-actions .hand-toggle { font-size: .82rem; }
.hand-toggle[aria-pressed=true] { color: var(--gold); border-color: #d9a44166; }
.admin-backups ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; max-height: 320px; overflow: auto; }
.admin-backups li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--edge-soft); }
.admin-backups li small { display: block; color: var(--muted); font-size: .78rem; }
.admin-backups li .button, .admin-backups li button { padding: 5px 10px; font-size: .82rem; text-decoration: none; }
/* Chat: tiradas dentro del texto y reacciones */
.inline-roll { display: inline-flex; align-items: baseline; gap: 4px; padding: 0 7px; border-radius: 6px; background: var(--sunken); border: 1px solid var(--edge); white-space: nowrap; }
.inline-roll b { color: var(--gold); font-variant-numeric: tabular-nums; }
.inline-roll small { color: var(--muted); font-size: .72rem; }
.inline-roll.critical { border-color: var(--gold); box-shadow: 0 0 8px #d9a44155; }
.inline-roll.fumble b { color: #e59a8c; }
.reactions { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.reaction, .reaction-add, .reaction-picker button { min-height: 0; padding: 1px 7px; font-size: .82rem; border-radius: 999px; background: var(--sunken); border: 1px solid transparent; }
.reaction small { margin-left: 3px; color: var(--muted); }
.reaction.mine { border-color: #d9a44188; }
.reaction-add { opacity: 0; color: var(--muted); }
.chat-message:hover .reaction-add, .chat-message:focus-within .reaction-add, .reaction-add:focus-visible { opacity: 1; }
@media (hover: none) { .reaction-add { opacity: .7; } }
.reaction-picker { display: inline-flex; gap: 2px; }
/* Votación rápida */
.poll-body p { margin: 0 0 6px; font: 500 1rem var(--serif); }
.poll-options { display: grid; gap: 4px; }
.poll-option { position: relative; overflow: hidden; display: flex; gap: 8px; align-items: baseline; text-align: left; padding: 6px 10px; }
.poll-option > span:not(.poll-bar), .poll-option b, .poll-option small { position: relative; }
.poll-option b { margin-left: auto; color: var(--gold); }
.poll-option small { color: var(--muted); font-size: .74rem; }
.poll-option.mine { border-color: var(--gold-deep); }
.poll-bar { position: absolute; inset: 0 auto 0 0; width: 0; background: #d9a44122; transition: width .4s; }
.poll-banner strong { color: var(--gold); }
.poll-option:disabled { opacity: 1; }
/* Iniciativa a mano */
.init-edit-button { padding: 2px 8px !important; min-height: 0 !important; }
.initiative-edit { margin: 10px 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.initiative-edit li { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 8px; background: var(--raised); }
.initiative-edit li.current { box-shadow: inset 3px 0 0 var(--gold); }
.init-add { gap: 6px; }
.init-add input { width: 90px; }
.house-rules-title { margin: 10px 0 4px; font: 500 .9rem var(--serif); }
.house-rules { white-space: pre-wrap; font-size: .82rem; line-height: 1.5; margin: 0; }
.admin-errors ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.admin-errors summary { cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: baseline; padding: 6px 0; }
.admin-errors summary small { grid-column: 2; color: var(--muted); font-size: .8rem; }
.admin-errors .error-count { grid-row: span 2; color: #e59a8c; font-weight: 700; font-variant-numeric: tabular-nums; }
.admin-errors pre { white-space: pre-wrap; font-size: .76rem; background: var(--sunken); padding: 8px 10px; border-radius: 8px; max-height: 220px; overflow: auto; }
/* Ficha: pestaña activa inequívoca, dos filas en el móvil e impresión completa y legible. */
.sh-tabs button { background: transparent !important; border-bottom: 3px solid transparent !important; }
.sh-tabs button[aria-selected="true"] { color: var(--ink) !important; border-bottom-color: #b07a2f !important; background: #fffaf0 !important; box-shadow: 0 -1px 0 var(--paper-edge) inset; }
.dock-content .sh-tabs button[aria-selected="true"] { color: var(--gold) !important; background: var(--edge) !important; border-bottom-color: var(--gold) !important; }
.print-only { display: none; }
@media (max-width: 600px) {
  .sh-tabs { flex-wrap: wrap; overflow: visible; }
  .sh-tabs button { flex: 1 1 30%; padding: 8px 6px; }
}
@media print {
  html:has(body.print-sheet), body.print-sheet { background: #fff !important; }
  body.print-sheet dialog#modal { background: #fff !important;  max-height: none !important; overflow: visible !important; height: auto !important; padding: 0 !important; }
  body.print-sheet .print-only { display: block; margin: 18px 0 6px; font: 600 1.15rem var(--serif); border-bottom: 1.5px solid #000; padding-bottom: 3px; }
  body.print-sheet .sh-panel { break-inside: auto; }
  body.print-sheet .sh-block, body.print-sheet .spell-row, body.print-sheet .attack-card { break-inside: avoid; }
  body.print-sheet .sh-tile, body.print-sheet .sh-tile.ac, body.print-sheet [class*="sh-tile"] { background: #fff !important; border: 1px solid #000 !important; }
  body.print-sheet button { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; min-height: 0 !important; }
  body.print-sheet button.primary, body.print-sheet .sheet-actions, body.print-sheet .icon-button, body.print-sheet [data-focus-hp], body.print-sheet .coin-purse input { display: none !important; }
  body.print-sheet .sh-hp meter, body.print-sheet meter { display: none !important; }
}
/* Panel «Turno» (jugador en el móvil) */
.turn-card { padding: 12px; margin-bottom: 12px; border-radius: 12px; background: var(--raised); border: 1px solid var(--edge-soft); }
.turn-card.mine { border-color: var(--gold); box-shadow: 0 0 0 3px #d9a44122; }
.turn-card .turn-head { display: flex; gap: 12px; align-items: center; }
.turn-card .turn-head img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; border: 2px solid var(--edge); }
.turn-card .turn-head strong { font: 500 1.25rem var(--serif); }
.turn-status { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.turn-status.now { color: var(--gold); font-weight: 700; font-size: 1rem; }
.turn-status.soon { color: #e8c98a; }
.turn-hp { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: baseline; margin: 12px 0 4px; }
.turn-hp > b { font: 600 2.2rem/1 var(--serif); color: var(--paper); }
.turn-hp.down > b { color: #e59a8c; }
.turn-hp > span { color: var(--muted); }
.turn-hp .row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.turn-hp .row button { min-height: 44px; font-weight: 600; }
.turn-death { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; margin: 6px 0; border-radius: 8px; background: #b03a2e22; color: #f0b3a6; }
.turn-conds { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.turn-conds span { padding: 2px 8px; border-radius: 999px; background: #a397dc22; color: var(--purple); font-size: .78rem; }
.turn-pips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 8px 0; }
.turn-pips span { text-align: center; padding: 6px 2px; border-radius: 8px; background: #6aa58c22; color: var(--mint); font-size: .76rem; font-weight: 600; }
.turn-pips span.spent { background: var(--sunken); color: var(--muted); text-decoration: line-through; }
.turn-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.turn-big { display: grid; gap: 2px; text-align: left; min-height: 60px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--edge); }
.turn-big b { font: 500 1.02rem var(--serif); }
.turn-big small { color: var(--muted); font-size: .76rem; }
.turn-big.end { grid-column: 1 / -1; border-color: var(--gold-deep); background: #d9a4411a; }
.turn-dice, .turn-order, .turn-party { margin: 14px 0; }
.turn-dice h3, .turn-order h3, .turn-party h3 { margin: 0 0 6px; font: 500 .95rem var(--serif); color: var(--muted); }
.turn-dice .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.turn-dice button { min-height: 44px; }
.turn-order ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.turn-order li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 8px; }
.turn-order li.current { background: #d9a4411a; box-shadow: inset 3px 0 0 var(--gold); }
.turn-order img, .turn-party img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; }
.turn-party > div { display: grid; grid-template-columns: 28px 1fr 70px auto; gap: 8px; align-items: center; padding: 3px 0; }
.turn-party meter { width: 70px; height: 6px; }
.turn-party small { color: var(--muted); font-size: .76rem; }
.import-notes { margin: 0 0 16px; padding: 12px 16px; border-radius: 10px; background: #d9a4411a; border: 1px solid #d9a44155; }
.import-notes strong { color: var(--gold); }
.import-notes ul { margin: 6px 0 0; padding-left: 18px; font-size: .9rem; }
.import-dialog .method-tabs { display: flex; gap: 4px; margin: 10px 0; }
.import-dialog textarea { width: 100%; font-family: ui-monospace, monospace; font-size: .82rem; }
.spell-foot .review.half { border-color: #8f7440; color: #e8c98a; }
/* Visión por personaje */
.vision-dark { fill: #07050a; opacity: .96; pointer-events: none; }
.vision-dim { fill: #07050a; opacity: .62; pointer-events: none; }

/* ——— Compendio: un grimorio. Índice por niveles a la izquierda; la página abierta, en vitela, a la derecha ——— */
.grimoire { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); grid-template-areas: "jump jump" "index page"; gap: 14px 28px; align-items: start; }
.compendium-results:has(> .grimoire) { display: block; }
.grimoire-jump { grid-area: jump; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.grimoire-jump a { min-width: 34px; padding: 4px 10px; border-radius: 999px; text-align: center; color: var(--muted); text-decoration: none; font: 500 .9rem var(--serif); border: 1px solid var(--edge-soft); }
.grimoire-jump a:hover { color: var(--text); border-color: var(--edge); background: var(--raised); }
.grimoire-index { grid-area: index; max-height: calc(100vh - 230px); overflow-y: auto; padding-right: 6px; scrollbar-width: thin; scrollbar-color: var(--edge) transparent; }
.grimoire-level h2 { position: sticky; top: 0; z-index: 1; display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 12px 4px 6px; background: var(--bg);
  font: italic 500 1.15rem var(--serif); color: #d8b878; border-bottom: 1px solid var(--edge-soft); }
.grimoire-level h2 small { font: 400 .8rem var(--sans); color: var(--muted); font-style: normal; }
.grimoire-level ol { list-style: none; margin: 0 0 8px; padding: 0; }
.grimoire .spell-card { padding: 0; border: 0; border-radius: 0; background: none; }
.grimoire .spell-card button { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; width: 100%; padding: 7px 8px; text-align: left;
  background: transparent; border: 0; border-radius: 6px; color: var(--text); }
.grimoire .spell-card button:hover { background: var(--panel); }
.grimoire .spell-card button[aria-pressed=true] { background: var(--raised); box-shadow: inset 2px 0 var(--school); }
.spell-dot { grid-row: 1 / 3; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--school); box-shadow: 0 0 6px color-mix(in srgb, var(--school) 60%, transparent); }
.grimoire .spell-card strong { font: 500 1.02rem/1.25 var(--serif); }
.grimoire .spell-card small { grid-column: 2; color: var(--muted); font-size: .78rem; }
.grimoire .spell-card b { grid-column: 3; grid-row: 1 / 3; align-self: center; color: #d8b878; font: 500 .82rem var(--sans); }
.grimoire-page { grid-area: page; position: sticky; top: 84px; }
.spell-page { position: relative; min-height: 340px; padding: 38px 46px 32px; border-radius: 4px; color: var(--ink);
  background: radial-gradient(ellipse at 50% 0%, #fbf4e2, transparent 70%), linear-gradient(180deg, #f3e9d2, #eadcbc); 
  box-shadow: 0 0 0 1px #cdbb9488, 0 1px 0 6px #e6d7b5, 0 0 0 7px #a07c4a55, 0 30px 60px #000a; }
.spell-page::before { content: ''; position: absolute; inset: 0 0 auto; height: 5px; background: var(--school); border-radius: 4px 4px 0 0; opacity: .85; }
.spell-page .spell-head { display: flex; justify-content: flex-start; gap: 16px; align-items: center; margin-bottom: 20px; text-align: left; }
.spell-page .spell-badge { width: 44px; height: 44px; font-size: 1.15rem; color: #fff8ea; background: color-mix(in srgb, var(--school) 80%, #2b2118); border: 2px solid #fff6; box-shadow: 0 2px 6px #0003; }
.spell-page h3 { margin: 0; font: 600 2rem/1.05 var(--serif); color: var(--ink); }
.spell-page .spell-head small { font: italic 1rem var(--serif); color: var(--ink-soft); }
.spell-page dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; margin: 0 0 18px; padding: 12px 0; border-block: 1px solid #b8935c66; }
.spell-page dt { font: italic .88rem var(--serif); color: var(--ink-soft); }
.spell-page dd { margin: 2px 0 0; font: 500 .98rem var(--sans); }
.spell-page p { color: var(--ink); opacity: 1; }
.spell-page .spell-text { margin: 0 0 18px; color: var(--ink); font: 1.12rem/1.6 var(--serif); max-width: 62ch; }
.spell-page .spell-text::first-letter { float: left; margin: 6px 8px 0 0; font: 700 3.3rem/.8 var(--serif); color: color-mix(in srgb, var(--school) 75%, #2b2118); }
.spell-page .resolves { clear: both; margin: 0 0 14px; color: var(--ink); background: #b8935c22; border-left-color: var(--school); font-size: .9rem; }
.spell-page .spell-foot { clear: both; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.spell-page .spell-foot span { font-size: .8rem; padding: 2px 9px; border-radius: 999px; background: #2b211812; color: var(--ink); border: 1px solid #b8935c66; }
.spell-page .spell-foot .review { color: #4f6b3c; border-color: #6c9a5c88; }
.spell-page .spell-foot .review:not(.ok) { display: none; }
.spell-page .spell-foot b { margin-left: auto; color: #7d1d14; font: 600 1rem var(--serif); }
#modal.spell-modal { color: var(--ink); background: linear-gradient(180deg, #f3e9d2, #eadcbc); border: 0; border-top: 5px solid #a07c4a; }
#modal.spell-modal .modal-heading h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#modal.spell-modal .modal-heading { justify-content: flex-end; }
#modal.spell-modal #close-modal { color: var(--ink); }
#modal .spell-page { box-shadow: none; padding: 0 2px 4px; background: none; }
#modal .spell-page::before { display: none; }
#modal .spell-page h3 { font-size: 1.6rem; }
#modal .spell-page dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .grimoire { grid-template-columns: 1fr; grid-template-areas: "jump" "index"; }
  .grimoire-index { max-height: none; overflow: visible; }
  .grimoire-page { display: none; }
  .grimoire-level h2 { top: 56px; }
}

/* ——— Códice (14 oct 2026): rúbricas, capitulares, cabeceras con arte y retratos en camafeo ———
   Las etiquetas pequeñas ya no van en versalitas espaciadas: son rúbricas en cursiva, como las notas
   de un manuscrito. El título de cada página abre con una capitular de lacre. */
:root { --rubric: #d8b878; --wax-bright: #cf4a3b; }
.eyebrow, .kicker, .hero-kicker, .cover-tag, .mini-class, .hall-cards .mini-class, .campaign-cover .levels, .hall-campaign .levels, .closed-agenda .kicker,
.visual-label .eyebrow, .page-heading .eyebrow, .room-heading .eyebrow, .rail-label, .tables-panel h3 {
  font-family: var(--serif); font-style: italic; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--rubric); }
.eyebrow, .kicker, .hero-kicker { font-size: 1.02rem; }
.cover-tag, .mini-class, .hall-cards .mini-class, .campaign-cover .levels, .hall-campaign .levels { font-size: .92rem; }
.spell-card dt, .landing-stats dt { font: italic 400 .9rem var(--serif); text-transform: none; letter-spacing: 0; }

/* Capitular: la primera letra del título de cada página, en lacre con filo de latón. */
.site-heading h1::first-letter, .page-heading h1::first-letter {
  color: var(--wax-bright); font-size: 1.18em; text-shadow: 0 1px 0 #f3c76a66, 0 0 22px #b03a2e66; }

/* Cabecera con arte: una banda de la mesa detrás del título, que se funde con la madera. */
body.adventures-page, body.characters-page, body.compendium-page, body.library-page {
  background: linear-gradient(180deg, #17120e30 0, #17120e99 230px, var(--bg) 400px) 0 0 / 100% 100% no-repeat,
    linear-gradient(90deg, var(--bg) 12%, #17120ecc 42%, #17120e1a 80%) 0 0 / 100% 400px no-repeat,
    var(--band) 50% var(--band-y, -120px) / 100% auto no-repeat, var(--bg); }
.adventures-page { --band: url(/assets/portada-taberna.webp); }
.characters-page { --band: url(/assets/portada-heroe.webp); }
.compendium-page { --band: url(/assets/valdecuervo-santuario.webp); --band-y: -260px; }
.library-page { --band: url(/assets/valdecuervo-camino.webp); }
.site-heading p { color: #cdbfa6; }

/* Retratos en camafeo: los retratos de Atlas son medallones pintados sobre blanco; se recortan en círculo
   sobre un fondo de vela para que ninguna esquina blanca rompa la mesa. */
.hall-cards .mini-card img, .mini-card img { aspect-ratio: 1; object-fit: cover; object-position: 50% 50%; clip-path: circle(46% at 50% 50%); border-bottom: 0;
  padding: 10px 10px 0; background: none; }
.hall-cards .mini-card, .mini-card { background: radial-gradient(circle at 50% 34%, #3a2c1f 0, #241c15 46%, var(--panel) 70%); }
.mini-card:hover img { transform: scale(1.03); }
.library-page .library-section .portrait-asset img { aspect-ratio: 1; object-position: 50% 50%; clip-path: circle(46% at 50% 50%); padding: 8px; }
.library-page .library-section .portrait-asset { background: radial-gradient(circle at 50% 30%, #3a2c1f, var(--panel) 62%); }

/* Pie: sin eslogan. */
body > footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); letter-spacing: 0; font: italic .95rem var(--serif); }
body > footer a { color: var(--muted); }
body > footer a:hover { color: var(--text); }
.room-page > footer, .join-page > footer { display: none; }

/* La invitación es para quien llega: sin el menú de quien prepara aventuras. */
.join-page .studio-nav, .join-page #join-button, .join-page #connection, .join-page #tables-pill { display: none; }

/* Móvil: el menú se desliza en una fila en vez de cortarse. */
@media (max-width: 760px) {
  .studio-nav { order: 3; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .studio-nav::-webkit-scrollbar { display: none; }
  .studio-nav a { flex: none; padding: 0 12px; }
  .studio-nav a[aria-current=page]::after { bottom: 0; width: 6px; height: 6px; margin-left: -3px; }
  body.adventures-page, body.characters-page, body.compendium-page, body.library-page { background-size: 100% 100%, 100% 400px, auto 400px, auto; background-position: 0 0, 0 0, 50% 60px, 0 0; }
}

/* Aventuras: el cuerpo de la tarjeta empuja los botones al pie, para que las tres campañas se lean a la misma altura. */
.cover-body { flex: 1; }
.cover-actions { margin-top: auto; padding-top: 10px; }
.cover-facts { color: #c9beac; font-size: .88rem; }
.cover-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 2px 0 0 !important; }
.cover-chips i { font: italic .84rem var(--serif); padding: 1px 9px; border-radius: 999px; color: var(--rubric); border: 1px solid #d8b87833; background: #d8b8780d; }
.adventures-page .cover-card.ghost { min-height: 0; }
.adventures-page .cover-grid:has(> .cover-card.ghost) { align-items: start; }

/* Archivo vacío: la galería de clases como invitación, no un recuadro punteado. */
.empty-roster { border: 0; padding: 40px 24px 48px; background: radial-gradient(ellipse 60% 70% at 50% 40%, #2c231b, transparent 70%); }
.roster-fan { display: flex; justify-content: center; margin: 0 auto 26px; }
.roster-fan img { width: 112px; aspect-ratio: 1; object-fit: cover; clip-path: circle(46%); margin: 0 -14px; transform: translateY(calc(var(--lift, 0) * 1px)) rotate(calc(var(--turn, 0) * 1deg)); filter: saturate(.85) brightness(.92); }
.roster-fan img:nth-child(1) { --turn: -14; --lift: 26; } .roster-fan img:nth-child(2) { --turn: -9; --lift: 11; } .roster-fan img:nth-child(3) { --turn: -4; --lift: 3; }
.roster-fan img:nth-child(4) { --turn: 0; --lift: 0; width: 132px; z-index: 1; filter: none; }
.roster-fan img:nth-child(5) { --turn: 4; --lift: 3; } .roster-fan img:nth-child(6) { --turn: 9; --lift: 11; } .roster-fan img:nth-child(7) { --turn: 14; --lift: 26; }
.roster-fan img:nth-child(-n+3) { z-index: 0; } .roster-fan img:nth-child(n+5) { z-index: 0; }
@media (max-width: 560px) { .roster-fan img { width: 74px; margin: 0 -12px; } .roster-fan img:nth-child(4) { width: 90px; } .roster-fan img:nth-child(1), .roster-fan img:nth-child(7) { display: none; } }

/* ——— Mesa: nombres que no se pisan y pestañas del panel con aire ——— */
.map-token .token-name.full { display: none; }
.map-token:hover .token-name.short, .map-token.selected .token-name.short { display: none; }
.map-token:hover .token-name.full, .map-token.selected .token-name.full { display: inline; }
.map-token:hover, .map-token.selected { isolation: isolate; }
.room-page .dock-tabs { display: flex; justify-content: space-between; gap: 0; overflow-x: auto; scrollbar-width: none; padding: 0 4px; }
.room-page .dock-tabs::-webkit-scrollbar { display: none; }
.room-page .dock-tabs button { flex: none; padding: 6px 4px; font-size: .84rem; }

/* ——— Biblioteca: buscar arriba, subir en su propia bandeja; etiquetas en rúbrica ——— */
.library-toolbar { display: grid; grid-template-columns: auto minmax(0, 1fr) 200px auto; align-items: center; gap: 12px; }
.library-toolbar .library-upload { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--sunken); }
.library-toolbar .library-upload select { width: 170px; }
.library-toolbar .library-upload .upload-label { margin: 0; }
.library-toolbar #library-usage { margin-left: auto; }
.library-toolbar select { width: auto; }
.resource-tabs button[aria-pressed=true] { background: var(--raised); border-color: #d9a44166; color: var(--text); box-shadow: inset 0 -2px var(--gold); }
.asset-info > small { font: italic .88rem var(--serif); letter-spacing: 0; color: var(--rubric); }
.cover-card img { filter: sepia(.1) brightness(.93); }
.cover-card:hover img { filter: none; }
@media (max-width: 760px) {
  .library-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .library-toolbar .resource-tabs, .library-toolbar > input { grid-column: 1 / -1; }
  .library-toolbar .library-upload { grid-row: auto; flex-wrap: wrap; }
  .library-toolbar #library-usage { margin-left: 0; flex-basis: 100%; }
}
@media (max-width: 760px) {
  .room-page .board-actions { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); padding-right: 28px; }
}

/* ——— Lo que más ve el jugador (14 oct 2026) ——— */
/* La mesa no cambia el nombre de la ficha al seleccionarla: el nombre entero, solo al señalarla. */
.map-token.selected .token-name.short { display: inline; }
.map-token.selected .token-name.full { display: none; }
.map-token:hover .token-name.short { display: none; }
.map-token:hover .token-name.full { display: inline; }

/* Ficha en el panel: cabecera compacta, fichas de datos en madera (no pegatinas de papel) y las seis pestañas a la vista. */
.dock-content .sh-head { gap: 4px 14px; padding-bottom: 12px; }
.dock-content .sh-portrait { width: 56px; height: 68px; }
.dock-content .sh-tiles { gap: 5px; margin-top: 4px; }
.dock-content .sh-tile, .dock-content .sh-tile.ac { min-width: 0; padding: 5px 4px; background: var(--raised); border: 1px solid var(--edge-soft); border-radius: 7px; }
.dock-content .sh-tile b { font-size: 1.12rem; color: var(--text); }
.dock-content .sh-tile.ac b { color: var(--gold); }
.dock-content .sh-tile b i { color: var(--muted); }
.sh-tile small, .dock-content .sh-tile small, .dock-content .sh-tile.ac small { font: italic .76rem var(--serif); letter-spacing: 0; text-transform: none; color: var(--muted); text-align: center; line-height: 1.15; }
.dock-content .sh-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; overflow: visible; position: sticky; top: -1px; z-index: 2; background: #1b1510; padding-top: 4px; }
.dock-content .sh-tabs button { padding: 7px 4px; font-size: .86rem; border-radius: 6px 6px 0 0; }
.dock-content .spells .spell-head span { color: var(--muted); }
.dock-content .spells .spell-head b { color: var(--gold); font-size: 1.05rem; }
/* Etiquetas de la ficha y de los diálogos de ataque y conjuro: rúbricas, no versalitas. */
.spell-group h4, .sh-dl dt, .ab-head small, .sh-features li b, .sh-persona small, .attack-section h3, .dice-result small.dice-label, .prep-level {
  font-family: var(--serif); font-style: italic; text-transform: none; letter-spacing: 0; }
.attack-section h3 { font-size: .98rem; color: var(--rubric); }
.ab-head small { font-size: .82rem; }
.sh-features li b { font-size: .86rem; }
.spell-group h4 { font-size: .95rem; }
.cast-meta span { font: italic .84rem var(--serif); letter-spacing: 0; text-transform: none; }

/* Móvil del jugador: una sola navegación y los dados solo donde se tira. */
@media (max-width: 600px) {
  /* La barra inferior ya lleva Chat, Ficha, Pistas y Campaña: arriba quedan solo los que no tienen sitio abajo. */
  .room-page .dock-tabs [data-dock="chat"], .room-page .dock-tabs [data-dock="notes"], .room-page .dock-tabs [data-dock="clues"], .room-page .dock-tabs [data-dock="world"] { display: none; }
  .room-page:not(.role-player) .dock-tabs [data-dock="people"], .room-page.role-player:not(:has(.mobile-table-nav [data-mobile-panel="turn"])) .dock-tabs [data-dock="people"] { display: none; }
  .room-page .dock-tabs { justify-content: flex-start; gap: 6px; padding: 0 8px; }
  .room-page .dock-tabs button { font-size: .9rem; color: var(--muted); }
  .room-page:not(.mobile-turn):not(.mobile-people) .game-dock .dice-tray { display: none; }
  .room-page .game-dock { margin-bottom: 64px; }
}

/* Bandeja de dados en escritorio: dos filas en lugar de tres, para que la ficha y el chat respiren.
   Arriba los dados; abajo cuántos, el modificador y el modo, en línea. Las tiradas guardadas, encima, en una tira fina. */
@media (min-width: 601px) {
  .room-page .game-dock .dice-tray { padding: 8px 10px; }
  .room-page .game-dock .macro-bar { padding-bottom: 6px; }
  .room-page .game-dock .macro-bar .macro { padding: 3px 9px; min-height: 30px; }
  .room-page .game-dock .dice-buttons button { min-height: 0; padding: 4px 0 2px; font-size: .7rem; }
  .room-page .game-dock .dice-buttons .die-shape { width: 18px; height: 18px; }
  .room-page .game-dock .dice-options { grid-template-columns: auto auto 1fr; margin-top: 6px; }
  .room-page .game-dock .dice-options label { flex-direction: row; align-items: center; gap: 6px; font: italic .82rem var(--serif); color: var(--muted); }
  .room-page .game-dock .dice-options input { width: 48px; min-height: 28px; padding: 2px 6px; }
  .room-page .game-dock .dice-options select { min-height: 28px; padding: 2px 6px; }
}

/* Panel «Turno» del móvil: los botones de vida parecen botones, con el daño en lacre y la cura en verdín. */
.turn-card .turn-hp .row button { background: var(--sunken); border: 1px solid var(--edge-soft); border-radius: 8px; font: 600 1rem var(--sans); }
.turn-card .turn-hp .row button[data-delta^="-"] { color: #ec9c8c; border-color: #b03a2e55; }
.turn-card .turn-hp .row button:not([data-delta^="-"]) { color: #a8d4c1; border-color: #6aa58c55; }
.turn-dice h3, .turn-order h3, .turn-party h3 { font: italic 500 1.05rem var(--serif); color: var(--rubric); }
@media (max-width: 600px) {
  /* En el mapa, la cinta del jugador se queda en una línea: lo que le queda del turno ya está en «Turno». */
  .room-page.role-player .turn-strip.mine .economy, .room-page.role-player .turn-strip.mine .turn-menu-wrap { display: none; }
  .room-page.role-player .turn-strip.mine { min-height: 48px; padding: 6px 10px; }
  .room-page.role-player .turn-strip.mine #end-turn, .room-page.role-player .turn-strip.mine .end-turn { margin-left: auto; }
}

/* Portada pública: las doce clases también en camafeo, con el nombre debajo y no sobre una esquina blanca. */
.legend { aspect-ratio: auto; padding: 12px 12px 0; background: radial-gradient(circle at 50% 38%, #3a2c1f, #211a14 62%); }
.legend img { height: auto; aspect-ratio: 1; object-position: 50% 50%; clip-path: circle(47% at 50% 50%); }
.legend figcaption { position: static; padding: 6px 6px 14px; background: none; }

/* Elegir personaje al llegar a la mesa: retratos en camafeo, como en el resto. */
.claim-card { background: radial-gradient(circle at 50% 36%, #3a2c1f, var(--panel) 66%); }
.claim-card img { aspect-ratio: 1; object-position: 50% 50%; clip-path: circle(46% at 50% 50%); padding: 8px 8px 0; }

/* Biblioteca: lo de la primera aventura, plegado al final. */
.library-section.old { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--edge-soft); }
.library-section.old > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; cursor: pointer; list-style: none; }
.library-section.old > summary::-webkit-details-marker { display: none; }
.library-section.old > summary h2 { margin: 0; color: var(--muted); }
.library-section.old > summary h2::before { content: '▸ '; color: var(--rubric); }
.library-section.old[open] > summary h2::before { content: '▾ '; }
.library-section.old > summary .muted { font: italic .92rem var(--serif); }
.library-section.old[open] > summary { margin-bottom: 18px; }

/* Ajustes: el índice y las filas alineados con el título de la página, no flotando a media pantalla. */
.settings:not(.in-table) { max-width: 1320px; grid-template-columns: 190px minmax(0, 820px); }
.settings-nav a[aria-current=true], .settings-nav a.active { color: var(--text); border-left-color: var(--gold); }

/* Administración: superficies por tono (sin el marco de tarjeta), botones con aire y cifras del mismo latón que el resto. */
.admin-page .surface { border-color: transparent; background: var(--panel); }
.admin-page .surface form > .row, .admin-page .surface > .row { margin-top: 12px; }
.admin-page .surface h2 { font-size: 1.3rem; }
.admin-stats .stat b { color: #f0d8a8; }

/* ——— Instalada en iPhone (barra de estado translúcida) y con muesca en horizontal: nada bajo la muesca ni la raya de inicio ——— */
:root { --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); }
body > header { height: calc(64px + var(--sat)); padding-top: var(--sat);
  padding-left: max(20px, calc((100vw - 1320px) / 2), var(--sal)); padding-right: max(20px, calc((100vw - 1320px) / 2), var(--sar)); }
.room-page .board { padding-top: calc(6px + var(--sat)); padding-left: max(8px, var(--sal)); padding-right: max(8px, var(--sar)); padding-bottom: var(--sab); }
#notice { margin-bottom: var(--sab); }
@media (max-width: 760px) {
  body > header { height: auto; padding-top: calc(8px + var(--sat)); padding-left: max(14px, var(--sal)); padding-right: max(14px, var(--sar)); }
}
@media (max-width: 600px) {
  .mobile-table-nav { padding-bottom: calc(8px + var(--sab)) !important; padding-left: var(--sal); padding-right: var(--sar); }
  .room-page .game-dock { margin-bottom: calc(64px + var(--sab)); }
}

/* Hoja de instalación */
.install-sheet { display: grid; gap: 14px; max-width: 52ch; }
.install-steps { margin: 0; padding-left: 1.4em; display: grid; gap: 10px; font-size: 1.02rem; line-height: 1.45; }
.install-steps b { color: var(--text); }
.ios-share { width: 1em; height: 1.2em; vertical-align: -.2em; color: #6aa8ff; }
.install-note { padding: 12px 14px; border-radius: 10px; background: var(--sunken); border-left: 3px solid var(--gold); }
.install-note p { margin: 0 0 10px; }
.install-note .row { display: flex; gap: 8px; }
.install-note input { flex: 1; min-width: 0; font-size: .85rem; }
/* Móvil: la marca, Instalar, Unirme y la cuenta caben en una fila. */
.install-button { border: 1px solid #6aa58c55; color: #a8d4c1; background: #6aa58c14; }
@media (max-width: 760px) {
  .wide-only { display: none; }
  body > header .brand { font-size: 1.05rem; }
  .header-tools { gap: 6px; margin-left: auto; }
  .header-tools button { padding: 6px 10px; }
}

/* La mesa en movimiento: rastro de quien se mueve, anillo del turno y avisos de estado sobre la ficha. */
.move-trail { stroke: #f0d8a8; stroke-width: 3; stroke-dasharray: 2 9; stroke-linecap: round; pointer-events: none; }
.turn-pulse { fill: none; stroke: var(--gold); stroke-width: 4; pointer-events: none; filter: drop-shadow(0 0 6px #d9a441aa); }
.fx-note { font-size: 13px; font-weight: 600; }
/* Tira de avisos sobre el mapa: lo último que ha pasado, legible sobre cualquier mapa y sin tapar las fichas. */
.map-workspace { position: relative; }
.map-ticker { position: absolute; z-index: 6; left: 50%; bottom: 52px; transform: translateX(-50%); width: min(560px, calc(100% - 140px));
  display: grid; gap: 5px; justify-items: center; pointer-events: none; }
.map-ticker p { margin: 0; max-width: 100%; padding: 6px 14px; border-radius: 999px; background: #120e0ae6; border: 1px solid #d9a44144;
  color: var(--text); font: 500 .9rem/1.35 var(--sans); text-align: center; box-shadow: 0 6px 18px #0008; overflow-wrap: anywhere; }
.map-ticker p:last-child { border-color: #d9a44199; }
@media (max-width: 600px) {
  .map-ticker { bottom: auto; top: 58px; width: calc(100% - 72px); left: calc(50% + 28px); }
  .map-ticker p { font-size: .8rem; padding: 5px 10px; }
}

/* Cabecera de la mesa ordenada (19 oct 2026): tres grupos separados por un filete (quién está, jugar, administrar).
   Los botones secundarios llevan icono; por debajo de 1600 px queda solo el icono y el nombre va en el título. */
.room-page .board-actions .ba-group { display: flex; align-items: center; gap: 2px; }
.room-page .board-actions .ba-group + .ba-group { padding-left: 8px; margin-left: 4px; border-left: 1px solid var(--edge-soft); }
.room-page .board-actions .ba-icon { color: var(--gold-deep); margin-right: 5px; }
.room-page .view-as { display: inline-flex; align-items: center; gap: 4px; }
.room-page .view-as > .ba-icon { display: none; }
@media (max-width: 1600px) {
  .room-page .board-actions .ba-play .ba-label, .room-page .view-as > .ba-label { display: none; }
  .room-page .board-actions .ba-play .ba-icon { margin-right: 0; font-size: 1.05rem; }
  .room-page .view-as > .ba-icon { display: inline; }
}

/* Mesa sencilla (19 oct 2026): lo esencial a la vista, lo demás a un toque. */
.room-page .rail-prep { display: contents; }
.room-page .rail-prep[hidden] { display: none; }
.room-page .rail-prep-toggle { border-top: 1px solid var(--edge-soft); margin-top: 4px; padding-top: 8px; }
.room-page .rail-prep-toggle small { white-space: nowrap; }
.room-page .map-help-idle:empty { display: none; }
.room-page .map-grid-info:empty { display: none; }
.room-page .game-dock .dice-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: stretch; }
.room-page .game-dock .dice-more { min-width: 40px; padding: 0 8px; font-size: .84rem; color: var(--muted); white-space: nowrap; }
.room-page .game-dock .dice-more[aria-expanded=true] { color: var(--gold); }
.room-page .game-dock .dice-options[hidden] { display: none; }
.room-page .game-dock .macro-tools { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.room-page .game-dock .macro-tools .macro { min-height: 30px; padding: 3px 10px; font-size: .84rem; }
.room-page .focus-bar.compact .focus-amount,
.room-page .focus-bar.compact #focus-temp-hp:not(.has-temp),
.room-page .focus-bar.compact .focus-elevation[role=group]:not(.raised) { display: none; }
.room-page .focus-bar.compact button.focus-light:not(.lit) { display: none; }
.room-page .focus-bar .focus-more { color: var(--muted); }
/* La tira del registro no tapa la ficha seleccionada, y enseña como mucho las dos últimas líneas. */
.room-page .map-stage:has(.focus-bar) .map-ticker { bottom: 128px; }
.room-page .map-ticker p:not(:nth-last-child(-n+2)) { display: none; }
.room-page .game-dock .dice-row .dice-buttons { order: 0; flex-basis: auto; }
