/* Patio principal: patio escolar reconocible con fachada, arcos y camino */
.stage.hub {
  background: linear-gradient(#72b7c4 0 36%, #88c67e 36% 100%);
}
.stage.hub .sky {
  inset: 0 0 59%;
  background: linear-gradient(#75bdd1, #c8e9cf);
}
.stage.hub .floor {
  inset: 41% 0 0;
  background: linear-gradient(90deg, #77b876 0 10%, #96cf82 10% 90%, #70ad73 90%);
  border-top: 7px solid #d2edb0;
}
.stage.hub:before {
  content: "";
  position: absolute;
  left: 11%;
  right: 11%;
  top: 15%;
  height: 33%;
  z-index: -1;
  background: linear-gradient(#f0d89b 0 24%, #d4a96b 24% 100%);
  border: 7px solid #fff0c5;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 10px 0 #805c4790;
}
.stage.hub:after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 38%;
  right: 38%;
  top: 43%;
  bottom: 0;
  background: repeating-linear-gradient(0deg, #d9c391 0 24px, #cbb27e 25px 27px);
  clip-path: polygon(25% 0, 75% 0, 100% 100%, 0 100%);
  opacity: 0.95;
}
.stage.hub .window,
.stage.hub .rug,
.stage.hub .desk {
  display: none;
}
.stage.hub .sun {
  width: 48px;
  height: 48px;
  right: 7%;
  top: 7%;
  box-shadow: 0 0 35px #fff4ad;
}
.stage.hub .plant {
  z-index: -1;
  left: 3%;
  bottom: 28%;
  font-size: 48px;
  filter: drop-shadow(0 5px 2px #315d3c66);
}
.stage.hub .map-label {
  top: 5%;
  z-index: 2;
  color: #304b37;
  background: #fff6daee;
}
.stage.hub .node {
  width: clamp(92px, 13%, 132px);
  min-width: 0;
  height: clamp(102px, 20%, 132px);
  padding: 35px 6px 6px;
  border: 4px solid #ffe6ad;
  border-radius: 52px 52px 8px 8px;
  background: linear-gradient(90deg, #795239, #ad7950 18%, #86583d 82%, #654431);
  box-shadow:
    inset 0 0 0 3px #5c402c,
    0 7px 0 #40352999;
  top: 48% !important;
}
.stage.hub .node:before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  width: 25px;
  height: 24px;
  border: 3px solid #f5d89a;
  border-radius: 50% 50% 2px 2px;
  background: #85b7b1;
}
.stage.hub .node .icon {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  font-size: 16px;
  z-index: 1;
}
.stage.hub .node .label {
  position: relative;
  font-size: clamp(8px, 1vw, 11px);
  line-height: 1.15;
  color: #fff8df;
  text-shadow: 0 1px #392719;
}
.stage.hub .node .status {
  font-size: 8px;
  color: #d9f6df;
}
.stage.hub .node:hover,
.stage.hub .node.near {
  border-color: #fff27d;
  filter: brightness(1.12);
  transform: translate(-50%, -53%);
}
.stage.hub .node.done {
  background: linear-gradient(90deg, #387969, #51937c 18%, #397661 82%, #2f6455);
}
.stage.hub .node[data-final] {
  top: 77% !important;
  width: 138px;
  height: 92px;
  padding-top: 34px;
  border-radius: 14px;
  background: #214d48;
  border-color: #ffe078;
}
.stage.hub .node[data-final]:before {
  display: none;
}
.stage.hub .node[data-final] .icon {
  top: 5px;
  font-size: 23px;
}
.stage.hall {
  background: linear-gradient(#bfd7c7 0 39%, #bda77e 39%);
}
.stage.hall .sky {
  background: linear-gradient(#c5dddc, #e9dda9);
}
.stage.hall:before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 17%;
  height: 30%;
  border: 8px solid #e5d2a0;
  border-radius: 8px;
  background: repeating-linear-gradient(90deg, #658c87 0 12%, #d8c597 12.5% 13.5%, #70948c 14% 26%);
  box-shadow: 0 7px #816449;
}
.stage.hall:after {
  content: "MAPA DE RUTAS";
  position: absolute;
  right: 12%;
  top: 22%;
  width: 17%;
  height: 17%;
  display: grid;
  place-items: center;
  border: 7px solid #8e6549;
  border-radius: 5px;
  background: linear-gradient(145deg, #fff2c8, #cbe5bc);
  color: #36584b;
  font-size: clamp(7px, 0.9vw, 10px);
  font-weight: bold;
  box-shadow: 0 5px #76533b;
}
.stage.hall .desk {
  width: 18%;
  height: 13%;
  background: #8c654a;
  border-bottom-color: #624633;
}
.stage.hall .rug {
  left: 36%;
  width: 26%;
  background: #d9c478;
  border-color: #a98456;
}
.sprite {
  width: 56px;
  height: 94px;
  filter: drop-shadow(0 5px 3px #18362c66);
}
.sprite .head {
  top: 1px;
  left: 17px;
  width: 23px;
  height: 26px;
  border: 1px solid #65483c;
  box-shadow: inset -3px -2px #00000012;
}
.sprite .hair {
  top: -1px;
  left: 15px;
  width: 27px;
  height: 12px;
  border-radius: 15px 15px 5px 4px;
  box-shadow: inset 0 -3px #0000001c;
}
.sprite .neck {
  top: 25px;
  left: 24px;
  width: 10px;
  height: 8px;
}
.sprite .torso {
  top: 31px;
  left: 9px;
  width: 38px;
  height: 32px;
  border-radius: 11px 11px 6px 6px;
  box-shadow: inset 0 -5px #00000012;
}
.sprite .torso:before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid #f4dfbd;
  opacity: 0.9;
}
.sprite .torso:after {
  content: "";
  position: absolute;
  right: 5px;
  top: 12px;
  width: 7px;
  height: 8px;
  border-radius: 1px 1px 3px 3px;
  background: #ffffff35;
  border: 1px solid #ffffff65;
}
.sprite .arm {
  top: 34px;
  width: 10px;
  height: 27px;
  border: 1px solid #00000015;
}
.sprite .arm:after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 9px;
  height: 8px;
  border-radius: 50%;
  background: var(--skin);
}
.sprite .arm.left {
  left: 1px;
}
.sprite .arm.right {
  right: 1px;
}
.sprite .leg {
  top: 62px;
  width: 14px;
  height: 22px;
  background: linear-gradient(90deg, var(--pants), #ffffff12, var(--pants));
  border-radius: 3px 3px 5px 5px;
}
.sprite .leg.left {
  left: 13px;
}
.sprite .leg.right {
  right: 13px;
}
.sprite .shoe {
  top: 82px;
  width: 17px;
  height: 7px;
  background: #332c2b;
  border-bottom: 2px solid #d4c9b6;
}
.sprite .shoe.left {
  left: 8px;
}
.sprite .shoe.right {
  right: 8px;
}
.sprite .head:after {
  top: 10px;
  left: 5px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  box-shadow: 9px 0 #332a28;
}
.sprite .head:before {
  top: 17px;
  left: 9px;
  width: 6px;
  height: 3px;
  border-bottom: 1px solid #704b41;
}
.sprite.sam .hair {
  border-radius: 14px 14px 5px 4px;
}
.sprite.sam .hair:after {
  content: "";
  position: absolute;
  right: -2px;
  top: 8px;
  width: 7px;
  height: 15px;
  border-radius: 0 0 8px 3px;
  background: var(--hair);
}
.sprite.orientation .hair {
  height: 17px;
  border-radius: 14px 14px 8px 7px;
}
.sprite.orientation .hair:after {
  content: "";
  position: absolute;
  left: -3px;
  top: 9px;
  width: 7px;
  height: 19px;
  border-radius: 5px;
  background: var(--hair);
}
.sprite.lia .hair {
  height: 15px;
  border-radius: 13px 13px 8px 8px;
}
.sprite.lia .hair:after {
  content: "";
  position: absolute;
  right: -5px;
  top: 7px;
  width: 8px;
  height: 25px;
  border-radius: 0 0 8px 8px;
  background: var(--hair);
}
.sprite.teacher .hair {
  height: 9px;
  border-radius: 12px 12px 3px 3px;
}
.sprite.teacher .torso:after {
  background: #e8bf64;
}
.sprite.lia {
  --skin: #c98f6c;
  --shirt: #8b6cac;
  --pants: #394c5f;
  --hair: #302a2a;
}
.sprite.npc-sprite {
  animation: npcIdle 1.6s ease-in-out infinite alternate;
}
.sprite.npc-sprite .head {
  animation: npcLook 3.2s ease-in-out infinite alternate;
}
.sprite.moving .torso {
  animation: bounce 0.24s infinite alternate;
}
.room-clue:before {
  content: "";
  position: absolute;
  inset: -12px;
  border: 2px solid #fff07a;
  border-radius: 50%;
  animation: cluePulse 1.4s infinite;
  pointer-events: none;
}
.touch [data-run].active {
  border-color: var(--gold);
  color: var(--gold);
  background: #ffd36e22;
}
@keyframes bounce {
  to {
    transform: translateY(-2px);
  }
}
@keyframes cluePulse {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}
@keyframes npcIdle {
  to {
    margin-top: -3px;
  }
}
@keyframes npcLook {
  to {
    transform: rotate(3deg);
  }
}
.sprite .label {
  top: 97px;
  font-size: 9px;
  border: 1px solid #ffffff35;
}
.preview {
  transform: scale(1.08);
  transform-origin: top center;
}
@media (max-width: 820px) {
  .stage.hub .node {
    height: 102px;
    padding-top: 32px;
  }
  .sprite {
    transform: translate(-50%, -50%) scale(0.9);
  }
}
