/* El Poblado (Taller): marco del lienzo, marcador y herramientas */
.bq-marco {
  position: relative; width: 100%; height: min(78vh, 720px); min-height: 430px;
  border-radius: 22px; overflow: hidden; border: 3px solid #2f4a2c;
  background: linear-gradient(#cfe9f2 0%, #e8f3df 55%, #f3ecd6 100%);
  box-shadow: 0 6px 0 #2f4a2c, 0 22px 40px -18px rgba(47, 74, 44, .5);
  user-select: none; -webkit-user-select: none; transition: background .6s;
}
.bq-marco.es-noche { background: linear-gradient(#141a3a 0%, #232b55 55%, #2e3560 100%); }
.bq-marco canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; touch-action: pan-y; }
.bq-marco.con-zoom canvas { touch-action: none; cursor: grab; }
.bq-capa { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bq-carga { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; text-align: center; font: 600 16px/1.4 Inter, sans-serif; color: #2f4a2c; }

.bq-bocadillo {
  position: absolute; left: 0; top: 0; max-width: 210px; padding: 7px 11px 8px; white-space: normal; text-align: center;
  font: 600 13px/1.3 Inter, sans-serif; color: #2b2520; background: #fffdf4; border: 2px solid #2b2520; border-radius: 10px;
  box-shadow: 0 3px 0 rgba(43, 37, 32, .25); will-change: transform; animation: bq-pop .18s ease-out;
}
.bq-bocadillo::after { content: ''; position: absolute; left: 50%; bottom: -8px; width: 10px; height: 10px; margin-left: -6px; background: #fffdf4; border-right: 2px solid #2b2520; border-bottom: 2px solid #2b2520; transform: rotate(45deg); }
.bq-bocadillo.es-mini { padding: 3px 8px 4px; font-size: 14px; border-radius: 9px; white-space: nowrap; }
@keyframes bq-pop { from { opacity: 0; margin-top: 8px; } to { opacity: 1; margin-top: 0; } }

/* Cartel con la etapa y los habitantes */
.bq-cartel {
  position: absolute; left: 10px; top: 10px; min-width: 150px; max-width: min(215px, calc(100% - 70px)); padding: 7px 9px 7px;
  background: #fff8e3; border: 2px solid #5b3d26; border-radius: 9px; box-shadow: 0 3px 0 #5b3d26; color: #3a2a1c; font-family: Inter, sans-serif;
}
.bq-cartel-era { font-family: 'OffBit-Bold', Inter, sans-serif; font-size: 13px; line-height: 1.1; margin: 0 0 4px; }
.bq-cartel-num { display: flex; align-items: baseline; gap: 6px; margin: 0; }
.bq-cartel-num strong { font-family: 'OffBit-Bold', Inter, sans-serif; font-size: 21px; line-height: 1; color: #b4531a; }
.bq-cartel-num span { font-size: 10.5px; line-height: 1.2; font-weight: 600; }
.bq-cartel-num small { display: block; font-weight: 500; color: #7a6a58; }
.bq-progreso { height: 6px; margin: 6px 0 4px; background: #e6d7b0; border: 1.5px solid #5b3d26; border-radius: 5px; overflow: hidden; }
.bq-progreso i { display: block; height: 100%; width: 0; background: #7fb364; transition: width .5s; }
.bq-cartel-falta { font-size: 10px; font-weight: 600; margin: 0; color: #5c4a36; }

/* Herramientas */
.bq-barra { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 6px; align-items: stretch; max-width: calc(100% - 20px); }
.bq-grupo { display: flex; gap: 4px; padding: 4px; background: #fff8e3; border: 2px solid #5b3d26; border-radius: 10px; box-shadow: 0 3px 0 #5b3d26; }
.bq-btn {
  display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 3px 8px; cursor: pointer; white-space: nowrap;
  font: 600 12px/1 Inter, sans-serif; color: #3a2a1c; background: #f3e4bb; border: 1.5px solid #5b3d26; border-radius: 7px; box-shadow: 0 2px 0 #b99a63;
  transition: transform .08s, box-shadow .08s, background .15s;
}
.bq-btn:hover { background: #ffeebd; }
.bq-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #b99a63; }
.bq-btn:focus-visible { outline: 3px solid #3f7cac; outline-offset: 2px; }
.bq-btn.es-activa { background: #7fb364; color: #17300f; box-shadow: 0 2px 0 #4f8040; }
.bq-btn .bq-ico { font-size: 14px; line-height: 1; }
.bq-btn b { display: inline-block; min-width: 16px; padding: 2px 4px; border-radius: 5px; background: #fffdf4; border: 1.5px solid #5b3d26; font-size: 10.5px; text-align: center; }
.bq-btn.es-solo { padding: 6px 10px; }
.bq-lateral { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; padding: 4px; background: #fff8e3; border: 2px solid #5b3d26; border-radius: 10px; box-shadow: 0 3px 0 #5b3d26; }
.bq-lateral .bq-btn { justify-content: center; width: 30px; padding: 0; font-size: 14px; }

.bq-aviso {
  position: absolute; left: 50%; bottom: 58px; transform: translate(-50%, 8px); max-width: min(440px, calc(100% - 28px)); padding: 8px 14px; text-align: center;
  font: 600 12.5px/1.35 Inter, sans-serif; color: #fffdf4; background: rgba(43, 37, 32, .88); border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.bq-aviso.es-visible { opacity: 1; transform: translate(-50%, 0); }

.bq-demo { position: absolute; right: 56px; top: 10px; width: min(260px, calc(100% - 300px)); padding: 6px 10px; background: #fff8e3; border: 2px dashed #5b3d26; border-radius: 9px; font: 600 11.5px/1.3 Inter, sans-serif; color: #3a2a1c; }
.bq-demo input { width: 100%; margin-top: 6px; accent-color: #7fb364; }

/* Texto de debajo */
.bq-info { margin-top: 34px; }
.bq-bocadillo.con-enlace { pointer-events: auto; }
.bq-bocadillo a { display: block; margin-top: 4px; color: #b4531a; font-weight: 700; text-decoration: underline; }
.bq-info h2 { margin-top: 0; }
.bq-eras { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.bq-eras li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 2px solid #e2d8bf; border-radius: 14px; background: #fffdf6; font-size: 14.5px; line-height: 1.4; color: #6b655a; }
.bq-eras li small { font-size: 13px; }
.bq-eras li.es-hecha { border-color: #b9d6a6; background: #f3f9ee; color: #3f4a38; }
.bq-eras li.es-actual { border-color: #7fb364; background: #e9f5df; color: #26351f; box-shadow: 0 3px 0 #7fb364; }
.bq-era-ico { font-size: 24px; line-height: 1.1; filter: grayscale(1) opacity(.55); }
.bq-eras li.es-hecha .bq-era-ico, .bq-eras li.es-actual .bq-era-ico { filter: none; }
.bq-gestos { margin: 14px 0 0; padding-left: 20px; }
.bq-gestos li { margin: 6px 0; }

@media (max-width: 720px) {
  .bq-marco { height: 76vh; min-height: 460px; border-radius: 18px; }
  .bq-cartel { left: 8px; top: 8px; min-width: 0; }
  .bq-lateral { right: 8px; top: 8px; }
  .bq-lateral .bq-btn { width: 34px; min-height: 34px; }
  .bq-barra { bottom: 8px; }
  .bq-barra .bq-btn { min-height: 36px; padding: 4px 10px; }
  .bq-btn .bq-ico { font-size: 17px; }
  .bq-btn .bq-txt { display: none; }
  .bq-aviso { bottom: 60px; }
  .bq-demo { right: 8px; top: auto; bottom: 100px; width: calc(100% - 16px); }
}
@media (prefers-reduced-motion: reduce) { .bq-bocadillo { animation: none; } }

/* ── ¿De dónde son los habitantes? ───────────────────────────────────────── */
.bq-origen { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.bq-origen li { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 2px solid #e2d8bf; border-radius: 999px; background: #fffdf6; font-size: 14.5px; line-height: 1.2; color: #3f4a38; }
.bq-origen li:first-child { border-color: #7fb364; background: #e9f5df; }
.bq-origen-ico { font-size: 18px; line-height: 1; }
.bq-origen b { font-variant-numeric: tabular-nums; color: #26351f; }
.bq-origen:empty { display: none; }

/* ── Mapamundi 3D de «¿De dónde son?» ─────────────────────────────────── */
.bq-mapa {
  position: relative; width: 100%; aspect-ratio: 16 / 8.5; min-height: 240px; margin: 16px 0 4px; overflow: hidden;
  border-radius: 20px; border: 3px solid #2f4a2c; box-shadow: 0 5px 0 #2f4a2c, 0 18px 30px -18px rgba(47, 74, 44, .5);
  background: radial-gradient(ellipse at 50% 30%, #e3f2f6 0%, #cfe6ee 55%, #b9d8e3 100%);
  user-select: none; -webkit-user-select: none;
}
.bq-mapa[hidden] { display: none; }
.bq-mapa canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.bq-mapa.es-arrastrando canvas { cursor: grabbing; }
.bq-mapa-capa { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bq-mapa-etiqueta {
  position: absolute; left: 0; top: 0; padding: 2px 7px 3px; white-space: nowrap; border-radius: 8px; transition: opacity .3s;
  font: 700 12px/1.2 Inter, sans-serif; color: #2b2520; background: #fffdf4; border: 2px solid #2b2520; box-shadow: 0 2px 0 rgba(43, 37, 32, .25);
}
.bq-mapa-etiqueta.es-primera { font-size: 14px; background: #fff3c4; }
.bq-mapa-cartel {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; padding: 6px 11px 7px; border-radius: 10px; text-align: center;
  background: #2b2520; color: #fffdf4; font: 500 12.5px/1.3 Inter, sans-serif; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .5);
}
.bq-mapa-cartel[hidden] { display: none; }
.bq-mapa-cartel b { display: block; font-size: 14px; }
#bq-mapa p.bq-mapa-ayuda { position: absolute; right: 10px; bottom: 8px; margin: 0; padding: 3px 9px; border-radius: 999px; background: rgba(255, 253, 244, .85); font: 600 11.5px Inter, sans-serif; color: #3f4a38; pointer-events: none; }
#bq-mapa p.bq-mapa-vacio { display: none; position: absolute; left: 50%; top: 12px; transform: translateX(-50%); width: max-content; max-width: 90%; margin: 0; padding: 6px 12px; border-radius: 10px; background: rgba(255, 253, 244, .92); border: 2px solid #2b2520; font: 600 13px/1.35 Inter, sans-serif; color: #2b2520; text-align: center; pointer-events: none; }
#bq-mapa.sin-datos p.bq-mapa-vacio { display: block; }
#bq-mapa.sin-datos p.bq-mapa-ayuda { display: none; }
@media (max-width: 600px) {
  .bq-mapa { aspect-ratio: 16 / 11; min-height: 0; border-radius: 14px; }
  #bq-mapa p.bq-mapa-ayuda { font-size: 10.5px; right: 6px; bottom: 6px; }
  .bq-mapa-etiqueta { font-size: 10.5px; padding: 1px 5px 2px; }
  .bq-mapa-etiqueta.es-primera { font-size: 12px; }
}
