/* css/gerador-rodadas.css */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@400;500;600&display=swap');

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

body {
  min-height: 100vh;
  background: #0a1628;
  font-family: 'DM Sans', sans-serif;
  position: relative;
  overflow-x: hidden;
}

.sp-bg-field {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 110%, #1a4a2e 0%, transparent 65%),
    radial-gradient(ellipse 60% 40% at 20% -10%, #1e3a5f 0%, transparent 60%),
    #0a1628;
  z-index: 0;
}

.sp-lines {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 420px; height: 220px; opacity: 0.05; z-index: 0;
}

/* Header */
.sp-header {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px 0;
}

.sp-back {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.07);
  border: 0.5px solid rgba(255,255,255,0.15);
  border-radius: 20px; padding: 6px 14px;
  font-size: 12px; color: rgba(255,255,255,0.7);
  cursor: pointer; transition: background 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.sp-back:hover { background: rgba(255,255,255,0.12); }

.sp-logo { display: flex; align-items: center; gap: 8px; }
.sp-logo-icon {
  width: 28px; height: 28px; background: #22c55e;
  border-radius: 6px; display: flex; align-items: center;
  justify-content: center; font-size: 14px;
}
.sp-logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px; letter-spacing: 2px; color: #fff;
}
.sp-logo-text span { color: #22c55e; }

.sp-logout-btn {
  background: rgba(220,53,69,0.15);
  border: 0.5px solid rgba(220,53,69,0.3);
  border-radius: 20px; padding: 6px 14px;
  font-size: 12px; color: #f87171;
  cursor: pointer; transition: background 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.sp-logout-btn:hover { background: rgba(220,53,69,0.25); }

/* Hero */
.sp-hero {
  position: relative; z-index: 2;
  text-align: center; padding: 28px 20px 24px;
}

.sp-page-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(96,165,250,0.15);
  border: 0.5px solid rgba(96,165,250,0.3);
  border-radius: 20px; padding: 4px 12px;
  font-size: 11px; color: #93c5fd;
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 10px;
}

.sp-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 38px; letter-spacing: 3px; color: #fff; line-height: 1;
  margin: 0 0 6px;
}
.sp-title span { color: #4ade80; }
.sp-subtitle { font-size: 13px; color: rgba(255,255,255,0.4); }

/* Content */
.sp-content {
  position: relative; z-index: 2;
  max-width: 640px; margin: 0 auto;
  padding: 0 20px 40px;
  display: flex; flex-direction: column; gap: 16px;
}

/* Cards */
.sp-card {
  background: rgba(255,255,255,0.05);
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 16px; overflow: hidden;
}

.sp-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 0.5px solid rgba(255,255,255,0.07);
}

.sp-card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: #fff;
}

.sp-card-title-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(34,197,94,0.15);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}

.sp-config-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }

.sp-config-row { display: flex; gap: 14px; }

.sp-config-field { flex: 1; }
.sp-config-label {
  font-size: 11px; color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px;
}

.sp-select {
  width: 100%; background: rgba(255,255,255,0.06);
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 9px 12px;
  font-size: 13px; color: #fff; font-family: 'DM Sans', sans-serif;
  outline: none; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(255,255,255,0.3)' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.sp-select:focus { border-color: rgba(34,197,94,0.4); }
.sp-select option { background: #1e2d3d; color: #fff; }

/* Info grid */
.sp-info-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}

.sp-info-item {
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 12px 14px;
}

.sp-info-label {
  font-size: 10px; color: rgba(255,255,255,0.35);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px;
}

.sp-info-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px; color: #4ade80;
}

/* Botões */
.sp-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.sp-btn {
  padding: 8px 16px; border-radius: 20px; font-size: 12px; font-weight: 500;
  cursor: pointer; border: 0.5px solid; transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.sp-btn-ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6);
}
.sp-btn-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; }

.sp-btn-primary {
  background: rgba(34,197,94,0.15);
  border-color: rgba(34,197,94,0.4);
  color: #4ade80;
}
.sp-btn-primary:hover { background: rgba(34,197,94,0.25); }

.sp-btn-danger {
  background: rgba(248,113,113,0.1);
  border-color: rgba(248,113,113,0.3);
  color: #fca5a5;
}
.sp-btn-danger:hover { background: rgba(248,113,113,0.2); }

.sp-gerar-row { display: flex; justify-content: center; padding-top: 4px; }

.sp-btn-gerar {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none; border-radius: 12px;
  padding: 12px 32px; font-size: 14px; font-weight: 600;
  color: #fff; cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: opacity 0.2s, transform 0.15s;
}
.sp-btn-gerar:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.sp-btn-gerar:disabled { opacity: 0.4; cursor: not-allowed; }

/* Prévia das rodadas */
.rodadas-container {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}

.rodada-preview {
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 14px;
}

.rodada-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 0.5px solid rgba(255,255,255,0.08);
}

.rodada-titulo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px; color: #4ade80; letter-spacing: 1px;
}

.btn-inverter-rodada {
  background: rgba(96,165,250,0.1);
  border: 0.5px solid rgba(96,165,250,0.25);
  border-radius: 16px; padding: 4px 10px;
  font-size: 11px; color: #93c5fd;
  cursor: pointer; transition: background 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.btn-inverter-rodada:hover { background: rgba(96,165,250,0.2); }

.jogos-list { display: flex; flex-direction: column; gap: 8px; }

.jogo-preview {
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(255,255,255,0.07);
  border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}

.jogo-hora { font-size: 10px; color: rgba(255,255,255,0.3); }

.jogo-times {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
}

.time-info {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; flex: 1; text-align: center;
}

.icone-time {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
}

.nome-time {
  font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.8);
  text-transform: uppercase; letter-spacing: 0.5px;
}

.vs-separator {
  font-weight: 700; color: rgba(255,255,255,0.3);
  font-size: 14px; margin: 0 8px; flex-shrink: 0;
}

/* Modais */
.sp-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: none; justify-content: center; align-items: center;
  z-index: 1000; backdrop-filter: blur(4px);
}

.sp-modal {
  background: #0f1f35;
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 16px; max-width: 420px; width: 90%;
  overflow: hidden;
}

.sp-modal-header {
  padding: 16px 20px;
  border-bottom: 0.5px solid rgba(255,255,255,0.08);
  font-size: 14px; font-weight: 600; color: #fff;
}

.sp-modal-body {
  padding: 20px;
  font-size: 13px; color: rgba(255,255,255,0.7); line-height: 1.6;
}

/* Loading */
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white; border-radius: 50%;
  animation: spin 0.8s linear infinite; margin-left: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsivo */
@media (max-width: 600px) {
  .sp-header { padding: 16px 16px 0; }
  .sp-content { padding: 0 16px 32px; }
  .rodadas-container { grid-template-columns: 1fr; }
  .sp-info-grid { grid-template-columns: repeat(2, 1fr); }
  .sp-title { font-size: 30px; }
}
