

@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  --roxo-escuro: #0a0414;
  --roxo-medio: #1e0a40;
  --roxo-vivo: #4a1a9e;
  --roxo-neon: #7c3aed;
  --roxo-claro: #a78bfa;
  --rosa-neon: #c084fc;
  --azul-neon: #0ea5e9;
  --ouro: #fbbf24;
  --ouro-claro: #fde68a;
  --branco: #f0eaff;
  --cinza: #c4b5fd;
  --verde: #22c55e;
  --vermelho: #f43f5e;
  --sombra-roxa: 0 0 30px rgba(124, 58, 237, 0.5);
}

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

body {
  font-family: 'Nunito', sans-serif;
  background-color: var(--roxo-escuro);
  color: var(--branco);
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse at 10% 10%, rgba(123, 47, 247, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 90%, rgba(168, 85, 247, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

#tela-login {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 4, 20, 0.97);
  backdrop-filter: blur(20px);
}

.login-card {
  background: linear-gradient(135deg, rgba(61, 26, 110, 0.6), rgba(26, 10, 46, 0.9));
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 24px;
  padding: 50px 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 0 60px rgba(168, 85, 247, 0.3);
}

.login-icon {
  font-size: 4rem;
  margin-bottom: 15px;
  display: block;
}

.login-card h2 {
  font-family: 'Bangers', cursive;
  font-size: 2rem;
  letter-spacing: 3px;
  color: var(--roxo-claro);
  margin-bottom: 8px;
}

.login-card p {
  color: rgba(216, 180, 254, 0.6);
  font-size: 0.9rem;
  margin-bottom: 30px;
}

.campo {
  width: 100%;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--branco);
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  outline: none;
  transition: all 0.3s;
  margin-bottom: 15px;
  display: block;
}

.campo:focus {
  border-color: var(--roxo-neon);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.campo::placeholder {
  color: rgba(216, 180, 254, 0.4);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--roxo-vivo), var(--roxo-neon));
  color: white;
  width: 100%;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(168, 85, 247, 0.6);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: var(--roxo-claro);
}

.btn-secondary:hover {
  background: rgba(168, 85, 247, 0.25);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #f43f5e;
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.25);
}

.btn-success {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: white;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(34, 197, 94, 0.5);
}

.erro-msg {
  color: var(--vermelho);
  font-size: 0.9rem;
  margin-top: 10px;
  font-weight: 700;
  min-height: 24px;
}

#painel-admin {
  position: relative;
  z-index: 10;
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 35px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}

.admin-header h1 {
  font-family: 'Bangers', cursive;
  font-size: 2rem;
  letter-spacing: 3px;
  color: var(--roxo-claro);
}

.admin-header h1 span {
  color: var(--ouro);
}

.card-secao {
  background: linear-gradient(135deg, rgba(61, 26, 110, 0.3), rgba(26, 10, 46, 0.6));
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 25px;
  backdrop-filter: blur(10px);
}

.card-titulo {
  font-family: 'Bangers', cursive;
  font-size: 1.4rem;
  letter-spacing: 2px;
  color: var(--roxo-claro);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.config-row {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.campo-inline {
  flex: 1;
  min-width: 200px;
}

.salas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.sala-card {
  background: rgba(26, 10, 46, 0.6);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.3s;
}

.sala-card:hover {
  border-color: rgba(168, 85, 247, 0.4);
}

.sala-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.15);
}

.sala-badge-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-family: 'Bangers', cursive;
  font-size: 1.2rem;
  color: white;
}

.sala-card-body {
  padding: 16px 20px;
}

.rodadas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.rodada-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rodada-label {
  font-size: 0.7rem;
  color: rgba(216, 180, 254, 0.5);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.campo-rodada {
  width: 100%;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 8px;
  padding: 8px;
  color: var(--branco);
  font-size: 0.95rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: all 0.2s;
}

.campo-rodada:focus {
  border-color: var(--roxo-neon);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

.total-admin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(168, 85, 247, 0.1);
  border-radius: 10px;
  margin-bottom: 12px;
}

.total-admin-label {
  font-size: 0.85rem;
  color: var(--roxo-claro);
  font-weight: 700;
}

.total-admin-val {
  font-family: 'Bangers', cursive;
  font-size: 1.4rem;
  color: var(--ouro);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
  letter-spacing: 1px;
}

.log-container {
  max-height: 300px;
  overflow-y: auto;
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  padding: 15px;
}

.log-container::-webkit-scrollbar {
  width: 5px;
}

.log-container::-webkit-scrollbar-track {
  background: rgba(168, 85, 247, 0.1);
  border-radius: 5px;
}

.log-container::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.4);
  border-radius: 5px;
}

.log-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(168, 85, 247, 0.1);
  font-size: 0.85rem;
}

.log-item:last-child {
  border-bottom: none;
}

.log-hora {
  color: rgba(216, 180, 254, 0.5);
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.8rem;
}

.log-texto {
  color: var(--cinza);
}

.notif {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, var(--roxo-medio), var(--roxo-vivo));
  border: 1px solid var(--roxo-neon);
  border-radius: 12px;
  padding: 15px 25px;
  color: white;
  font-weight: 700;
  box-shadow: var(--sombra-roxa);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 320px;
}

.notif.show {
  transform: translateY(0);
  opacity: 1;
}

.notif.sucesso { border-color: var(--verde); background: linear-gradient(135deg, #14532d, #16a34a); }
.notif.erro    { border-color: var(--vermelho); background: linear-gradient(135deg, #4c0519, #be123c); }

.save-status {
  font-size: 0.8rem;
  color: rgba(216, 180, 254, 0.5);
  text-align: right;
  margin-top: 4px;
  min-height: 18px;
}

.spinner-sm {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .salas-grid {
    grid-template-columns: 1fr;
  }

  .rodadas-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-card {
    padding: 35px 25px;
  }

  .config-row {
    flex-direction: column;
  }
}

.form-adicionar {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}

.form-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 140px;
}

select.campo {
  appearance: none;
  cursor: pointer;
}

.totais-grid {
  border-top: 1px solid rgba(168, 85, 247, 0.15);
  padding-top: 20px;
  margin-top: 5px;
}

.totais-salas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.total-sala-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(168,85,247,0.15);
  border-radius: 12px;
  padding: 10px 14px;
}

.total-display-val {
  font-family: 'Bangers', cursive;
  font-size: 1.5rem;
  color: var(--ouro);
  letter-spacing: 1px;
}

.total-display-label {
  font-size: 0.75rem;
  color: rgba(216,180,254,0.5);
  font-weight: 700;
}

.historico-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.historico-container::-webkit-scrollbar { width: 5px; }
.historico-container::-webkit-scrollbar-track { background: rgba(168,85,247,0.1); border-radius: 5px; }
.historico-container::-webkit-scrollbar-thumb { background: rgba(168,85,247,0.4); border-radius: 5px; }

.entrada-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(168,85,247,0.15);
  border-radius: 12px;
  padding: 12px 16px;
  transition: border-color 0.2s;
}

.entrada-item:hover {
  border-color: rgba(168,85,247,0.35);
}

@media (max-width: 640px) {
  .form-row { flex-direction: column; }
  .totais-salas { gap: 8px; }
  .total-sala-card { padding: 8px 10px; }
}

select.campo option {
  background-color: #1e0a40;
  color: #f0eaff;
}

select.campo {
  color: #f0eaff;
}
