/* =====================================================================
   Farmermon: la página pública (/farmermon, clases fm-*) y el panel del clan
   (/farmermon/clan, clases fx-* y farm-*), en el mundo del bastión.
   ===================================================================== */

/* ---------- Página pública ---------- */
.fm-cab-in { align-items: center; }
.fm-lema { margin: 10px 0 0; font-family: var(--pixel); font-size: 24px; color: var(--oro-claro); text-shadow: .125em .125em 0 var(--oro-hondo); }
.fm-acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.fm-cofre { flex: none; width: 216px; padding: 12px; }
.fm-cofre .mc-panel-titulo { margin-bottom: 8px; }
.fm-cofre-rejilla { display: grid; grid-template-columns: repeat(3, 60px); gap: 4px; }
.fm-cofre-rejilla .mc-slot { position: relative; width: 60px; height: 60px; }
.fm-cofre-rejilla .mc-slot img { width: 40px; height: 40px; }
.fm-tolva { box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--pz-5), 0 0 0 2px var(--oro) !important; }
.fm-proyectos { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.fm-proyecto { position: relative; display: flex; flex-direction: column; gap: 12px; scroll-margin-top: calc(var(--barra-alto) + 16px); }
.fm-proyecto-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.fm-proyecto-cab h3 { margin: 0; font-family: var(--pixel); font-size: 24px; font-weight: 400; line-height: 1.15; color: #fff; text-shadow: .125em .125em 0 #3f3f3f; overflow-wrap: anywhere; }
.fm-proyecto-cab .fm-proyecto-sin { color: var(--tinta-3); }
.fm-objetos { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.fm-objetos .mc-slot { position: relative; }
.fm-objetos .hecho img { opacity: .45; }
.fm-objetos .hecho::after, .farm-slot-hecho::after {
  content: ""; position: absolute; right: 3px; bottom: 3px; width: 12px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 6' shape-rendering='crispEdges'%3E%3Cpath fill='%236fdc7e' d='M6 0h1v2H6zM5 2h1v1H5zM4 3h1v1H4zM3 4h1v1H3zM2 5h1v1H2zM1 4h1v1H1zM0 3h1v1H0z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.fm-mas { font-family: var(--pixel); font-size: 16px; color: var(--tinta-3); }
.fm-cifras { display: flex; justify-content: space-between; gap: 10px; margin: 0; color: var(--tinta-2); font-size: 14px; }
.fm-cifras b { font-family: var(--pixel); font-size: 16px; font-weight: 400; color: var(--oro-claro); white-space: nowrap; }
.fm-proyecto.hecho .bd-game-progress > i { background: linear-gradient(180deg, #a9f5b4 0 3px, var(--verde) 3px 9px, #2f8f40 9px); }
.fm-proyecto-pie { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 2px solid var(--pz-3); }
.fm-dos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.fm-titulo { margin: 0; font-family: var(--pixel); font-size: 24px; font-weight: 400; color: #fff; text-shadow: .125em .125em 0 #3f3f3f; }
.fm-nota { margin: 14px 0 0; color: var(--tinta-2); font-size: 14px; }
.fm-enlace { display: inline-block; margin-top: 12px; color: var(--oro-claro); font-size: 15px; }
.fm-requisitos { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.fm-requisitos li { display: flex; align-items: center; gap: 12px; color: var(--tinta-2); }
.fm-requisitos .mc-slot { width: 40px; height: 40px; }
.fm-requisitos .mc-slot img { width: 24px; height: 24px; }
.fm-requisitos strong, .fm-unete code { color: #fff; }
.fm-unete .fm-acciones { margin-top: 18px; }

/* ---------- Piezas compartidas ---------- */
.farm-slot {
  position: relative; display: inline-grid; place-items: center; flex: none; width: 56px; height: 56px; box-sizing: border-box;
  background: var(--pz-0); box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--pz-5);
}
.farm-slot img { width: 40px; height: 40px; image-rendering: pixelated; }
.farm-slot-sm { width: 48px; height: 48px; }
.farm-slot-sm img { width: 32px; height: 32px; }
.farm-slot-xs { width: 40px; height: 40px; }
.farm-slot-xs img { width: 24px; height: 24px; }
.farm-cantidad { position: absolute; right: 3px; bottom: 1px; font-family: var(--pixel); font-size: 16px; line-height: 1; color: #fff; text-shadow: .125em .125em 0 #3f3f3f; }
.farm-cabeza { image-rendering: pixelated; box-shadow: 0 0 0 2px #000; border-radius: 0 !important; }
.farm-xp { position: relative; height: 14px; background: #000; box-shadow: inset 0 0 0 2px #000; overflow: hidden; }
.farm-xp-relleno { width: var(--p, 0%); height: 100%; background: linear-gradient(180deg, var(--oro-claro) 0 3px, var(--oro) 3px 9px, var(--oro-oscuro) 9px); box-shadow: inset 0 0 0 2px #000; }
.farm-xp::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(0, 0, 0, .75) calc(10% - 2px) 10%); }
.farm-xp-mini { height: 10px; }
.farm-nivel { font-family: var(--pixel); color: var(--verde); text-shadow: .125em .125em 0 #12301a; }
.farm-etq { display: block; min-width: 0; font-family: var(--pixel); font-size: 16px; color: var(--tinta-2); }
.farm-etq input, .farm-etq select, .farm-etq textarea { font-family: var(--lectura); margin-top: 6px; }
.farm-ayuda { display: block; color: var(--tinta-3); font-family: var(--lectura); font-size: 13px; }
.farm-ayuda:empty { display: none; }
.farm-ayuda-mal { color: var(--rojo-claro) !important; font-weight: 700; }
.farm-campo { width: 100%; }
.farm-codigo { margin: 8px 0 0; padding: 12px; background: #000; box-shadow: inset 0 0 0 2px var(--oro-oscuro); font-family: var(--pixel); font-size: 24px; letter-spacing: .1em; color: var(--oro-claro); text-align: center; user-select: all; }

/* Renombrar proyecto */
.farm-renombrar { position: relative; margin-left: auto; }
.farm-renombrar > summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 10px 8px; box-sizing: border-box; border: 2px solid #000;
  background: var(--pz-3); box-shadow: inset 2px 2px 0 var(--pz-4), inset -2px -3px 0 var(--pz-1); color: var(--tinta-2);
  font-family: var(--pixel); font-size: 16px; line-height: 1; list-style: none; cursor: pointer; user-select: none; white-space: nowrap;
}
.farm-renombrar > summary::-webkit-details-marker { display: none; }
.farm-renombrar > summary:hover, .farm-renombrar[open] > summary { border-color: #fff; color: #fff; }
.farm-renombrar > summary svg { width: 14px; height: 14px; }
.farm-renombrar .si-abierto, .farm-renombrar[open] .si-cerrado { display: none; }
.farm-renombrar[open] .si-abierto { display: inline; }
.farm-renombrar-caja, .fx-pop-caja {
  position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; width: min(24rem, calc(100vw - 2.5rem)); padding: 14px; box-sizing: border-box;
  background: rgba(16, 5, 9, .97); border: 2px solid transparent; border-image: linear-gradient(180deg, var(--oro), var(--rojo-oscuro)) 1;
  outline: 2px solid rgba(16, 5, 9, .97); box-shadow: 0 18px 40px rgba(0, 0, 0, .7); text-align: left;
  animation: farm-entra 160ms var(--ease-out);
}
@keyframes farm-entra { from { opacity: 0; transform: translateY(-4px); } }
.farm-renombrar-fila { display: flex; gap: 8px; margin-top: 6px; }
.farm-renombrar-fila .farm-campo { flex: 1; min-width: 0; }
.farm-renombrar-aviso { margin-top: 8px; }
.farm-renombrar-aviso.juntar { color: var(--oro-claro); font-weight: 700; }
.fm-proyecto-pie .farm-renombrar { position: static; }
.fm-proyecto-pie .farm-renombrar-caja { top: calc(100% - 4px); left: 8px; right: 8px; width: auto; }

/* Índice de proyectos */
.farm-indice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 20px; }
.farm-indice-etq { margin-right: 4px; font-family: var(--pixel); font-size: 16px; color: var(--tinta-3); }
.farm-indice a { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 36px; padding: 4px 10px 6px; box-sizing: border-box; border: 2px solid #000; background: var(--pz-3); color: var(--tinta); font-weight: 700; font-size: 14px; text-decoration: none; }
.farm-indice a:hover, .farm-indice a:focus-visible { border-color: #fff; }
.farm-indice a span { min-width: 0; max-width: 15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.farm-indice a b { font-family: var(--pixel); font-size: 16px; font-weight: 400; color: var(--oro-claro); }
.farm-indice a.hecho b { color: var(--verde); }
.farm-indice a.sin span { color: var(--tinta-3); }
.farm-indice a[hidden] { display: none; }

/* Pedir materiales (staff) */
.farm-pedido { margin-top: 24px; scroll-margin-top: calc(var(--barra-alto) + 16px); }
.farm-pedido > summary { display: flex; align-items: center; gap: 16px; padding: 4px 4px 4px 0; list-style: none; cursor: pointer; }
.farm-pedido > summary::-webkit-details-marker { display: none; }
.farm-pedido > summary .font-titulo { font-size: 24px; }
.farm-pedido-cuerpo { margin-top: 16px; padding-top: 16px; border-top: 2px solid var(--pz-3); }
.farm-pedido-cuerpo > label, .farm-buscador > label { font-family: var(--pixel); font-size: 16px; color: var(--tinta-2); text-transform: none; letter-spacing: 0; }
.farm-buscador > div { position: relative; }
.farm-lupa { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--oro); pointer-events: none; }
.bd-page .farm-campo-buscar { padding-left: 44px; font-weight: 700; }
.farm-resultados {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px; max-height: 300px; margin: 6px 0 0; padding: 6px; overflow-y: auto; list-style: none;
  background: rgba(16, 5, 9, .97); border: 2px solid #000; box-shadow: inset 0 0 0 2px var(--oro-oscuro);
}
.farm-opcion { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 8px; cursor: pointer; font-size: 14px; }
.farm-opcion:hover { background: rgba(255, 255, 255, .06); }
.farm-opcion[aria-selected="true"] { background: var(--oro-hondo); box-shadow: inset 0 0 0 2px var(--oro); }
.farm-opcion-libre { grid-column: 1 / -1; color: var(--tinta-3); }
.farm-ya { flex: none; font-family: var(--pixel); font-size: 16px; color: var(--verde); }
.farm-lineas { display: grid; gap: 6px; margin: 16px 0 0; padding: 0; list-style: none; }
.farm-linea { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto 40px; align-items: center; gap: 12px; padding: 6px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 2px var(--pz-3); }
.farm-linea-aviso { animation: farm-aviso .9s ease-out; }
@keyframes farm-aviso { from { box-shadow: inset 0 0 0 2px var(--oro); background: rgba(244, 196, 48, .12); } }
.farm-linea-nombre { min-width: 0; font-weight: 700; }
.farm-linea-cant { display: flex; gap: 6px; }
.bd-page .farm-linea-num { width: 7rem; text-align: right; }
.farm-linea-unidad { cursor: pointer; }
.farm-linea-total { min-width: 7.5rem; font-family: var(--pixel); font-size: 16px; color: var(--oro-claro); white-space: nowrap; }
.farm-linea-total:empty { display: none; }
.farm-quitar { display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: transparent; color: var(--tinta-3); font-family: var(--pixel); font-size: 24px; cursor: pointer; }
.farm-quitar:hover, .farm-quitar:focus-visible { color: var(--rojo-claro); }
.farm-texto { margin-top: 20px; }
.farm-texto > summary { width: fit-content; color: var(--oro-claro); font-weight: 700; cursor: pointer; list-style: none; }
.farm-texto > summary::-webkit-details-marker { display: none; }
.farm-texto textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.farm-pedido-pie { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px 20px; margin-top: 20px; padding-top: 16px; border-top: 2px solid var(--pz-3); }
.farm-pedido-pie > p { margin: 0 auto 0 0; color: var(--tinta-2); font-size: 14px; }

/* Editar material */
.farm-editar { grid-column: 1 / -1; padding: 16px; background: rgba(16, 5, 9, .9); box-shadow: inset 0 0 0 2px var(--oro-oscuro); }
.farm-editar-titulo { margin: 0 0 12px; font-family: var(--pixel); font-size: 16px; color: var(--oro-claro); }
.farm-editar-error { margin: 0 0 12px; padding: 8px 12px; background: var(--rojo-hondo); box-shadow: inset 0 0 0 2px var(--rojo-oscuro); color: var(--rojo-claro); font-weight: 700; font-size: 14px; }
.farm-editar-rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.farm-editar-objeto { display: flex; align-items: center; gap: 8px; }
.farm-editar-botones { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Podio de farmers (columnas de bloques) */
.farm-podio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 8px; margin-top: 16px; }
.farm-podio p { margin: 6px 0 0; }
.farm-escalon { display: grid; place-items: center; width: 100%; border: 2px solid #000; border-bottom: 0; font-family: var(--pixel); font-size: 24px; color: #1c1300; }
.farm-escalon-1 { height: 76px; background: linear-gradient(180deg, #ffe27a 0 4px, #f4c430 4px, #d9a520); }
.farm-escalon-2 { height: 56px; background: linear-gradient(180deg, #fff 0 4px, #d8d8d8 4px, #b8b8b8); }
.farm-escalon-3 { height: 42px; background: linear-gradient(180deg, #f2a77a 0 4px, #d9814e 4px, #b8653a); }

/* ---------- Panel del clan ---------- */
.fx { max-width: 1080px; margin: 0 auto; padding: 32px 0 0; }
.fx .ok { color: var(--verde); }
.fx-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.fx-suave { color: var(--tinta-3); }
.fx-dorado { color: var(--oro-claro); }
.fx-mini { font-size: 13px; color: var(--tinta-3); }
.fx kbd { display: inline-block; min-width: 1.4em; padding: 0 6px 2px; border: 2px solid #000; background: var(--pz-4); box-shadow: inset 0 -2px 0 var(--pz-1); font-family: var(--pixel); font-size: 16px; line-height: 1.2; color: #fff; text-align: center; }
.fx-enlace { color: var(--oro-claro); font-weight: 700; text-underline-offset: .2em; }
.fx-enlace:hover { text-decoration: underline; }
.fx-num { display: inline-block; margin-left: 6px; font-family: var(--pixel); font-size: 16px; color: var(--tinta-3); }
.fx-nota { margin: 10px 0 0; color: var(--tinta-2); font-size: 14px; line-height: 1.6; }
.fx-nota strong { color: #fff; }
.fx code { padding: 1px 5px; background: #000; color: var(--oro-claro); font-size: 13px; }
.fx-card { position: relative; }
.fx-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px 4px; background: var(--pz-3); box-shadow: inset 0 0 0 2px var(--pz-5); font-family: var(--pixel); font-size: 16px; line-height: 1; color: var(--tinta-2); white-space: nowrap; }
.fx-chip-ok { background: var(--verde-hondo); box-shadow: inset 0 0 0 2px #2a6b38; color: var(--verde); }
.fx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 6px 12px 8px; box-sizing: border-box;
  border: 2px solid #000; background: var(--pz-4); box-shadow: inset 2px 2px 0 #4f434a, inset -2px -3px 0 #120d10;
  color: var(--tinta); font-family: var(--pixel); font-size: 16px; line-height: 1; white-space: nowrap; cursor: pointer; list-style: none; user-select: none;
}
.fx-btn::-webkit-details-marker { display: none; }
.fx-btn:hover, details[open] > .fx-btn { border-color: #fff; }
.fx-btn-icono { width: 40px; padding: 0; }
.fx-btn-icono svg { width: 16px; height: 16px; }
.fx-btn-ok { color: var(--verde); }
.fx-btn-mal { color: var(--rojo-claro); }
.fx-quitar { min-height: 40px; border: 0; background: none; color: var(--rojo-claro); font-weight: 700; font-size: 14px; cursor: pointer; }
.fx-quitar:hover { text-decoration: underline; }

.fx-destino { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; margin-bottom: 32px; padding: 10px 14px; background: rgba(0, 0, 0, .45); box-shadow: inset 0 0 0 2px var(--oro-oscuro); }
.fx-destino h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 0; font-family: var(--lectura); font-size: 14px; font-weight: 400; color: var(--tinta-2); }
.fx-destino h2 strong { font-family: var(--pixel); font-size: 16px; font-weight: 400; color: var(--oro-claro); user-select: all; overflow-wrap: anywhere; }
.fx .fx-copiar-comando svg { width: 16px; height: 16px; }
.fx-copiar-comando.copiado { color: var(--verde); }

.fx-cabecera { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.fx-cabecera-txt { min-width: 0; max-width: 40rem; }
.fx-titulo { margin: 0; font-family: var(--pixel); font-size: 48px; font-weight: 400; line-height: 1.05; color: #fff; text-shadow: .125em .125em 0 #3f3f3f; }
.fx-titulo span { color: var(--oro) !important; text-shadow: .125em .125em 0 var(--oro-hondo); }
.fx-intro { margin: 8px 0 0; color: var(--tinta-2); font-size: 17px; }
.fx-cabecera-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.fx-acceso { max-width: 520px; margin: 48px auto 0; text-align: center; }
.fx-acceso .farm-slot { margin: 0 auto; }
.fx-acceso h2 { margin: 18px 0 6px; font-family: var(--pixel); font-size: 24px; font-weight: 400; color: #fff; text-shadow: .125em .125em 0 #3f3f3f; }
.fx-acceso p { margin: 0; color: var(--tinta-2); }
.fx-acceso form, .fx-acceso .fx-acceso-accion { margin-top: 20px; }

.fx-revisar { margin-top: 24px; padding: 16px; background: rgba(244, 196, 48, .05); box-shadow: inset 0 0 0 2px var(--oro-oscuro); }
.fx-revisar-cab { display: flex; align-items: flex-start; gap: 12px; }
.fx-revisar-cab h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-family: var(--pixel); font-size: 24px; font-weight: 400; color: #fff; text-shadow: .125em .125em 0 #3f3f3f; }
.fx-revisar-cab h2 .fx-num { margin: 0; padding: 0 6px 2px; background: var(--oro); color: #1c1300; }
.fx-revisar-cab p { margin: 4px 0 0; color: var(--tinta-2); font-size: 14px; }
.fx-revisar-lista { margin: 12px 0 0; padding: 0; list-style: none; }
.fx-revisar-lista li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 2px solid var(--pz-3); font-size: 15px; }
.fx-revisar-lista p { margin: 0; }
.fx-revisar-lista .farm-cabeza { display: inline-block; vertical-align: -3px; }
.fx-revisar-botones { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }

.fx-materiales { margin: 40px 0 56px; scroll-margin-top: calc(var(--barra-alto) + 16px); }
.fx-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 16px; }
.fx-h2 { margin: 0; font-family: var(--pixel); font-size: 32px; font-weight: 400; color: #fff; text-shadow: .125em .125em 0 #3f3f3f; }
.fx-pestanas { display: inline-flex; flex-wrap: wrap; gap: 2px; border: 2px solid #000; background: #000; }
.fx-pestanas a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px 8px; box-sizing: border-box; background: var(--pz-3);
  box-shadow: inset 2px 2px 0 var(--pz-4), inset -2px -2px 0 var(--pz-1); color: var(--tinta-3); font-family: var(--pixel); font-size: 16px; text-decoration: none;
}
.fx-pestanas a img { width: 20px; height: 20px; image-rendering: pixelated; }
.fx-pestanas a:hover { color: #fff; }
.fx-pestanas a[aria-current="page"] { background: var(--oro); box-shadow: inset 2px 2px 0 var(--oro-claro), inset -2px -2px 0 #9a6c10; color: #1c1300; }
.fx-pestanas a[aria-current="page"] .fx-num { color: #3a2a06; }
.fx-buscar { position: relative; display: flex; align-items: center; flex: 1 1 15rem; max-width: 22rem; margin-left: auto; }
.fx-buscar[hidden] { display: none; }
.fx-buscar svg { position: absolute; left: 14px; width: 16px; height: 16px; color: var(--tinta-3); pointer-events: none; }
.bd-page .fx-buscar input { width: 100%; padding-left: 40px; }
.fx-buscar kbd { position: absolute; right: 10px; pointer-events: none; }
.fx-buscar input:focus ~ kbd, .fx-buscar input:not(:placeholder-shown) ~ kbd { display: none; }
.fx-vista-resumen { max-width: 75ch; margin: 0 0 24px; color: var(--tinta-2); font-size: 15px; }
.fx-vista-resumen strong { color: #fff; }
.fx-vista-resumen strong.ok { color: var(--verde); }
.fx-resultados { margin: 0 0 16px; color: var(--tinta-2); font-size: 14px; }
.fx-resultados:empty { display: none; }
.fx-vacio { padding: 40px 20px; text-align: center; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 2px var(--pz-3); }
.fx-vacio .farm-slot { margin: 0 auto; }
.fx-vacio-titulo { margin: 14px 0 0; font-family: var(--pixel); font-size: 24px; color: #fff; text-shadow: .125em .125em 0 #3f3f3f; }
.fx-vacio-txt { max-width: 32rem; margin: 6px auto 0; color: var(--tinta-2); font-size: 15px; }
.fx-vacio[hidden] { display: none; }
.fx-limpiar { border: 0; background: none; color: var(--oro-claro); font: inherit; text-decoration: underline; cursor: pointer; }

/* Un panel por proyecto, una fila de inventario por material */
.fx-proyectos { display: grid; gap: 20px; }
.fx-proyectos > [hidden] { display: none; }
.fx-proy { background: var(--pz-2); border: 2px solid #000; box-shadow: inset 2px 2px 0 var(--pz-4), inset -2px -2px 0 var(--pz-0); scroll-margin-top: calc(var(--barra-alto) + 16px); }
.fx-proy:has(details[open]) { z-index: 6; }
.fx-proy-cab { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 14px; padding: 16px 18px 14px; }
.fx-proy-icono { display: grid; grid-template-columns: repeat(2, 20px); gap: 2px; padding: 4px; background: var(--pz-0); box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--pz-5); }
.fx-proy-icono img, .fx-proy-icono i { width: 20px; height: 20px; image-rendering: pixelated; }
.fx-proy-info { min-width: 0; }
.fx-proy-nombre { margin: 0; overflow-wrap: anywhere; font-family: var(--pixel); font-size: 24px; font-weight: 400; line-height: 1.15; color: #fff; text-shadow: .125em .125em 0 #3f3f3f; }
.fx-proy-nombre.sin { color: var(--tinta-3); }
.fx-proy-datos { display: flex; flex-wrap: wrap; gap: 0 14px; margin: 4px 0 0; color: var(--tinta-3); font-size: 14px; }
.fx-proy-datos strong { color: #fff; }
.fx-proy-lado { display: flex; align-items: center; gap: 10px; }
.fx-proy-pct { font-family: var(--pixel); font-size: 24px; color: var(--oro-claro); text-shadow: .125em .125em 0 var(--oro-hondo); }
.fx-proy-barra { grid-column: 1 / -1; margin-top: 6px; }
.fx-proy .farm-renombrar { margin-left: 0; }
.fx-lista-caja { container-type: inline-size; border-top: 2px solid #000; }
.fx-lista { margin: 0; padding: 0; list-style: none; }
.fx-mat { position: relative; display: grid; align-items: center; gap: 10px 16px; padding: 12px 18px; border-top: 2px solid var(--pz-3); scroll-margin-top: calc(var(--barra-alto) + 16px); }
.fx-lista > .fx-mat:first-child { border-top: 0; }
.fx-mat[hidden] { display: none; }
.fx-mat:hover { background: rgba(255, 255, 255, .02); }
.fx-mat:target { animation: farm-aviso 1.6s ease-out; }
.fx-slot { width: 56px; height: 56px; }
.fx-slot img { width: 40px; height: 40px; }
.fx-mat-nombre { min-width: 0; }
.fx-mat-titulo { margin: 0; overflow-wrap: anywhere; font-family: var(--pixel); font-size: 16px; line-height: 1.35; color: #fff; text-shadow: .125em .125em 0 #3f3f3f; }
.fx-mat-sub { margin: 2px 0 0; color: var(--tinta-3); font-size: 13px; }
.fx-mat-aviso { margin: 4px 0 0; color: var(--rojo-claro); font-size: 13px; font-weight: 700; }
.fx-mat-estado { min-width: 0; }
.fx-mat-estado p { margin: 0; }
.fx-falta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; color: var(--tinta-3); font-size: 13px; }
.fx-falta strong { font-family: var(--pixel); font-size: 16px; font-weight: 400; color: var(--oro-claro); }
.fx-mat-avance .farm-xp { margin: 6px 0 4px; }
.fx-mat-hecho p:first-child { color: var(--tinta-2); font-size: 14px; }
.fx-mat-hecho p:first-child .ok { font-family: var(--pixel); font-size: 16px; }
.fx-mat-hecho strong { color: #fff; }
.fx-mat-hecho .fx-mini { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; }
.fx-mat.hecho .fx-slot img { opacity: .8; }
.fx-mat-gente { min-width: 0; }
.fx-mat-gente:empty { display: none; }
.fx-cabezas { display: inline-flex; align-items: center; max-width: 100%; }
.fx-cabezas .farm-cabeza { width: 24px; height: 24px; margin-right: -4px; }
.fx-cabezas-mas { display: inline-grid; place-items: center; height: 24px; min-width: 24px; padding: 0 4px; background: var(--pz-4); box-shadow: 0 0 0 2px #000; font-family: var(--pixel); font-size: 16px; color: var(--tinta-2); }
.fx-cabezas-txt { min-width: 0; margin-left: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; }
.fx-cabezas-txt span { font-weight: 400; color: var(--tinta-3); }
.fx-pop { position: relative; }
.fx-pop-titulo { margin: 0 0 10px; font-family: var(--pixel); font-size: 16px; color: var(--oro-claro); }
.fx-pop-fila { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 10px; }
.fx-pop-botones { display: flex; justify-content: flex-end; margin-top: 12px; }
.fx-menu-caja { width: 12rem; padding: 6px; }
.fx-menu-caja form { margin: 0; }
.fx-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 10px; border: 0; background: none; color: var(--tinta); font-family: var(--pixel); font-size: 16px; text-align: left; text-decoration: none; cursor: pointer; }
.fx-menu-item svg { width: 16px; height: 16px; flex: none; color: var(--tinta-3); }
.fx-menu-item:hover, .fx-menu-item:focus-visible { background: rgba(255, 255, 255, .07); outline: none; }
.fx-menu-item.peligro, .fx-menu-item.peligro svg { color: var(--rojo-claro); }

.fx-mat { grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "slot nombre menu" "estado estado estado" "gente gente aportar"; }
.fx-mat > .fx-slot { grid-area: slot; }
.fx-mat > .fx-mat-nombre { grid-area: nombre; }
.fx-mat > .fx-mat-estado { grid-area: estado; }
.fx-mat > .fx-mat-gente { grid-area: gente; }
.fx-mat > .fx-aportar { grid-area: aportar; justify-self: end; }
.fx-mat > .fx-menu { grid-area: menu; justify-self: end; align-self: start; }
.fx-mat > .farm-editar { grid-column: 1 / -1; }
/* En pantallas angostas el «⋯» va en la esquina, para que «Aportar a mano» no le robe el ancho al nombre. */
@container (max-width: 559.98px) {
  .fx-lista:not(.sin-menu) .fx-mat { grid-template-areas: "slot nombre nombre" "estado estado estado" "gente gente aportar"; }
  .fx-lista:not(.sin-menu) .fx-mat > .fx-mat-nombre { padding-right: 52px; }
  .fx-mat > .fx-menu { grid-area: auto; position: absolute; top: 12px; right: 14px; }
}
/* Y si ni así cabe «Aportar a mano» junto a las cabezas, va debajo, a todo el ancho. */
@container (max-width: 419.98px) {
  .fx-lista-caja .fx-lista .fx-mat { grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "slot nombre" "estado estado" "gente gente" "aportar aportar"; }
  .fx-lista-caja .fx-lista .fx-mat:not(:has(> .fx-aportar)) { grid-template-areas: "slot nombre" "estado estado" "gente gente"; }
  .fx-mat > .fx-aportar { justify-self: stretch; }
  .fx-mat > .fx-aportar > .fx-btn { width: 100%; }
}
@container (min-width: 560px) {
  .fx-mat { grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr) auto; grid-template-areas: "slot nombre estado menu" "slot gente aportar aportar"; }
  .fx-mat > .fx-menu { align-self: center; }
}
@container (min-width: 820px) {
  .fx-mat { column-gap: 18px; grid-template-columns: 56px minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 10rem) 9.5rem 40px; grid-template-areas: "slot nombre estado gente aportar menu"; }
  .fx-lista.sin-aportar .fx-mat { grid-template-columns: 56px minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 10rem) 40px; grid-template-areas: "slot nombre estado gente menu"; }
  .fx-lista.sin-menu .fx-mat { grid-template-columns: 56px minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 10rem) 9.5rem; grid-template-areas: "slot nombre estado gente aportar"; }
  .fx-lista.sin-menu.sin-aportar .fx-mat { grid-template-columns: 56px minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 12rem); grid-template-areas: "slot nombre estado gente"; }
  .fx-mat > .fx-aportar { justify-self: stretch; }
  .fx-mat > .fx-aportar > .fx-btn { width: 100%; }
  .fx-mat > .fx-menu { align-self: center; }
}

/* Plegables del final (progreso, top, conectar, ayuda, entrega) */
.fx-disclosure { border-top: 2px solid var(--pz-3); }
.fx-disclosure > summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-height: 64px; padding: 12px 0; list-style: none; cursor: pointer;
  font-family: var(--pixel); font-size: 24px; color: #fff; text-shadow: .125em .125em 0 #3f3f3f;
}
.fx-disclosure > summary::-webkit-details-marker { display: none; }
.fx-disclosure > summary::after { content: "+"; margin-left: auto; color: var(--oro); }
.fx-disclosure[open] > summary::after { content: "-"; }
.fx-disclosure > summary:hover { color: var(--oro-claro); }
.fx-disclosure > summary > span { font-family: var(--lectura); font-size: 14px; color: var(--tinta-3); text-shadow: none; }
.fx-disclosure-body { padding: 4px 0 28px; }
.fx-pie { display: block; }
.fx-pie-cab { display: flex; justify-content: flex-end; }
.fx-tablero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; }
.fx-tablero:not(:has(.fx-tu)) { grid-template-columns: 1fr; }
.fx-clan, .fx-tu { padding: 16px; background: var(--pz-2); border: 2px solid #000; box-shadow: inset 2px 2px 0 var(--pz-4), inset -2px -2px 0 var(--pz-0); }
.fx-resumen-titulo { margin: 0; font-family: var(--pixel); font-size: 16px; font-weight: 400; color: var(--tinta-2); }
.fx-clan-cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.fx-clan-num { margin: 6px 0 0; color: var(--tinta-2); }
.fx-clan-num strong { display: block; font-family: var(--pixel); font-size: 32px; font-weight: 400; color: #fff; text-shadow: .125em .125em 0 #3f3f3f; }
.fx-clan-pct { font-size: 32px; }
.fx-clan-datos { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 0; padding: 0; list-style: none; color: var(--tinta-2); font-size: 14px; }
.fx-clan-datos a { color: inherit; }
.fx-clan-datos b { font-family: var(--pixel); font-size: 16px; font-weight: 400; color: #fff; }
.fx-clan-datos b.ok { color: var(--verde); }
.fx-tu-cab { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.fx-tu-cab .farm-cabeza { width: 40px; height: 40px; }
.fx-tu-nick { margin: 0; font-family: var(--pixel); font-size: 24px; color: #fff; text-shadow: .125em .125em 0 #3f3f3f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-tu-puesto { margin: 2px 0 0; color: var(--oro-claro); font-size: 14px; font-weight: 700; }
.fx-tu-datos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0 0; }
.fx-tu-datos dt { color: var(--tinta-3); font-size: 13px; }
.fx-tu-datos dd { margin: 2px 0 0; font-family: var(--pixel); font-size: 24px; color: #fff; }
.fx-tu-datos dd.ok { color: var(--verde); }
.fx-tu-aviso { margin: 12px 0 0; padding: 8px 12px; background: rgba(244, 196, 48, .07); box-shadow: inset 0 0 0 2px var(--oro-oscuro); font-size: 14px; }
.fx-top-lista { margin: 14px 0 0; padding: 4px; list-style: none; background: rgba(0, 0, 0, .55); }
.fx-top-lista li { display: flex; align-items: center; gap: 10px; padding: 5px 8px; font-family: var(--pixel); font-size: 16px; color: #fff; text-shadow: .125em .125em 0 #3f3f3f; }
.fx-top-lista li.yo { background: rgba(244, 196, 48, .14); }
.fx-top-pos { width: 2em; color: var(--tinta-3); text-align: center; }
.fx-top-nick { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-top-uds { color: #ff5555; text-shadow: .125em .125em 0 #3f1515; }
.fx-pasos { display: grid; gap: 14px; margin: 16px 0 0; padding: 0; list-style: none; }
.fx-pasos li { display: flex; gap: 12px; }
.fx-paso-num { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border: 2px solid #000; background: var(--oro); box-shadow: inset 2px 2px 0 var(--oro-claro), inset -2px -2px 0 #9a6c10; font-family: var(--pixel); font-size: 16px; color: #1c1300; }
.fx-paso-titulo { font-family: var(--pixel); font-size: 16px; color: #fff; }
.fx-pasos button.fx-paso-titulo { border: 0; background: none; padding: 0; color: var(--oro-claro); cursor: pointer; text-decoration: underline; }
.fx-comando { display: block; margin-top: 6px; padding: 8px 10px; background: #000; color: var(--oro-claro); font-size: 14px; overflow-wrap: anywhere; }
.fx-dispositivos { display: grid; gap: 8px; margin: 16px 0 0; padding: 12px 0 0; border-top: 2px solid var(--pz-3); list-style: none; font-size: 14px; }
.fx-dispositivos li { display: flex; align-items: center; gap: 8px; }
.fx-ayuda-lista { display: grid; gap: 4px; }
.fx-ayuda-lista ul { display: grid; gap: 8px; margin: 0; padding: 0 4px 14px 36px; list-style: none; color: var(--tinta-2); font-size: 14px; }
.fx-ayuda-lista strong { color: #fff; }
.fx-puntos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 8px; max-width: 46rem; margin: 12px 0 0; padding: 0; list-style: none; }
.fx-puntos li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 2px var(--pz-3); }
.fx-puntos p { margin: 0; }
.fx-punto-tipo { font-family: var(--pixel); font-size: 16px; color: #fff; }
.fx-punto-tipo span { font-family: var(--lectura); font-size: 13px; color: var(--tinta-3); }
.fx-coords { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0; border: 0; background: none; font-family: var(--pixel); font-size: 16px; color: var(--oro-claro); cursor: pointer; user-select: all; }
.fx-coords::after { content: "copiar"; padding: 0 4px 2px; box-shadow: inset 0 0 0 2px var(--oro-oscuro); font-family: var(--lectura); font-size: 11px; color: var(--tinta-3); }
.fx-coords.copiado::after { content: "¡copiado!"; color: var(--verde); }
.fx-punto-donde { overflow-wrap: anywhere; color: var(--tinta-3); font-size: 12px; }

@media (max-width: 1023px) {
  .fm-cab-in { flex-wrap: wrap; }
  .fm-dos { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .fm-cofre { display: none; }
  .fm-proyectos { grid-template-columns: 1fr; }
  .fx-titulo { font-size: 32px; }
  .fx-h2 { font-size: 24px; width: 100%; }
  .fx-buscar { max-width: none; margin-left: 0; flex-basis: 100%; }
  .fx-pestanas { width: 100%; }
  .fx-pestanas a { flex: 1 1 auto; justify-content: center; padding: 6px; }
  .fx-proy-cab { grid-template-columns: auto minmax(0, 1fr); padding: 14px; }
  .fx-proy-lado { grid-column: 1 / -1; justify-content: space-between; }
  .fx-mat { padding: 12px 14px; }
  .fx-revisar-botones { margin-left: 0; width: 100%; }
  .fx-revisar-botones .fx-btn { flex: 1 1 7.5rem; }
  .fx-pop-fila, .farm-editar-rejilla { grid-template-columns: 1fr; }
  .fx-tablero { grid-template-columns: 1fr; }
  .fx-disclosure > summary { font-size: 16px; flex-wrap: nowrap; }
  .fx-revisar-cab h2 { font-size: 20px; }
  .fx-disclosure > summary > span { display: none; }
  .farm-linea { grid-template-columns: 48px minmax(0, 1fr) 40px; }
  .farm-linea-cant, .farm-linea-total { grid-column: 2 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .farm-renombrar-caja, .fx-pop-caja, .farm-linea-aviso, .fx-mat:target { animation: none; }
}

/* Lo que vale cada material en puntos (Común ×1 … Muy raro ×16 o más). */
.fx-valor { display: inline-block; margin-left: 6px; padding: 0 6px; border: 2px solid var(--pz-5); background: var(--pz-1);
  font-size: 12px; line-height: 1.5; color: var(--pz-6, #8b7d84); white-space: nowrap; vertical-align: 1px; cursor: help; }
.fx-valor.v2 { color: #d8d0d4; }
.fx-valor.v4 { border-color: #2f6fa8; color: #8cc8ff; }
.fx-valor.v8 { border-color: #7a3fb0; color: #d6a8ff; }
.fx-valor.v16 { border-color: var(--oro-oscuro); color: var(--oro-claro); background: var(--oro-hondo); }

/* ---------- Aportaciones por farmer (desglose por material) ---------- */
.fx-tu-desglose { display: inline-block; margin-top: 8px; font-size: 14px; }
.fx-apo { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.fx-apo-farmer { background: var(--pz-1); box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--pz-4); }
.fx-apo-farmer.yo { box-shadow: inset 0 0 0 2px var(--oro-oscuro); background: var(--oro-hondo); }
.fx-apo-farmer > summary { display: grid; grid-template-columns: 32px auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px 12px; cursor: pointer; list-style: none; }
.fx-apo-farmer > summary::-webkit-details-marker { display: none; }
.fx-apo-farmer > summary:hover .fx-apo-nombre strong { color: var(--oro-claro); }
.fx-apo-farmer .farm-cabeza { width: 28px; height: 28px; image-rendering: pixelated; box-shadow: 0 0 0 2px #000; }
.fx-apo-pos { display: grid; place-items: center; font-family: var(--pixel); font-size: 16px; color: var(--tinta-3); }
.fx-apo-pos.m1 { color: var(--oro-claro); } .fx-apo-pos.m2 { color: #e2e2e2; } .fx-apo-pos.m3 { color: #e0915a; }
.fx-apo-nombre { min-width: 0; }
.fx-apo-nombre strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--pixel); font-size: 16px; font-weight: 400; color: #fff; }
.fx-apo-nombre small, .fx-apo-puntos small { display: block; color: var(--tinta-3); font-size: 13px; }
.fx-apo-puntos { text-align: right; }
.fx-apo-puntos b { display: block; font-family: var(--pixel); font-size: 16px; font-weight: 400; color: var(--oro-claro); font-variant-numeric: tabular-nums; }
.fx-apo-mats { margin: 0; padding: 4px 12px 12px; list-style: none; }
.fx-apo-mats li { display: grid; grid-template-columns: 40px minmax(0, 1.4fr) minmax(0, 1fr) auto 5.5rem; align-items: center; gap: 10px;
  padding: 6px 0; border-top: 2px solid var(--pz-3); font-size: 14px; color: var(--tinta-2); }
.fx-apo-slot { width: 40px; height: 40px; }
.fx-apo-slot img { width: 24px; height: 24px; }
.fx-apo-mat, .fx-apo-uds { min-width: 0; }
.fx-apo-mat b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tinta); }
.fx-apo-mat small, .fx-apo-uds small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tinta-3); font-size: 12px; }
.fx-apo-pts { text-align: right; font-family: var(--pixel); font-size: 14px; color: var(--oro-claro); white-space: nowrap; }
.fx-apo-mats .fx-valor { margin-left: 0; justify-self: start; }
@media (max-width: 640px) {
  .fx-apo-mats li { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "slot mat pts" "slot uds valor"; row-gap: 2px; }
  .fx-apo-slot { grid-area: slot; } .fx-apo-mat { grid-area: mat; } .fx-apo-uds { grid-area: uds; }
  .fx-apo-mats .fx-valor { grid-area: valor; justify-self: end; } .fx-apo-pts { grid-area: pts; }
  .fx-apo-farmer > summary { grid-template-columns: 26px auto minmax(0, 1fr) auto; gap: 8px; padding: 8px; }
}

/* ---------- /farmermon-valores: lo que vale cada material ---------- */
.fv-niveles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; margin-top: 24px; }
.fv-nivel { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; color: var(--tinta-2); text-decoration: none; }
.fv-nivel:hover { box-shadow: inset 0 0 0 2px var(--oro-oscuro); }
.fv-nivel .fx-valor { margin-left: 0; align-self: flex-start; font-size: 14px; }
.fv-nivel-ej { font-size: 14px; line-height: 1.4; }
.fv-nivel-num { margin-top: auto; color: var(--tinta-3); font-size: 13px; }
.fv-lista-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 28px 0 8px; }
.fv-buscar { flex: 1 1 320px; max-width: 520px; }
.fv-buscar[hidden] { display: none; }
.fv-buscar input { width: 100%; height: 44px; padding: 0 14px; background: var(--pz-0); color: var(--tinta); border: 0; outline: none;
  box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--pz-5); font-size: 16px; }
.fv-buscar input:focus { box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--pz-5), 0 0 0 2px var(--oro); }
.fv-cuenta { margin: 0; color: var(--tinta-3); font-size: 14px; }
.fv-grupo[hidden] { display: none; }
.fv-objetos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.fv-obj { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "slot nombre valor" "slot nombre stack";
  align-items: center; column-gap: 10px; padding: 6px 10px 6px 6px; background: var(--pz-1); box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--pz-4); }
.fv-obj[hidden] { display: none; }
.fv-slot { grid-area: slot; width: 44px; height: 44px; }
.fv-slot img { width: 28px; height: 28px; image-rendering: pixelated; }
.fv-nombre { grid-area: nombre; min-width: 0; }
.fv-nombre b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tinta); font-size: 15px; }
.fv-nombre small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tinta-3); font-size: 12px; }
.fv-obj .fx-valor { grid-area: valor; justify-self: end; margin-left: 0; }
.fv-stack { grid-area: stack; justify-self: end; color: var(--tinta-3); font-size: 12px; white-space: nowrap; }
.fv-stack b { color: var(--oro-claro); font-weight: 700; }
.fv-sin { margin: 16px 0; color: var(--tinta-3); }

/* ---------- Desglose de un material: quién aportó cuánto ---------- */
.fx-mat { cursor: pointer; }
.fx-mat.abierto { background: rgba(244, 196, 48, .05); box-shadow: inset 2px 0 0 var(--oro); }
button.fx-mat-gente { display: block; min-width: 0; padding: 4px 6px; margin: -4px -6px; background: none; border: 0; color: inherit; text-align: left; cursor: pointer; }
button.fx-mat-gente:hover, .fx-mat.abierto button.fx-mat-gente { background: rgba(255, 255, 255, .05); }
button.fx-mat-gente:focus-visible { outline: 2px solid var(--oro); outline-offset: 2px; }
.fx-sin-aportes { color: var(--tinta-3); font-size: 13px; }
.fx-desglose { grid-column: 1 / -1; padding: 12px 14px; background: var(--pz-1); box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--pz-4); cursor: default; }
.fx-desglose[hidden] { display: none; }
.fx-desglose-titulo { margin: 0 0 8px; font-family: var(--pixel); font-size: 16px; color: var(--oro-claro); }
.fx-desglose-titulo span { margin-left: 8px; font-family: var(--lectura); font-size: 13px; color: var(--tinta-3); }
.fx-desglose-lista { margin: 0; padding: 0; list-style: none; }
.fx-desglose-lista li { display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(80px, 1fr) auto; align-items: center; gap: 10px; padding: 6px 4px;
  border-top: 2px solid var(--pz-3); }
.fx-desglose-lista li:first-child { border-top: 0; }
.fx-desglose-lista li.yo { background: rgba(244, 196, 48, .08); }
.fx-desglose-lista .farm-cabeza { width: 24px; height: 24px; image-rendering: pixelated; box-shadow: 0 0 0 2px #000; }
.fx-desglose-nick { min-width: 0; }
.fx-desglose-nick b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-size: 14px; }
.fx-desglose-nick small, .fx-desglose-uds small { display: block; color: var(--tinta-3); font-size: 12px; }
.fx-desglose-barra { height: 8px; background: var(--pz-0); box-shadow: inset 1px 1px 0 #000; }
.fx-desglose-barra i { display: block; height: 100%; width: var(--p, 0%); background: var(--oro); }
.fx-desglose-uds { text-align: right; white-space: nowrap; }
.fx-desglose-uds b { color: var(--tinta); font-size: 14px; }
@media (max-width: 640px) {
  .fx-desglose-lista li { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .fx-desglose-barra { grid-column: 2 / -1; grid-row: 2; }
}

/* ---------- /farmermon-valores: el staff cambia lo que vale un objeto ---------- */
.fv-staff { margin-top: 24px; padding: 16px 18px; }
.fv-staff-titulo { margin: 0; font-family: var(--pixel); font-size: 24px; font-weight: 400; color: #fff; text-shadow: .125em .125em 0 #3f3f3f; }
.fv-staff-titulo span { display: block; margin-top: 2px; font-family: var(--lectura); font-size: 13px; color: var(--oro-claro); text-shadow: none; }
.fv-staff-ayuda { max-width: 72ch; margin: 6px 0 0; color: var(--tinta-2); font-size: 14px; line-height: 1.5; }
.fv-staff-ayuda strong { color: #fff; }
.fv-mano-titulo { margin: 18px 0 8px; font-family: var(--pixel); font-size: 16px; font-weight: 400; color: var(--oro-claro); }
.fv-mano-titulo span { margin-left: 4px; color: var(--tinta-3); }
.fv-staff .fv-sin { margin: 0; }
.fv-mano { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.fv-mano li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "slot nombre boton"; align-items: center; column-gap: 10px; padding: 6px 8px 6px 6px;
  background: var(--pz-1); box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--pz-4); }
.fv-mano form { grid-area: boton; margin: 0; }
.fv-mano .fx-btn { min-height: 34px; padding: 4px 8px 6px; font-size: 14px; }
.fv-mano .fv-nombre b, .fv-mano .fv-nombre small { white-space: normal; }
@media (max-width: 640px) {
  .fv-mano li { grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "slot nombre" "slot boton"; row-gap: 6px; }
  .fv-mano form { justify-self: start; }
}
.fv-nombre a { color: inherit; text-decoration: none; }
.fv-nombre a:hover { color: var(--oro-claro); text-decoration: underline; }
.fv-objetos { align-items: start; }
a.fv-cambiar { text-decoration: none; cursor: pointer; }
a.fv-cambiar:hover, a.fv-cambiar:focus-visible, .fv-obj.editando a.fv-cambiar { border-color: #fff; outline: none; }
.fv-obj.a-mano { background: rgba(244, 196, 48, .07); }
.fv-nombre small.fv-a-mano { color: var(--oro-claro); }
.fv-obj.editando { box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--pz-4), 0 0 0 2px var(--oro); }
.fv-obj.recien { animation: farm-aviso 1.6s ease-out; }
.fv-obj > .fv-editor { grid-column: 1 / -1; margin-top: 8px; }
.fv-editor { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; padding-top: 8px; border-top: 2px solid var(--pz-3); }
.fv-editor-campo { display: flex; flex-direction: column; gap: 4px; color: var(--tinta-3); font-size: 12px; }
.fv-editor-campo input { width: 8.5rem; height: 40px; padding: 0 10px; background: var(--pz-0); color: var(--tinta); border: 0; outline: none;
  box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--pz-5); font-family: var(--pixel); font-size: 18px; }
.fv-editor-campo input:focus { box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--pz-5), 0 0 0 2px var(--oro); }
.fv-editor-botones { display: flex; flex-wrap: wrap; gap: 6px; }
.fv-editor .fx-btn[hidden] { display: none; }
.fv-editor-info { order: 2; flex: 1 1 100%; margin: 0; color: var(--tinta-3); font-size: 13px; }
.fv-editor-arriba { margin-top: 14px; padding: 12px; background: var(--pz-1); box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--pz-4); }
.fv-editor-de { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; color: #fff; }
@media (prefers-reduced-motion: reduce) { .fv-obj.recien { animation: none; } }

/* ---------- /farmermon-fallos: lo que el punto de entrega no contó, puesto a mano ---------- */
.ff-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px 14px; margin-top: 14px; }
.ff-campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--tinta-3); font-size: 12px; }
.ff-campo input, .ff-campo select { width: 100%; height: 40px; padding: 0 10px; box-sizing: border-box; background: var(--pz-0); color: var(--tinta); border: 0; outline: none;
  box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--pz-5); font-family: var(--lectura); font-size: 15px; }
.ff-campo input[type="number"] { font-family: var(--pixel); font-size: 18px; }
.ff-campo input:focus, .ff-campo select:focus { box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--pz-5), 0 0 0 2px var(--oro); }
.ff-campo option, .ff-campo optgroup { background: var(--pz-1); color: var(--tinta); }
.ff-ancho { grid-column: 1 / -1; }
.ff-cantidad { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 8rem); gap: 8px; }
.ff-calculo { grid-column: 1 / -1; min-height: 1em; margin: 0; color: var(--oro-claro); font-family: var(--pixel); font-size: 16px; }
.ff-calculo:empty { display: none; }
.ff-form .fv-editor-botones { grid-column: 1 / -1; }
.ff-lista { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.ff-lista li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "slot texto boton"; align-items: center; column-gap: 10px; padding: 6px 8px 6px 6px;
  background: var(--pz-1); box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--pz-4); }
.ff-lista li.deshecho { opacity: .6; }
.ff-lista li.deshecho .ff-mas { text-decoration: line-through; }
.ff-texto { grid-area: texto; min-width: 0; }
.ff-texto p { margin: 0; color: var(--tinta-2); font-size: 14px; line-height: 1.5; }
.ff-texto b { color: #fff; }
.ff-texto .farm-cabeza { display: inline-block; margin-right: 4px; vertical-align: -3px; image-rendering: pixelated; }
.ff-mas { color: var(--verde); font-family: var(--pixel); font-size: 16px; }
.ff-pts { margin-left: 6px; color: var(--oro-claro); font-size: 13px; }
.ff-texto .ff-meta { color: var(--tinta-3); font-size: 12px; }
.ff-texto .ff-nota { color: var(--tinta); font-style: italic; }
.ff-sin-cuenta { color: var(--rojo-claro); }
.ff-lista form { grid-area: boton; margin: 0; }
.ff-lista .fx-btn { min-height: 34px; padding: 4px 10px 6px; font-size: 14px; }
.ff-mas-lista { margin: 12px 0 0; }
.ff-enlace { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; color: var(--tinta-3); font-size: 14px; }
.ff-enlace .fx-btn { text-decoration: none; }
@media (max-width: 640px) {
  .ff-lista li { grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "slot texto" "slot boton"; }
  .ff-lista form { justify-self: start; margin-top: 6px; }
}
