:root {
  --bg: #343549;
  --panel: #11182d;
  --text: #ffffff;
  --viewport-height: 100dvh;
  --viewport-stable-height: 100dvh;
  --safe-area-top: 0px;
  --safe-area-right: 0px;
  --safe-area-bottom: 0px;
  --safe-area-left: 0px;
  --tg-safe-area-inset-top: 0px;
  --tg-safe-area-inset-right: 0px;
  --tg-safe-area-inset-bottom: 0px;
  --tg-safe-area-inset-left: 0px;
  --tg-content-safe-area-inset-top: 0px;
  --tg-content-safe-area-inset-right: 0px;
  --tg-content-safe-area-inset-bottom: 0px;
  --tg-content-safe-area-inset-left: 0px;
  --desktop-max-width: 560px;
  --game-aspect: 16 / 10;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0 !important;
  width: 100%;
  height: var(--viewport-stable-height);
  min-height: var(--viewport-stable-height);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  font-family: Arial, sans-serif;
}

#app {
  padding: 0 !important;
  width: 100%;
  height: var(--viewport-stable-height);
  min-height: var(--viewport-stable-height);
  display: flex;
  align-items: center;
  justify-content: center;
}

#unity-shell {
  position: relative;
  padding: 0 !important;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#desktop-banner {
  display: none;
  width: min(100% - 32px, 420px);
  padding: 28px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  text-align: left;
}

.desktop-banner__brand {
  margin-bottom: 28px;
  font-size: 18px;
  font-weight: 700;
}

#desktop-banner h1 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.1;
}

#desktop-banner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  line-height: 1.45;
}

#desktop-banner .desktop-banner__hint {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 14px;
}

body.is-desktop-blocked #desktop-banner {
  display: block;
}

body.is-desktop-blocked #unity-container {
  display: none;
}

#unity-container {
  position: relative;
  padding: 0 !important;
  width: min(100vw, var(--desktop-max-width));
  aspect-ratio: var(--game-aspect);
  background: #000;
  overflow: hidden;
  border-radius: 18px;
}

#unity-container.is-mobile {
  width: 100vw;
  height: var(--viewport-stable-height);
  aspect-ratio: auto;
  border-radius: 0;
}

#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  outline: none;
}

#unity-loading-bar {
  background-image: url("../TemplateData/splash_loading.png");
  background-size: cover;
  background-position: center;

  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: end;
  padding-bottom: 100px;
  flex-direction: column;
  gap: 12px;
  background: rgba(0, 0, 0, 0.45);
  z-index: 5;
}

#unity-progress-bar-empty {
  width: min(220px, 60%);
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
}

#unity-progress-bar-full {
  width: 0%;
  height: 100%;
  background: #ffffff;
}

#unity-warning {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 10;
}

#unity-footer {
  display: none !important;
}

@media (min-width: 1024px) {
  :root {
    --desktop-max-width: 620px;
  }
}
