/* 에듀플레이: 게임 iframe용 큰 모달(거의 전체 화면). 허브·마을 등 공통 */

.game-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  padding: max(10px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px))
    max(10px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  align-items: stretch;
  justify-content: stretch;
}

.game-modal.is-open {
  display: flex;
}

.game-modal .modal-inner {
  width: calc(100vw - 16px);
  height: calc(100dvh - 16px);
  max-width: none;
  max-height: none;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.game-modal .modal-inner iframe#game-frame,
.game-modal #game-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.game-modal .btn-close-modal {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 44px;
  font-weight: bold;
  color: #c62828;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10001;
  line-height: 1;
}

.game-modal .modal-inner:fullscreen,
.game-modal .modal-inner:-webkit-full-screen {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
}

/* index.html 등: main.js가 쓰는 #gameModal / #gameFrame */
#gameModal.eduplay-embed-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.72);
  box-sizing: border-box;
  padding: max(10px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px))
    max(10px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
  align-items: stretch;
  justify-content: stretch;
}

#gameModal.eduplay-embed-modal.is-open {
  display: flex;
}

.eduplay-embed-modal-inner {
  position: relative;
  width: calc(100vw - 16px);
  height: calc(100dvh - 16px);
  max-width: none;
  max-height: none;
  margin: auto;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
}

#gameModal #gameFrame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.eduplay-embed-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 10001;
  font-size: 44px;
  font-weight: bold;
  color: #c62828;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}

.eduplay-embed-modal-inner:fullscreen,
.eduplay-embed-modal-inner:-webkit-full-screen {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
}
