/* TG/H5 inline game iframe shell — game-LEYv10A uses .game-shell but built CSS only had .game-container */
html.game-playing-mode,
body.game-playing-mode {
  overflow: hidden !important;
  height: 100% !important;
  touch-action: manipulation;
}

body.game-playing-mode #app {
  height: 100dvh !important;
  min-height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}

body.game-playing-mode #app > main,
body.game-playing-mode #app main.page,
body.game-playing-mode #app .page {
  height: 100% !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
  padding-bottom: 0 !important;
}

body.game-playing-mode #bottom-menu,
body.game-playing-mode .menu {
  display: none !important;
}

.game-page {
  width: 100% !important;
  max-width: 100vw !important;
  height: calc(var(--vh, 1vh) * 100) !important;
  min-height: calc(var(--vh, 1vh) * 100) !important;
  max-height: calc(var(--vh, 1vh) * 100) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.game-shell,
.game-container {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-height: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  position: relative !important;
  box-sizing: border-box !important;
}

.game-shell__frame {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-height: 0 !important;
  height: 100% !important;
  position: relative !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.game-shell .game-iframe,
.game-shell__frame .game-iframe,
.game-container .game-iframe {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  border: 0 !important;
  display: block !important;
  background: #000 !important;
}

.game-shell--fullscreen,
.game-page--fullscreen .game-shell,
.game-page--fullscreen .game-container {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-width: 100vw !important;
  max-height: 100dvh !important;
  z-index: 10050 !important;
}

body.game-fullscreen-mode .game-page {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

html.tg-miniapp body.game-playing-mode #app,
body.tg-miniapp.game-playing-mode #app {
  height: var(--tg-viewport-height, calc(var(--vh, 1vh) * 100)) !important;
  min-height: var(--tg-viewport-height, calc(var(--vh, 1vh) * 100)) !important;
  max-height: var(--tg-viewport-height, calc(var(--vh, 1vh) * 100)) !important;
}

html.tg-miniapp .game-page,
body.tg-miniapp .game-page {
  height: var(--tg-viewport-height, calc(var(--vh, 1vh) * 100)) !important;
  min-height: var(--tg-viewport-height, calc(var(--vh, 1vh) * 100)) !important;
  max-height: var(--tg-viewport-height, calc(var(--vh, 1vh) * 100)) !important;
  padding-top: var(--tg-content-safe-area-inset-top, 0px) !important;
  box-sizing: border-box !important;
}

.gm-h5-float-home {
  position: fixed;
  z-index: 12010;
  width: 38px;
  height: 38px;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(255, 225, 92, 0.55);
  border-radius: 50%;
  background: rgba(7, 7, 8, 0.88);
  color: #ffe15c;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
}

.gm-h5-float-home.is-dragging {
  cursor: grabbing;
  opacity: 0.92;
}

.gm-h5-float-home__icon {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

/* 电报小程序：使用 Telegram 原生返回，避免额外悬浮图标遮挡游戏画面 */
html.tg-miniapp .gm-h5-float-home {
  display: none !important;
  pointer-events: none !important;
}

html.tg-miniapp .tg-game-actions,
body.tg-miniapp .tg-game-actions {
  display: none !important;
  pointer-events: none !important;
}

html.tg-miniapp .tg-game-actions__btn,
body.tg-miniapp .tg-game-actions__btn {
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 225, 92, 0.6) !important;
  border-radius: 50% !important;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(145deg, rgba(35, 38, 46, 0.94), rgba(8, 8, 10, 0.92)) !important;
  color: #ffe15c !important;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0 !important;
  -webkit-tap-highlight-color: transparent !important;
  touch-action: none !important;
  cursor: grab !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

html.tg-miniapp .tg-game-actions.is-dragging .tg-game-actions__btn,
body.tg-miniapp .tg-game-actions.is-dragging .tg-game-actions__btn {
  cursor: grabbing !important;
  opacity: 0.9 !important;
  transform: scale(0.96) !important;
}

html.tg-miniapp .tg-game-actions__btn::before,
body.tg-miniapp .tg-game-actions__btn::before,
html.tg-miniapp .tg-game-actions__btn::after,
body.tg-miniapp .tg-game-actions__btn::after {
  content: none !important;
}

html.tg-miniapp .tg-game-actions__text,
body.tg-miniapp .tg-game-actions__text {
  display: none !important;
}

html.tg-miniapp .tg-game-actions__btn svg,
body.tg-miniapp .tg-game-actions__btn svg {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  color: #ffe15c !important;
  pointer-events: none !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55)) !important;
}
