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

#unity-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(rgba(11, 7, 16, 0.6), rgba(11, 7, 16, 0.8)),
    url('loading-bg.png') center / cover no-repeat #0b0710;
}

#unity-canvas {
  position: relative;
  width: 960px;
  height: 600px;
  max-width: 100vw;
  max-height: 100vh;
  display: block;
  outline: none;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  z-index: 5;
}

/* Экран загрузки: фон из внутриигрового лоадера + лого по центру.
   Закрывает канвас, пока wasm/data качаются и инстанс создаётся. */
#unity-loading-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background:
    linear-gradient(rgba(11, 7, 16, 0.55), rgba(11, 7, 16, 0.75)),
    url('loading-bg.png') center / cover no-repeat #0b0710;
  z-index: 10;
}

#unity-logo {
  width: min(46vw, 640px);
  max-height: 40vh;
  object-fit: contain;
  filter: drop-shadow(0 6px 28px rgba(0, 0, 0, 0.65));
  user-select: none;
  -webkit-user-drag: none;
}

#unity-progress-track {
  width: min(40vw, 520px);
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

#unity-progress-bar-full {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #a3243a, #e8556e);
  transition: width 0.25s ease;
}

#unity-progress-label {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

#unity-warning {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 12px;
  width: min(90vw, 720px);
  z-index: 20;
  color: #fff;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  text-align: center;
}

#unity-warning div {
  border-radius: 8px;
  margin-bottom: 6px;
}

@media (max-width: 720px) {
  #unity-logo { width: 78vw; }
  #unity-progress-track { width: 70vw; }
}

#unity-fullscreen-button {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 30;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background-color: rgba(0, 0, 0, 0.5);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s, transform 0.1s;
}

#unity-fullscreen-button:hover { opacity: 1; }
#unity-fullscreen-button:active { transform: scale(0.94); }
