/* D-BARRA-INFERIOR (claude/_CLAUDE_D_BARRA_INFERIOR_MESA.md) — la franja de abajo: las pestañas del chat en el sitio del título
   (D-BI-1/2/4), «tu grupo» a la izquierda (D-BI-5/6/7) y «lo que pasa» a la derecha (D-BI-8/9/10), en los dos estilos (D-BI-12),
   sin scroll a 1280×720 ni a 1920×1080 (D-BI-13). En combate los dos huecos son del combate (D-BI-11).
   Va después de marco.css: los selectores llevan dos ids (#rpg-root …) para ganar a los suyos sin !important. */

/* ───────── El chat: las pestañas donde iba el título (D-BI-1) ───────── */

#rpg-root #chatCabecera {
  align-items: flex-end;
  min-height: 0;
  margin: 0 0 6px;
  border-bottom: 1px solid rgba(200, 168, 96, 0.4);
}
@media (min-width: 1001px) {
  #rpg-root #chatCabecera > h2 { display: none; }
}
#rpg-root #chatCabecera .chat-canales,
#rpg-root #chatCabecera .cv-chat-pestanas { margin: 0; gap: 4px; align-items: flex-end; }

#rpg-root #chroniclesSection .chat-canales button,
#rpg-root #chroniclesSection .cv-chat-pestanas button {
  position: relative;
  margin-bottom: -1px;
  padding: 4px 18px 3px;
  font-family: 'Germania One', var(--ui-fuente-titulo) !important;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #8d8773;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}
/* La hoja vieja (v2-theme) pone su fuente a todo con !important: los hijos de la pestaña heredan la de la pestaña. */
#rpg-root #chroniclesSection .chat-canales button > :not(.cv-cnt),
#rpg-root #chroniclesSection .cv-chat-pestanas button > :not(.cv-cnt) { font-family: inherit !important; }
#rpg-root #chroniclesSection .chat-canales button:hover,
#rpg-root #chroniclesSection .cv-chat-pestanas button:hover { color: #d9c690; }
#rpg-root #chroniclesSection .chat-canales button.on,
#rpg-root #chroniclesSection .cv-chat-pestanas button.on {
  color: #f3dfa0;
  background: linear-gradient(180deg, rgba(200, 168, 96, 0.2), rgba(12, 10, 8, 0.6));
  border-color: rgba(200, 168, 96, 0.6);
  box-shadow: inset 0 1px 0 rgba(243, 223, 160, 0.25);
}
/* D-BI-2 — el sin leer: un círculo rojo arriba a la derecha del rótulo */
#rpg-root #chroniclesSection .chat-canales .cv-cnt,
#rpg-root #chroniclesSection .cv-chat-pestanas .cv-cnt {
  position: absolute;
  top: -5px;
  right: 0;
  min-width: 17px;
  height: 17px;
  margin: 0;
  padding: 0 4px;
  border-radius: 9px;
  background: #c0392b;
  box-shadow: 0 0 0 2px #0d0b08;
  color: #fff;
  font-family: var(--ui-fuente-texto) !important;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
/* D-BI-13 — la lista de en línea no se desplaza: recorta */
#rpg-root #onlineUsersContainer { overflow: hidden; align-self: center; }

/* ───────── Los dos laterales ───────── */

#rpg-root .bi-pie {
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 16px;
  overflow: hidden;
}
/* La hoja vieja (v2-theme) pone su fuente medieval a todo con !important: aquí, la del texto y sin mayúsculas (el nombre, aparte). */
#rpg-root .bi-pie,
#rpg-root .bi-pie *:not(.ui-pie__nombre):not(.ui-pie__nombre *) { font-family: var(--ui-fuente-texto) !important; text-transform: none !important; }
#rpg-root .bi-pie button { min-height: 0 !important; min-width: 0 !important; line-height: inherit; }
#rpg-root .bi-pie button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
#rpg-root .bi-pie img { display: block; }

/* El retrato redondo, con aro dorado (A) */
#rpg-root .bi-retrato {
  flex: none;
  display: block;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  background: #120f0b;
  border: 2px solid var(--ui-acento) !important;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.7), 0 0 10px rgba(200, 168, 96, 0.35);
}
#rpg-root .bi-retrato img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
#rpg-root button.bi-retrato:hover,
#rpg-root .bi-miembro:hover .bi-retrato { border-color: var(--ui-acento-luz) !important; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.7), 0 0 14px rgba(243, 223, 160, 0.55); }

/* D-BI-5 — el líder */
#rpg-root .bi-lider { display: flex; align-items: center; gap: 12px; min-width: 0; flex: none; }
#rpg-root .bi-lider__datos { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
#rpg-root .bi-pie .ui-pie__nombre,
#rpg-root .bi-pie .ui-pie__nombre * { font-family: 'Germania One', var(--ui-fuente-titulo) !important; font-weight: 400; font-size: 24px; line-height: 1.05; letter-spacing: 0.04em; }
#rpg-root .bi-lider__linea { display: flex; align-items: baseline; gap: 5px; min-width: 0; white-space: nowrap; overflow: hidden; }
#rpg-root .bi-lider__linea > * { flex: none; }
#rpg-root .bi-lider__clase { flex: 0 1 auto !important; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ui-tinta-1); }
#rpg-root .bi-lider__clase:not(:empty)::after { content: " ·"; color: var(--ui-tinta-2); }
#rpg-root .bi-lider__linea .ui-pie__valor { font-size: 13px; }
#rpg-root .bi-lider__linea .ui-pie__rotulo { font-size: 10px; }
#rpg-root .bi-lider .ui-barra { margin-top: 2px; max-width: 260px; }

/* D-BI-6 — los compañeros */
#rpg-root .bi-grupo { display: flex; gap: 10px; min-width: 0; flex: none; }
#rpg-root .bi-miembro { flex: 0 1 84px; min-width: 0; display: flex !important; flex-direction: column; align-items: center; gap: 3px; }
#rpg-root .bi-miembro .bi-retrato { width: 44px; height: 44px; }
#rpg-root .bi-miembro__nombre { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; color: var(--ui-tinta-0); }
#rpg-root .bi-miembro--caido { opacity: 0.5; filter: grayscale(0.8); }
#rpg-root .bi-barra { display: block; width: 100%; height: 4px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5); }
#rpg-root .bi-barra > span { display: block; height: 100%; }
#rpg-root .bi-barra--vida > span { background: linear-gradient(90deg, #8f1d1d, #d9402f); }
#rpg-root .bi-barra--mana > span { background: linear-gradient(90deg, #1d4f9f, #3f92e6); }
#rpg-root .bi-barra--sin { visibility: hidden; }
#rpg-root .bi-vacio { font-size: 12px; color: var(--ui-tinta-2); font-style: italic; }

/* D-BI-7 — los estados */
#rpg-root .bi-estados { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; margin-top: auto; max-height: 22px; overflow: hidden; }
#rpg-root .bi-estado {
  padding: 1px 9px;
  border: 1px solid rgba(200, 168, 96, 0.5);
  border-radius: 10px;
  font-size: 11px;
  line-height: 16px;
  color: var(--ui-tinta-0);
  background: rgba(0, 0, 0, 0.3);
  cursor: help;
  white-space: nowrap;
}
#rpg-root .bi-estado--bueno { border-color: rgba(120, 180, 110, 0.6); color: #cfe8c4; }
#rpg-root .bi-estado--aviso { border-color: rgba(230, 150, 70, 0.7); color: #f6cf9f; }
#rpg-root .bi-estado--malo { border-color: rgba(210, 70, 60, 0.8); color: #f3b3aa; }
#rpg-root .bi-estado--mana { border-color: rgba(80, 140, 220, 0.7); color: #b9d4f7; }

/* D-BI-8 — el platino y los materiales */
#rpg-root .bi-recursos { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; flex: none; }
#rpg-root .bi-materiales { display: contents; }
#rpg-root .bi-chapa {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px 0 5px !important;
  border: 1px solid rgba(200, 168, 96, 0.5) !important;
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.35) !important;
  font-family: var(--ui-fuente-texto) !important;
  font-size: 14px;
  font-weight: 700;
  color: var(--ui-tinta-0);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#rpg-root .bi-chapa img { width: 22px; height: 22px; object-fit: contain; }
#rpg-root .bi-chapa--pp { gap: 6px; padding-left: 4px !important; }
#rpg-root .bi-chapa--pp .ui-recurso__moneda { width: 20px; height: 20px; }
#rpg-root .bi-chapa--cero { opacity: 0.55; }
#rpg-root button.bi-chapa:hover { border-color: var(--ui-acento-luz) !important; }

/* D-BI-9 — los relojes */
#rpg-root .bi-relojes { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 0; overflow: hidden; }
#rpg-root .bi-reloj {
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 4px 9px !important;
  border: 1px solid rgba(200, 168, 96, 0.24) !important;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3) !important;
  font-size: 13px;
  line-height: 16px;
}
#rpg-root button.bi-reloj:hover { border-color: rgba(243, 223, 160, 0.6) !important; background: rgba(200, 168, 96, 0.08) !important; }
#rpg-root .bi-reloj__icono { grid-row: 1 / span 2; width: 22px; height: 22px; object-fit: contain; }
#rpg-root .bi-reloj__texto { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ui-tinta-0); }
#rpg-root .bi-reloj__valor { white-space: nowrap; font-weight: 700; color: var(--ui-acento-luz); font-variant-numeric: tabular-nums; }
#rpg-root .bi-reloj__barra { grid-column: 2 / 4; display: block; height: 3px; margin-top: 3px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, 0.08); }
#rpg-root .bi-reloj__barra > span { display: block; height: 100%; background: linear-gradient(90deg, #a08840, #f3dfa0); }
#rpg-root .bi-reloj--listo .bi-reloj__valor { color: #9be37f; }
#rpg-root .bi-reloj--vacio,
#rpg-root .bi-reloj--mas { display: block !important; cursor: default; background: transparent !important; border-style: dashed !important; color: var(--ui-tinta-2); }
#rpg-root .bi-reloj--vacio .bi-reloj__texto { display: block; color: var(--ui-tinta-1); }
#rpg-root .bi-reloj__pista { display: block; font-size: 11px; color: var(--ui-tinta-2); }
#rpg-root .bi-reloj--mas { padding: 1px 9px !important; font-size: 11px; text-align: right; border: 0 !important; }

/* D-BI-10 — dónde está el grupo */
#rpg-root .bi-lugar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; margin-top: auto; flex: none; font-size: 12px; color: var(--ui-tinta-1); }
#rpg-root .bi-lugar:empty { display: none; }
/* la versión del juego (fija abajo a la derecha) bajaba encima del lugar: con el marco, pegada al borde y más pequeña */
body.ui-marco-activo #v2FooterVersion { bottom: 1px; right: 4px; font-size: 9px; letter-spacing: 0.06em; opacity: 0.6; }
#rpg-root .bi-lugar { padding-bottom: 6px; }
#rpg-root .bi-lugar__texto { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#rpg-root .bi-lugar__texto b { color: var(--ui-acento-luz); font-weight: 700; }
#rpg-root .bi-lugar__nivel { color: var(--ui-tinta-2); }
#rpg-root .bi-lugar__atlas { flex: none; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; border: 1px solid rgba(200, 168, 96, 0.6) !important; }
#rpg-root .bi-lugar__atlas img { width: 100%; height: 100%; object-fit: cover; }
#rpg-root .bi-lugar__atlas:hover { border-color: var(--ui-acento-luz) !important; box-shadow: 0 0 8px rgba(243, 223, 160, 0.5); }

/* ───────── En combate (D-BI-11): el hueco es del combate ─────────
   El combate mete su pieza (.cv-franja-pieza, replay-adapter.jsx) en los dos huecos en las tres disposiciones; todo lo demás se aparta. */
#rpg-root .bi-pie:has(> .cv-franja-pieza) > :not(.cv-franja-pieza):not(.ui-esquina) { display: none !important; }
#rpg-root .bi-pie:has(> .cv-franja-pieza) { justify-content: center; }
#rpg-root .bi-pie > .cv-franja-pieza { width: 100%; min-height: 0; }

/* ───────── La franja baja (≤1500 de ancho o ≤860 de alto: 168 px, ui/tokens.css) ───────── */
@media (max-width: 1500px), (max-height: 860px) {
  #rpg-root .bi-pie { gap: 5px; padding: 7px 10px; }
  #rpg-root #chroniclesSection .chat-canales button,
  #rpg-root #chroniclesSection .cv-chat-pestanas button { font-size: 16px; padding: 2px 12px 2px; }
  #rpg-root #chatCabecera { margin-bottom: 4px; }
  #rpg-root .bi-retrato { width: 40px; height: 40px; }
  #rpg-root .bi-lider { gap: 8px; }
  #rpg-root .bi-pie .ui-pie__nombre,
  #rpg-root .bi-pie .ui-pie__nombre * { font-size: 18px; }
  #rpg-root .bi-lider__linea { font-size: 11px; }
  #rpg-root .bi-grupo { gap: 6px; }
  #rpg-root .bi-miembro { flex-basis: 60px; gap: 2px; }
  #rpg-root .bi-miembro .bi-retrato { width: 30px; height: 30px; border-width: 1px !important; }
  #rpg-root .bi-miembro__nombre { font-size: 10px; }
  #rpg-root .bi-barra { height: 3px; }
  #rpg-root .bi-miembro:nth-child(n + 5) { display: none !important; }
  #rpg-root .bi-estados { gap: 4px; max-height: 18px; }
  #rpg-root .bi-estado { font-size: 10px; line-height: 14px; padding: 1px 7px; }
  #rpg-root .bi-recursos { gap: 4px; }
  #rpg-root .bi-chapa { height: 22px; gap: 3px; padding: 0 7px 0 3px !important; font-size: 12px; }
  #rpg-root .bi-chapa img { width: 16px; height: 16px; }
  #rpg-root .bi-chapa--pp .ui-recurso__moneda { width: 15px; height: 15px; }
  #rpg-root .bi-relojes { gap: 3px; }
  #rpg-root .bi-reloj { grid-template-columns: 16px minmax(0, 1fr) auto; column-gap: 6px; padding: 2px 7px !important; font-size: 11px; line-height: 14px; }
  #rpg-root .bi-reloj__icono { width: 16px; height: 16px; }
  #rpg-root .bi-reloj__barra { height: 2px; margin-top: 1px; }
  #rpg-root .bi-reloj__pista { font-size: 10px; }
  #rpg-root .bi-lugar { font-size: 11px; gap: 6px; }
  #rpg-root .bi-lugar__atlas { width: 20px; height: 20px; }
}

/* ───────── Estrecho (≤1000 px, D-UI-M-14): sólo nombre, nivel y platino, como antes ───────── */
@media (max-width: 1000px) {
  #rpg-root .bi-pie { flex-direction: row; align-items: center; padding: 4px 12px; }
  #rpg-root .bi-grupo,
  #rpg-root .bi-estados,
  #rpg-root .bi-materiales,
  #rpg-root .bi-relojes,
  #rpg-root .bi-lugar,
  #rpg-root .bi-retrato--lider,
  #rpg-root .bi-lider__clase { display: none !important; }
  #rpg-root .bi-pie .ui-pie__fila--tenue.bi-lider__linea { display: flex; }
  #rpg-root .bi-lider__linea > :nth-child(n + 4) { display: none; }
  #rpg-root .bi-pie .ui-pie__nombre,
  #rpg-root .bi-pie .ui-pie__nombre * { font-size: var(--ui-letra-m); }
  #rpg-root .bi-chapa { height: 24px; border: 0 !important; background: none !important; }
}

/* ═════════ B · Estandartes (D-BI-12) ═════════ */
html[data-estilo-marco="B"] #rpg-root #chatCabecera { border-bottom: 2px solid #6b2418; box-shadow: 0 1px 0 rgba(233, 196, 106, 0.35); }
html[data-estilo-marco="B"] #rpg-root #chroniclesSection .chat-canales button,
html[data-estilo-marco="B"] #rpg-root #chroniclesSection .cv-chat-pestanas button { border-radius: 0; color: #a68f72; }
html[data-estilo-marco="B"] #rpg-root #chroniclesSection .chat-canales button.on,
html[data-estilo-marco="B"] #rpg-root #chroniclesSection .cv-chat-pestanas button.on {
  color: #fff3c4;
  background: linear-gradient(180deg, #7a2a1c, #3a120c);
  border-color: #e9c46a;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5);
}
html[data-estilo-marco="B"] #rpg-root .bi-retrato {
  border-color: #9a2c1c !important;
  box-shadow: 0 0 0 1px #e9c46a, 0 0 0 3px rgba(0, 0, 0, 0.7), 0 0 12px rgba(233, 150, 64, 0.3);
}
html[data-estilo-marco="B"] #rpg-root button.bi-retrato:hover,
html[data-estilo-marco="B"] #rpg-root .bi-miembro:hover .bi-retrato { border-color: #e9c46a !important; }
html[data-estilo-marco="B"] #rpg-root .bi-chapa,
html[data-estilo-marco="B"] #rpg-root .bi-reloj:not(.bi-reloj--mas),
html[data-estilo-marco="B"] #rpg-root .bi-estado {
  border-radius: 0;
  border-color: rgba(154, 44, 28, 0.8) !important;
  background: linear-gradient(180deg, rgba(70, 18, 12, 0.6), rgba(20, 8, 6, 0.7)) !important;
}
html[data-estilo-marco="B"] #rpg-root .bi-reloj:not(.bi-reloj--mas) { border-left: 3px solid #9a2c1c !important; }
html[data-estilo-marco="B"] #rpg-root .bi-reloj__barra > span { background: linear-gradient(90deg, #9a2c1c, #e9c46a); }
html[data-estilo-marco="B"] #rpg-root .bi-reloj__valor,
html[data-estilo-marco="B"] #rpg-root .bi-lugar__texto b { color: #e9c46a; }
html[data-estilo-marco="B"] #rpg-root .bi-lugar__atlas { border-radius: 0; border-color: #9a2c1c !important; box-shadow: 0 0 0 1px rgba(233, 196, 106, 0.5); }
html[data-estilo-marco="B"] #rpg-root .bi-estado--bueno { color: #d6ecc9; }
html[data-estilo-marco="B"] #rpg-root .bi-estado--aviso { color: #f6cf9f; }
html[data-estilo-marco="B"] #rpg-root .bi-estado--malo { color: #f3b3aa; }
html[data-estilo-marco="B"] #rpg-root .bi-estado--mana { color: #b9d4f7; }
