/* Árbol de talentos interactivo (estatico/js/visor.js).
   Todo vive bajo .visor y usa los tokens de sitio.css siempre con valor de reserva (ver web/ESPEC.md).
   Móvil primero: un árbol con pestañas y barra de nivel flotante; desde 640 px de ancho del visor, árbol
   y dino en dos columnas; desde 900 px (pantalla de 1024), los tres árboles lado a lado como en los
   vídeos, y desde 1060 px el dino en una columna al lado. Los cortes son consultas de contenedor:
   miran el ancho real del visor, no el de la ventana. */

.visor {
  --v-dorado: var(--dorado, #E8C36A);
  --v-dorado-oscuro: var(--dorado-oscuro, #AE9250);
  --v-verde: var(--verde, #78E682);
  --v-apagado: var(--apagado, #9696A0);
  --v-acento: var(--acento, #9146FF);
  --v-acento-claro: var(--acento-claro, #C9A8FF);
  --v-fondo: var(--fondo, #0B0B10);
  --v-sup: var(--superficie, #15141F);
  --v-sup-2: var(--superficie-2, #1D1C2A);
  --v-borde: var(--borde, rgba(255, 255, 255, .12));
  --v-texto: var(--texto, #EDEAF5);
  --v-suave: var(--texto-suave, #B9B5C9);
  --v-f-titulo: var(--fuente-titulo, "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  --v-f-texto: var(--fuente-texto, "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  --v-radio-s: var(--radio-s, 8px);
  --v-radio-m: var(--radio-m, 14px);
  --v-radio-l: var(--radio-l, 20px);
  --v-sombra: var(--sombra, 0 14px 34px rgba(0, 0, 0, .6));
  --v-clase: var(--clase, var(--visor-clase, #9146FF));
  --v-z-flotante: var(--z-flotante, 60);
  --v-amarillo: #FFD100;      /* texto de los tooltips del juego, como en el vídeo */
  --v-vacio: #3A3A44;         /* marco de un talento sin puntos */
  --v-gris-flecha: #63636F;
  --v-borde-caja: rgba(196, 196, 210, .82);
  position: relative;
  color: var(--v-texto);
  font-family: var(--v-f-texto);
  font-weight: 500;
  -webkit-text-size-adjust: 100%;
}

/* Hueco reservado mientras carga el JS (solo si hay JS: sin él, la lista de pasos basta). */
@media (scripting: enabled) {
  .visor:empty { min-height: 940px; }
}
@media (scripting: enabled) and (min-width: 700px) {
  .visor:empty { min-height: 690px; }
}
@media (scripting: enabled) and (min-width: 1000px) {
  .visor:empty { min-height: 640px; }
}
@media (scripting: enabled) and (min-width: 1280px) {
  .visor:empty { min-height: 700px; }
}

.visor *,
.visor *::before,
.visor *::after { box-sizing: border-box; }

.visor [hidden] { display: none !important; }

.visor p,
.visor ul { margin: 0; }

.visor ul { padding: 0; list-style: none; }

.visor img { max-width: none; }

.visor button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  font: inherit;
  color: inherit;
  text-transform: none;
  letter-spacing: normal;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Palabras resaltadas de los títulos: caja morada con texto blanco, como en los vídeos. */
.visor mark {
  margin: 0 .04em;
  padding: .02em .24em .05em;
  border-radius: .32em;
  background: var(--v-acento);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--v-acento) 62%, #fff),
    0 0 14px color-mix(in srgb, var(--v-acento) 45%, transparent);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.visor .visor-icono {
  display: block;
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visor .visor-oculto {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------ maquetación */
.visor .visor__cuerpo { container: visor / inline-size; }

/* Móvil: pestañas, árbol, barra y explicación, en ese orden (visor.js coloca la barra en el DOM según
   --visor-barra para que el tabulador siga el orden visual). */
.visor .visor__rejilla {
  --visor-barra: abajo;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "pestanas" "arboles" "control" "charla";
  gap: 8px;
}

/* ------------------------------------------------------------------ control de nivel */
/* En móvil va justo debajo del árbol y se queda pegada arriba o abajo de la pantalla al desplazar:
   fila 1, botones y estado (nivel, puntos y título corto del paso); fila 2, deslizador y Resumen. */
.visor .visor-control {
  grid-area: control;
  position: sticky;
  top: calc(var(--tope, 60px) + 6px);
  bottom: max(8px, env(safe-area-inset-bottom, 0px));
  z-index: 8;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "botones estado estado"
    "deslizador deslizador resumen";
  align-items: center;
  gap: 2px 8px;
  padding: 7px 10px 3px;
  border-radius: var(--v-radio-l);
  border: 1px solid color-mix(in srgb, var(--v-dorado) 40%, transparent);
  background: linear-gradient(180deg, rgba(28, 26, 44, .95), rgba(11, 11, 19, .97));
  box-shadow: 0 16px 36px rgba(0, 0, 0, .62), inset 0 1px 0 rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.visor .visor-botones {
  grid-area: botones;
  display: flex;
  align-items: center;
  gap: 4px;
}

.visor .visor-boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: var(--v-texto);
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .1s, opacity .15s;
}

.visor .visor-boton:hover {
  background: rgba(255, 255, 255, .12);
  border-color: color-mix(in srgb, var(--v-dorado) 60%, transparent);
}

.visor .visor-boton:active { transform: scale(.94); }

.visor .visor-boton[aria-disabled="true"] {
  opacity: .36;
  cursor: default;
  transform: none;
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .1);
}

.visor .visor-boton--play {
  width: 48px;
  height: 48px;
  border: 0;
  color: #241A06;
  background: linear-gradient(180deg, #F7E1A4, var(--v-dorado) 55%, #C99F49);
  box-shadow: 0 0 0 2px #0E0C06, 0 4px 16px color-mix(in srgb, var(--v-dorado) 35%, transparent);
}

.visor .visor-boton--play:hover {
  background: linear-gradient(180deg, #FBEABF, var(--v-dorado) 60%, #D1A852);
}

.visor .visor-boton--play .visor-icono { width: 24px; height: 24px; }
.visor .visor-boton--play .visor-icono--play { margin-left: 3px; }
.visor .visor-boton--play .visor-icono--pausa,
.visor .visor-boton--play.es-pausa .visor-icono--play { display: none; }
.visor .visor-boton--play.es-pausa .visor-icono--pausa { display: block; }

.visor .visor-boton--texto {
  grid-area: resumen;
  justify-self: end;
  width: auto;
  min-width: 44px;
  padding: 0 13px;
  font-size: 13px;
}

.visor .visor-boton--texto .visor-icono { display: none; width: 18px; height: 18px; color: var(--v-dorado); }

.visor .visor-boton--texto[aria-pressed="true"] {
  opacity: 1;
  color: #241A06;
  border-color: transparent;
  background: var(--v-dorado);
}

.visor .visor-boton--texto[aria-pressed="true"] .visor-icono { color: inherit; }

.visor .visor-estado {
  grid-area: estado;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.visor .visor-estado__linea {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

.visor .visor-estado__nivel {
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.15;
  color: #fff;
  white-space: nowrap;
}

.visor .visor-estado__nv-corto { display: none; }

.visor .visor-estado__titulo {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: .8rem;
  line-height: 1.3;
  color: var(--v-dorado);
}

.visor .visor-estado__nivel b,
.visor .visor-estado__puntos b {
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.visor .visor-estado__nivel b { color: var(--v-dorado); }

.visor .visor-estado__puntos {
  min-width: 0;
  font-size: .75rem;
  line-height: 1.3;
  color: var(--v-suave);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visor .visor-estado__puntos::before { content: "· "; }

.visor .visor-estado__puntos b { color: #fff; }

.visor .visor-reparto {
  grid-area: reparto;
  display: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.visor .visor-reparto__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px 3px 3px;
  border-radius: 999px;
  background: rgb(var(--arbol-rgb));
  border: 1px solid rgb(var(--arbol-claro) / .55);
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  color: #fff;
  transition: border-color .2s, box-shadow .2s;
}

.visor .visor-reparto__item img {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 999px;
}

.visor .visor-reparto__item b { color: var(--v-dorado); font-variant-numeric: tabular-nums; }
.visor .visor-reparto__item.sin-puntos b { color: var(--v-apagado); }

.visor .visor-reparto__item.es-activo {
  border-color: var(--v-dorado);
  box-shadow: 0 0 12px color-mix(in srgb, var(--v-dorado) 45%, transparent);
}

/* Deslizador: la bola dorada con el nivel dentro, como la barra del vídeo. */
.visor .visor-deslizador {
  grid-area: deslizador;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.visor .visor-deslizador__fin {
  display: none;
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: 13px;
  color: #AAAAB9;
  white-space: nowrap;
}

.visor .visor-deslizador__pista {
  --r: 17px;
  position: relative;
  flex: 1;
  min-width: 0;
  height: 46px;
}

.visor .visor-rango {
  --lleno: calc(var(--r) + (100% - 2 * var(--r)) * var(--pos, 1));
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.visor .visor-rango:focus { outline: none; }

.visor .visor-rango::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #C99F49 0, #F4DEA6 var(--lleno), #11111B var(--lleno), #11111B 100%);
  box-shadow: inset 0 0 0 2px #464658;
}

.visor .visor-rango::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 34px;
  height: 34px;
  margin-top: -11px;
  border-radius: 50%;
  border: 3px solid #0E0C06;
  background: radial-gradient(circle at 50% 32%, #FCEBC0, var(--v-dorado) 58%, #C99F49);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .6);
}

.visor .visor-rango::-moz-range-track {
  height: 12px;
  border-radius: 999px;
  background: #11111B;
  box-shadow: inset 0 0 0 2px #464658;
}

.visor .visor-rango::-moz-range-progress {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #C99F49, #F4DEA6);
}

.visor .visor-rango::-moz-range-thumb {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #0E0C06;
  background: radial-gradient(circle at 50% 32%, #FCEBC0, var(--v-dorado) 58%, #C99F49);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .6);
}

.visor .visor-rango:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--v-acento);
}

.visor .visor-rango:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--v-acento);
}

.visor .visor-deslizador__burbuja {
  position: absolute;
  top: 50%;
  left: calc(var(--r) + (100% - 2 * var(--r)) * var(--pos, 1));
  transform: translate(-50%, -50%);
  pointer-events: none;
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  color: #221806;
  font-variant-numeric: tabular-nums;
}

.visor .visor-marcas {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 9px);
  height: 6px;
  pointer-events: none;
}

.visor .visor-marca {
  position: absolute;
  top: 0;
  left: calc(var(--r) + (100% - 2 * var(--r)) * var(--f));
  width: 2px;
  height: 6px;
  margin-left: -1px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--v-dorado) 60%, transparent);
}

/* ------------------------------------------------------------------ pestañas (un árbol a la vez) */
.visor .visor-pestanas {
  grid-area: pestanas;
  display: grid;
  grid-template-columns: repeat(var(--n-arboles, 3), minmax(0, 1fr));
  gap: 6px;
  margin-bottom: -2px;
}

.visor .visor-pestana {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 46px;
  padding: 3px 3px;
  border-radius: 14px 14px 8px 8px;
  border: 2px solid color-mix(in srgb, var(--v-dorado-oscuro) 50%, transparent);
  background:
    linear-gradient(180deg, rgb(var(--arbol-rgb) / .95), rgb(var(--arbol-rgb) / .5)),
    #0B0B12;
  color: #D6D3E2;
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: clamp(11.5px, 3.6cqi, 13px);   /* "Supervivencia" cabe entera a 360 px */
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  opacity: .72;
  transition: opacity .15s, border-color .15s, box-shadow .2s;
}

.visor .visor-pestana:hover { opacity: .92; }

.visor .visor-pestana[aria-selected="true"] {
  opacity: 1;
  color: #fff;
  border-color: var(--v-dorado);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .5);
}

.visor .visor-pestana[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  margin-left: -7px;
  border-top: 7px solid var(--v-dorado);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
}

/* Punto dorado: este árbol recibe puntos en el paso actual. */
.visor .visor-pestana.es-activo::before {
  content: "";
  position: absolute;
  top: 6px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--v-dorado);
  box-shadow: 0 0 8px 2px color-mix(in srgb, var(--v-dorado) 75%, transparent);
  animation: visor-punto 1.1s ease-in-out infinite alternate;
}

.visor .visor-pestana__nombre {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .6);
}

.visor .visor-pestana__pts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 9px 1px 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .6);
  border: 1px solid color-mix(in srgb, var(--v-dorado) 80%, transparent);
  color: var(--v-dorado);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.visor .visor-pestana.sin-puntos .visor-pestana__pts {
  color: var(--v-apagado);
  border-color: color-mix(in srgb, var(--v-dorado) 30%, transparent);
}

.visor .visor-pestana__icono {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.visor .visor-pestana__ud { display: none; }

/* ------------------------------------------------------------------ árboles */
.visor .visor-arboles {
  grid-area: arboles;
  align-self: start;
  align-items: start;
  min-width: 0;
}

.visor .visor-arbol {
  display: none;
  position: relative;
  min-width: 0;
  container-type: inline-size;
}

.visor .visor-arbol.es-visible { display: block; }

.visor .visor-arbol__panel {
  position: relative;
  border-radius: var(--v-radio-m);
  border: 3px solid var(--v-dorado-oscuro);
  background: rgb(var(--arbol-rgb));
  box-shadow: 0 12px 26px rgba(0, 0, 0, .65);
}

/* Línea fina interior con el color del árbol aclarado (como el marco del vídeo). */
.visor .visor-arbol__panel::after {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: 1;
  border-radius: calc(var(--v-radio-m) - 6px);
  border: 1px solid rgb(var(--arbol-claro) / .35);
  pointer-events: none;
}

/* Arte del árbol oscurecido y teñido con su color. */
.visor .visor-arbol__arte {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: calc(var(--v-radio-m) - 3px);
}

.visor .visor-arbol__arte-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
  filter: brightness(.6) saturate(1.1);
}

.visor .visor-arbol__arte::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0) 14%),
    linear-gradient(0deg, rgba(0, 0, 0, .69), rgba(0, 0, 0, 0) 39%),
    rgb(var(--arbol-rgb) / .24);
}

/* Halo dorado en los árboles que reciben puntos en el paso actual. */
.visor .visor-arbol::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: 0;
  border-radius: calc(var(--v-radio-m) + 2px);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--v-dorado) 90%, transparent),
    0 0 24px 7px color-mix(in srgb, var(--v-dorado) 50%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.visor .visor-arbol.es-activo::before {
  opacity: 1;
  animation: visor-halo 1.5s ease-in-out infinite alternate;
}

/* Velo oscuro en los que no reciben puntos en este paso. */
.visor .visor-arbol::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: var(--v-radio-m);
  background: rgba(4, 4, 8, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.visor .visor-arbol.es-apagado::after { opacity: 1; }

.visor .visor-arbol__cab {
  display: none;
  position: relative;
  z-index: 2;
  padding: 12px 8px 2px;
  text-align: center;
}

.visor .visor-arbol__nombre {
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: clamp(17px, 8.4cqi, 27px);
  line-height: 1.15;
  color: #fff;
  text-shadow: 2px 3px 0 rgba(0, 0, 0, .75), 0 0 14px rgba(0, 0, 0, .55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visor .visor-arbol__pts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 2px 12px 2px 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .68);
  border: 2px solid color-mix(in srgb, var(--v-dorado) 90%, transparent);
  color: var(--v-dorado);
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: clamp(12px, 5.6cqi, 16px);
  line-height: 1.3;
  white-space: nowrap;
}

.visor .visor-arbol__pts img {
  display: block;
  width: 1.35em;
  height: 1.35em;
  border-radius: 5px;
}

.visor .visor-arbol.sin-puntos .visor-arbol__pts {
  color: var(--v-apagado);
  border-color: color-mix(in srgb, var(--v-dorado) 35%, transparent);
}

/* Rejilla 4 x 7 con los talentos en su fila y columna. En móvil, la altura de fila sale del alto real de
   la pantalla (svh, con las barras del navegador visibles) para que pestañas, árbol entero y barra de
   nivel quepan a la vez bajo la cabecera: 210 px = pestañas, bordes, huecos y barra. */
.visor .visor-arbol__rejilla {
  --fila: clamp(46px, calc((100svh - var(--tope, 60px) - 210px) / 7), 64px);
  --icono: min(clamp(36px, 13cqi, 52px), calc(var(--fila) - 14px));
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(7, var(--fila));
  padding: 8px 6px 8px;
}

.visor .visor-flechas {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.visor .visor-flecha__sombra {
  fill: none;
  stroke: rgba(0, 0, 0, .85);
}

.visor .visor-flecha__linea {
  fill: none;
  stroke: var(--v-gris-flecha);
  transition: stroke .25s;
}

.visor .visor-flecha__punta {
  fill: var(--v-gris-flecha);
  stroke: rgba(0, 0, 0, .85);
  stroke-width: 1.5px;
  stroke-linejoin: round;
  transition: fill .25s;
}

.visor .visor-flecha.es-activa .visor-flecha__linea { stroke: var(--v-dorado); }
.visor .visor-flecha.es-activa .visor-flecha__punta { fill: var(--v-dorado); }

/* Un talento: marco dorado (máximo), verde (a medias) o gris (sin puntos, icono en gris). */
.visor .visor-t {
  position: relative;
  z-index: 1;
  justify-self: center;
  align-self: start;
  width: var(--icono);
  height: var(--icono);
  margin-top: 4px;
  padding: 0;
  border: 0;
  border-radius: calc(var(--icono) * .2);
  background: none;
  cursor: pointer;
}

.visor .visor-t::before {
  content: "";
  position: absolute;
  inset: -11px;
  z-index: 0;
  border-radius: calc(var(--icono) * .35);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--v-dorado) 90%, transparent), color-mix(in srgb, var(--v-dorado) 35%, transparent) 62%, transparent);
  opacity: 0;
  pointer-events: none;
}

.visor .visor-t.en-paso::before {
  opacity: 1;
  animation: visor-latido 1.25s ease-in-out infinite alternate;
}

.visor .visor-t__marco {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  padding: 3px;
  border-radius: inherit;
  background: var(--v-vacio);
  box-shadow: 0 0 0 2px #06060A, 0 5px 10px rgba(0, 0, 0, .7);
  transition: background-color .2s, box-shadow .2s;
}

.visor .visor-t__img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--icono) * .14);
  object-fit: cover;
  transition: filter .25s;
}

.visor .visor-t.r-cero .visor-t__img { filter: grayscale(1) brightness(.45); }
.visor .visor-t.r-parcial .visor-t__marco { background: var(--v-verde); }
.visor .visor-t.r-max .visor-t__marco { background: var(--v-dorado); }

/* Brillo de cristal en la mitad de arriba cuando el talento tiene puntos. */
.visor .visor-t.r-parcial .visor-t__marco::after,
.visor .visor-t.r-max .visor-t__marco::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 3px;
  height: calc(50% - 3px);
  border-radius: calc(var(--icono) * .14) calc(var(--icono) * .14) 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.visor .visor-t.en-paso .visor-t__marco {
  box-shadow: 0 0 0 2px #06060A, 0 0 0 4px color-mix(in srgb, var(--v-dorado) 60%, transparent), 0 5px 12px rgba(0, 0, 0, .7);
}

.visor .visor-t:hover .visor-t__marco,
.visor .visor-t.es-mirado .visor-t__marco {
  box-shadow: 0 0 0 2px #06060A, 0 0 0 4px rgba(255, 255, 255, .6), 0 5px 12px rgba(0, 0, 0, .7);
}

.visor .visor-t:focus { outline: none; }

.visor .visor-t:focus-visible .visor-t__marco {
  box-shadow: 0 0 0 2px #06060A, 0 0 0 5px #fff, 0 0 0 8px var(--v-acento);
}

/* Insignia r/max abajo a la derecha, del color del marco. */
.visor .visor-t__rango {
  position: absolute;
  z-index: 3;
  right: -9px;
  bottom: -10px;
  padding: 2px 5px 1px;
  border-radius: 7px;
  border: 1px solid rgba(150, 150, 160, .55);
  background: rgba(10, 10, 14, .94);
  color: var(--v-apagado);
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: max(11px, calc(var(--icono) * .29));
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}

.visor .visor-t.r-parcial .visor-t__rango {
  color: var(--v-verde);
  border-color: color-mix(in srgb, var(--v-verde) 60%, transparent);
}

.visor .visor-t.r-max .visor-t__rango {
  color: var(--v-dorado);
  border-color: color-mix(in srgb, var(--v-dorado) 60%, transparent);
}

/* "+n": puntos que recibe en el paso actual. */
.visor .visor-t__mas {
  position: absolute;
  z-index: 3;
  left: -10px;
  top: -10px;
  display: none;
  padding: 1px 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFE8AC, var(--v-dorado));
  color: #241A06;
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: 11px;
  line-height: 1.35;
  box-shadow: 0 0 0 2px #06060A;
  pointer-events: none;
}

.visor .visor-t.en-paso .visor-t__mas { display: block; }

.visor .visor-t__anillo {
  position: absolute;
  inset: -3px;
  z-index: 4;
  border-radius: calc(var(--icono) * .26);
  border: 3px solid var(--v-dorado);
  opacity: 0;
  pointer-events: none;
}

/* ------------------------------------------------------------------ el dino explicando */
/* Bocadillo arriba; debajo, los botones de enlace a la izquierda y el dino a la derecha. */
.visor .visor-charla {
  grid-area: charla;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "bocadillo bocadillo" "acciones dino";
  align-items: center;
  gap: 6px 12px;
  min-width: 0;
}

.visor .visor-acciones {
  grid-area: acciones;
  align-self: center;
  min-width: 0;
}

.visor .visor-acciones__fila {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.visor .visor-bocadillo {
  grid-area: bocadillo;
  position: relative;
  min-width: 0;
  padding: 14px 16px 16px;
  border-radius: 18px;
  border: 2px solid var(--v-borde-caja);
  background: linear-gradient(170deg, #1B1F44 0%, #0E1027 60%, #0A0B1C 100%);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .55);
}

.visor .visor-bocadillo::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 13px;
  border: 1px solid color-mix(in srgb, var(--v-dorado) 28%, transparent);
  pointer-events: none;
}

/* Pico del bocadillo hacia el dino (abajo a la derecha, sobre su cabeza). */
.visor .visor-bocadillo::after {
  content: "";
  position: absolute;
  right: calc(var(--ancho-dino, 76px) / 2 - 2px);
  bottom: -9px;
  width: 16px;
  height: 16px;
  background: #0A0B1C;
  border-right: 2px solid var(--v-borde-caja);
  border-bottom: 2px solid var(--v-borde-caja);
  transform: rotate(45deg);
}

.visor .visor-bocadillo__antetitulo {
  margin-bottom: 4px;
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: .72rem;
  line-height: 1.3;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--v-dorado);
}

.visor .visor-bocadillo__titulo {
  margin-bottom: 8px;
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1.45;
  color: #fff;
  text-wrap: balance;
}

.visor .visor-bocadillo__texto {
  font-size: .95rem;
  line-height: 1.55;
  color: var(--v-texto);
}

.visor .visor-bocadillo__extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.visor .visor-bocadillo__extra:empty { display: none; }

.visor .visor-accion,
.visor .visor-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .05);
  color: var(--v-texto);
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: .82rem;
  line-height: 1.1;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}

.visor .visor-accion { white-space: nowrap; }
.visor .visor-accion .visor-icono { width: 17px; height: 17px; }

.visor .visor-accion:hover {
  background: rgba(255, 255, 255, .1);
  border-color: color-mix(in srgb, var(--v-dorado) 55%, transparent);
}

.visor .visor-accion.es-hecho {
  color: var(--v-verde);
  border-color: var(--v-verde);
}

.visor .visor-cta {
  min-height: 44px;
  padding: 0 18px 0 14px;
  border: 0;
  color: #221806;
  font-size: .92rem;
  background: linear-gradient(180deg, #F7E1A4, var(--v-dorado) 55%, #C99F49);
  box-shadow: 0 0 0 2px #0E0C06, 0 6px 16px color-mix(in srgb, var(--v-dorado) 25%, transparent);
}

.visor .visor-cta:hover { background: linear-gradient(180deg, #FBEABF, var(--v-dorado) 60%, #D1A852); }

.visor .visor-cta--suave {
  color: var(--v-texto);
  background: rgba(255, 255, 255, .05);
  border: 1px solid color-mix(in srgb, var(--v-dorado) 50%, transparent);
  box-shadow: none;
}

.visor .visor-cta--suave:hover { background: rgba(255, 255, 255, .1); }

.visor .visor-cta .visor-icono { width: 18px; height: 18px; }

/* Firma del canal: píldora oscura con borde morado. */
.visor .visor-canal {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 18px 8px;
  border-radius: 16px;
  border: 2px solid color-mix(in srgb, var(--v-acento) 85%, transparent);
  background: rgba(0, 0, 0, .5);
  text-decoration: none;
  transition: background-color .15s;
}

.visor .visor-canal:hover { background: color-mix(in srgb, var(--v-acento) 22%, rgba(0, 0, 0, .5)); }

.visor .visor-canal__llamada {
  font-size: .75rem;
  line-height: 1.2;
  color: var(--v-suave);
}

.visor .visor-canal__url {
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  color: #D9C2FF;
}

/* Ficha del talento del paso (la caja del vídeo). */
.visor .visor-fichas {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.visor .visor-fichas:empty { display: none; }

.visor .visor-ficha {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px 10px;
  padding: 9px 11px 10px;
  border-radius: 12px;
  border: 1px solid rgba(196, 196, 210, .2);
  background: rgba(4, 5, 14, .55);
}

.visor .visor-ficha__icono,
.visor .visor-tip__icono {
  display: block;
  flex: none;
  padding: 2px;
  border-radius: 9px;
  background: var(--v-vacio);
  box-shadow: 0 0 0 2px #06060A;
}

.visor .visor-ficha__icono { width: 40px; height: 40px; }
.visor .visor-tip__icono { width: 50px; height: 50px; }

.visor .visor-ficha__icono img,
.visor .visor-tip__icono img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 7px;
}

.visor .visor-ficha__icono.r-parcial,
.visor .visor-tip__icono.r-parcial { background: var(--v-verde); }

.visor .visor-ficha__icono.r-max,
.visor .visor-tip__icono.r-max { background: var(--v-dorado); }

.visor .visor-ficha__icono.r-cero img,
.visor .visor-tip__icono.r-cero img { filter: grayscale(1) brightness(.5); }

.visor .visor-ficha__cab {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.visor .visor-ficha__nombre {
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: .92rem;
  line-height: 1.25;
  color: #fff;
}

.visor .visor-ficha__rango,
.visor .visor-tip__rango {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: .78rem;
  line-height: 1.3;
  color: #ADADBC;
}

.visor .visor-ficha__texto {
  grid-column: 1 / -1;
  font-size: .87rem;
  line-height: 1.45;
  color: var(--v-amarillo);
}

.visor .visor-ficha__nota,
.visor .visor-tip__nota { color: #CBC8D8; }

.visor .visor-pips {
  display: inline-flex;
  gap: 3px;
}

.visor .visor-pips i {
  display: block;
  width: 10px;
  height: 7px;
  border-radius: 2px;
  background: #2E3044;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .7);
}

.visor .visor-pips i.es-lleno { background: var(--v-dorado); }

/* Alternativa si no se puede copiar: la URL seleccionable. */
.visor .visor-copia {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--v-dorado) 45%, transparent);
  background: rgba(0, 0, 0, .45);
}

.visor .visor-copia__txt {
  display: block;
  margin-bottom: 6px;
  font-size: .8rem;
  line-height: 1.35;
  color: var(--v-suave);
}

.visor .visor-copia__fila {
  display: flex;
  gap: 6px;
}

.visor .visor-copia__campo {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: #0B0B12;
  color: #fff;
  font-family: var(--v-f-texto);
  font-size: .85rem;
}

.visor .visor-copia__cerrar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  color: var(--v-texto);
  cursor: pointer;
}

/* El dino: caras apiladas para cambiar sin parpadeos de carga. */
.visor .visor-dino-sitio {
  grid-area: dino;
  position: relative;
  width: var(--ancho-dino, 76px);
  margin-right: 4px;
  padding-bottom: 6px;
}

.visor .visor-dino-sitio::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 0;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .65), rgba(0, 0, 0, 0));
}

.visor .visor-dino {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 252 / 400;
  animation: visor-respira 3.6s ease-in-out infinite alternate;
}

.visor .visor-dino__cara {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  visibility: hidden;
}

.visor .visor-dino__cara.es-visible { visibility: visible; }

/* ------------------------------------------------------------------ tooltip */
.visor .visor-tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: var(--v-z-flotante);
  width: max-content;
  max-width: 340px;
  padding: 12px 14px 12px;
  border-radius: 14px;
  border: 2px solid var(--v-borde-caja);
  background: linear-gradient(180deg, rgba(24, 28, 58, .98), rgba(8, 9, 22, .98));
  box-shadow: 0 18px 40px rgba(0, 0, 0, .7);
  color: var(--v-texto);
  pointer-events: none;
}

.visor .visor-tip::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--v-dorado) 26%, transparent);
  pointer-events: none;
}

.visor .visor-tip::after {
  content: "";
  position: absolute;
  left: var(--flecha-x, 50%);
  width: 14px;
  height: 14px;
  margin-left: -7px;
  transform: rotate(45deg);
  border: 2px solid var(--v-borde-caja);
}

.visor .visor-tip[data-lado="arriba"]::after {
  bottom: -9px;
  border-top: 0;
  border-left: 0;
  background: #090A18;
}

.visor .visor-tip[data-lado="abajo"]::after {
  top: -9px;
  border-bottom: 0;
  border-right: 0;
  background: #181C3A;
}

.visor .visor-tip__cab {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.visor .visor-tip__titulos { min-width: 0; }

.visor .visor-tip__nombre {
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  color: #fff;
}

.visor .visor-tip__rango { margin-top: 3px; }

.visor .visor-tip__arbol {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  padding: 1px 9px 1px 2px;
  border-radius: 999px;
  border: 1px solid rgb(var(--arbol-claro) / .5);
  background: rgb(var(--arbol-rgb));
  font-family: var(--v-f-titulo);
  font-weight: 700;
  font-size: .72rem;
  line-height: 1.45;
  color: #E8E5F2;
}

.visor .visor-tip__arbol img {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 999px;
}

.visor .visor-tip__texto {
  margin-top: 10px;
  font-size: .9rem;
  line-height: 1.45;
  color: var(--v-amarillo);
}

.visor .visor-tip__meta {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: .8rem;
  line-height: 1.35;
  color: var(--v-suave);
}

.visor .visor-tip__req { color: #E8E5F2; }
.visor .visor-tip__req.es-pendiente { color: #FF9C8F; }
.visor .visor-tip__sin-uso { color: var(--v-apagado); font-style: italic; }

.visor .visor-tip__nota-pie {
  margin-top: 8px;
  text-align: right;
  font-size: .68rem;
  line-height: 1.3;
  color: #8E8E9D;
}

/* ------------------------------------------------------------------ foco visible */
.visor .visor-boton:focus,
.visor .visor-pestana:focus,
.visor .visor-accion:focus,
.visor .visor-cta:focus,
.visor .visor-copia__cerrar:focus { outline: none; }

.visor .visor-boton:focus-visible,
.visor .visor-pestana:focus-visible,
.visor .visor-accion:focus-visible,
.visor .visor-cta:focus-visible,
.visor .visor-canal:focus-visible,
.visor .visor-copia__cerrar:focus-visible,
.visor .visor-copia__campo:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ animaciones */
@keyframes visor-latido {
  from { opacity: .45; transform: scale(.9); }
  to { opacity: 1; transform: scale(1.08); }
}

@keyframes visor-halo {
  from { opacity: .55; }
  to { opacity: 1; }
}

@keyframes visor-punto {
  from { opacity: .5; transform: scale(.85); }
  to { opacity: 1; transform: scale(1.1); }
}

@keyframes visor-respira {
  from { transform: translateY(0); }
  to { transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .visor *,
  .visor *::before,
  .visor *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ------------------------------------------------------------------ anchos (consultas de contenedor) */
/* Móvil muy estrecho: "Nv 40" en vez de "Nivel 40" para que nivel y puntos quepan en una línea. */
@container visor (max-width: 349px) {
  .visor .visor-estado__nv-largo { display: none; }
  .visor .visor-estado__nv-corto { display: inline; }
}

/* Una columna en un móvil grande o en horizontal: el árbol y la barra no se estiran de más. */
@container visor (min-width: 480px) {
  .visor .visor-pestanas,
  .visor .visor-arboles,
  .visor .visor-control { justify-self: center; width: 100%; max-width: 460px; }
  .visor .visor-charla { justify-self: center; width: 100%; max-width: 600px; --ancho-dino: 92px; }
  .visor .visor-bocadillo { padding: 16px 20px 18px; }
}

/* Tableta: barra arriba y a lo ancho (como en el vídeo); el árbol con sus pestañas a la izquierda y el
   dino a la derecha. */
@container visor (min-width: 640px) {
  .visor .visor__rejilla {
    --visor-barra: arriba;
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "control control"
      "pestanas charla"
      "arboles charla";
    gap: 14px 20px;
  }

  .visor .visor-pestanas,
  .visor .visor-arboles,
  .visor .visor-control,
  .visor .visor-charla { max-width: none; }

  .visor .visor-control {
    position: relative;
    top: auto;
    bottom: auto;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "botones estado reparto resumen"
      "deslizador deslizador deslizador deslizador";
    gap: 4px 16px;
    padding: 12px 18px 4px;
  }

  .visor .visor-botones { gap: 6px; }
  .visor .visor-boton--play { width: 50px; height: 50px; }
  .visor .visor-boton--texto { padding: 0 14px 0 11px; font-size: 14px; }
  .visor .visor-boton--texto .visor-icono { display: block; }
  .visor .visor-estado__linea { flex-direction: column; align-items: flex-start; gap: 1px; }
  .visor .visor-estado__nivel { font-size: 1.3rem; line-height: 1.1; }
  .visor .visor-estado__puntos { font-size: .8125rem; }
  .visor .visor-estado__puntos::before { content: none; }
  .visor .visor-estado__titulo { display: none; }
  .visor .visor-deslizador__pista { height: 50px; }
  .visor .visor-deslizador__fin { display: block; }

  .visor .visor-reparto { display: flex; flex-wrap: nowrap; }
  .visor .visor-reparto__item { padding-right: 9px; }
  .visor .visor-reparto__nombre {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }

  .visor .visor-pestana { min-height: 54px; padding: 6px 4px; font-size: 13px; }

  .visor .visor-arbol__rejilla {
    --icono: clamp(40px, 13cqi, 52px);
    --fila: calc(var(--icono) + 16px);
    padding: 10px 6px 10px;
  }

  .visor .visor-charla { align-content: start; --ancho-dino: 108px; }
  .visor .visor-dino-sitio { margin-right: 10px; }
  .visor .visor-bocadillo::after { right: calc(var(--ancho-dino) / 2 + 2px); }
}

/* Escritorio: los tres árboles lado a lado, como en el vídeo, y el dino con su bocadillo en una columna
   al lado (con pantalla de 1024 px el visor mide unos 930 px y todo cabe en 768 de alto). */
@container visor (min-width: 900px) {
  .visor .visor__rejilla {
    grid-template-columns: minmax(0, 1fr) clamp(250px, 26cqi, 300px);
    grid-template-rows: auto;
    grid-template-areas:
      "control control"
      "arboles charla";
    gap: 16px;
  }

  .visor .visor-pestanas { display: none; }

  .visor .visor-reparto__item { padding-right: 11px; }
  .visor .visor-reparto__nombre { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; clip-path: none; }

  .visor .visor-arboles {
    display: grid;
    grid-template-columns: repeat(var(--n-arboles, 3), minmax(0, 1fr));
    gap: 10px;
  }

  .visor .visor-arbol { display: block; }
  .visor .visor-arbol__cab { display: block; }

  .visor .visor-arbol__arte::after {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0) 21%),
      linear-gradient(0deg, rgba(0, 0, 0, .69), rgba(0, 0, 0, 0) 39%),
      rgb(var(--arbol-rgb) / .24);
  }

  .visor .visor-arbol__rejilla {
    --icono: clamp(34px, 18cqi, 58px);
    --fila: calc(var(--icono) + 18px);
    padding: 8px 8px 12px;
  }

  .visor .visor-charla {
    align-content: start;
    gap: 6px 10px;
    --ancho-dino: clamp(104px, 11.5cqi, 132px);
  }

  .visor .visor-bocadillo::after { right: calc(var(--ancho-dino) / 2 + 2px); }
}
