:root {
  --app-width: 100vw;
  --app-height: 100dvh;
  --app-min-width: 360px;
  --app-min-height: 560px;
  --game-frame-height: var(--app-height, 100dvh);
  --game-frame-width: calc(var(--game-frame-height, 100dvh) * 9 / 16);
  --tg-bg: #000000;
  --tg-text: #ffffff;
  --tg-hint: rgba(255, 255, 255, 0.72);
}

html {
  min-width: var(--app-min-width, 360px);
  min-height: var(--app-min-height, 560px);
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--tg-bg, #000);
  color: var(--tg-text, #fff);
}

body {
  position: fixed;
  inset: 0;
  width: var(--app-width, 100vw);
  height: var(--app-height, 100dvh);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#GameViewportRoot {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--app-width, 100vw);
  height: var(--app-height, 100dvh);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: var(--tg-bg, #000);
}

#GameDiv {
  position: relative;
  overflow: hidden;
  background: #000;
  width: var(--game-frame-width, var(--app-width, 100vw));
  height: var(--game-frame-height, var(--app-height, 100dvh));
  flex: 0 0 auto;
  transform: translateZ(0);
  transform-origin: center center;
}

#Cocos3dGameContainer,
#GameCanvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

#GameCanvas {
  display: block;
  outline: none;
  background: transparent;
}

#RotateHint {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px;
  font: 600 20px/1.4 Inter, Arial, sans-serif;
  color: var(--tg-text, #fff);
  background: rgba(0, 0, 0, 0.82);
  z-index: 1000;
}

#RotateHint.show {
  display: flex;
}

#SizeGuard {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 28px;
  box-sizing: border-box;
  text-align: center;
  color: var(--tg-text, #fff);
  background: rgba(0, 0, 0, 0.9);
  pointer-events: auto;
  z-index: 1200;
}

#SizeGuard.show {
  display: flex;
}

.size-guard-card {
  width: min(420px, 100%);
  padding: 24px 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  background: rgba(18, 24, 34, 0.92);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.size-guard-title {
  display: block;
  margin-bottom: 10px;
  font: 800 24px/1.1 Inter, Arial, sans-serif;
}

.size-guard-text {
  margin: 0;
  font: 500 16px/1.35 Inter, Arial, sans-serif;
  color: var(--tg-hint, rgba(255, 255, 255, 0.72));
}
