/* v940 – Larger training animation after choosing training points. */
.training-monitor-stage-v931 {
  height: clamp(340px, 52vh, 450px);
}
#trainingDefenseAnimationV931 {
  width: min(460px, 92%) !important;
  height: min(350px, calc(100% - 56px)) !important;
  max-height: 350px;
  bottom: 30px !important;
}
#defenseTrainingPanel .defense-arena { height: 380px; }
#defenseTrainingPanel .defense-frames { height: 300px; bottom: 30px; }
#defenseTrainingPanel .defense-device,
#defenseTrainingPanel .defense-monster { width: 210px; height: 210px; bottom: 30px; }
#defenseTrainingPanel .defense-device { left: calc(50% - 210px); }
#defenseTrainingPanel .defense-monster { right: calc(50% - 210px); }
#defenseTrainingPanel .defense-impact { left: calc(50% - 19px); top: 190px; font-size: 52px; }
@media (max-height: 650px) {
  .training-monitor-stage-v931 { height: 300px; }
  #defenseTrainingPanel .defense-arena { height: 320px; }
  #defenseTrainingPanel .defense-frames { height: 250px; }
}
@media (max-width: 700px) {
  .training-monitor-stage-v931 { height: 300px; }
  #trainingDefenseAnimationV931 { width: 92% !important; height: calc(100% - 50px) !important; }
}

/* v940 – Blur the whole training ground behind a running training window;
   the back button (z-index 10000 inside the scene) stays sharp. */
body:has(#trainingDefenseMonitorV931[aria-hidden="false"]) #trainingGroundSceneV615::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
/* Second training view lives inside the stage: blur its neighbours instead. */
body:has(#defenseTrainingPanel.is-running:not([hidden])) #trainingGroundSceneV615 .training-ground-stage-v615 > :not(#defenseTrainingPanel) {
  filter: blur(8px);
}
body:has(#trainingDefenseMonitorV931[aria-hidden="false"]) :is(#playerHudV276, #backpackHudV79, #systemHudV277, #monsterHudSlotV527),
body:has(#defenseTrainingPanel.is-running:not([hidden])) :is(#playerHudV276, #backpackHudV79, #systemHudV277, #monsterHudSlotV527) {
  filter: blur(8px) !important;
}
/* Keep the running training window above Neo and other scene figures. */
#defenseTrainingPanel.is-running:not([hidden]) { z-index: 60; }
/* v943 – Back button looks exactly like the back button in the other buildings
   (same colours, frame, font and size; scaled like the 1600x900 building stages). */
body.training-ground-open-v615 #trainingGroundSceneV615 > #marketplaceBackV129 {
  --s: var(--training-back-scale, 1);
  width: calc(132px * var(--s)) !important;
  min-width: calc(132px * var(--s)) !important;
  height: calc(48px * var(--s)) !important;
  min-height: calc(48px * var(--s)) !important;
  padding: 0 !important;
  background: rgba(45, 31, 22, 0.88) !important;
  border: calc(2px * var(--s)) solid rgba(122, 86, 52, 0.92) !important;
  border-radius: calc(12px * var(--s)) !important;
  box-shadow:
    inset 0 calc(1px * var(--s)) 0 rgba(255, 255, 255, 0.07),
    inset 0 calc(-1px * var(--s)) 0 rgba(0, 0, 0, 0.28),
    0 calc(2px * var(--s)) calc(5px * var(--s)) rgba(0, 0, 0, 0.38) !important;
  color: rgb(245, 226, 183) !important;
  font-family: Georgia, "Times New Roman", serif !important;
  font-weight: 700 !important;
  font-size: calc(16.8px * var(--s) * var(--s)) !important;
  text-shadow: 0 calc(1px * var(--s)) calc(2px * var(--s)) rgba(0, 0, 0, 0.75) !important;
}
