.hse-epi {
  position: fixed;
  inset: 0;
  z-index: 9300;
  display: grid;
  place-items: center;
  padding: 18px;
  color: #f8fafc;
  font-family: Arial, Helvetica, sans-serif;
}

.hse-epi * {
  box-sizing: border-box;
}

.hse-epi__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
}

.hse-epi--launch-ready {
  pointer-events: none;
}

.hse-epi--launch-ready .hse-epi__backdrop {
  display: none;
}

.hse-epi--launch-ready .hse-epi__launch {
  pointer-events: auto;
}

.hse-epi__launch {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  padding: 0 26px;
  border: 1px solid rgba(94, 234, 212, 0.55);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42), 0 0 0 7px rgba(20, 184, 166, 0.14);
  cursor: pointer;
  transform: translate(-50%, -50%);
  animation: hseEpiLaunchPulse 2.2s ease-in-out infinite;
}

.hse-epi__dialog {
  position: relative;
  width: min(1060px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #0f172a;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

.hse-epi__welcome {
  display: grid;
  min-height: 520px;
  place-items: center;
  text-align: center;
}

.hse-epi__welcome[hidden],
.hse-epi__game[hidden] {
  display: none !important;
}

.hse-epi__welcome-visual {
  position: relative;
  width: 190px;
  height: 190px;
  margin-bottom: 20px;
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.2), rgba(15, 23, 42, 0.1) 62%);
  box-shadow: 0 0 0 12px rgba(20, 184, 166, 0.08);
}

.hse-epi__welcome-visual span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62px;
  height: 42px;
  border-radius: 999px 999px 8px 8px;
  background: #fbbf24;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 -8px rgba(146, 64, 14, 0.18);
}

.hse-epi__welcome-visual span:nth-child(2) {
  width: 86px;
  height: 12px;
  top: 57%;
  border-radius: 999px;
  background: #0f766e;
}

.hse-epi__welcome-visual span:nth-child(3) {
  width: 44px;
  height: 54px;
  top: 70%;
  border-radius: 18px;
  background: #334155;
}

.hse-epi__welcome-title {
  max-width: 620px;
  margin: 0;
  color: #ffffff;
  font-size: 34px;
  line-height: 1.08;
}

.hse-epi__welcome-message {
  max-width: 660px;
  margin: 14px 0 24px;
  color: #cbd5e1;
  font-size: 16px;
  line-height: 1.55;
}

.hse-epi__eyebrow {
  margin: 0 0 4px;
  color: #5eead4;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hse-epi__title {
  margin: 0;
  color: #ffffff;
  font-size: 26px;
  line-height: 1.15;
}

.hse-epi__instruction {
  margin: 10px 0 0;
  color: #cbd5e1;
  font-size: 15px;
  line-height: 1.45;
}

.hse-epi__workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  margin-top: 20px;
}

.hse-epi__items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: start;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.hse-epi__item {
  min-height: 88px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: #f8fafc;
  font-size: 13px;
  font-weight: 800;
  cursor: grab;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.hse-epi__item:active {
  cursor: grabbing;
}

.hse-epi__item--selected {
  border-color: #5eead4;
  background: rgba(20, 184, 166, 0.18);
}

.hse-epi__item--used {
  opacity: 0.55;
}

.hse-epi__item--chosen,
.hse-epi__item--drag {
  border-color: #5eead4;
  background: rgba(20, 184, 166, 0.22);
  cursor: grabbing;
}

.hse-epi__item--ghost {
  opacity: 0.35;
}

.hse-epi__sortable-fallback {
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

.hse-epi__item-icon {
  display: block;
  width: 54px;
  height: 38px;
  margin: 0 auto 8px;
  border-radius: 999px 999px 8px 8px;
  background: #fbbf24;
  box-shadow: inset 0 -8px rgba(146, 64, 14, 0.18);
}

.hse-epi__item-icon--glasses {
  height: 24px;
  margin-top: 9px;
  border: 5px solid #334155;
  border-radius: 18px;
  background: #64748b;
}

.hse-epi__item-icon--gloves {
  width: 44px;
  height: 48px;
  border-radius: 18px 18px 10px 10px;
  background: #facc15;
}

.hse-epi__item-icon--safety_shoes {
  width: 62px;
  height: 30px;
  margin-top: 12px;
  border-radius: 10px 24px 8px 8px;
  background: #b45309;
}

.hse-epi__item-icon--earplugs {
  width: 58px;
  height: 18px;
  margin-top: 14px;
  border-radius: 999px;
  background: #fbbf24;
}

.hse-epi__item-icon--respirator {
  width: 58px;
  height: 38px;
  margin-top: 7px;
  border-radius: 18px;
  background: #334155;
}

.hse-epi__item-icon--atex_suit {
  width: 48px;
  height: 54px;
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(90deg, #f59e0b 0 45%, #fbbf24 46% 54%, #f59e0b 55% 100%);
}

.hse-epi__operator {
  position: relative;
  min-height: 520px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: radial-gradient(circle at center, rgba(20, 184, 166, 0.12), rgba(15, 23, 42, 0.9) 64%);
  overflow: hidden;
}

.hse-epi__person {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 210px;
  height: 420px;
  transform: translate(-50%, -50%);
}

.hse-epi__body-shape {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #f59e0b;
}

.hse-epi__body-shape--head {
  top: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #f2c48d;
}

.hse-epi__body-shape--torso {
  top: 78px;
  width: 150px;
  height: 190px;
  border-radius: 42px 42px 16px 16px;
}

.hse-epi__body-shape--legs {
  top: 258px;
  width: 128px;
  height: 150px;
  border-radius: 0 0 34px 34px;
}

.hse-epi__slots {
  position: absolute;
  inset: 0;
}

.hse-epi__slot {
  position: absolute;
  width: 136px;
  min-height: 54px;
  padding: 8px;
  border: 1px dashed rgba(94, 234, 212, 0.58);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.hse-epi__slot-label {
  display: block;
  margin-bottom: 2px;
  color: #5eead4;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.hse-epi__slot strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}

.hse-epi__slot--filled {
  border-style: solid;
  background: rgba(20, 184, 166, 0.2);
}

.hse-epi-is-dragging,
.hse-epi-is-dragging *,
.hse-dnd-is-dragging,
.hse-dnd-is-dragging * {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

.hse-epi-is-dragging ::selection,
.hse-dnd-is-dragging ::selection {
  background: transparent;
}

.hse-epi__slot--head {
  left: calc(50% - 68px);
  top: 20px;
}

.hse-epi__slot--eyes {
  left: calc(50% + 74px);
  top: 82px;
}

.hse-epi__slot--ears {
  left: calc(50% - 216px);
  top: 92px;
}

.hse-epi__slot--face {
  left: calc(50% + 92px);
  top: 164px;
}

.hse-epi__slot--hands {
  left: calc(50% - 230px);
  top: 264px;
}

.hse-epi__slot--body {
  left: calc(50% + 92px);
  top: 288px;
}

.hse-epi__slot--feet {
  left: calc(50% - 68px);
  bottom: 18px;
}

.hse-epi__status {
  min-height: 22px;
  margin: 14px 0 0;
  color: #5eead4;
  font-size: 14px;
  font-weight: 900;
}

.hse-epi__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.hse-epi__primary,
.hse-epi__secondary {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.hse-epi__primary {
  border: 1px solid #0f766e;
  background: #0f766e;
  color: #ffffff;
}

.hse-epi__secondary {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #ffffff;
}

.hse-epi--complete .hse-epi__dialog {
  border-color: rgba(134, 239, 172, 0.5);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55), 0 0 0 7px rgba(34, 197, 94, 0.14);
}

.hse-epi-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 9250;
  max-width: min(520px, calc(100vw - 28px));
  padding: 13px 18px;
  border: 1px solid rgba(94, 234, 212, 0.42);
  border-radius: 999px;
  background: rgba(7, 20, 28, 0.92);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38), 0 0 0 5px rgba(20, 184, 166, 0.12);
  color: #ecfeff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.hse-epi-toast--visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

[hidden].hse-epi {
  display: none !important;
}

[hidden].hse-epi-toast {
  display: none !important;
}

.hse-epi__launch[hidden] {
  display: none !important;
}

.hse-epi__dialog[hidden] {
  display: none !important;
}

@keyframes hseEpiLaunchPulse {
  0%,
  100% {
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42), 0 0 0 7px rgba(20, 184, 166, 0.14);
  }

  50% {
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42), 0 0 0 12px rgba(20, 184, 166, 0.22);
  }
}

.hse-epi-next-hotspot {
  z-index: 9200 !important;
}

.hse-epi-next-hotspot-target {
  width: 96px !important;
  height: 96px !important;
  left: calc(50% - ((96px + 0px) / 2) + 0px) !important;
  top: calc(50% - ((96px + 0px) / 2) + 0px) !important;
  border-radius: 34px !important;
  background: rgba(20, 184, 166, 0.74) !important;
  box-shadow: 0 0 0 7px rgba(20, 184, 166, 0.18), 0 14px 34px rgba(0, 0, 0, 0.28) !important;
  transform: scale(1) !important;
  transform-origin: center center !important;
  animation: hseEpiNextHotspotBounce 1.05s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.hse-epi-next-hotspot-target::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: inherit;
  pointer-events: none;
}

.hse-epi-next-hotspot-target .ggskin_svg,
.hse-epi-next-hotspot-target img {
  transform: scale(1.25);
  transform-origin: center center;
}

@keyframes hseEpiNextHotspotBounce {
  0% {
    transform: translateY(0) scale(1) !important;
    box-shadow: 0 0 0 6px rgba(20, 184, 166, 0.14), 0 14px 34px rgba(0, 0, 0, 0.28);
  }

  28% {
    transform: translateY(-14px) scale(1.18) !important;
    box-shadow: 0 0 0 13px rgba(20, 184, 166, 0.09), 0 24px 42px rgba(0, 0, 0, 0.22);
  }

  52% {
    transform: translateY(0) scale(0.94) !important;
    box-shadow: 0 0 0 5px rgba(20, 184, 166, 0.18), 0 10px 28px rgba(0, 0, 0, 0.3);
  }

  72% {
    transform: translateY(-6px) scale(1.06) !important;
    box-shadow: 0 0 0 10px rgba(20, 184, 166, 0.1), 0 18px 34px rgba(0, 0, 0, 0.24);
  }

  100% {
    transform: translateY(0) scale(1) !important;
    box-shadow: 0 0 0 6px rgba(20, 184, 166, 0.14), 0 14px 34px rgba(0, 0, 0, 0.28);
  }
}

@media (max-width: 700px) {
  .hse-epi {
    padding: 10px;
  }

  .hse-epi__dialog {
    max-height: 92vh;
    padding: 14px;
  }

  .hse-epi__title {
    font-size: 20px;
  }

  .hse-epi__welcome {
    min-height: 480px;
  }

  .hse-epi__welcome-visual {
    width: 140px;
    height: 140px;
    margin-bottom: 16px;
  }

  .hse-epi__welcome-title {
    font-size: 25px;
  }

  .hse-epi__welcome-message {
    margin-bottom: 18px;
    font-size: 14px;
  }

  .hse-epi__instruction {
    font-size: 13px;
  }

  .hse-epi__workspace {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 14px;
  }

  .hse-epi__items {
    grid-template-columns: repeat(4, minmax(74px, 1fr));
    order: 2;
    gap: 8px;
  }

  .hse-epi__item {
    min-height: 70px;
    padding: 8px 6px;
    font-size: 11px;
    cursor: pointer;
  }

  .hse-epi__item-icon {
    width: 42px;
    height: 28px;
    margin-bottom: 6px;
  }

  .hse-epi__operator {
    order: 1;
    min-height: 390px;
  }

  .hse-epi__person {
    width: 150px;
    height: 310px;
  }

  .hse-epi__body-shape--head {
    width: 54px;
    height: 54px;
  }

  .hse-epi__body-shape--torso {
    top: 60px;
    width: 110px;
    height: 140px;
  }

  .hse-epi__body-shape--legs {
    top: 194px;
    width: 94px;
    height: 108px;
  }

  .hse-epi__slot {
    width: 104px;
    min-height: 45px;
    padding: 6px;
  }

  .hse-epi__slot strong {
    font-size: 11px;
  }

  .hse-epi__slot--head {
    left: calc(50% - 52px);
    top: 8px;
  }

  .hse-epi__slot--eyes {
    left: calc(50% + 42px);
    top: 58px;
  }

  .hse-epi__slot--ears {
    left: calc(50% - 154px);
    top: 62px;
  }

  .hse-epi__slot--face {
    left: calc(50% + 54px);
    top: 124px;
  }

  .hse-epi__slot--hands {
    left: calc(50% - 162px);
    top: 202px;
  }

  .hse-epi__slot--body {
    left: calc(50% + 54px);
    top: 218px;
  }

  .hse-epi__slot--feet {
    left: calc(50% - 52px);
    bottom: 10px;
  }

  .hse-epi__actions {
    flex-direction: column;
  }

  .hse-epi-toast {
    bottom: 14px;
    max-width: calc(100vw - 20px);
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
  }
}
