:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --success-color: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  padding: 1rem 0.5rem;
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: 650px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 1.25rem;
  border-radius: 16px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

h1 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: #818cf8;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

h2 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.75rem 0;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.4rem;
  color: #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

input[type="text"] {
  flex: 1;
  padding: 0.6rem 0.8rem;
  background-color: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.status-card {
  background: #111827;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.notification-box {
  min-height: 2rem;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
  background: rgba(148, 163, 184, 0.08);
  color: #dbeafe;
  border: 1px solid transparent;
}

.notification-box.error {
  background: rgba(244, 114, 182, 0.14);
  border-color: rgba(248, 113, 113, 0.3);
  color: #fee2e2;
}

.notification-box.success {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.3);
  color: #d1fae5;
}

.notification-box.info {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.3);
  color: #dbeafe;
}

.status-line {
  color: #e2e8f0;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.status-subtitle {
  color: #94a3b8;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.queue-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.queue-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.queue-item.empty {
  opacity: 0.7;
}

button {
  padding: 0.68rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.75);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: #334155;
  color: #f1f5f9;
}

.btn-secondary:hover {
  background-color: #475569;
}

.action-inline-hint {
  margin: 0.75rem 0 1rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.12);
  color: #bbe4ff;
  border: 1px solid rgba(14, 165, 233, 0.25);
  font-size: 0.95rem;
}

.sort-again-container {
  margin-bottom: 1rem;
  text-align: center;
}

.sort-again-container .btn-secondary {
  min-width: 220px;
}

.btn-draw {
  background-color: #f59e0b;
  color: #0f172a;
  box-shadow: 0 6px 12px rgba(245, 158, 11, 0.25);
}

.btn-draw:hover {
  background-color: #d97706;
}

.btn-danger {
  background-color: #451a03;
  color: #fca5a5;
}

.btn-danger:hover {
  background-color: #78350f;
}

.btn-win {
  background-color: var(--success-color);
  color: white;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.btn-win:hover {
  background-color: #059669;
  transform: scale(1.03);
}

.timer-container {
  background: #020617;
  color: #38bdf8;
  padding: 0.75rem;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 1.25rem;
  border: 1px solid #1e293b;
}

.timer-display {
  font-family: monospace;
  font-size: 2.2rem;
  font-weight: bold;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.timer-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.timer-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 6px;
}

.player-list-container {
  background: #0f172a;
  padding: 0.75rem;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-color);
}

.player-tags {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.player-tag {
  background: #1e293b;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  gap: 0.25rem;
}

.player-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.select-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.select-label input[type="number"] {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: #020617;
  color: var(--text-main);
}

.input-note {
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.reserva-container {
  margin-top: 1rem;
  background: #111827;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.reservas-lista {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.reserva-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  color: #e2e8f0;
  font-size: 0.9rem;
}

.reserva-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: 12px;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.12);
  margin-bottom: 0.75rem;
}

.reserva-nome {
  font-size: 1rem;
  font-weight: 700;
}

.historico-container {
  margin-top: 1rem;
  padding: 0.9rem;
  border-radius: 12px;
  background: #111827;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.historico-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.historico-card {
  background: #111827;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 0.65rem;
  opacity: 0;
  transform: translateY(8px);
  animation: fadeInUp 0.35s ease forwards;
  animation-delay: var(--delay, 0ms);
}

.historico-times {
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: #f8fafc;
}

.historico-resultado {
  color: #c7d2fe;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.historico-data {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.remove-btn {
  color: #ef4444;
  cursor: pointer;
  font-weight: bold;
  border: none;
  background: none;
  font-size: 1rem;
  padding-left: 0.4rem;
}

.grupos-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.grupo-card {
  padding: 0.9rem;
  border-radius: 12px;
  color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.vitorias-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: bold;
}

.grupo-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  padding-bottom: 0.2rem;
  padding-right: 4rem;
}

.jogadores-lista {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.jogadores-lista li {
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.partida-card {
  background: #1e293b;
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  opacity: 0;
  transform: translateY(14px);
  animation: fadeInUp 0.35s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.partida-header {
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

.partida-confronto {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
}

@media (min-width: 480px) {
  .partida-confronto {
    flex-direction: row;
    align-items: center;
  }
}

.time-lado {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex: 1;
  padding: 1rem;
  border-radius: 10px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.time-nome {
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
  color: #ffffff;
}

.vs-text {
  font-weight: 900;
  color: #f59e0b;
  font-size: 1.25rem;
  text-align: center;
  align-self: center;
}

.reserva-box {
  background: #78350f;
  border: 1px solid #b45309;
  color: #fef3c7;
  padding: 0.75rem;
  border-radius: 10px;
  margin-top: 0.75rem;
  font-size: 0.8rem;
}

.espera-container {
  background: #0f172a;
  border: 1px dashed var(--border-color);
  padding: 0.75rem;
  border-radius: 10px;
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.espera-lista {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #a5b4fc;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.espera-item-badge {
  background: #1e293b;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.mural-container {
  background: #0b0f19;
  border: 2px solid #f59e0b;
  padding: 0.9rem;
  border-radius: 12px;
  margin-top: 1.25rem;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
}

.mural-lista {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.mural-item {
  background: linear-gradient(90deg, #1e1b4b 0%, #111827 100%);
  border: 1px solid #b45309;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mural-time-info strong {
  color: #fef08a;
}

.mural-time-jogadores {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.mural-data {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: bold;
}

.btn-clean-mural {
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  background: #451a03;
  color: #fca5a5;
  border-radius: 6px;
}

.btn-clean-mural:hover {
  background: #78350f;
}

.modal-panfleto {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.panfleto-card {
  background: radial-gradient(circle, #1e1b4b 0%, #030712 100%);
  color: white;
  width: 100%;
  max-width: 380px;
  border: 4px solid #f59e0b;
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.5);
  position: relative;
}

.panfleto-card h2 {
  color: #f59e0b;
  font-size: 1.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.25rem;
  border: none;
  padding: 0;
}

.subtitulo-panfleto {
  font-size: 0.95rem;
  color: #fef08a;
  margin-bottom: 1.25rem;
  font-style: italic;
}

.panfleto-time {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0.75rem 0;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
}

.panfleto-jogadores {
  list-style: none;
  font-size: 1rem;
  color: #e2e8f0;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.panfleto-footer {
  font-size: 0.75rem;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.75rem;
}

.btn-fechar {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  color: white;
  font-size: 1.4rem;
  border: none;
  cursor: pointer;
}

@media (max-width: 400px) {
  body { padding: 0.5rem 0.25rem; }
  .container { padding: 0.85rem; border-radius: 12px; }
  h1 { font-size: 1.2rem; }
  h2 { font-size: 0.95rem; }
  input[type="text"] { padding: 0.6rem 0.7rem; font-size: 0.95rem; }
  button, .timer-btn { padding: 0.8rem 1rem; font-size: 0.95rem; min-height: 46px; }
  .timer-display { font-size: 1.8rem; }
  .player-tags { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .player-tag { font-size: 0.78rem; padding: 0.35rem 0.45rem; }
  .grupos-container { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.5rem; }
  .grupo-card { padding: 0.7rem; }
  .grupo-card h3 { font-size: 0.9rem; }
  .vitorias-badge { padding: 0.2rem 0.4rem; font-size: 0.65rem; }
  .jogadores-lista li { font-size: 0.8rem; padding: 0.3rem 0.45rem; }
  .time-nome { font-size: 1rem; }
  .actions-grid { grid-template-columns: 1fr; }
  .timer-controls { flex-direction: column; }
  .input-group { flex-direction: column; }
  .settings-grid { grid-template-columns: 1fr; }
  .reserva-card { flex-direction: column; align-items: stretch; }
}
