@import url("https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap");

@import url("https://fonts.googleapis.com/css2?family=Russo+One&display=swap");

body {
  margin: 0;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Share Tech Mono", monospace;
  overscroll-behavior: none;
  font-size: 24px;
  text-align: center;
  background-color: #08203a;
  color: #8ee3f1;
  min-height: 100vh;
  cursor: url("img/cursor.png") 8 8, auto !important;
  -webkit-touch-callout: none;
  /* iOS Safari */
  -webkit-user-select: none;
  /* Safari */
  -khtml-user-select: none;
  /* Konqueror HTML */
  -moz-user-select: none;
  /* Old versions of Firefox */
  -ms-user-select: none;
  /* Internet Explorer/Edge */
  user-select: none;
}

a,
button,
.number,
.bin-item {
  cursor: url("img/cursor.png") 8 8, pointer !important;
}

p {
  margin: 0;
}

.intro {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  z-index: 99999;
  background-color: #08203a;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-out ease-in 0.3s forwards;
  animation-delay: 4.5s;
}

.logo {
  position: relative;
  opacity: 1;
  animation: fade-out ease-in 1s forwards;
  animation-delay: 3.3s;
}

.logo-svg {
  position: absolute;
  z-index: 999999;
  height: 21px;
  top: 42px;
  right: 43px;
  opacity: 0;
  animation: fade-in ease-in 1s forwards;
  animation-delay: 2s;
}

.logo-svg path {
  fill: #8ee3f1;
}

.logo::after {
  content: "";
  position: absolute;
  left: 21px;
  bottom: 21px;
  width: 0;
  height: 2px;
  background-color: #8ee3f1;
  animation: grow ease-in 0.8s forwards;
  animation-delay: 2s;
}

.logo::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 21px;
  width: 0;
  margin-left: 80%;
  height: 2px;
  background-color: #8ee3f1;
  animation: grow ease-in 0.8s forwards;
  animation-delay: 1.5s;
}

.logo-text {
  position: absolute;
  top: 36px;
  left: 28px;
  font-family: "Russo One", sans-serif;
  font-size: 28px;
  letter-spacing: 12px;
  z-index: 99999;
  opacity: 0;
  animation: fade-in ease-in 1s forwards;
  animation-delay: 2s;
}

.logo-text .e {
  color: #08203a;
}

.logo-bg {
  position: absolute;
  width: 0;
  top: 33px;
  left: 20px;
  height: 40px;
  background-color: #08203a;
  z-index: 9999;
  animation: grow linear 0.6s forwards;
  animation-delay: 1.5s;
}

.logo-circles {
  display: block;
  width: 200px;
  height: 100px;
  border: 2px solid #8ee3f1;
  border-radius: 100%;
  position: relative;
}

.logo-circles::before {
  content: "";
  width: 0;
  height: 100%;
  position: absolute;
  top: -2px;
  left: 50%;
  border: 2px solid #8ee3f1;
  border-radius: 100%;
  animation: scale72 linear 1s forwards;
  animation-delay: 1s;
  opacity: 0;
}

.logo-circles::after {
  content: "";
  width: 0;
  height: 100%;
  position: absolute;
  top: -2px;
  left: 50%;
  border: 2px solid #8ee3f1;
  border-radius: 100%;
  animation: scale33 linear 1s forwards;
  animation-delay: 1.8s;
  opacity: 0;
}

header {
  flex-shrink: 0;
  padding: 25px 0;
  border-bottom: 1px solid rgba(127, 220, 255, 0.25);
  box-shadow: inset 0 -1px 0 rgba(127, 220, 255, 0.15);
  background: #08203a;
  display: flex;
  justify-content: center; /* Centraliza horizontalmente */
  align-items: center;
  position: relative;
  z-index: 100;
  animation: headerDrift 12s ease-in-out infinite alternate;
  background-size: 200% 200%;
  letter-spacing: 0.1em;
}

.header .fullscreen {
  transition: opacity 0.3s ease, border-color 0.3s ease;
}

.header .fullscreen:hover {
  opacity: 0.85;
  border-color: rgba(127, 220, 255, 0.75);
}

.header .hint {
  letter-spacing: 0.18em;
  opacity: 0.55;
}

.header .status {
  font-weight: 300;
}

@keyframes headerDrift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

header::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 5px;
  background-color: #08203a;
  display: block;
  border-bottom: 2px solid #8ee3f1;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 95%; /* Aumentamos para dar mais respiro aos números */
  max-width: 1200px; /* Evita que em telas muito grandes fique espalhado demais */
}

.header-content div {
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-content div p {
  margin-left: 40px;
}

.header-content .lumen {
  font-family: "Russo One", sans-serif;
  font-weight: bold;
  font-size: 20px;
  letter-spacing: 8px;
  position: relative;
  width: 110px;
  height: 28px;
}

.header-content .lumen .circles {
  border-radius: 100%;
  height: 80px;
  width: 120px;
  position: absolute;
  border: 2px solid #8ee3f1;
  height: 68px;
  width: 143px;
  top: -23px;
  left: -23px;
}

.header-content .lumen .circles::before {
  content: "";
  width: 66%;
  border: 2px solid #8ee3f1;
  height: 100%;
  position: absolute;
  border-radius: 100%;
  left: 15%;
  top: -2px;
}

.header-content .lumen .circles::after {
  content: "";
  width: 33%;
  border: 2px solid #8ee3f1;
  height: 100%;
  position: absolute;
  border-radius: 100%;
  left: 31%;
  top: -2px;
}

.lumen-text {
  background-color: #08203a;
  padding: 2px;
  margin-bottom: 2px;
  position: absolute;
  left: -7px;
  z-index: 999;
}

.header-percent {
  color: transparent;
  -webkit-text-stroke: 1px #8ee3f1;
}

footer {
  flex-shrink: 0;
  padding: 20px 0;
  border-top: 2px solid #8ee3f1;
  background: #08203a;
  display: flex;
  flex-direction: column;
  align-items: center; /* Centraliza tudo no rodapé */
  position: relative;
  z-index: 100;
  margin-top: -50px;
}

footer > div {
  width: 100%;
}

footer .code {
  margin-top: 16px;
  padding-top: 8px;
  font-size: 16px;
  border-top: 1px solid #8ee3f1;
}

.footer-container {
  display: flex; /* Mudamos de grid para flex para centralizar melhor */
  justify-content: center;
  gap: 20px;
  width: 100%;
  margin-bottom: 15px;
}

.footer-container div {
  border: 2px solid #8ee3f1;
  font-size: 20px;
  padding: 4px 0;
  position: relative;
}

.footer-container div.b30::before {
  content: "";
  width: 30%;
  height: 100%;
  left: 0;
  top: 0;
  position: absolute;
  background-color: #8ee3f1;
}

.footer-container div.b11::before {
  content: "";
  width: 11%;
  height: 100%;
  left: 0;
  top: 0;
  position: absolute;
  background-color: #8ee3f1;
}

.footer-container div.b9::before {
  content: "";
  width: 9%;
  height: 100%;
  left: 0;
  top: 0;
  position: absolute;
  background-color: #8ee3f1;
}

.footer-container div.b27::before {
  content: "";
  width: 27%;
  height: 100%;
  left: 0;
  top: 0;
  position: absolute;
  background-color: #8ee3f1;
}

.footer-container div.b18::before {
  content: "";
  width: 18%;
  height: 100%;
  left: 0;
  top: 0;
  position: absolute;
  background-color: #8ee3f1;
}

/* Container do grid para alinhar com seu design */
section {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(320px, 1.2fr);
  gap: 15px;
  padding: 40px;
  height: 60vh; /* Ajuste conforme necessário */
  overflow: hidden;
  position: relative;
}

@keyframes flicker {
  0% {
    opacity: 0.8;
    text-shadow: none;
  }
  50% {
    opacity: 1;
    text-shadow: 0 0 5px #8ee3f1;
  }
  100% {
    opacity: 0.8;
    text-shadow: none;
  }
}

/* Aplicaremos essa classe via JS em alguns números */
.flicker-slow {
  animation: flicker 3s infinite;
}
.flicker-fast {
  animation: flicker 0.5s infinite;
}

/* Quando o mouse passa ou está na caixa */
.number.selected {
  color: #00faad;
  text-shadow: 0 0 10px #00faad;
  transform: scale(1.4);
}

/* A caixa de seleção visual */
#selection-box {
  border: 1px solid #00faad;
  background-color: rgba(0, 250, 173, 0.05);
  position: absolute;
  pointer-events: none;
  display: none;
  z-index: 1000;
}

/* Efeito de sumir ao "refinar" */
.refining {
  opacity: 0;
  transform: translateY(20px) scale(0);
  transition: all 0.5s ease-in;
}

@media only screen and (min-width: 1024px) {
  section {
    grid-template-columns: minmax(180px, 1fr) auto minmax(320px, 1.2fr);
  }
}

@media only screen and (min-width: 1200px) {
  section {
    grid-template-columns: minmax(180px, 1fr) auto minmax(320px, 1.2fr);
  }
}

section > div {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 100;
}

section > div.b-20 {
  animation: float-bottom-20 6s ease-in-out infinite;
}

section > div.l-20 {
  animation: float-left-20 6s ease-in-out infinite;
}

section > div.d-1 {
  animation-delay: 1s;
}

section > div.d-1_5 {
  animation-delay: 1.5s;
}

section > div.du-2 {
  animation-duration: 3s;
}

section > div.du-8 {
  animation-duration: 4s;
}

.reports {
  margin: 20px;
  padding: 20px;
  border: 2px solid #8ee3f1;
  color: #8ee3f1;
  background-color: #041b2d;
  font-family: "Share Tech Mono", monospace;
  text-align: center;
}

.reports h2 {
  margin-bottom: 15px;
  font-size: 24px;
}

#report-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.report-item {
  border: 1px solid #8ee3f1;
  padding: 10px;
  background-color: #08203a;
  color: #8ee3f1;
  font-size: 18px;
  text-align: left;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  margin: 10px;
  background-color: #8ee3f1;
  color: #08203a;
  text-decoration: none;
  font-family: "Share Tech Mono", monospace;
  font-size: 16px;
  border: 2px solid #8ee3f1;
  border-radius: 5px;
  transition: background-color 0.2s;
  text-align: center;
}

.btn:hover {
  background-color: #041b2d;
  color: #8ee3f1;
}

/* Container de efeitos - deve cobrir a tela toda */
.overlay-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Importante: permite clicar nos números por baixo */
  z-index: 9999;
  background: radial-gradient(
    circle,
    transparent 40%,
    rgba(0, 0, 0, 0.4) 100%
  ); /* Vinheta */
}

/* Linhas de scan (scanlines) */
.overlay-effects::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
    linear-gradient(
      90deg,
      rgba(255, 0, 0, 0.02),
      rgba(0, 255, 0, 0.01),
      rgba(0, 0, 255, 0.02)
    );
  background-size: 100% 3px, 3px 100%;
  z-index: 2;
}

/* Efeito de Flicker (piscar sutil) */
@keyframes flicker {
  0% {
    opacity: 0.97;
  }
  5% {
    opacity: 0.95;
  }
  10% {
    opacity: 0.9;
  }
  15% {
    opacity: 0.98;
  }
  100% {
    opacity: 1;
  }
}

body {
  animation: flicker 0.15s infinite;
}

@keyframes float-bottom-20 {
  0% {
    padding-bottom: 0;
    padding-top: 0;
  }

  50% {
    padding-bottom: 10px;
    padding-top: 0;
  }

  100% {
    padding-bottom: 0;
    padding-top: 0;
  }
}

@keyframes float-left-20 {
  0% {
    padding-left: 0;
    padding-right: 0;
  }

  50% {
    padding-left: 10px;
    padding-right: 0;
  }

  100% {
    padding-left: 0;
    padding-right: 0;
  }
}

@keyframes fade-in {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes fade-out {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    display: none;
  }
}

@keyframes grow {
  0% {
    width: 0;
    margin-left: 80%;
  }

  100% {
    width: 80%;
    margin-left: 0;
  }
}

@keyframes scale {
  0% {
    transform: scale(0);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes scale33 {
  0% {
    opacity: 1;
    width: 0;
    left: 50%;
  }

  100% {
    width: 33%;
    left: 33%;
    opacity: 1;
  }
}

@keyframes scale72 {
  0% {
    opacity: 1;
    width: 0;
    left: 50%;
  }

  100% {
    width: 72%;
    left: 14%;
    opacity: 1;
  }
}

/* Definição do tremor */
@keyframes shake {
  0% {
    transform: translate(1px, 1px) rotate(0deg);
  }
  10% {
    transform: translate(-1px, -2px) rotate(-1deg);
  }
  20% {
    transform: translate(-3px, 0px) rotate(1deg);
  }
  30% {
    transform: translate(3px, 2px) rotate(0deg);
  }
  40% {
    transform: translate(1px, -1px) rotate(1deg);
  }
  50% {
    transform: translate(-1px, 2px) rotate(-1deg);
  }
  60% {
    transform: translate(-3px, 1px) rotate(0deg);
  }
  70% {
    transform: translate(3px, 1px) rotate(-1deg);
  }
  80% {
    transform: translate(-1px, -1px) rotate(1deg);
  }
  90% {
    transform: translate(1px, 2px) rotate(0deg);
  }
  100% {
    transform: translate(1px, -2px) rotate(-1deg);
  }
}

/* Classe que será aplicada via JS */
.shake-effect {
  animation: shake 0.3s;
  animation-iteration-count: 1;
}

/* No teu style.css, garante que estas propriedades existem para as barras */
.bin-bar {
  width: 100%;
  height: 8px;
  background: rgba(142, 227, 241, 0.1);
  border: 1px solid #8ee3f1;
  margin: 5px 0;
  overflow: hidden;
}

.bin-bar .fill {
  height: 100%;
  background: #8ee3f1;
  width: 0%; /* Começa vazio */
  transition: width 0.4s ease-out;
}

.bin-item {
  min-width: 120px; /* Garante um tamanho fixo para não sambar */
  text-align: center;
}

.bin-item.selected-type {
  border-color: #00faad;
  box-shadow: 0 0 10px rgba(0, 250, 173, 0.5);
}

#data-grid {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(34px, max-content));
  justify-content: center;
  gap: 16px;
  padding: 20px 10px; /* Aumentamos o padding superior e inferior (60px) */
  overflow-y: auto;
  align-content: start;
}

/* Animação de flutuação */
/* Animação de flutuação orgânica */
@keyframes floatNumber {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(2px, 3px);
  } /* Movimento subtil */
  100% {
    transform: translate(0, 0);
  }
}

/* Garante que a lente de aumento continue funcionando por cima da animação */
.number:hover {
  z-index: 10;
  opacity: 0.9;
}

.number {
  display: inline-block;
  transition: transform 0.25s ease, opacity 0.25s ease;
  will-change: transform;
  cursor: default;
  opacity: 0.55;
}

/* Importante: Se você tiver uma animação de 'float', 
garanta que ela NÃO use a propriedade 'transform' */
@keyframes float {
  0% {
    margin-top: 0px;
  }
  50% {
    margin-top: 5px;
  }
  100% {
    margin-top: 0px;
  }
}

.floating {
  animation: float 3s ease-in-out infinite;
}

/* Brilho quando o número entra no bin */
@keyframes bin-flash {
  0% {
    background: rgba(142, 227, 241, 0.5);
  }
  100% {
    background: transparent;
  }
}

.bin-flash-active {
  animation: bin-flash 0.4s ease-out;
}

/* Brilho extra na barra de preenchimento quando abre */
.bin-open .fill {
  filter: brightness(1.5);
  box-shadow: 0 0 15px #8ee3f1;
}

/* Efeito da caixa a abrir (expansão e brilho) */
.bin-item {
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    background 0.3s;
}

.bin-open {
  transform: scale(1.15); /* Aumenta a caixa simulando abertura */
  background: rgba(142, 227, 241, 0.2) !important;
  box-shadow: 0 0 20px #8ee3f1;
  border-color: #ffffff;
}

/* Garante que a barra de preenchimento apareça */
.fill {
  height: 100%;
  background-color: #8ee3f1; /* Cor Lumon */
  width: 0%;
  transition: width 0.4s ease-out;
  box-shadow: 0 0 10px #8ee3f1;
}

/* Garante o cursor personalizado em todos os elementos interativos */
body,
html,
a,
button,
.number,
.bin-item,
#fullscreen-btn {
  cursor: url("img/cursor.png") 8 8, auto !important;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
}

#fullscreen-btn {
  background: transparent;
  border: 1px solid #8ee3f1;
  color: #8ee3f1;
  font-family: "Share Tech Mono", monospace;
  padding: 5px 15px;
  font-size: 14px;
  transition: all 0.3s ease;
}

#fullscreen-btn:hover {
  background: #8ee3f1;
  color: #08203a;
  box-shadow: 0 0 10px #8ee3f1;
}

/* Efeito opcional: Esconde o botão quando já estiver em tela cheia (se quiser) */
:fullscreen #fullscreen-btn {
  border-color: rgba(142, 227, 241, 0.3);
  color: rgba(142, 227, 241, 0.3);
}

#refine-instruction {
  font-size: 14px;
  color: #00faad; /* Verde Lumon para destaque */
  letter-spacing: 2px;
  opacity: 0; /* Começa invisível */
  transition: opacity 0.3s ease;
  text-transform: uppercase;
  margin-left: 90px;
}

/* Classe que o JS vai ativar quando houver números selecionados */
.show-instruction {
  opacity: 1 !important;
  animation: blinkText 1.5s infinite;
}

@keyframes blinkText {
  0%,
  100% {
    opacity: 1;
    text-shadow: 0 0 5px #00faad;
  }
  50% {
    opacity: 0.3;
    text-shadow: none;
  }
}

/* Overlay que escurece o fundo */
#alert-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.hidden {
  display: none !important;
}

/* Caixa do alerta */
/* Overlay que escurece o fundo e foca no erro */
#alert-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(5px);
}

.hidden {
  display: none !important;
}

/* Caixa do alerta estilo terminal antigo */
.alert-box {
  background: #08203a;
  border: 4px solid #ff3333;
  padding: 40px;
  text-align: center;
  box-shadow: 0 0 30px rgba(255, 51, 51, 0.5);
  max-width: 450px;
  position: relative;
}

.alert-title {
  font-family: "Russo One", sans-serif;
  color: #ff3333;
  font-size: 28px;
  margin-bottom: 20px;
  letter-spacing: 3px;
  animation: pulse-red 1s infinite alternate;
}

.highlight {
  color: #ffffff;
  background: #ff3333;
  padding: 2px 5px;
}

#ack-button {
  margin-top: 30px;
  background: transparent;
  border: 1px solid #ff3333;
  color: #ff3333;
  padding: 10px 20px;
  font-family: "Share Tech Mono", monospace;
  cursor: url("img/cursor.png") 8 8, pointer !important;
  transition: all 0.2s;
}

#ack-button:hover {
  background: #ff3333;
  color: white;
  box-shadow: 0 0 15px #ff3333;
}

@keyframes pulse-red {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0.7;
    transform: scale(0.98);
  }
}

/* Efeito de erro crítico no ecrã */
.system-unstable {
  animation: shake-extreme 0.2s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  transform: translate3d(0, 0, 0);
  filter: sepia(1) saturate(2) hue-rotate(-50deg) !important; /* Deixa tudo avermelhado */
}

@keyframes shake-extreme {
  10%,
  90% {
    transform: translate3d(-2px, 0, 0);
  }
  20%,
  80% {
    transform: translate3d(4px, 0, 0);
  }
  30%,
  50%,
  70% {
    transform: translate3d(-6px, 0, 0);
  }
  40%,
  60% {
    transform: translate3d(6px, 0, 0);
  }
}

#audit-log {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 320px;
  max-height: 180px;
  overflow: hidden;

  background: rgba(8, 32, 58, 0.85);
  border: 1px solid rgba(142, 227, 241, 0.4);
  padding: 10px;

  font-size: 12px;
  text-align: left;
  z-index: 5000;
}

.log-title {
  letter-spacing: 3px;
  opacity: 0.6;
  margin-bottom: 6px;
}

#log-entries {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry {
  opacity: 0;
  animation: logFadeIn 0.4s forwards;
}

.log-entry.violation {
  color: #ff6666;
}

.log-entry.success {
  color: #00faad;
}

@keyframes logFadeIn {
  to {
    opacity: 0.85;
  }
}

.system-footer {
  position: relative;
}
