[hidden] {
  display: none!important;
}

.granja-visor {
  position: relative;
  width: 100%;
  height: calc(100vh - 180px);
  min-height: 560px;
  margin-top: 24px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%,#263034,#050708 70%);
}

#granjaCanvas {
  width: 100%;
  height: 100%;
  display: block;
  outline: 0;
  touch-action: none;
}

.granja-portada {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  color: #fff;
  background: linear-gradient(90deg,rgba(3,6,7,.88),rgba(3,6,7,.48),rgba(3,6,7,.88));
}

.granja-portada h2 {
  max-width: 780px;
  margin: 8px 0;
  font: 700 clamp(36px,5vw,72px)/1.02 Tektur,sans-serif;
}

.granja-portada > p:not(.granja-kicker) {
  max-width: 650px;
  font-size: 18px;
  color: #d0d7d3;
}

.granja-kicker {
  color: #83bd48;
  letter-spacing: .16em;
  font-size: 12px;
}

.granja-portada small {
  color: #aab5af;
}

.granja-portada button, .granja-hud button {
  border: 1px solid #83bd48;
  background: rgba(20,34,25,.9);
  color: #fff;
  font: 600 14px Tektur,sans-serif;
}

.granja-portada button {
  margin: 20px 0 12px;
  padding: 15px 28px;
  border-radius: 999px;
  cursor: pointer;
}

.granja-portada button:disabled {
  opacity: .55;
  cursor: wait;
}

.granja-hud {
  position: absolute;
  inset: 18px 18px auto;
  display: flex;
  gap: 10px;
  pointer-events: none;
}

.granja-hud span, .granja-hud button {
  padding: 8px 12px;
  border-radius: 5px;
  color: #fff;
  background: rgba(10,16,18,.88);
}

.granja-hud button {
  margin-left: auto;
}

.granja-punto {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%,-50%);
  pointer-events: none;
}

.granja-error {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  padding: 12px;
  color: #fff;
  background: #581d1d;
  text-align: center;
}

[id="granjaCalidad"] {
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.granja-obras {
  position: absolute;
  z-index: 20;
  left: 50%;
  top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(420px,calc(100% - 250px));
  padding: 7px 18px;
  transform: translateX(-50%);
  border: 1px solid rgba(239,181,43,.8);
  border-radius: 5px;
  color: #fff;
  background: linear-gradient(90deg,rgba(72,48,8,.94),rgba(24,21,14,.94),rgba(72,48,8,.94));
  box-shadow: 0 7px 22px rgba(0,0,0,.3);
  pointer-events: none;
}

.granja-obras svg {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}

.granja-obras span {
  display: flex;
  flex-direction: column;
}

.granja-obras strong {
  font: 700 14px Tektur,sans-serif;
  letter-spacing: .13em;
  color: #f3c44f;
}

.granja-obras small {
  font: 12px "Exo 2",sans-serif;
  color: #ded8c9;
}

@media (max-width:700px) {
  .granja-obras {
    top: 8px;
    min-width: 0;
    width: calc(100% - 18px);
    padding: 6px 10px;
  }
}

@media (max-width:700px) {
  .granja-obras svg {
    width: 30px;
    height: 30px;
  }
}

@media (max-width:700px) {
  .granja-obras strong {
    font-size: 12px;
  }
}

@media (max-width:700px) {
  .granja-obras small {
    font-size: 10px;
  }
}

@media (max-width:700px) {
  .granja-hud {
    top: 62px;
  }
}

.granja-controles-tactiles {
  display: none;
  position: absolute;
  z-index: 25;
  inset: auto 14px 14px;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
}

.granja-controles-tactiles--activos {
  display: flex;
}

.granja-joystick {
  position: relative;
  width: 126px;
  height: 126px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 50%;
  background: rgba(5,10,11,.34);
  box-shadow: inset 0 0 28px rgba(0,0,0,.28);
  touch-action: none;
  pointer-events: auto;
}

.granja-joystick span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px;
  border: 2px solid rgba(243,196,79,.9);
  border-radius: 50%;
  background: rgba(28,38,31,.78);
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
  will-change: transform;
}

.granja-joystick small {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -19px;
  color: rgba(255,255,255,.72);
  font: 10px Tektur,sans-serif;
  letter-spacing: .12em;
  text-align: center;
}

.granja-rapido {
  align-self: flex-end;
  margin-bottom: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(243,196,79,.7);
  border-radius: 999px;
  color: #fff;
  background: rgba(10,16,18,.72);
  font: 700 11px Tektur,sans-serif;
  pointer-events: auto;
  touch-action: manipulation;
}

.granja-rapido.activo {
  color: #18160f;
  background: #f3c44f;
}

@media (pointer:fine) {
  .granja-controles-tactiles {
    display: none!important;
  }
}

@media (max-width:700px) {
  .granja-joystick {
    width: 108px;
    height: 108px;
  }
}

@media (max-width:700px) {
  .granja-joystick span {
    width: 46px;
    height: 46px;
    margin: -23px;
  }
}

@media (max-width:700px) {
  .granja-rapido {
    font-size: 10px;
    padding: 9px 11px;
  }
}

