/* OpenEvolution · versión simple. Sobre los tokens del sistema "Organic" (../css/tokens.css). */
:root {
  color-scheme: light;
  /* El motor de criaturas lee estos tres. */
  --color-danger: #a93a2b; --bad: var(--color-danger); --body: var(--font-body); --rule: rgba(32, 30, 29, .14);
  /* Facciones extra (como en la versión anterior). */
  --color-cumbre-500: oklch(0.55 0.08 250);
  --color-ciruela-500: oklch(0.56 0.10 340);
  --color-ocre-500: oklch(0.62 0.11 90);
  /* Y más, para el multijugador de hasta 12 facciones. */
  --color-turquesa-500: oklch(0.60 0.10 195);
  --color-violeta-500: oklch(0.50 0.13 295);
  --color-vino-500: oklch(0.44 0.13 20);
  --color-lima-500: oklch(0.72 0.17 128);
  --color-rosa-500: oklch(0.72 0.12 0);
  --color-pino-500: oklch(0.45 0.09 158);
  --color-cacao-500: oklch(0.46 0.07 60);
  /* Terreno: color de fondo y tinta del dibujo. */
  --t-pradera: #ebe1b3; --i-pradera: #8d8442;
  --t-bosque: #b9cc9c;  --i-bosque: #48663a;
  --t-montana: #d3cabd; --i-montana: #6b6155;
  --t-pantano: #a9c8b6; --i-pantano: #3b6b5b;
  --t-desierto: #f2dcac; --i-desierto: #b0844a;
  --t-agua: #a8cfe1;    --i-agua: #ffffff;
  --fight: #d9472b;
  --top-h: 52px; --pool-h: 92px;
  /* Tamaño de la interfaz (main.js, `applyUi`): 1 en una pantalla de 1180 × 760 o más; menos en una
     más chica (un portátil de 1366 × 768, o uno de 1920 × 1080 con la escala de Windows al 150 %). */
  --ui: 1;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--color-bg); color: var(--color-text); font-family: var(--font-body); }
button { font: inherit; color: inherit; cursor: pointer; }
.app { display: grid; grid-template-rows: calc(var(--top-h) * var(--ui)) 1fr calc(var(--pool-h) * var(--ui)); grid-template-columns: minmax(0, 1fr); height: 100vh; height: 100dvh; } /* la columna no crece con la barra de arriba (en una pantalla angosta, todo quedaba más ancho que ella) */

/* Todo lo que va sobre el mapa (paneles, botones, menús) y las hojas se achica junto con --ui; el
   mapa no (lo dibuja el canvas a su tamaño). Los paneles que se ubican junto al puntero (menú, ficha,
   tooltip) corrigen su posición en main.js (`uiPlace`). */
.top, .pool, .stage > :not(#map):not(.ghost):not(.press-ring), .overlay > * { zoom: var(--ui); }

/* Barra superior */
.top { display: flex; align-items: center; gap: 14px; padding: 0 14px; border-bottom: 1px solid var(--color-divider); background: var(--color-bg); z-index: 5; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.top::-webkit-scrollbar { display: none; }
.top > * { flex-shrink: 0; }
.brand { font-family: var(--font-heading); font-size: 20px; white-space: nowrap; }
.brand-open { color: var(--color-accent); } .brand-evo { color: var(--color-accent-2-700); }
.res { display: flex; align-items: baseline; gap: 4px; padding: 5px 12px; border-radius: 999px; background: var(--color-surface); font-size: 15px; white-space: nowrap; }
.res b { font-size: 17px; } .res small { color: var(--color-neutral-700); font-weight: 700; }
.res.flash { animation: flash .5s 2; }
@keyframes flash { 50% { background: var(--color-accent-300); } }
.land { position: relative; flex: 1 1 160px; min-width: 160px; max-width: 360px; height: 26px; border-radius: 8px; background: var(--color-surface); overflow: hidden; }
.land-bar { display: flex; height: 100%; }
.land-bar span { height: 100%; }
.land::after { content: ''; position: absolute; left: var(--goal, 50%); top: 0; bottom: 0; border-left: 2px dashed var(--color-text); opacity: .5; }
.land-txt { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; text-shadow: 0 0 4px #fff, 0 0 2px #fff; }
.send, .clock { display: flex; align-items: center; gap: 2px; background: var(--color-surface); border-radius: 999px; padding: 3px; }
.send-k { font-size: 12px; font-weight: 700; padding: 0 6px 0 8px; color: var(--color-neutral-700); }
.send button, .clock button { border: 0; background: none; padding: 4px 9px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.send button[aria-pressed="true"], .clock button[aria-pressed="true"] { background: var(--color-text); color: var(--color-bg); }
.clock span { font-weight: 800; padding: 0 6px; font-variant-numeric: tabular-nums; }
.icon-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--color-divider); background: none; font-weight: 800; }

/* Pantallas angostas (iPad, ventanas chicas): la barra de arriba se compacta para que entre entera
   (si igual no entra, se desliza de costado). */
@media (max-width: 1280px) { .brand { display: none; } }
@media (max-width: 1060px) { .top { gap: 8px; padding: 0 10px; } .send-k { display: none; } .res { padding: 5px 9px; } .land { min-width: 100px; } }
@media (max-width: 860px) { .winclock { display: none !important; } #langBtn { display: none; } .land { min-width: 80px; } }

/* Táctil: sin selección de texto ni menú del sistema al mantener pulsado, sin zoom de la página al
   tocar dos veces (los textos de escribir, sí). El anillo se llena mientras mantienes pulsado un lugar. */
html { touch-action: manipulation; }
body.touch { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.touch input, body.touch textarea { -webkit-user-select: text; user-select: text; }
.press-ring { position: absolute; z-index: 7; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .35), inset 0 0 0 2px rgba(0, 0, 0, .2); pointer-events: none; animation: press-fill var(--hold, 330ms) linear forwards; }
@keyframes press-fill { from { transform: scale(.35); opacity: .3; } to { transform: scale(1); opacity: 1; } }

/* Mapa */
.stage { position: relative; overflow: hidden; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#map.dragging { cursor: grabbing; }
.map-ctrl { position: absolute; left: 12px; top: 12px; display: flex; flex-direction: column; gap: 4px; }
.map-ctrl button { width: 32px; height: 32px; border-radius: 10px; border: 0; background: rgba(255,255,255,.85); box-shadow: var(--shadow-sm); font-weight: 800; font-size: 16px; }
/* Botonera de obras (teclas 1 2 3) y el dibujo que sigue al mouse al ponerlas. */
.buildbar { position: absolute; left: 12px; top: 198px; z-index: 4; display: flex; flex-direction: column; gap: 6px; }
.buildbar button { position: relative; width: 62px; padding: 5px 2px 4px; border: 0; border-radius: 12px; background: rgba(255,255,255,.9); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10.5px; line-height: 1.15; }
.buildbar button:hover { background: #fff; }
.buildbar button[aria-pressed="true"] { background: #fff; outline: 2.5px solid var(--color-accent); }
.buildbar canvas { width: 42px; height: 36px; }
.buildbar .k { position: absolute; left: 4px; top: 4px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 5px; background: var(--color-text); color: var(--color-bg); font-size: 10px; font-weight: 800; line-height: 15px; }
.buildbar small { color: var(--color-neutral-700); font-size: 10px; }
.buildbar .bb-sep { height: 1px; margin: 2px 8px; background: var(--color-divider); }
.buildbar .ico { font-size: 24px; line-height: 34px; height: 36px; }
/* Si no cabe a lo alto (main.js, `fitBuildbar`): primero con dibujos más bajos, después sin el nombre
   (queda en el tooltip) y, si tampoco, en dos columnas. La tecla y el costo siempre se ven. */
.buildbar.tight { gap: 4px; }
.buildbar.tight button { padding: 3px 2px; }
.buildbar.tight canvas { height: 28px; }
.buildbar.tight .ico { font-size: 20px; line-height: 28px; height: 28px; }
.buildbar.compact button { width: 52px; padding: 3px 2px; }
.buildbar.compact b { display: none; }
.buildbar.compact canvas { width: 36px; height: 28px; }
.buildbar.compact .ico { font-size: 20px; line-height: 28px; height: 28px; }
.buildbar.cols { display: grid; grid-template-columns: repeat(2, auto); }
.buildbar.cols .bb-sep { grid-column: 1 / -1; }
.ghost-ico { font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.migpop { position: absolute; left: 84px; top: 330px; z-index: 6; width: 290px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--color-bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 8px; }
.migpop .mig-h { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.migpop .mig-row { display: flex; justify-content: space-between; font-size: 14px; }
.migpop input[type=range] { width: 100%; accent-color: var(--color-accent); }
.migpop .hint { margin: 0; font-size: 12.5px; }
.stage.placing #map { cursor: crosshair; }
/* Minimapa (abajo a la derecha) y el aviso de cómo moverse (arriba al centro). */
.minimap { position: absolute; right: 12px; bottom: 12px; z-index: 4; width: 210px; padding: 5px; border-radius: 14px; background: rgba(255, 255, 255, .88); box-shadow: var(--shadow-md); }
.minimap canvas { display: block; width: 100%; border-radius: 9px; cursor: pointer; touch-action: none; }
.minimap button { position: absolute; top: -10px; right: -6px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--color-bg); box-shadow: var(--shadow-sm); font-size: 12px; line-height: 24px; padding: 0; }
.minimap.off { width: auto; padding: 0; background: transparent; box-shadow: none; }
.minimap.off canvas { display: none; }
.minimap.off button { position: static; width: 38px; height: 38px; font-size: 18px; line-height: 38px; box-shadow: var(--shadow-md); }
.maphint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 10px; max-width: min(720px, calc(100% - 120px)); padding: 9px 10px 9px 14px; border-radius: 14px; background: rgba(32, 30, 29, .92); color: #fff; font-size: 13.5px; line-height: 1.4; box-shadow: var(--shadow-lg); }
.maphint .mh-ico { font-size: 20px; }
.maphint .mh-x { flex: none; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; }
body.at-start .minimap, body.at-start .maphint { visibility: hidden; }
.map-ctrl button[aria-pressed="true"] { background: var(--color-text); color: var(--color-bg); }
.details-legend { position: absolute; left: 84px; bottom: 12px; z-index: 5; max-width: min(620px, calc(100% - 330px)); padding: 8px 12px; border-radius: 12px; background: rgba(32, 30, 29, .9); color: #fff; font-size: 12.5px; line-height: 1.45; }
.wall-bar { margin-top: 2px; }
.soundpop { position: absolute; right: 12px; top: 12px; z-index: 8; width: 300px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--color-bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 10px; }
.soundpop .snd-h { display: flex; justify-content: space-between; align-items: center; }
.soundpop .snd-row { display: grid; grid-template-columns: 82px 1fr 44px; align-items: center; gap: 8px; font-size: 13px; }
.soundpop input[type=range] { width: 100%; accent-color: var(--color-accent); }
.langpop { width: 200px; right: 88px; }
.langpop .lang-list { display: flex; flex-direction: column; gap: 6px; }
.langpop .lang-list .btn { width: 100%; justify-content: flex-start; }
.langpop .lang-list .btn[aria-pressed="true"] { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.soundpop .snd-row b { text-align: right; font-variant-numeric: tabular-nums; }
.soundpop .snd-ui select { grid-column: 2 / -1; padding: 3px 6px; border-radius: 8px; border: 1px solid var(--color-divider); background: var(--color-bg); font: inherit; }
.chip.style { background: #efe2c8; }
body.at-start .details-legend { visibility: hidden; }
.ghost { position: absolute; z-index: 6; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 2px; transform: translate(-50%, calc(-100% - 8px)); }
.ghost canvas { width: 58px; height: 50px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.ghost.no canvas { opacity: .5; filter: grayscale(.7); }
.ghost-txt { max-width: 240px; padding: 4px 8px; border-radius: 8px; color: #fff; font-size: 12px; font-weight: 700; text-align: center; white-space: normal; }
.ghost.ok .ghost-txt { background: rgba(38, 104, 52, .94); }
.ghost.no .ghost-txt { background: rgba(140, 42, 30, .94); }
.place-sub .no-goal { color: var(--color-cumbre-500); font-weight: 700; }
.tip { position: absolute; z-index: 6; pointer-events: none; max-width: 260px; padding: 8px 10px; border-radius: 10px; background: rgba(32,30,29,.92); color: #fff; font-size: 12.5px; line-height: 1.4; }
.tip b { font-weight: 800; } .tip .act { color: #ffd5b5; }
.toasts { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 7; }
.toast { padding: 8px 14px; border-radius: 999px; background: rgba(32,30,29,.9); color: #fff; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-md); animation: toast-in .2s ease-out; }
/* Ficha de una especie (clic en el pool, en la tarjeta de un lugar o al elegir acompañantes) */
.spsheet { position: absolute; z-index: 9; width: 330px; padding: 12px; border-radius: 14px; background: var(--color-bg); box-shadow: var(--shadow-lg); }
.ss { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.ss-head { display: flex; align-items: center; gap: 10px; }
.ss-head canvas { width: 64px; height: 40px; flex: none; }
.ss-title b { display: block; font-size: 16px; font-weight: 800; }
.ss-title small { display: block; font-size: 12px; color: var(--color-neutral-700); }
.ss-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ss-stat { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 9px; background: var(--color-surface); }
.ss-stat b { font-size: 15px; }
.ss-stat .ss-l { font-weight: 700; color: var(--color-neutral-700); }
.ss-line { display: grid; grid-template-columns: 66px minmax(0, 1fr); align-items: baseline; gap: 6px; line-height: 1.35; }
.ss-k { flex: none; width: 66px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--color-neutral-700); }
.ss-terr { margin: 0; font-size: 12px; color: var(--color-neutral-700); }
.ss-extra { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; color: var(--color-neutral-700); border-top: 1px solid var(--color-divider); padding-top: 7px; }
.ss-extra .btn { padding: 4px 10px; font-size: 12px; }
.who-row.has-sheet { cursor: pointer; }
.who-row.has-sheet:hover { box-shadow: inset 0 0 0 1.5px var(--color-accent); }
.cp-detail { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .7); }
.cp-mchip .chips { margin-top: 3px; }
.cp-mchip .chip { font-size: 11px; padding: 1px 6px; }
/* Orígenes elegidos: barra de abajo (los avisos suben para no taparla) */
.selbar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 10px; max-width: min(860px, calc(100% - 260px)); padding: 7px 8px 7px 14px; border-radius: 14px; background: rgba(32, 30, 29, .92); color: #fff; font-size: 13px; line-height: 1.35; box-shadow: var(--shadow-lg); }
.selbar .sb-o { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.selbar .sb-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; }
.selbar .sb-help { color: rgba(255, 255, 255, .78); font-size: 12px; }
.selbar .sb-help b { color: #fff; }
.selbar kbd { background: #fff; color: var(--color-text); }
.selbar .sb-multi { flex: none; border: 0; border-radius: 999px; padding: 4px 10px; background: rgba(255, 255, 255, .16); color: #fff; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.selbar .sb-multi[aria-pressed="true"] { background: #fff; color: var(--color-text); }
body.touch .selbar .sb-multi { padding: 8px 12px; }
/* Angosto (iPad vertical): sin el texto de ayuda (la tarjeta lo dice) y a la izquierda, sin taparle el minimapa. */
@media (max-width: 1000px) { .selbar .sb-help { display: none; } .selbar { left: 88px; transform: none; max-width: calc(100% - 88px - 236px); } }
body.touch .selbar .x { width: 34px; height: 34px; }
body.touch .clock button, body.touch .send button { padding: 7px 10px; }
.selbar .x { flex: none; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; }
.stage.has-sel .toasts { bottom: 64px; }
.toast.warn { background: var(--color-danger); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* Tarjeta del lugar */
.place { position: absolute; right: 12px; top: 12px; width: 330px; max-height: calc(100% - 24px - 170px); overflow: auto; z-index: 4; padding: 14px; border-radius: var(--radius-md); background: var(--color-bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 10px; }
/* Termina arriba del minimapa (antes una regla posterior lo anulaba y en pantallas de 768 px de alto lo tapaba); con el minimapa plegado, casi todo el alto. */
.stage:has(#minimapBox.off) .place { max-height: calc(100% - 24px - 50px); }
.place h2 { margin: 0; font-family: var(--font-heading); font-weight: 400; font-size: 22px; line-height: 1.1; }
.place-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--color-neutral-800); }
.badge { font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--color-surface); }
.badge.fight { background: var(--fight); color: #fff; }
.close { position: absolute; right: 10px; top: 8px; border: 0; background: none; font-size: 18px; color: var(--color-neutral-700); }
.who { display: flex; flex-direction: column; gap: 6px; }
.who-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 12px; background: var(--color-surface); border-left: 4px solid var(--fc, #999); }
.who-row canvas { width: 44px; height: 28px; }
.who-row .nm { font-weight: 800; font-size: 13.5px; line-height: 1.15; }
.who-row .nm small { display: block; font-weight: 600; color: var(--color-neutral-700); font-size: 11.5px; }
.who-row .n { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.verdict { padding: 8px 10px; border-radius: 12px; font-size: 13px; font-weight: 700; background: var(--color-surface); }
.verdict.gana { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.verdict.pierde { background: var(--color-accent-100); color: var(--color-accent-800); }
.sec-k { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--color-neutral-700); margin: 2px 0 -4px; }
.acts { display: flex; flex-direction: column; gap: 6px; }
.act-btn { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--color-divider); background: var(--color-bg); font-weight: 700; font-size: 13.5px; text-align: left; }
.act-btn:hover:not(:disabled) { border-color: var(--color-accent); }
.act-btn:disabled { opacity: .5; cursor: not-allowed; }
.act-btn.primary { background: var(--color-accent); color: var(--color-bg); border-color: var(--color-accent); }
.act-btn .cost { font-weight: 800; white-space: nowrap; }
.why { font-size: 12px; color: var(--color-danger); font-weight: 600; }
.hint { font-size: 12px; color: var(--color-neutral-700); }

/* Fila de envío (tarjeta y menú del clic derecho): criatura, nombre, fuerza aquí, cuántas y quién gana */
.send-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; width: 100%; padding: 6px 8px; border-radius: 12px; border: 1px solid var(--color-divider); background: var(--color-bg); text-align: left; }
.send-row:hover:not(:disabled) { border-color: var(--color-accent); background: #fff; }
.send-row:disabled { opacity: .5; cursor: not-allowed; }
.send-row canvas { width: 40px; height: 25px; }
.send-row .nm { font-weight: 800; font-size: 13px; line-height: 1.2; }
.send-row .nm small { display: block; font-weight: 600; font-size: 11.5px; color: var(--color-neutral-700); }
.out { font-size: 11.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px; white-space: nowrap; background: var(--color-surface); }
.out.gana, .out.vacio { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.out.pierde { background: var(--color-accent-100); color: var(--color-accent-800); }
.out.pareja { background: #fff3cf; color: #7a5a00; }
.menu { position: absolute; z-index: 8; width: 330px; padding: 8px; border-radius: 14px; background: var(--color-bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 5px; }
.menu-h { font-size: 12px; font-weight: 800; color: var(--color-neutral-700); padding: 2px 4px; }
.send-row.chk { grid-template-columns: 18px 40px 1fr auto; }
.send-row.chk .tick { width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--color-divider); display: grid; place-items: center; font-weight: 900; font-size: 12px; color: #fff; }
.send-row.chk.on { border-color: var(--color-accent); background: #fff; }
.send-row.chk.on .tick { background: var(--color-accent); border-color: var(--color-accent); }
.menu-sum { font-size: 12.5px; font-weight: 700; padding: 4px 6px; border-radius: 8px; background: var(--color-surface); }
.menu-go { display: flex; gap: 6px; justify-content: flex-end; }
.menu-go .btn { padding: 6px 12px; font-size: 13px; }
.pc-send { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pc-send .tj { font-size: 12px; font-weight: 800; text-transform: none; letter-spacing: 0; }
/* Tope de Biomasa en los envíos (fila ámbar y barra de lo que alcanza), vista previa del gasto arriba y «Cuántas» del menú */
.cap-bar { display: block; height: 4px; margin: 3px 0 1px; border-radius: 2px; background: #f3d98a; overflow: hidden; }
.cap-bar span { display: block; height: 100%; background: #6a9a24; }
.send-row .nm small.cap, .menu-sum small.cap, .menu-qty small.cap { color: #8a5a00; font-weight: 700; }
.menu-sum small.cap { display: block; font-size: 11.5px; margin-top: 2px; }
.send-row .rt { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.send-row .rt small { font-size: 11px; font-weight: 700; color: var(--color-neutral-700); }
.send-row.capped { border-color: #e9c46a; }
.bio-p { font-weight: 800; font-size: 15px; color: var(--color-neutral-700); }
.bio-p.low { color: #b23a1e; }
.res.previewing { box-shadow: 0 0 0 2px #e9c46a; }
.chip.bio { background: #e3eed3; color: #3d5a12; }
.menu-qty { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 8px; align-items: center; font-size: 12px; font-weight: 700; padding: 2px 4px; }
.menu-qty small { grid-column: 1 / -1; font-size: 11.5px; color: var(--color-neutral-700); }
.menu-qty input[type=range] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: linear-gradient(to right, #6a9a24 0 var(--aff, 100%), #f3d98a var(--aff, 100%) 100%); }
.menu-qty input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--color-text); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.menu-qty input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--color-text); border: 2px solid #fff; }
.menu-rows { display: flex; flex-direction: column; gap: 5px; }
/* Panel de envío (ventana del clic derecho y tarjeta de un lugar que no es tuyo): compacto, una fila por especie */
#menu:has(.send-panel) { width: 320px; padding: 7px; }
/* En la ventana del clic derecho, el alto no pasa del mapa (main.js, `placeMenu`): con muchos lugares
   o especies, esas listas se achican con scroll propio y el título y el botón quedan siempre a la vista.
   Se achica antes la de los lugares: la de las especies es la que más se ajusta. */
#menu:has(.send-panel) { overflow: hidden; }
#menu .send-panel { flex: 0 1 auto; min-height: 0; }
#menu .spp-h, #menu .spp-foot { flex: none; }
#menu .spp-from, #menu .spp-sps { flex: 0 1 auto; min-height: 46px; overflow-y: auto; overscroll-behavior: contain; }
#menu .spp-from { flex-shrink: 4; }
.send-panel { display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.send-panel.in-card { padding: 6px; border-radius: 12px; border: 1px solid var(--color-divider); background: var(--color-bg); }
.spp-h { font-weight: 800; font-size: 13px; line-height: 1.2; }
.spp-h .spp-room { font-weight: 700; color: var(--color-neutral-700); }
.spp-from { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.spp-k { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--color-neutral-700); margin-right: 2px; }
.spp-place { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 3px; border-radius: 999px; border: 1px solid var(--color-divider); background: #fff; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.spp-place input { margin: 0; width: 12px; height: 12px; }
.spp-place small { font-weight: 700; color: var(--color-neutral-700); }
.spp-place:has(input:checked) { border-color: var(--color-accent); }
.spp-sps { display: flex; flex-direction: column; gap: 3px; }
.spp-sp { display: grid; grid-template-columns: 14px 26px minmax(0, max-content) minmax(60px, 1fr) auto; column-gap: 5px; align-items: center; padding: 2px 6px; border-radius: 8px; border: 1px solid var(--color-divider); background: #fff; }
.spp-sp input[type=checkbox] { margin: 0; width: 13px; height: 13px; }
.spp-sp canvas { width: 26px; height: 17px; }
.spp-sp .nm { font-weight: 800; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spp-sp .disc { min-width: 15px; height: 15px; padding: 0 3px; font-size: 10px; }
.spp-sp .spp-n { font-size: 11.5px; white-space: nowrap; min-width: 34px; text-align: right; }
.spp-sp input[type=range] { width: 100%; margin: 0; accent-color: var(--color-accent); }
.spp-sp.no { opacity: .5; }
.spp-foot { display: flex; align-items: center; gap: 6px; }
.spp-sum { flex: 1; min-width: 0; font-size: 11.5px; font-weight: 700; padding: 4px 7px; border-radius: 8px; background: var(--color-surface); line-height: 1.3; }
.spp-sum.err { background: #fbe3dc; color: #8a2b16; }
.spp-sum small.cap { display: block; font-size: 11px; color: #8a5a00; }
.spp-sum.gana, .spp-sum.vacio { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.spp-sum.pierde { background: var(--color-accent-100); color: var(--color-accent-800); }
.spp-sum.pareja { background: #fff3cf; color: #7a5a00; }
.spp-foot .btn { padding: 5px 12px; font-size: 13px; flex: none; }
.pc-k small.free { font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 999px; background: var(--color-accent-2-100); color: var(--color-accent-2-800); text-transform: none; letter-spacing: 0; }
.pc-origin { font-size: 12px; font-weight: 600; padding: 5px 8px; border-radius: 10px; background: var(--color-surface); color: var(--color-neutral-700); }
.pc-origin.on { background: var(--color-accent-2-100); color: var(--color-accent-2-800); font-weight: 700; }

/* Ficha: chips de números y terreno */
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--color-surface); white-space: nowrap; }
.chip.up { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.chip.down { background: var(--color-accent-100); color: var(--color-accent-800); }
.chip.no { opacity: .45; text-decoration: line-through; }
.chip.here { outline: 2px solid var(--color-text); }
.terrain { display: flex; gap: 3px; flex-wrap: wrap; }

/* Pool de especies */
.pool { display: flex; align-items: stretch; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--color-divider); background: var(--color-bg); overflow-x: auto; z-index: 5; }
.pool-k { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--color-neutral-700); text-align: center; }
.sp { position: relative; display: grid; grid-template-columns: 58px 1fr; grid-template-rows: auto auto; gap: 2px 8px; align-items: center; min-width: 228px; padding: 6px 10px 6px 6px; border-radius: 14px; border: 1px solid var(--color-divider); background: var(--color-bg); text-align: left; }
.sp[aria-pressed="true"] { border-color: var(--color-accent); box-shadow: 0 0 0 2px var(--color-accent); }
.sp canvas { grid-row: 1 / 3; width: 58px; height: 36px; }
.sp .nm { font-weight: 800; font-size: 13.5px; white-space: nowrap; }
.sp .nm small { font-weight: 600; color: var(--color-neutral-700); font-size: 11.5px; }
.sp .x { position: absolute; right: 4px; top: 2px; border: 0; background: none; font-size: 13px; color: var(--color-neutral-600); padding: 2px 4px; }

/* Hojas: mutar, ayuda, fin, inicio */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(32,30,29,.45); }
.overlay[hidden] { display: none; }
.sheet { width: min(860px, 100%); max-height: 100%; overflow: auto; padding: 20px 22px; border-radius: var(--radius-lg); background: var(--color-bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 14px; }
.sheet h2 { margin: 0; font-family: var(--font-heading); font-weight: 400; font-size: 26px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 760px) { .opts { grid-template-columns: 1fr; } }
.opt { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; border: 1px solid var(--color-divider); background: #fffaf2; }
.opt canvas { width: 100%; height: 110px; }
.opt h3 { margin: 0; font-size: 16px; }
.opt p { margin: 0; font-size: 12.5px; color: var(--color-neutral-800); }
.btn { border: 1px solid transparent; border-radius: 12px; padding: 9px 14px; font-weight: 800; background: none; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { border-color: var(--color-divider); }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.help-grid dt { font-weight: 800; white-space: nowrap; } .help-grid dd { margin: 0; color: var(--color-neutral-800); }
.start .sheet { width: min(760px, 100%); align-items: center; text-align: center; }
.start h1 { margin: 0; font-family: var(--font-heading); font-weight: 400; font-size: 44px; }
.start .lead { margin: 0; font-size: 15px; color: var(--color-neutral-800); }
.picks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; }
@media (max-width: 700px) { .picks { grid-template-columns: repeat(2, 1fr); } }
.pick { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px; border-radius: 16px; border: 2px solid var(--color-divider); background: #fffaf2; }
.pick[aria-pressed="true"] { border-color: var(--color-accent); box-shadow: 0 0 0 2px var(--color-accent); }
.pick canvas { width: 100%; height: 80px; }
.pick b { font-size: 15px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--color-surface); }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--color-text); color: var(--color-bg); }
.opts-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.start .play { font-size: 17px; padding: 12px 40px; }
.link { border: 0; background: none; color: var(--color-accent-700); font-weight: 700; text-decoration: underline; padding: 0; font-size: 13px; }
/* Idioma en la portada: ES · EN · PT · FR, el activo sin subrayar. */
.lang-sel { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; }
.lang-sel .link { padding: 0 5px; }
.lang-sel .link + .link { border-left: 1px solid var(--color-divider); }
.lang-sel .link[aria-pressed="true"] { text-decoration: none; color: var(--color-text); cursor: default; }
.likes { display: flex; flex-direction: column; gap: 3px; width: 100%; }
.likes-row { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; justify-content: center; }
.likes-k { font-size: 11px; font-weight: 800; color: var(--color-neutral-700); text-transform: uppercase; letter-spacing: .04em; margin-right: 2px; }
.likes-none { font-size: 12px; color: var(--color-neutral-700); }
.chip.no { text-decoration: none; }
/* Catálogo de especies (como un Pokédex) */
.dex { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.dex-item { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 8px; border-radius: 16px; border: 1px solid var(--color-divider); background: #fffaf2; text-align: center; }
.dex-item canvas { width: 100%; height: 70px; }
.dex-item.locked canvas { filter: brightness(0) opacity(.35); }
.dex-item b { font-size: 14px; }
.dex-item .how { font-size: 12px; font-weight: 700; color: var(--color-accent-700); }
.dex-h { margin: 6px 0 0; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--color-neutral-700); }
/* Sala y chat (en red) */
.input { font: inherit; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--color-divider); background: #fffaf2; color: var(--color-text); }
.input.code { width: 84px; text-transform: uppercase; letter-spacing: .15em; font-weight: 800; text-align: center; }
.lobby { width: min(820px, 100%); }
.lobby-form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.lobby-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; color: var(--color-neutral-700); }
.lobby-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 6px; }
.lp { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--color-surface); font-size: 14px; }
.lp.off { opacity: .55; }
.lp.ai { grid-template-columns: 1fr auto; }
.lp .ok { color: var(--color-accent-2-700); font-weight: 800; }
.lp .btn { padding: 2px 12px; }
.lobby-chat { display: flex; flex-direction: column; gap: 6px; }
.chat-log { max-height: 140px; overflow: auto; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.chat-dock { position: absolute; left: 12px; bottom: 12px; z-index: 6; width: 300px; display: flex; flex-direction: column; gap: 3px; }
.chat-line { align-self: flex-start; max-width: 100%; padding: 4px 10px; border-radius: 10px; background: rgba(32,30,29,.82); color: #fff; font-size: 12.5px; }
.chat-hint { font-size: 11px; color: var(--color-neutral-700); font-weight: 700; }
.chat-dock .input { width: 100%; }
/* Tooltip rápido (reemplaza al title del navegador) */
.ftip { position: fixed; z-index: 100; max-width: 280px; padding: 7px 10px; border-radius: 9px; background: rgba(32,30,29,.94); color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.35; pointer-events: none; box-shadow: var(--shadow-md); animation: ftip-in .08s ease-out; }
@keyframes ftip-in { from { opacity: 0; transform: translateY(2px); } }
.identity { display: flex; gap: 8px; justify-content: center; }
.identity .input { font-size: 16px; padding: 10px 14px; }
.identity .input.tag { width: 100px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; text-align: center; }
.start .play { min-width: 180px; }
/* Marca de cada especie tuya (número y color, iguales en el pool y en el mapa) */
.disc { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; color: #fff; font-size: 11px; font-weight: 800; vertical-align: 1px; box-shadow: 0 0 0 1.5px #fff; }
.sp.old { opacity: .7; }
.sp.gone { opacity: .5; }
.pool-old { align-self: center; border: 1px dashed var(--color-divider); border-radius: 12px; background: none; padding: 8px 12px; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.who-row .n .grow { font-size: 11px; color: var(--color-accent-2-700); font-weight: 800; }
/* Tarjeta del pool en tres líneas: nombre, dónde está y ficha */
.sp { grid-template-rows: auto auto auto; row-gap: 1px; }
.sp canvas { grid-row: 1 / 4; }
.sp .nm small { display: block; font-size: 11.5px; }
.sp .nm { padding-right: 18px; }
/* Especies que no pueden enviarse a este lugar: una línea con su marca. */
.send-away { font-size: 12px; color: var(--color-neutral-700); margin: 2px 2px 0; line-height: 1.7; }
.send-away > span { white-space: nowrap; margin-right: 10px; }
/* Escena de cerca del lugar (en su tarjeta). */
.place-scene { display: block; width: 100%; height: 168px; border-radius: 12px; border: 1px solid var(--rule); flex: none; }
/* Obra del pueblo: barra de avance. */
.build-bar { position: relative; height: 30px; border-radius: 8px; background: var(--color-surface, #efe6cf); overflow: hidden; border: 1px solid var(--rule); }
.build-bar span { position: absolute; inset: 0 auto 0 0; opacity: .35; }
.build-bar b { position: relative; display: grid; place-items: center; height: 100%; font-size: 12.5px; }
/* Migración: tres botones del mismo ancho. */
.seg.mig { display: grid; grid-template-columns: repeat(3, 1fr); }
/* Tutorial: la guía arriba a la izquierda y el resaltado de lo que hay que tocar. */
.coach { position: absolute; left: 60px; top: 12px; width: min(360px, calc(100% - 420px)); min-width: 240px; z-index: 5; padding: 12px 14px; border-radius: var(--radius-md); background: var(--color-bg); box-shadow: var(--shadow-lg); border: 2px solid #e0a800; }
.coach h3 { margin: 2px 0 4px; font-family: var(--font-heading); font-weight: 400; font-size: 19px; }
.coach p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.45; }
.coach-k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-neutral-700); }
.coach-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.tut-glow { outline: 3px solid #e0a800 !important; outline-offset: 2px; border-radius: 10px; animation: tutglow 1.1s ease-in-out infinite; }
@keyframes tutglow { 50% { outline-color: rgba(224, 168, 0, .2); } }
.btn.learn { width: 100%; }
@media (max-width: 760px) { .coach { left: 56px; right: 12px; width: auto; min-width: 0; } }
/* Junto al reloj: desde cuándo se puede ganar y la cuenta regresiva de quien sostiene la meta. */
.clock .winclock { font: 700 12px var(--font-body); padding: 3px 9px; border-radius: 999px; background: var(--color-surface, #efe6cf); color: var(--color-neutral-800, #3d3a35); white-space: nowrap; }
.clock .winclock.open { background: #e4ecd9; color: #3f6b3a; }
.clock .winclock.mine { background: #3f8f4e; color: #fff; animation: winpulse 1s ease-in-out infinite; }
.clock .winclock.rival { background: #c0392b; color: #fff; animation: winpulse 1s ease-in-out infinite; }
@keyframes winpulse { 50% { filter: brightness(1.18); } }
@media (prefers-reduced-motion: reduce) { .clock .winclock.mine, .clock .winclock.rival { animation: none; } }

/* ── Inicio: portada sobre una partida entre computadoras ───────────── */
/* Con el inicio a la vista, la partida de fondo se ve sola: sin barra, pool ni controles. */
body.at-start .app { grid-template-rows: 0 1fr 0; }
body.at-start .top, body.at-start .pool, body.at-start .map-ctrl, body.at-start #buildbar, body.at-start #place,
body.at-start #coach, body.at-start #chatDock, body.at-start #tip, body.at-start #ghost, body.at-start #migpop,
body.at-start #quest, body.at-start #voice { visibility: hidden; }
.overlay.start { background: radial-gradient(ellipse 75% 70% at 50% 50%, rgba(245, 234, 216, .1), rgba(245, 234, 216, .7)); }
.start .hero, .start .sheet { background: color-mix(in srgb, var(--color-bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.start .hero { width: min(1000px, 100%); max-height: 100%; overflow: auto; display: grid; grid-template-columns: 1.05fr 1fr; gap: 22px 30px; padding: 30px 32px 20px; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); text-align: left; }
.hero h1 { font-size: 54px; line-height: 1; }
.hero .tagline { margin: 12px 0 8px; font-size: 16px; line-height: 1.45; color: var(--color-neutral-800); max-width: 38ch; }
.hero .invite { margin: 4px 0 10px; padding: 8px 12px; border-radius: 12px; background: var(--color-accent-100); font-weight: 700; }
.parade { display: flex; gap: 2px; align-items: flex-end; margin: 4px 0 14px; min-height: 60px; }
.parade canvas { width: 66px; height: 58px; }
.id-box { padding: 12px 14px; border-radius: 16px; background: var(--color-surface); }
.id-box .id-k { margin-bottom: 8px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--color-neutral-700); }
.id-box .identity { justify-content: flex-start; }
.id-box .identity .input { flex: 1; min-width: 0; }
.id-box .hint { margin: 8px 0 0; }
.modes { display: grid; gap: 10px; align-content: center; }
.mode-card { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 1.5px solid var(--color-divider); border-radius: 18px; background: rgba(255, 255, 255, .6); text-align: left; transition: transform .12s, box-shadow .12s, border-color .12s; }
.mode-card:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--color-accent-300); box-shadow: var(--shadow-md); }
.mode-card:disabled { opacity: .45; cursor: not-allowed; }
.mode-card .ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--color-surface); font-size: 26px; }
.mode-card b { display: block; font-family: var(--font-heading); font-weight: 400; font-size: 20px; }
.mode-card small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--color-neutral-700); }
.mode-card .go { font-size: 26px; line-height: 1; color: var(--color-neutral-500); }
.mode-card.primary { border-color: var(--color-accent); background: var(--color-accent); color: #fff; }
.mode-card.primary small, .mode-card.primary .go { color: rgba(255, 255, 255, .88); }
.mode-card.primary .ico { background: rgba(255, 255, 255, .2); }
.hero .foot { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--color-divider); }
.hero .foot .opts-row { justify-content: center; }
@media (max-width: 860px) { .start .hero { grid-template-columns: 1fr; padding: 22px 18px 16px; } .hero h1 { font-size: 42px; } .parade { display: none; } }
/* Mirar: elegir entre computadoras o una partida en red. */
.watch-sheet { width: min(620px, 100%) !important; text-align: left !important; align-items: stretch !important; }
.watch-sheet h2 { text-align: center; }
.watch-opt { padding: 14px 16px; border-radius: 16px; background: var(--color-surface); }
.watch-opt h3 { margin: 0 0 4px; font-size: 18px; }
.watch-opt .opts-row { justify-content: flex-start; margin-top: 8px; }

/* ── Mirando (espectador) ─────────────────────────────────────────── */
.spect { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--color-surface); white-space: nowrap; }
.spect-k { font-weight: 800; font-size: 13px; }
.spect-dot { width: 10px; height: 10px; border-radius: 50%; }
.spect-sel { max-width: 230px; padding: 4px 6px; border: 1px solid var(--color-divider); border-radius: 8px; background: var(--color-bg); font: inherit; font-size: 13px; font-weight: 700; }
.spect-auto { padding: 4px 10px; border: 0; border-radius: 999px; background: transparent; font-weight: 700; font-size: 13px; color: var(--color-neutral-700); }
.spect-auto.on { background: var(--color-text); color: var(--color-bg); }
body.spectating .send, body.spectating #buildbar, body.spectating #migpop { display: none !important; }
.watch-note { margin-top: 6px; font-weight: 700; }
/* Partidas en red en curso (en la sala). */
.live-list { display: flex; flex-direction: column; gap: 6px; }
.live-row { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--color-surface); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #d9472b; box-shadow: 0 0 0 0 rgba(217, 71, 43, .5); animation: live 1.6s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(217, 71, 43, 0); } 100% { box-shadow: 0 0 0 0 rgba(217, 71, 43, 0); } }
.live-nm b { display: block; font-size: 14px; } .live-nm small { color: var(--color-neutral-700); }

/* ── Tarjeta del lugar, minimalista ────────────────────────────────── */
.pc-head { display: flex; align-items: center; gap: 8px; padding-right: 26px; }
.pc-head h2 { flex: 1; min-width: 0; }
.pc-works { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 5px; }
.pc-work { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px; border: 1.5px solid var(--color-divider); border-radius: 12px; background: rgba(255, 255, 255, .6); font-size: 11.5px; line-height: 1.15; text-align: center; }
.pc-work .ico { font-size: 20px; }
.pc-work b { font-size: 11.5px; }
.pc-work small { color: var(--color-neutral-700); font-weight: 700; }
button.pc-work:hover:not(:disabled) { border-color: var(--color-accent-300); background: #fff; }
button.pc-work:disabled { opacity: .5; }
.pc-work.done { background: var(--color-surface); border-style: dashed; }
.pc-work.busy { background: var(--color-surface); }
.pc-bar { display: block; width: 80%; height: 5px; margin-top: 3px; border-radius: 4px; background: rgba(0, 0, 0, .1); overflow: hidden; }
.pc-bar span { display: block; height: 100%; }
.pc-row { display: flex; align-items: center; gap: 8px; }
.pc-row .seg { flex: 1; }
.pc-k { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--color-neutral-700); }
.pc-evo { display: flex; gap: 6px; flex-wrap: wrap; }
.pc-evo .act-btn { flex: 1; min-width: 120px; }
.who-row.cocoon { grid-template-columns: 44px 1fr auto; background: color-mix(in srgb, #9a5fc0 10%, var(--color-surface)); }
.who-row.cocoon .egg { font-size: 22px; text-align: center; }
.who-row.cocoon .pc-bar { grid-column: 1 / -1; width: 100%; margin-top: 0; }
.sheet.meta { width: min(640px, 100%); }
.opts.two { grid-template-columns: repeat(2, 1fr); }
.opts.one { grid-template-columns: minmax(0, 340px); justify-content: center; }
@media (max-width: 760px) { .opts.two { grid-template-columns: 1fr; } }
.meta-opt { text-align: left; cursor: pointer; font: inherit; color: inherit; }
.meta-opt[aria-pressed="true"] { border-color: var(--color-accent); box-shadow: 0 0 0 2px var(--color-accent) inset; background: var(--color-bg); }
.meta-now { margin: 0; font-weight: 700; }
.meta-sp { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-sp button { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 12px; border: 1px solid var(--color-divider); background: var(--color-bg); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.mut-pick { flex-direction: column; }
.mut-pick button { padding: 6px 12px 6px 6px; font-size: 14px; }
.mut-pick button small { margin-left: auto; font-weight: 400; color: var(--color-neutral-800); }
.meta-sp button[aria-pressed="true"] { border-color: var(--color-accent); box-shadow: 0 0 0 2px var(--color-accent) inset; }
.meta-sp canvas { width: 44px; height: 28px; }
.meta-n { display: grid; grid-template-columns: 70px 1fr 44px; gap: 10px; align-items: center; font-weight: 700; }
.meta-n input { width: 100%; accent-color: var(--color-accent); }
.meta-n b { text-align: right; font-size: 18px; font-variant-numeric: tabular-nums; }
.meta-sum { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--color-surface); }
.meta-sum p { margin: 0; }
.meta-err { color: #a93a2b; font-weight: 700; }
.meta-go { display: flex; justify-content: flex-end; }
.send-row.short { grid-template-columns: 36px 1fr auto; padding: 4px 8px; }
.send-row.short canvas { width: 36px; height: 24px; }
.send-row.short .nm { font-size: 13px; }
.who-row .st-ico { font-size: 12px; }
kbd { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 4px; background: var(--color-text); color: var(--color-bg); font: 800 10px/16px var(--font-body); text-align: center; }

/* ── Campaña «Río Arriba» ──────────────────────────────────────────── */
/* Lista de capítulos (en el inicio), presentación con viñetas y final con estrellas. */
.cp-stars { display: inline-flex; gap: 1px; font-size: 16px; line-height: 1; letter-spacing: 0; }
.cp-stars i { font-style: normal; color: color-mix(in srgb, var(--color-text) 22%, transparent); }
.cp-stars i.on { color: #e0a800; text-shadow: 0 1px 0 #9a6c00; }
.cp-k { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--color-neutral-700); font-weight: 700; }
.start .sheet.cp-list { width: min(620px, 100%); text-align: left; align-items: stretch; gap: 12px; }
.cp-list h2 { text-align: center; font-size: 30px; }
.cp-list .lead { margin: 0; text-align: center; font-size: 14.5px; line-height: 1.45; color: var(--color-neutral-800); }
.cp-list .opts-row { justify-content: center; }
.cp-act { display: grid; gap: 6px; }
.cp-act-h { margin-top: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--color-neutral-700); font-weight: 700; }
.cp-level { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; text-align: center; }
.cp-level-k { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--color-neutral-700); font-weight: 700; }
.cp-level small { flex-basis: 100%; color: var(--color-neutral-700); font-size: 12.5px; line-height: 1.4; }
.cp-ch { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 1.5px solid var(--color-divider); border-radius: 14px; background: rgba(255, 255, 255, .62); text-align: left; transition: transform .12s, box-shadow .12s, border-color .12s; }
.cp-ch:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--color-accent-300); box-shadow: var(--shadow-md); }
.cp-ch .n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--color-accent); color: #fff; font-weight: 800; }
.cp-ch b { display: block; font-family: var(--font-heading); font-weight: 400; font-size: 17px; }
.cp-ch small { display: block; font-size: 12px; color: var(--color-neutral-700); }
.cp-ch.locked { opacity: .5; cursor: default; }
.cp-ch.locked .n { background: var(--color-neutral-500); }
.cp-ch .lock { font-size: 15px; color: var(--color-neutral-700); }
.start .sheet.cp-brief, #end .sheet.cp-end { width: min(600px, 100%); text-align: left; align-items: stretch; gap: 12px; }
.cp-brief h2, .cp-end h2 { margin: -6px 0 0; font-size: 30px; }
.cp-brief .cp-k, .cp-brief h2, .cp-end .cp-k, .cp-end h2, .cp-end .lead, .cp-end .hint { text-align: center; }
.cp-end .lead { margin: 0; font-size: 16px; font-weight: 700; }
.cp-end .lead small { font-weight: 500; color: var(--color-neutral-700); }
.cp-big { display: grid; place-items: center; }
.cp-big .cp-stars { font-size: 46px; gap: 6px; }
.cp-brief .opts-row, .cp-end .opts-row { justify-content: center; }
.cp-lines { display: grid; gap: 8px; }
.cp-line { display: grid; grid-template-columns: 68px 1fr; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 16px; background: #fffaf2; border: 1.5px solid var(--color-divider); }
.cp-line b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-accent-600, #9c5226); }
.cp-line p { margin: 2px 0 0; font-size: 15px; line-height: 1.4; }
.cp-line.narra { background: transparent; border-style: dashed; }
.cp-line.narra p { font-style: italic; color: var(--color-neutral-800); }
.cp-face { width: 68px; height: 56px; border-radius: 12px; background: radial-gradient(circle at 50% 60%, #efe2c8, #e2cfa8); }
.cp-face.icon { display: grid; place-items: center; font-size: 30px; }
.cp-goal { display: grid; gap: 6px; padding: 12px 14px; border-radius: 16px; background: var(--color-surface); }
.cp-goal p { margin: 0; display: grid; grid-template-columns: 26px 1fr; gap: 6px; font-size: 14px; line-height: 1.4; }
.cp-goal .ico { font-size: 17px; line-height: 1.2; }
.cp-starline { color: var(--color-neutral-800); }

/* En la partida: el objetivo (arriba a la izquierda) y las voces (abajo, sobre el pool). */
.quest { position: absolute; left: 86px; top: 12px; width: min(330px, calc(100% - 420px)); min-width: 250px; z-index: 5; padding: 10px 12px; border-radius: var(--radius-md); background: color-mix(in srgb, var(--color-bg) 94%, transparent); box-shadow: var(--shadow-lg); display: grid; gap: 6px; }
.quest .q-head { display: flex; justify-content: space-between; align-items: center; }
.quest .q-head .link { font-size: 14px; padding: 0 4px; }
.quest .q-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.quest .q-rain { font-size: 15px; }
.quest .q-saved { font-size: 13.5px; font-weight: 700; }
.quest .cp-stars { margin-left: auto; font-size: 15px; }
.quest .q-bar { position: relative; height: 9px; margin: 6px 0 10px; border-radius: 999px; background: var(--color-surface); }
.quest .q-bar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--color-accent); transition: width .3s; }
.quest .q-bar .mk { position: absolute; top: 9px; transform: translateX(-100%); font-style: normal; font-size: 9px; line-height: 1; color: color-mix(in srgb, var(--color-text) 35%, transparent); white-space: nowrap; }
.quest .q-bar .mk::before { content: ''; position: absolute; right: 0; top: -9px; height: 9px; border-right: 2px solid color-mix(in srgb, var(--color-text) 35%, transparent); }
.quest .q-bar .mk.on { color: #b07f00; }
.quest .q-rule { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--color-neutral-800); }
@media (max-width: 760px) { .quest { left: 82px; right: 12px; width: auto; min-width: 0; } }
.voice { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); z-index: 8; display: grid; grid-template-columns: 68px 1fr; align-items: center; gap: 12px; width: min(520px, calc(100% - 32px)); padding: 8px 16px 8px 8px; border-radius: 18px; background: color-mix(in srgb, var(--color-bg) 96%, transparent); box-shadow: var(--shadow-lg); border: 2px solid var(--color-accent); animation: voice-in .25s ease-out; pointer-events: none; }
@keyframes voice-in { from { transform: translate(-50%, 8px); opacity: 0; } }
.voice b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-accent-600, #9c5226); }
.voice p { margin: 2px 0 0; font-size: 15px; line-height: 1.4; font-weight: 600; }
.voice.narra { border-color: var(--color-neutral-500); }
.voice.narra p { font-style: italic; font-weight: 500; }
/* La tarjeta del lugar: qué pasa con el fuego. */
.fire-line { margin: -2px 0 2px; padding: 5px 10px; border-radius: 10px; font-size: 12.5px; font-weight: 700; background: var(--color-surface); }
.fire-line.soon { background: #f6dfc4; color: #8a3b14; }
.fire-line.smoke { background: #e9b48f; color: #6d2408; animation: winpulse 1s ease-in-out infinite; }
.fire-line.burn { background: #c4401b; color: #fff; }
.fire-line.ash { background: #3a332f; color: #e9e2db; }
.fire-line.safe { background: #e4ecd9; color: #3f6b3a; }
/* La barra de arriba en la campaña: las marcas de la 2.ª y 3.ª estrella, y la lluvia. */
.land .land-mk { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--color-text); opacity: .35; }
.clock .winclock.rain { background: #dbe6ee; color: #2f5671; }
.land.no-goal::after { display: none; }
.fire-line.target { background: #f3e1a6; color: #6b4d00; }
/* Capítulos con metas: la lista (en el panel y en el final) y la manada que viaja. */
.q-goals { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.q-goals li { display: grid; grid-template-columns: 18px 1fr; align-items: baseline; color: var(--color-neutral-800); }
.q-goals li.ok { color: #3f6b3a; font-weight: 700; }
.q-goals .tick { font-weight: 800; }
.q-goals small { font-weight: 500; color: var(--color-neutral-700); white-space: nowrap; }
.cp-checks { align-self: center; font-size: 14.5px; gap: 5px; }
.cp-manada { display: grid; gap: 8px; padding: 10px 12px; border-radius: 16px; border: 1.5px dashed var(--color-divider); }
.cp-mrow { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-mchip { display: grid; grid-template-columns: 52px auto; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 14px; border: 1.5px solid var(--color-divider); background: rgba(255, 255, 255, .6); text-align: left; }
.cp-mchip.on { border-color: var(--color-accent); background: #fff3e8; box-shadow: inset 0 0 0 1px var(--color-accent); }
.cp-mchip.fixed { cursor: default; }
.cp-mchip b { display: block; font-size: 13.5px; }
.cp-mchip small { display: block; font-size: 12px; color: var(--color-neutral-700); }
.cp-sp { width: 52px; height: 36px; }
.cp-manada .hint { margin: 0; font-size: 12.5px; }
/* Botones arriba en la lista de capítulos y en la presentación (abajo quedan tras el scroll). */
.cp-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: -6px; }
.cp-top .btn { padding: 6px 12px; font-size: 13px; }
/* La decisión (capítulo 6): dos opciones grandes. */
.cp-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 600px) { .cp-options { grid-template-columns: 1fr; } }
.cp-option { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--color-divider); background: #fffaf2; text-align: left; transition: transform .12s, border-color .12s, box-shadow .12s; }
.cp-option:hover { transform: translateY(-1px); border-color: var(--color-accent); box-shadow: var(--shadow-md); }
.cp-option .ico { font-size: 26px; line-height: 1; }
.cp-option b { display: block; font-family: var(--font-heading); font-weight: 400; font-size: 18px; }
.cp-option small { display: block; margin-top: 3px; font-size: 13px; line-height: 1.35; color: var(--color-neutral-700); }

/* ── Mods (ui/mods.js): la pantalla para elegir uno, el HUD, la voz y sus botones ── */
.mods-sheet { width: min(720px, 100%); }
.mods-sheet .mod-cards { align-content: start; }
.mod-card[aria-pressed="true"] { border-color: var(--color-accent); box-shadow: 0 0 0 2px var(--color-accent); }
.mod-community { display: flex; flex-direction: column; gap: 8px; }
.mc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.mc-head h3 { margin: 0; font-size: 16px; }
.mc-search { display: flex; gap: 8px; }
.mc-search .input { flex: 1; min-width: 0; }
.mod-detail { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--color-divider); background: #fffaf2; }
.mod-detail h3 { margin: 0; font-family: var(--font-heading); font-weight: 400; font-size: 22px; }
.mod-detail p { margin: 0; line-height: 1.45; }
.mod-errs { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.45; }
.mod-errs code { font-size: 11.5px; padding: 1px 5px; border-radius: 6px; background: var(--color-surface); }
.mod-face { display: grid; place-items: center; width: 68px; height: 56px; border-radius: 12px; background: radial-gradient(circle at 50% 60%, #efe2c8, #e2cfa8); font-size: 32px; }
.q-goals.mod-hud li { grid-template-columns: 22px 1fr auto; gap: 4px; }
.q-goals.mod-hud b { font-variant-numeric: tabular-nums; }
.mod-acts { margin-top: 2px; }
.buildbar button.mod-bar:disabled { opacity: .5; cursor: not-allowed; }
/* El mod de la sala de red */
.lobby-mod { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--color-divider); background: #fffaf2; }
.lobby-mod .lm-k { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--color-neutral-700); }
.lobby-mod .lm-info { flex: 1 1 260px; min-width: 0; }
.lobby-mod .lm-desc { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: var(--color-neutral-800); }
.lobby-mod select { width: auto; max-width: 100%; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--color-divider); background: #fff; font: inherit; font-size: 14px; }

/* Mods: íconos que son imágenes del mod («@nombre») */
.mod-ico { width: 1.3em; height: 1.3em; object-fit: contain; vertical-align: -0.28em; }
.mod-face .mod-ico { width: 100%; height: 100%; vertical-align: 0; }
