* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body, #container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  body {
    background: #08080c;
    color: #ededf5;
  }
}

@media (prefers-color-scheme: light) {
  body {
    background: #f5f5f7;
    color: #1a1a1f;
  }
}

#container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* JOGO */
.jogo {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, #08080c 0%, #101018 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.jogo.visivel {
  opacity: 1;
  pointer-events: auto;
}

.servidores {
  display: flex;
  justify-content: center;
  gap: 3rem;
  width: 100%;
  max-width: 1200px;
  margin-top: 3rem;
}

.servidor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  flex: 1;
  max-width: 200px;
}

.titulo {
  font-size: 0.95rem;
  font-weight: 600;
  color: #9a9ab0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.haste {
  width: 100%;
  min-height: 400px;
  background: rgba(16, 16, 24, 0.6);
  border: 2px solid #26263a;
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.haste:hover {
  background: rgba(16, 16, 24, 0.8);
  border-color: #f59e0b;
}

.haste.selecionado {
  background: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.disco {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
  color: #08080c;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  cursor: grab;
  user-select: none;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.disco:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.disco.selecionado {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.5);
}

@media (prefers-color-scheme: light) {
  .disco {
    color: #ffffff;
  }
}

/* TELAS */
.tela {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  background: linear-gradient(135deg, #08080c 0%, #101018 100%);
}

.tela.ativa {
  opacity: 1;
  pointer-events: auto;
}

.painel {
  background: rgba(16, 16, 24, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid #26263a;
  border-radius: 12px;
  padding: 2rem;
  max-width: 540px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.painel h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #f59e0b;
  text-align: center;
}

.painel h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem;
  color: #ededf5;
}

.lema {
  font-size: 0.95rem;
  color: #9a9ab0;
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.secaoControles {
  margin: 1.5rem 0;
}

.controles {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
  background: rgba(245, 158, 11, 0.05);
  padding: 1rem;
  border-radius: 8px;
  border-left: 3px solid #f59e0b;
}

.controle {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
}

.controle strong {
  color: #ededf5;
}

.controle span {
  color: #f59e0b;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.dica {
  font-size: 0.875rem;
  color: #9a9ab0;
  line-height: 1.6;
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(245, 158, 11, 0.05);
  border-radius: 6px;
  border-left: 2px solid #f59e0b;
}

.resultado {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(245, 158, 11, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.1);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.stat .label {
  font-size: 0.75rem;
  color: #9a9ab0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat .valor {
  font-size: 1.75rem;
  font-weight: 700;
  color: #f59e0b;
  font-family: 'Courier New', monospace;
}

.detalhes {
  background: rgba(245, 158, 11, 0.05);
  border-left: 2px solid #f59e0b;
  border-radius: 6px;
  padding: 1rem;
  margin: 1.5rem 0;
}

.detalhes p {
  font-size: 0.875rem;
  color: #9a9ab0;
  line-height: 1.6;
}

.licao {
  font-size: 0.875rem;
  color: #9a9ab0;
  line-height: 1.6;
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(16, 185, 129, 0.05);
  border-radius: 6px;
  border-left: 2px solid #10b981;
}

/* BOTÕES */
button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: inline-block;
  text-align: center;
  min-height: 44px;
  min-width: 44px;
}

.botao-primario {
  width: 100%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #08080c;
  margin-top: 1rem;
  padding: 1rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.botao-primario:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.botao-primario:active {
  transform: translateY(0);
}

.botao-secundario {
  width: 100%;
  background: rgba(154, 154, 176, 0.1);
  color: #ededf5;
  border: 1px solid #26263a;
  margin-top: 0.5rem;
  padding: 0.75rem;
}

.botao-secundario:hover {
  background: rgba(154, 154, 176, 0.2);
  border-color: #9a9ab0;
}

/* HUD */
.hud {
  position: fixed;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  font-size: 0.875rem;
}

.hud.visivel {
  opacity: 1;
  pointer-events: auto;
}

.hud-esq,
.hud-dir {
  display: flex;
  gap: 1.5rem;
}

.hud-centro {
  flex: 1;
  max-width: 300px;
}

.hud-item {
  background: rgba(16, 16, 24, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid #26263a;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  min-width: fit-content;
}

.hud-item .label {
  display: block;
  font-size: 0.75rem;
  color: #9a9ab0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.hud-item .valor {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #f59e0b;
  font-family: 'Courier New', monospace;
}

/* RESPONSIVIDADE */
@media (max-width: 640px) {
  .painel {
    padding: 1.5rem;
  }

  .painel h1 {
    font-size: 1.5rem;
  }

  .controles {
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .resultado {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 1rem;
  }

  .servidores {
    gap: 1.5rem;
    padding: 1rem;
  }

  .servidor {
    max-width: 120px;
  }

  .haste {
    min-height: 300px;
    padding: 0.75rem;
  }

  .hud {
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
  }

  .hud-esq,
  .hud-dir {
    gap: 1rem;
  }

  .hud-item {
    padding: 0.5rem 0.75rem;
  }

  .hud-item .valor {
    font-size: 1.25rem;
  }

  .hud-centro {
    width: 100%;
    max-width: none;
    order: 3;
  }
}

/* ANIMAÇÕES */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.painel {
  animation: fadeIn 0.3s ease;
}

/* PREFERÊNCIA DE MOVIMENTO REDUZIDO */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
