html, body {
  margin: 0;
  padding: 0;
  position: fixed;
  inset: 0;
  width: var(--app-width, 100vw);
  height: var(--app-height, 100dvh);
  min-width: var(--app-width, 100vw);
  min-height: var(--app-height, 100dvh);
  max-width: var(--app-width, 100vw);
  max-height: var(--app-height, 100dvh);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-overflow-scrolling: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  background: #1b1b1b;
}

/* Full-viewport frame; canvas is centered inside (letterboxed sides or top/bottom). */
#unity-container {
  position: fixed;
  inset: 0;
  width: var(--app-width, 100vw);
  height: var(--app-height, 100dvh);
  min-width: var(--app-width, 100vw);
  min-height: var(--app-height, 100dvh);
  max-width: var(--app-width, 100vw);
  max-height: var(--app-height, 100dvh);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/*
  Portrait reference 9:16 (matches Canvas Scaler 1080×1920).
  Fits inside the browser viewport without stretching — extra space stays outside the canvas
  (body background / container), so Unity sees a stable portrait aspect on desktop and mobile.
*/
#unity-canvas {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(var(--app-width, 100vw), calc(var(--app-height, 100dvh) * 9 / 16));
  height: min(var(--app-height, 100dvh), calc(var(--app-width, 100vw) * 16 / 9));
  max-width: var(--app-width, 100vw);
  max-height: var(--app-height, 100dvh);
  transform: translate(-50%, -50%);
  background: #231f20;
  display: block;
  box-sizing: border-box;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#unity-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}

#unity-loading-overlay-frame {
  width: min(var(--app-width, 100vw), calc(var(--app-height, 100dvh) * 9 / 16));
  height: min(var(--app-height, 100dvh), calc(var(--app-width, 100vw) * 16 / 9));
  max-width: var(--app-width, 100vw);
  max-height: var(--app-height, 100dvh);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  background-color: #17110d;
  background-image: url('Background_Start.jpg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

#unity-loading-overlay-content {
  width: min(360px, 88vw);
  text-align: center;
}

#unity-loading-overlay-text {
  margin-bottom: 14px;
  display: block;
  width: 100%;
  text-align: center;
  color: #fff3de;
  font-family: 'Nunito-BlackUnderlay SDF', Tahoma, Arial, sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  text-shadow: none;
  filter: none;
  -webkit-filter: none;
  -webkit-text-stroke: 0;
}

#unity-loading-overlay-progress {
  width: 100%;
  height: 20px;
  padding: 2px;
  border: 2px solid rgba(255, 247, 224, 0.95);
  border-radius: 999px;
  box-sizing: border-box;
  background: rgba(45, 29, 16, 0.7);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.34), inset 0 1px 2px rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

#unity-loading-overlay-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f7a926 0%, #ffd45d 46%, #ff8a1c 100%);
  box-shadow: 0 0 10px rgba(255, 164, 51, 0.65), 0 0 18px rgba(255, 193, 99, 0.35);
  transition: width 0.24s ease-out;
}

#unity-loading-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
}

#unity-logo {
  width: 154px;
  height: 130px;
  margin: 0 auto 12px auto;
  background: transparent;
}

#unity-progress-bar-empty {
  width: 200px;
  height: 18px;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

#unity-progress-bar-full {
  width: 0%;
  height: 100%;
  background: #ffffff;
}

#unity-warning {
  position: absolute;
  left: 50%;
  top: 5%;
  transform: translateX(-50%);
}
