/* 부모 창 — 게임 진행 중 전체 화면 차단 (월드: 골드 액센트) */
/* 슬롯 목록 팝업이 열린 채 그 위를 가린다. 종료 시 이 레이어만 제거된다.
   z-index 는 casino-recall isBlockIntact(>=9000) 미만이면 즉시 게임 종료되므로 10000 유지 */
.modal[open][data-surface="slot-games"] > .mg-game-block {
  position: absolute;
  inset: 0;
  z-index: 10000;
}

.mg-game-block {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 10, 20, 0.88);
  padding: 24px;
}

.mg-game-block-panel {
  width: min(420px, 100%);
  padding: 36px 28px 32px;
  border-radius: 0;
  border: 1px solid #718293;
  background: linear-gradient(130deg, #202c39, #111925 65%);
  box-shadow: 0 24px 80px #000b, inset 3px 0 0 #7f93a8, inset 0 1px 0 #c6d7e244;
  text-align: center;
}

.mg-game-block-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: transparent;
  border: 3px solid rgba(85, 231, 237, 0.22);
  border-top-color: #55e7ed;
  color: transparent;
  font-size: 0;
  animation: bolt-game-spin 0.8s linear infinite;
}

.mg-game-block-icon i {
  display: none;
}

.mg-game-block-icon.is-hourglass,
.mg-game-block.is-ending .mg-game-block-icon {
  font-size: 0;
  animation: bolt-game-spin 0.8s linear infinite;
}

.mg-game-block-icon.is-hourglass i,
.mg-game-block.is-ending .mg-game-block-icon i {
  display: block;
  line-height: 1;
}

@keyframes bolt-game-spin {
  to { transform: rotate(360deg); }
}

@keyframes mg-hourglass-flip {
  0%,
  40% {
    transform: rotate(0deg);
  }
  50%,
  90% {
    transform: rotate(180deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.mg-game-block-title {
  margin: 0 0 12px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.mg-game-block.is-ending .mg-game-block-title {
  font-size: 18px;
  line-height: 1.45;
}

.mg-game-block-desc {
  margin: 0;
  color: rgba(199, 214, 230, 0.78);
  font-size: 14px;
  line-height: 1.6;
  white-space: nowrap;
}

/* 게임 창을 닫으면 종료된다. 메인 팝업의 중지 버튼은 쓰지 않는다. */
.mg-game-block-end {
  display: none !important;
}

.mg-game-block.is-ending .mg-game-block-desc {
  white-space: normal;
}

.mg-game-block-end {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  background: #d4af37;
  color: #111;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.mg-game-block-end:hover {
  background: #e0c04a;
  filter: brightness(1.05);
  color: #111;
}

.mg-game-block-end:disabled,
.mg-game-block.is-ending .mg-game-block-end {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
  pointer-events: none;
  background: #8a7a4a;
  color: #1a1a1a;
}

body.mg-game-blocked {
  overflow: hidden;
}

/* fast launch — 실행/종료 안내 패널 (공통 game-launch-block.css PC 숨김 해제) */
@media (min-width: 992px) {
  body.page-world.mg-game-blocked:not(.mg-game-same-window) .mg-game-block-panel,
  body.mg-game-blocked:not(.mg-game-same-window) .mg-game-block[data-show-parent-panel="1"] .mg-game-block-panel {
    display: block !important;
  }
}

/* 모바일 iframe — 게임 DIV가 하단 「실행 중」 패널보다 위 */
body.page-world.mg-game-iframe-popup .mg-game-iframe-shell {
  z-index: 50000;
}

body.page-world.mg-game-iframe-popup .mg-game-block,
body.page-world.mg-game-iframe-popup .mg-game-block.is-iframe-popup {
  display: flex !important;
  align-items: flex-end;
  justify-content: center;
  background: transparent !important;
  pointer-events: none;
  z-index: 10020;
  padding: 0 12px max(12px, env(safe-area-inset-bottom));
}

body.page-world.mg-game-iframe-popup .mg-game-block-panel,
body.page-world.mg-game-same-window .mg-game-block-panel {
  display: block !important;
  pointer-events: auto;
  width: min(560px, 100%);
}

body.page-world.mg-game-same-window .mg-game-block {
  background: transparent !important;
  pointer-events: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0 12px max(12px, env(safe-area-inset-bottom));
}

body.page-world.mg-game-same-window .mg-game-block-icon,
body.page-world.mg-game-same-window .mg-game-block-desc {
  display: none;
}

body.page-world.mg-game-same-window .mg-game-block-title {
  margin: 0 0 12px;
  font-size: 16px;
}

body.page-world.mg-game-same-window .mg-game-block-end {
  width: 100%;
  min-width: 0;
}

/* 종료·정산 중 — 전체 오버레이 + 안내 패널 */
body.page-world .mg-game-block.is-ending {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92) !important;
  pointer-events: auto;
  z-index: 50010;
  padding: 24px;
}

/* 모바일 iframe — 상단 닫기 바 + 게임 영역 분리 */
body.page-world.mg-game-iframe-popup .mg-game-iframe-shell {
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
}

body.page-world.mg-game-iframe-popup .mg-game-iframe-bar {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 44px;
  padding: max(6px, env(safe-area-inset-top)) 12px 6px;
  background: #111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: auto;
}

body.page-world.mg-game-iframe-popup .mg-game-iframe-shell .mg-game-same-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: auto;
  border: 0;
  background: #000;
}

body.page-world.mg-game-iframe-popup .mg-game-iframe-close--icon {
  min-width: 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
}

body.page-world.mg-game-iframe-popup .mg-game-iframe-close--icon:active {
  background: rgba(255, 255, 255, 0.16);
}

body.page-world .mg-game-block.is-ending .mg-game-block-panel {
  display: block !important;
}

body.page-world .mg-game-block.is-ending .mg-game-block-icon,
body.page-world .mg-game-block.is-ending .mg-game-block-desc {
  display: inline-flex;
}

body.page-world .mg-game-block.is-ending .mg-game-block-desc {
  display: block;
}
