/* Muñeco guía (guide.js): el muñeco vive en la habitación y la tarjeta flota encima. */
.bot {
  position: absolute; left: 0; top: 0; width: 0; height: 0; padding: 0; margin: 0;
  border: 0; background: none; cursor: pointer; z-index: 2;
  transition: opacity .35s, visibility .35s;
  -webkit-tap-highlight-color: transparent;
}
.bot.off { opacity: 0; visibility: hidden; pointer-events: none; }
.bot-in {
  position: absolute; left: 0; bottom: 0; width: 56px; height: 64px;
  transform-origin: 50% 100%;
}
.bot canvas {
  position: absolute; inset: 0; width: 56px; height: 64px;
  image-rendering: pixelated; image-rendering: crisp-edges;
  filter: drop-shadow(0 0 3px rgba(100, 255, 195, .28));
}
.bot-shadow {
  position: absolute; left: 6px; right: 6px; bottom: -4px; height: 9px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent);
}
.bot:focus-visible { outline: none; }
.bot:focus-visible .bot-in { outline: 2px solid var(--ph); outline-offset: 4px; border-radius: 6px; }
.bot-say {
  position: absolute; left: 0; bottom: 0; transform-origin: 50% 100%;
  padding: 6px 10px; border-radius: 10px;
  background: #e9fff5; color: #062118; font: 600 12px/1 var(--mono); letter-spacing: .03em;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .2s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .45);
}
.bot-say::after {
  content: ''; position: absolute; left: 50%; top: 100%; margin-left: -5px;
  border: 5px solid transparent; border-top-color: #e9fff5;
}
.bot-say.on { opacity: 1; }

.guide[hidden] { display: none; }
.guide {
  position: fixed; z-index: 4; left: 12px; right: 12px;
  top: calc(max(22px, env(safe-area-inset-top, 0px)) + 50px);
  display: grid; grid-template-columns: 42px minmax(0, 1fr) 30px; gap: 12px; align-items: start;
  padding: 14px 10px 14px 14px; border: 1px solid #374c60; border-radius: 14px;
  background: linear-gradient(145deg, rgba(18, 31, 45, .97), rgba(6, 14, 24, .97));
  box-shadow: inset 0 1px rgba(218, 236, 255, .08), 0 18px 50px rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(-8px); transition: opacity .3s, transform .3s;
}
.guide.on { opacity: 1; transform: none; }
.guide::before {
  content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, #78c4ec, transparent);
}
.g-av {
  width: 42px; height: 48px; margin-top: 2px;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
.g-k { font: 500 10px/1.4 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: #87eac8; }
.g-t { margin-top: 6px; font: 400 14.5px/1.5 var(--sans); color: #e3ebf2; text-wrap: pretty; }
.g-rest { opacity: 0; }
.g-a { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.g-a button {
  height: 38px; padding: 0 14px; border-radius: 9px; cursor: pointer;
  font: 500 13.5px/1 var(--sans); color: var(--ink);
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line);
  transition: background .2s;
}
.g-a button:hover { background: rgba(255, 255, 255, .08); }
.g-a .pri { color: #052116; background: #64ffc3; border-color: transparent; box-shadow: 0 5px 24px rgba(64, 230, 164, .14); }
.g-a .pri:hover { background: #9dffd6; }
.g-x {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; padding: 0;
  font: 400 21px/1 var(--sans); color: #9eacbd; background: none; border: 1px solid transparent;
}
.g-x:hover { color: var(--ink); border-color: var(--line); }
.g-a button:focus-visible, .g-x:focus-visible { outline: 2px solid var(--ph); outline-offset: 2px; }

/* durante la visita las vistas a pantalla completa empiezan bajo la tarjeta */
.guiding .city-view, .guiding #practicasView { top: var(--guide-bottom, 80px); }
.guiding .panel { max-height: calc(100svh - var(--guide-bottom, 80px) - 30px); }

@media (max-width: 919px) {
  .guide { grid-template-columns: 34px minmax(0, 1fr) 26px; gap: 10px; padding: 12px 8px 12px 12px; }
  .g-av { width: 34px; height: 39px; }
  .g-t { font-size: 14px; line-height: 1.45; }
  .g-a { margin-top: 10px; }
  .g-a button { height: 36px; padding: 0 12px; font-size: 13px; }
  .g-x { width: 26px; height: 26px; }
}
@media (min-width: 920px) {
  .guide { left: 30px; right: auto; width: 370px; top: 84px; padding: 16px 12px 16px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .bot, .guide, .bot-say { transition: none; }
}

.scope-invite { display: none; }
@media (max-width: 919px) {
  body:not(.guiding) .focus-scope .scope-invite {
    display: flex; align-items: center; gap: 6px; position: absolute; z-index: 2;
    top: var(--scope-top); right: max(8px, calc(100% - var(--scope-right)));
    transform: translateY(-100%); min-height: 48px; padding: 0 4px;
    border: 0; background: transparent; cursor: pointer; touch-action: manipulation;
  }
  .scope-invite canvas { width: 42px; height: 48px; image-rendering: pixelated; }
  .scope-invite span {
    background: #e9fff5; color: #062118; padding: 8px 10px;
    border-radius: 10px 10px 2px 10px; font: 600 12px/1.2 var(--mono);
  }
}

/* El bot presenta cada proyecto durante la visita. */
body.guiding .boat-copy > :not(.boat-status),
body.guiding #rutaView .city-eyebrow,
body.guiding #rutaTitle { display: none; }
body.guiding :is(#tfgView, #cityView, #futuroView, #practicasView) .boat-layout {
  grid-template: auto / minmax(0, 1fr);
  align-content: start;
  align-items: start;
  min-height: 0;
  max-width: 1100px;
  gap: 0;
}
body.guiding :is(.city-view, #practicasView) {
  padding-top: 12px;
}

body.guiding .boat-copy { margin-bottom: 16px; }
body.guiding .boat-copy .boat-status { margin-top: 0; }
body.guiding .boat-copy .status-next { margin-top: 8px; }

body.guiding #futuroView .boat-copy { display: none; }
