/* ─────────────────────────────────────────────────────────────────────────────
   RUTA Y CAMINOS (js/ui/screens/screens-adventure.js)
   Una hoja por zona, como js/ui/screens/. Ver "Estilos (CSS)" en AGENTS.md.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── ROUTE / ADVENTURE SCREEN ──────────────────────────────────────────────── */
.screen--adventure {
  background: var(--off-white);
  position: relative;
  overflow: hidden;
}

/* Fondo de la ruta — atenuado y desenfocado, capa independiente detrás
   del contenido (tarjetas de camino/equipo) */
.encounter-bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(3px) brightness(.55) saturate(.6);
  transform: scale(1.05);
  z-index: 0;
}

.encounter-area {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: var(--sp-md);
  gap: var(--sp-sm);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1;
}

.encounter-prompt {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--grey-dark);
  text-align: center;
  line-height: 1.8;
}

.encounter-btn {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-md);
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  text-align: left;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.encounter-btn:hover  { transform: translate(-2px,-2px); box-shadow: var(--shadow-md); }
.encounter-btn:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--black); }

/* ── PATH NODES ROW ─────────────────────────────────────────────────────────── */
.path-nodes-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.path-node-img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  object-fit: contain;
  display: block;
}

.path-node-sep {
  color: var(--grey-light);
  font-size: 12px;
  flex-shrink: 0;
  line-height: 1;
}

@media (max-width: 480px) {
  #btn-pause-combat { display: none; }

  .path-node-img {
    max-width: 24px;
    width: 100%;
    height: auto;
  }
  .path-nodes-row {
    gap: 2px;
  }
  .path-node-sep {
    font-size: 9px;
  }
}

/* ── PATH ENCOUNTER TOOLTIP ─────────────────────────────────────────────────── */
.path-encounter-cell { cursor: default; }

.path-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--black);
  color: var(--white);
  font-family: var(--font-pixel);
  font-size: var(--fs-6);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  z-index: 50;
  pointer-events: none;
  line-height: 1.6;
}

/* Flechita del tooltip */
.path-tooltip::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--black);
}

.path-encounter-cell:hover .path-tooltip { display: block; }

/* BF path — tooltip hacia abajo (el header no deja espacio arriba) */
.bf-path .path-tooltip {
  bottom: auto;
  top: calc(100% + 6px);
}
.bf-path .path-tooltip::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--black);
}

/* ── PATH PROGRESS — bolitas de progreso del camino elegido ─────────────────── */
.path-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 6px var(--sp-md);
  flex-shrink: 0;
}

.path-progress__step {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--off-white);
  border: 2px solid var(--grey-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 300ms ease, background 300ms ease;
}
.path-progress__step--done {
  border-color: var(--green);
  background: #eafaf0;
}

.path-progress__step--current {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(74,144,226,.25);
}

.path-progress__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .9;
}
.path-progress__step--done .path-progress__icon { opacity: .35; }

.path-progress__check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--green-dark);
  text-shadow: 1px 1px 0 rgba(255,255,255,.6);
}

.path-progress__line {
  width: 18px;
  height: 3px;
  background: var(--grey-light);
  flex-shrink: 0;
  transition: background 300ms ease;
}
.path-progress__line--done {
  background: var(--green);
}

/* ── BIENVENIDA A UNA RUTA (Screens._showWelcome) ─────────────────────────────── */
.welcome-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px 24px;
  text-align: center;
  background: linear-gradient(160deg, var(--green-dark) 0%, var(--green) 100%);
}
/* Con imagen de la ruta: la imagen va en línea (sale de los datos) */
.welcome-screen--img { background: none; background-size: cover; background-position: center; }
.welcome-screen__shade { background: rgba(0,0,0,.45); }
.welcome-screen__kicker { color: rgba(255,255,255,.7); }
.welcome-screen__title { text-shadow: 3px 3px 0 rgba(0,0,0,.5); }
.welcome-screen__subtitle { color: rgba(255,255,255,.85); }

/* ── ELEGIR CAMINO (Screens._showPathSelection) ─────────────────────────────── */
.route-footer { padding: 6px 14px; background: var(--off-white); z-index: 2; position: relative; justify-content: space-between; }
.path-select { padding: var(--sp-md) var(--sp-md) 0; gap: var(--sp-xs); }
.path-select__title {
  margin-bottom: 1em;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 2px 2px 0 #000;
}
.path-select__mark { font-size: 48px; text-shadow: 4px 4px 0 var(--grey-light); user-select: none; }
.path-select__sep { height: 2px; border-radius: 1px; margin: 4px 0; }
.path-node { display: flex; flex-direction: column; gap: 2px; flex: 1; position: relative; }
.path-node-emoji { font-size: 22px; }
/* Caminos ocultos (pathsVisible: false): cada camino es una interrogación pixelada */
.encounter-btn--hidden { justify-content: center; min-height: 56px; }
.path-hidden-mark { font-size: 28px; line-height: 1; color: var(--grey-dark); text-shadow: 3px 3px 0 var(--grey-light); user-select: none; }
.path-hidden-mark--small { font-size: 14px; text-shadow: 2px 2px 0 var(--grey-light); }
.route-team-list { display: flex; width: 100%; }

/* ── PRESENTACIÓN DEL ALTO MANDO (eliteIntro, routes-constants.js) ───────────
   Cinco pokémon alrededor del entrenador. Las variables --elite-* las pone eliteIntro
   solo cuando una presentación se sale de las posiciones de siempre. */
.elite-intro { display: flex; justify-content: center; align-items: flex-end; }
.elite-intro__mon { position: relative; image-rendering: pixelated; }
.elite-intro__mon--1 { transform: translateX(157px); z-index: 1; }
.elite-intro__mon--2 { transform: translateX(101px); z-index: 2; }
.elite-intro__mon--3 { transform: rotateY(175deg) translateX(var(--elite-x3, -78px)); z-index: 1; }
.elite-intro__mon--4 { transform: rotateY(175deg) translateX(var(--elite-x4, -19px)); z-index: 0; }
.elite-intro__mon--5 { transform: rotateY(175deg) translateX(80px) translateY(-13px); scale: 2; z-index: -3; }
.elite-intro__trainer {
  position: relative;
  z-index: 3;
  height: var(--elite-h, 70px);
  object-fit: contain;
  right: var(--elite-right, 238px);
}

/* ── Botón de ruta opcional de una ruta de información (_showInformation) ───
   Con require, debajo lo que pide o, bloqueada, el motivo (como .adventure-choice) */
.info-optional {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.info-optional__req { opacity: .8; }
