/* Fundo inicial branco */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Canvas da matriz */
#matrix-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 1;
}

/* Overlay branco que some = branco -> preto */
#white-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #ffffff;
  z-index: 2;
  pointer-events: none;
  opacity: 1;
  transition: opacity 4s ease-in-out;
}

/* Vignette leve nas bordas */
#vignette-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(circle at center,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.4) 55%,
    rgba(0, 0, 0, 0.85) 100%);
  opacity: 0;               /* entra junto com a matriz */
  transition: opacity 2s ease-in-out;
}

/* Texto de introdução centralizado */
#intro-text-container {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  color: #e5f0ff;
  text-shadow: 0 0 10px rgba(47,130,255,0.8);
  font-family: "Consolas", "Courier New", monospace;
  font-size: clamp(16px, 2.2vh, 22px);
  letter-spacing: 0.08em;
  padding: 0 24px;
  opacity: 1;
  transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
}

#intro-text-container.hidden {
  opacity: 0;
  transform: translateY(-12px);
}

.intro-line {
  min-height: 1.5em;
  margin: 4px 0;
  white-space: pre;
}

/* Cursor de digitação */
.intro-line::after {
  content: "▋";
  opacity: 0;
  animation: intro-cursor 0.9s steps(1) infinite;
}

.intro-line.typing::after {
  opacity: 1;
}

@keyframes intro-cursor {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* App Unity e checklist começam invisíveis */
#unity-container,
#checklistWindow {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease-in-out;
}

/* Quando a intro termina, mostramos o app */
body.app-show #unity-container,
body.app-show #checklistWindow {
  opacity: 1;
  pointer-events: auto;
}

/* Garante que o app Unity fique acima do canvas da matriz, sem mexer no posicionamento original */
#unity-container {
  z-index: 5;
}

/* Se o seu checklist já tiver position próprio, só ajustamos a camada */
#checklistWindow {
  z-index: 6;
}

/* Depois que o app aparecer, deixamos a matriz mais discreta */
body.app-show #matrix-bg {
  opacity: 0.25;
  transition: opacity 1.5s ease-in-out;
  pointer-events: none;
}
/* =========================================================
   OVERRIDES PARA MANTER O FUNDO ESCURO + MATRIZ FORTE
   ========================================================= */

/* Garante que o fundo da página continue preto,
   mesmo depois que o template da Unity tentar pintar cinza */
body,
body.app-show {
  background: #000000 !important;
}

/* Unity container transparente (sem aquele cinza do template) */
#unity-container,
#unity-container.unity-desktop,
#unity-container.unity-mobile {
  background: transparent !important;
}

/* Canvas do Unity transparente também, pra matriz aparecer atrás */
#unity-canvas {
  background-color: transparent !important;
}

/* Checklist por cima do jogo/matriz */
#checklistWindow {
  z-index: 6;
}

/* Garante apenas que o jogo fique acima da matriz, sem mudar posição */
#unity-container {
  z-index: 5;
}

/* (Opcional) se em algum momento você tiver colocado isso,
   deixe a matriz sempre forte, sem apagar depois que o app aparece: */
/*
body.app-show #matrix-bg {
  opacity: 1;
  pointer-events: none;
}
*/
/* Canvas da máscara que “desenha” o app com códigos */
#matrix-app-mask {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 7;           /* acima da matriz de fundo, abaixo/ao lado do Unity */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

/* Durante a fase da máscara, ele fica visível */
body.app-mask-phase #matrix-app-mask {
  opacity: 1;
}

/* Depois que o app aparece, a máscara some */
body.app-show #matrix-app-mask {
  opacity: 0;
}

#unity-build-title {
  color: #0db1ff;
  text-shadow: 0 0 12px rgba(13, 177, 255, 0.7);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

/* Modo "glitch" em uma palavra */
#unity-build-title.code-mode {
  color: #7ad9ff;
  text-shadow: 0 0 18px rgba(122, 217, 255, 0.95);
}

