/**
 * 카지노/슬롯 실행 중 전체 화면 차단 오버레이
 * JS: game-launch-guard.js
 */
.game-launch-block {
  position: fixed;
  inset: 0;
  z-index: 14000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.88);
}

.game-launch-block-panel {
  width: min(360px, 100%);
  padding: 28px 22px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, #1a1a1f 0%, #0d0d10 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.game-launch-block-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #9fd4f0;
  animation: game-launch-spin 0.8s linear infinite;
}

.game-launch-block-title {
  margin: 0 0 8px;
  color: #f4f4f5;
  font-size: 1.1rem;
  font-weight: 700;
}

.game-launch-block-text {
  margin: 0;
  color: #a1a1aa;
  font-size: 0.9rem;
  line-height: 1.5;
}

body.game-launch-blocking {
  overflow: hidden;
}

body.page-world .game-launch-block-spinner {
  border-top-color: #d4af37;
}

body.page-world .game-launch-block-panel {
  border-color: rgba(212, 175, 55, 0.4);
}

body.page-black .game-launch-block-spinner,
body.theme-black .game-launch-block-spinner {
  border-top-color: #00aeef;
}

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

/* 모바일 같은 창 게임 iframe — 팝업 차단 시 폴백 (테마 game-launch.css 와 병행) */
.mg-game-same-frame {
  position: fixed;
  inset: 0;
  z-index: 9995;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0b0b0f;
  pointer-events: auto;
}

body.mg-game-same-window .mg-game-block,
body.mg-game-same-window .mg-game-block.is-same-window {
  background: transparent !important;
  pointer-events: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

/* 실행중 「게임이 실행 중입니다 / 게임 종료」 메시지창 — 완전 제거 */
body.mg-game-same-window .mg-game-block-panel,
body.mg-game-iframe-popup .mg-game-block-panel {
  display: none !important;
}

body.mg-game-iframe-popup .mg-game-block,
body.mg-game-iframe-popup .mg-game-block.is-iframe-popup {
  display: none !important;
}

/* 모바일 iframe DIV 셸 (전 테마 공통) */
.mg-game-iframe-shell {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  flex-direction: column;
  background: #0b0b0f;
}

.mg-game-iframe-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 48px;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  background: #111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mg-game-iframe-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: #d4af37;
  color: #111;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.mg-game-iframe-close:active {
  filter: brightness(1.05);
}

.mg-game-iframe-shell .mg-game-same-frame {
  position: relative;
  inset: auto;
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  z-index: 1;
  border: 0;
  background: #000;
}

/* PC: 새 창 실행 시 안내 패널 숨김 — 전체 block(딤)만 유지 (종료: 팝업 닫기 / Esc) */
@media (min-width: 992px) {
  body.mg-game-blocked:not(.mg-game-same-window) .mg-game-block-panel {
    display: none !important;
  }
}
