/* Twin Games - WebGL Template Styles (image-based progress bar, fixed URLs) */

/* Reset básico */
html, body {
  padding: 0;
  margin: 0;
  height: 100%;
}

body {
  background: #0D1218;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif;
}

/* ==========================
   Container principal
   ========================== */
#unity-container {
  position: fixed;       /* Full-screen estável */
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: #0D1218;
  display: flex;
  align-items: center;
  justify-content: center;
}

#unity-container.unity-desktop,
#unity-container.unity-mobile {
  width: 100vw;
  height: 100vh;
}

/* ==========================
   Canvas do Unity
   ========================== */
#unity-canvas {
  display: block;      /* remove lacunas de inline */
  width: 100%;
  height: 100%;
  touch-action: none;  /* ajuda com gestos em mobile */
  background: #0D1218; /* fallback de fundo */
}

/* ==========================
   Barra de loading (central)
   - Usa imagens twin-progress-bar-*.png (200x46)
   - O preenchimento é recortado por overflow do pai
   ========================== */
#unity-loading-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;   /* visível via JS durante o boot */
  width: 200px;    /* largura da arte */
  z-index: 1000;   /* garante que fica acima do canvas */
}

#unity-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

#unity-logo-image {
  width: 150px;
  height: 150px;
  object-fit: contain;
  image-rendering: auto;
}

/* Container "vazio" com a arte da barra */
#unity-progress-bar-empty {
    position: relative;
    width: 141px; /* = largura da imagem */
    height: 18px; /* = altura da imagem */
    background: url("progress-bar-full-light.png") center center / contain no-repeat;
    border-radius: 0;
    overflow: hidden; /* necessário para mascarar o preenchimento */
    margin: 0 auto;
}

/* Elemento "cheio" cuja largura é controlada pelo loader via JS. */
#unity-progress-bar-full {
  position: absolute;
  left: 0;
  top: 0;
  height: 18px;
  width: 0%;           /* alterado via JS (0 → 100) */
  overflow: hidden;
}

/* A arte do preenchimento fica neste pseudo-elemento inteiro (200x46),
   e o pai (#unity-progress-bar-full) recorta pela largura. */
#unity-progress-bar-full::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 200px;
  height: 18px;
  background: url("twin-progress-bar-full.png") left center / contain no-repeat;
}

/* ==========================
   Avisos do loader (showBanner)
   ========================== */
#unity-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: none;            /* controlado via JS */
  text-align: center;
  font: 14px/1.4 sans-serif;
}

.unity-banner {
  padding: 10px;
  margin: 0;
}

.unity-banner--error {
  background: #c62828;
  color: #fff;
}

.unity-banner--warning {
  background: #ffeb3b;
  color: #000;
}

/* ==========================
   Aviso de orientação (opcional)
   ========================== */
#rotate-warning {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: #0D1218;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

body:not(.wrong-orientation) #rotate-warning {
  display: none;
}

/* ==========================
   Acessibilidade e UX
   ========================== */
:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
}

/* Evitar seleção acidental de texto sobre o canvas */
#unity-container, #unity-canvas, #unity-loading-bar {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
