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

:root {
  --fundo-1: #08080C;
  --fundo-2: #101018;
  --texto: #EDEDF5;
  --secundario: #9A9AB0;
  --borda: #26263A;
  --azul: #2563EB;
  --esmeralda: #10B981;
  --vermelho: #EF4444;
  --rosa: #EC4899;
  --violeta: #7C3AED;
  --ambar: #F59E0B;
}

@media (prefers-color-scheme: light) {
  :root {
    --fundo-1: #F5F5F7;
    --fundo-2: #EDEDF0;
    --texto: #1A1A1E;
    --secundario: #5A5A6A;
    --borda: #D0D0D8;
  }
}

body {
  background: linear-gradient(135deg, var(--fundo-1) 0%, var(--fundo-2) 100%);
  color: var(--texto);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

.container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
  touch-action: none;
}

/* OVERLAYS */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 12, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 100;
}

.overlay.ativo {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: linear-gradient(135deg, var(--fundo-2) 0%, #1A1A24 100%);
  border: 1px solid var(--borda);
  border-radius: 14px;
  padding: 3rem 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.3s ease;
}

.modal-pequeno {
  max-width: 320px;
  padding: 2rem;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--azul), var(--rosa));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 0;
}

.modal h2 {
  font-size: 1.3rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: var(--texto);
}

.subtitulo {
  color: var(--secundario);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.secao-controles {
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.controles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.controle {
  text-align: center;
}

.controle .icone {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.controle div:nth-child(2) {
  font-size: 0.9rem;
  color: var(--secundario);
  margin-bottom: 0.25rem;
}

.controle .desc {
  font-weight: 600;
  color: var(--azul);
  font-size: 0.85rem;
}

.pausa-info {
  text-align: center;
  color: var(--secundario);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--borda);
}

.placar {
  display: flex;
  gap: 2rem;
  margin: 2rem 0;
  justify-content: center;
}

.placar-item {
  text-align: center;
}

.placar-item .etiqueta {
  color: var(--secundario);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.placar-item .valor {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--azul);
  font-variant-numeric: tabular-nums;
}

.moral {
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--esmeralda);
  padding: 1rem;
  border-radius: 6px;
  margin: 1.5rem 0;
  color: var(--texto);
  font-style: italic;
  font-size: 0.95rem;
}

.info {
  color: var(--secundario);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 1rem;
}

/* BOTÕES */
.botao-primario,
.botao-secundario {
  width: 100%;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-top: 1rem;
  touch-action: manipulation;
}

.botao-primario {
  background: linear-gradient(135deg, var(--azul), #1d4ed8);
  color: white;
}

.botao-primario:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

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

.botao-secundario {
  background: transparent;
  color: var(--azul);
  border: 1px solid var(--azul);
}

.botao-secundario:hover {
  background: rgba(37, 99, 235, 0.1);
}

/* HUD */
.hud {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hud.visivel {
  opacity: 1;
}

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

.stat {
  background: rgba(8, 8, 12, 0.7);
  border: 1px solid var(--borda);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.stat .label {
  color: var(--secundario);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat .valor {
  color: var(--texto);
  font-size: 1.5rem;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}

.stat.ping .valor {
  color: var(--azul);
}

@media (max-width: 480px) {
  .modal {
    padding: 2rem 1.5rem;
  }

  .modal h1 {
    font-size: 2rem;
  }

  .controles-grid {
    grid-template-columns: 1fr;
  }

  .placar {
    gap: 1rem;
  }

  .placar-item .valor {
    font-size: 2rem;
  }

  .hud {
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
  }

  .stat {
    padding: 0.5rem 0.75rem;
  }

  .stat .valor {
    font-size: 1.2rem;
  }

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

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
