/* El Radar de maná, fase 2a de la caza con maná (js/radar-mana.js; CAZA-CON-MANA.md §11; mockups/mana-al-caminar.html).
   Todo cuelga del prefijo rm-: el chip sobre el mapa de Recorrer, las vertientes en el mapa, la tarjeta del paseo y las hojas.
   Un solo acento (--acc), íconos de trazo fino, nada por debajo de 12 px. */

/* El chip: dentro del panel de Recorrer (#pintar-panel, solo con body.pintando), arriba a la izquierda, bajo las píldoras de km y boletos;
   durante un paseo, bajo los números de la salida. */
#rm-chip { display: none; }
body.pintando #rm-chip:not([hidden]) {
  position: absolute; z-index: 3; pointer-events: auto; top: calc(60px + var(--sa-arriba, 0px)); left: 12px;
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 0; white-space: nowrap;
  background: var(--surf, #fff); color: var(--ink, #1F1D1A); box-shadow: var(--csh, 0 2px 10px rgba(0,0,0,.14));
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; cursor: pointer; max-width: calc(100% - 24px);
}
body.pintando #rm-chip.en-paseo:not([hidden]) { top: calc(150px + var(--sa-arriba, 0px)); }
#rm-chip small { font-size: 12px; font-weight: 500; color: var(--muted, #6B675F); }
#rm-chip .ico { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--field, #F1EEE8); color: var(--muted, #6B675F); display: grid; place-items: center; position: relative; }
#rm-chip .ico .trazo { width: 17px; height: 17px; }
#rm-chip.on .ico { background: var(--acc); color: var(--acc-ink, #fff); }
#rm-chip.on .ico .trazo { stroke: currentColor; }
#rm-chip.on .ico::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--acc); opacity: 0; }
#rm-chip.on.late .ico::after { animation: rm-pulso .9s ease-out; }

/* Las vertientes en el mapa: un disco con la gota y su estrella. Llena = te da maná hoy; punteada = ya la tomaste. */
.rm-vt { position: relative; width: 34px; height: 34px; padding: 0; border: 0; background: none; cursor: pointer; }
.rm-vt-disco { position: absolute; inset: 4px; border-radius: 50%; background: var(--surf, #fff); border: 2px solid var(--acc); color: var(--acc);
  display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.rm-vt-disco .trazo { width: 15px; height: 15px; stroke: currentColor; }
.rm-vt.tomada .rm-vt-disco { border-style: dashed; color: var(--muted, #6B675F); border-color: var(--muted, #6B675F); background: var(--field, #F1EEE8); }
.rm-vt.dormida .rm-vt-disco { opacity: .55; border-color: var(--muted, #6B675F); color: var(--muted, #6B675F); }
.rm-vt.apagada .rm-vt-disco { border-style: dotted; }
.rm-vt.lejos::before, .rm-vt.cerca::before, .rm-vt.cerca::after, .rm-vt.aqui::before, .rm-vt.aqui::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--acc); opacity: 0; pointer-events: none; }
.rm-vt.lejos::before { animation: rm-onda 2.6s ease-out infinite; }
.rm-vt.cerca::before { animation: rm-onda 1.3s ease-out infinite; }
.rm-vt.cerca::after { animation: rm-onda 1.3s ease-out .2s infinite; }
.rm-vt.aqui .rm-vt-disco { background: var(--acc); color: var(--acc-ink, #fff); }
.rm-vt.aqui::before { animation: rm-onda .8s ease-out infinite; background: color-mix(in srgb, var(--acc) 12%, transparent); }
.rm-vt.aqui::after { animation: rm-onda .8s ease-out .15s infinite; }
@keyframes rm-onda { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(2.1); opacity: 0; } }
@keyframes rm-pulso { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }

/* La tarjeta durante el paseo (dentro del panel de la salida de Recorrer). */
#rm-vivo { display: grid; gap: 8px; margin-top: 10px; }
#rm-vivo:empty { display: none; }
.rm-card { display: grid; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm, 16px); background: var(--field, #F1EEE8); }
.rm-card.alerta { background: color-mix(in srgb, var(--acc) 12%, var(--surf, #fff)); }
.rm-cab { display: flex; align-items: center; gap: 10px; }
.rm-rad { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surf, #fff); color: var(--acc); position: relative; }
.rm-rad .trazo { width: 18px; height: 18px; stroke: currentColor; }
.rm-card.alerta .rm-rad { background: var(--acc); color: var(--acc-ink, #fff); }
.rm-rad.doble::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--acc); animation: rm-pulso 1.3s ease-out infinite; }
.rm-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 14px; font-weight: 600; }
.rm-tx small { font-size: 12.5px; font-weight: 400; color: var(--muted, #6B675F); }
.rm-m { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rm-m small { font-size: 12px; font-weight: 500; color: var(--muted, #6B675F); margin-left: 1px; }
.rm-card .pt-boton { min-height: 48px; }
.rm-card .pt-boton:disabled { opacity: .55; }
.rm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rm-pildora { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surf, #fff); color: var(--ink, #1F1D1A); }
.rm-pildora.acc { background: var(--acc); color: var(--acc-ink, #fff); }
.rm-progreso { height: 6px; border-radius: 999px; background: var(--surf, #fff); overflow: hidden; }
.rm-progreso i { display: block; height: 100%; background: var(--acc); border-radius: inherit; }
.rm-x { width: 32px; height: 32px; flex: none; border: 0; border-radius: 50%; background: var(--surf, #fff); color: var(--muted, #6B675F); font-size: 18px; line-height: 1; cursor: pointer; }

/* Las hojas: el radar y la ficha de una vertiente. */
.rm-hoja { display: grid; gap: 12px; }
.rm-hoja h3 { margin: 0; font-size: 19px; }
.rm-sub { margin: 0; font-size: 14px; color: var(--muted, #6B675F); }
.rm-ensayo { margin: 0; font-size: 13px; padding: 8px 12px; border-radius: 12px; background: var(--field, #F1EEE8); }
.rm-franja { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm, 16px); background: var(--field, #F1EEE8); cursor: default; }
/* .cg-hoja label (cuadricula.css) pone display: block y márgenes: aquí manda la franja. */
.cg-hoja label.rm-franja, label.rm-franja { display: flex; margin: 0; font-size: inherit; color: inherit; cursor: pointer; }
.rm-ic { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surf, #fff); color: var(--muted, #6B675F); }
.rm-ic .trazo { width: 18px; height: 18px; stroke: currentColor; }
.rm-ic.acc { background: var(--acc); color: var(--acc-ink, #fff); }
.rm-sw { width: 22px; height: 22px; flex: none; accent-color: var(--acc); }
.rm-escuchar { justify-self: start; border: 1px solid var(--acc); color: var(--acc); background: transparent; border-radius: 999px; padding: 8px 14px; font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1; cursor: pointer; }

/* La fila de la hoja Pasear (usa .ru-via de portada-unida.css): el ícono con el acento cuando el radar está encendido. */
.ru-via-ic.rm-on { background: var(--acc); color: var(--acc-ink, #fff); }
.ru-via-ic.rm-on .trazo { stroke: currentColor; }

@media (prefers-reduced-motion: reduce) {
  .rm-vt::before, .rm-vt::after, #rm-chip.on.late .ico::after, .rm-rad.doble::after { animation: none; }
}
