html {
  -ms-touch-action: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  display: flex !important;
  flex-direction: column !important;
  background-color: #333;
  color: #888;
  font-family: 'Manrope', Helvetica, Verdana, Arial, sans-serif;
  text-align: center;
  cursor: default;
}

canvas, div {
  outline: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -khtml-user-select: none;
}

/* Remove spin of input type number */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Header */
header.game-header {
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
  flex-shrink: 0;
  padding: 12px 20px;
  box-sizing: border-box;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
}

.game-logo {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.game-logo:hover {
  opacity: 0.8;
}

.back-link {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.back-link:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

/* Main game area */
main.game-main {
  display: flex !important;
  flex: 1 1 auto;
  width: 100% !important;
  min-height: 0;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Footer */
footer.game-footer {
  display: block !important;
  width: 100% !important;
  flex-shrink: 0;
  padding: 12px 20px;
  box-sizing: border-box;
  text-align: center;
  background: rgba(0, 0, 0, 0.4);
  color: #888;
  font-size: 12px;
}

.game-footer p {
  margin: 0;
}

canvas {
  background-color: rgba(0, 0, 0, 0);
  display: block;
}

#GameDiv {
  width: min(100vw, calc(56.25vh - 50px));
  height: min(calc(100vh - 90px), 177.78vw);
  max-width: 450px;
  max-height: 750px;
  position: relative;
}

#Cocos3dGameContainer, #GameCanvas {
  width: 100%;
  height: 100%;
}

:root {
  --safe-top: env(safe-area-inset-top);
  --safe-right: env(safe-area-inset-right);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
}
