@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700&display=swap');

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #1e1b4b, #020617 70%);
  font-family: 'Baloo 2', cursive;
  color: #e5e7eb;
}

/* ========================================= */
/* HEADER */
/* ========================================= */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 40px;
  background: #020617;
  border-bottom: 5px solid #9333ea;
}

.header h1 {
  margin: 0;
  font-size: 30px;
  color: #f9fafb;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #7c3aed;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

.user-info span {
  color: white;
  font-weight: bold;
  font-size: 16px;
}

.logout-btn {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: bold;
  font-family: 'Baloo 2', cursive;
  font-size: 15px;
  transition: 0.2s;
  border: 3px solid #020617;
}

.logout-btn:hover {
  background: #c0392b;
  transform: scale(1.05);
}

/* ========================================= */
/* MENU */
/* ========================================= */
.menu {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 14px;
}

.menu-btn {
  background: #1e293b;
  border: 5px solid #020617;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 17px;
  cursor: pointer;
  color: #e5e7eb;
  transition: 0.2s;
  font-family: 'Baloo 2', cursive;
  font-weight: 600;
}

.menu-btn.active {
  background: #7c3aed;
  color: white;
}

.menu-btn:hover {
  transform: translateY(-2px);
  background: #6d28d9;
}

/* ========================================= */
/* CONTENT */
/* ========================================= */
main {
  max-width: 1300px;
  margin: auto;
  padding: 24px;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
}

/* ========================================= */
/* CARD */
/* ========================================= */
.card {
  background: #020617;
  border-radius: 32px;
  border: 5px solid #334155;
  padding: 26px;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.card h2 {
  text-align: center;
  font-size: 26px;
  margin-top: 0;
  color: #f9fafb;
}

/* ========================================= */
/* PERFIL */
/* ========================================= */
.profile-card {
  max-width: 700px;
  margin: 0 auto;
}

.profile-content {
  display: flex;
  gap: 40px;
  margin-top: 30px;
}

.avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  min-width: 200px;
}

.profile-avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid #7c3aed;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.5);
}

.avatar-upload {
  width: 100%;
}

.upload-btn {
  width: 100%;
  background: #7c3aed;
  color: white;
  border: 4px solid #020617;
  padding: 12px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: bold;
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  transition: 0.2s;
}

.upload-btn:hover {
  background: #6d28d9;
  transform: scale(1.05);
}

.profile-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-row label {
  font-weight: bold;
  color: #a78bfa;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.info-row span {
  font-size: 20px;
  color: #f9fafb;
  padding: 14px 18px;
  background: #1e293b;
  border-radius: 18px;
  border: 3px solid #334155;
}

/* ========================================= */
/* TABLE */
/* ========================================= */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

th {
  background: #020617;
  border: 4px solid #1e293b;
  border-radius: 18px;
  padding: 12px;
  font-size: 15px;
  color: #c7d2fe;
}

td {
  background: #020617;
  border: 4px solid #1e293b;
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  color: #f9fafb;
  font-size: 24px;
  font-weight: 700;
  text-shadow: 
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000,
    2px 2px 0 #000,
    0 0 10px rgba(0, 0, 0, 0.9);
}

tr:hover td {
  border-color: #7c3aed;
}

.table-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #7c3aed;
  display: inline-block;
}

/* ========================================= */
/* PLAY */
/* ========================================= */
select {
  width: 100%;
  padding: 14px;
  font-size: 18px;
  border-radius: 20px;
  border: 4px solid #1e293b;
  background: #020617;
  color: white;
  font-family: 'Baloo 2', cursive;
}

.play-btn {
  margin-top: 18px;
  width: 100%;
  padding: 16px;
  font-size: 22px;
  border-radius: 999px;
  border: 5px solid #020617;
  background: #22c55e;
  color: #020617;
  cursor: pointer;
  transition: 0.2s;
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
}

.play-btn:hover {
  background: #16a34a;
  transform: scale(1.04);
}

/* ========================================= */
/* CRIAR PARTIDA - PLAYER SELECTION */
/* ========================================= */
.create-match-form label {
  display: block;
  margin-bottom: 8px;
  color: #c7d2fe;
  font-size: 17px;
  font-weight: 700;
}

#playerSelectors {
  margin-top: 20px;
  margin-bottom: 20px;
}

.player-selector {
  margin-bottom: 16px;
}

.player-selector label {
  display: block;
  margin-bottom: 6px;
  color: #f9fafb;
  font-size: 16px;
}

.player-selector select,
.player-selector input {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  border-radius: 18px;
  border: 4px solid #1e293b;
  background: #020617;
  color: white;
  font-family: 'Baloo 2', cursive;
}

.player-selector input.disabled-input {
  background: #1e293b;
  color: #94a3b8;
  cursor: not-allowed;
}

.player-selector select:focus {
  outline: none;
  border-color: #7c3aed;
}

/* ========================================= */
/* AUTH (LOGIN / SIGNUP) */
/* ========================================= */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: #020617;
  border-radius: 32px;
  border: 5px solid #334155;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.auth-card h1 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 28px;
  color: #f9fafb;
}

.auth-card input {
  width: 100%;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 18px;
  border: 4px solid #1e293b;
  background: #020617;
  color: white;
  font-size: 16px;
  font-family: 'Baloo 2', cursive;
}

.auth-card input:focus {
  outline: none;
  border-color: #7c3aed;
}

.auth-card button {
  width: 100%;
  margin-top: 10px;
}

.auth-card p {
  text-align: center;
  margin-top: 16px;
}

.auth-card a {
  color: #a78bfa;
  text-decoration: none;
}

.auth-card a:hover {
  text-decoration: underline;
}

/* ========================================= */
/* PARTIDAS - MATCHES SECTION */
/* ========================================= */
.matches-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.match-item {
  background: #020617;
  border: 4px solid #1e293b;
  border-radius: 24px;
  padding: 20px;
  transition: 0.2s;
}

.match-item:hover {
  border-color: #7c3aed;
  transform: translateY(-3px);
}

.match-item.finished {
  border-color: #22c55e;
}

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.match-header strong {
  font-size: 20px;
  color: #c7d2fe;
}

.match-date {
  font-size: 14px;
  color: #94a3b8;
}

.match-players {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.player-chip {
  display: inline-block;
  padding: 8px 16px;
  background: #1e293b;
  border: 3px solid #334155;
  border-radius: 999px;
  font-size: 15px;
  color: #e5e7eb;
}

.player-chip.voted {
  background: #22c55e;
  border-color: #16a34a;
  color: #020617;
  font-weight: 700;
}

.match-btn {
  padding: 12px 28px;
  background: #7c3aed;
  color: white;
  border: 4px solid #020617;
  border-radius: 999px;
  cursor: pointer;
  font-size: 17px;
  font-family: 'Baloo 2', cursive;
  transition: 0.2s;
}

.match-btn:hover {
  background: #6d28d9;
  transform: scale(1.05);
}

.match-results {
  margin-top: 12px;
}

.result-row {
  padding: 10px 14px;
  margin: 6px 0;
  background: #1e293b;
  border: 3px solid #334155;
  border-radius: 18px;
  font-size: 16px;
  color: #e5e7eb;
}

.empty-message {
  text-align: center;
  color: #64748b;
  padding: 40px;
  font-size: 17px;
}
/* ========================================= */
/* EDITAR NICK */
/* ========================================= */
.nick-edit {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nick-edit input {
  flex: 1;
  font-size: 20px;
  padding: 14px 18px;
  background: #1e293b;
  border-radius: 18px;
  border: 3px solid #334155;
  color: #f9fafb;
  font-family: 'Baloo 2', cursive;
  transition: 0.2s;
}

.nick-edit input:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

.nick-edit button {
  padding: 14px 22px;
  background: #7c3aed;
  color: white;
  border: 4px solid #020617;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Baloo 2', cursive;
  transition: 0.2s;
  white-space: nowrap;
}

.nick-edit button:hover {
  background: #6d28d9;
  transform: scale(1.05);
}


/* ========================================= */
/* PÁGINA DE VOTAÇÃO - MATCH VOTE */
/* ========================================= */
.match-vote-card {
  max-width: 700px;
  margin: 0 auto;
}

.match-info {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 4px solid #1e293b;
}

.match-info h2 {
  color: #c7d2fe;
  margin-bottom: 8px;
  font-size: 28px;
}

.match-info p {
  color: #94a3b8;
  font-size: 16px;
}

.vote-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px;
  margin-bottom: 12px;
  background: #1e293b;
  border: 4px solid #334155;
  border-radius: 20px;
}

.vote-row label {
  font-weight: 700;
  color: #f9fafb;
  font-size: 18px;
  flex: 1;
}

.vote-row select {
  flex: 1.5;
  margin: 0;
  padding: 10px;
  border-radius: 16px;
}

.vote-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.vote-btn {
  flex: 2;
  padding: 16px;
  background: #22c55e;
  color: #020617;
  border: 5px solid #020617;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Baloo 2', cursive;
  transition: 0.2s;
}

.vote-btn:hover {
  background: #16a34a;
  transform: scale(1.05);
}

.back-btn {
  flex: 1;
  padding: 16px;
  background: #64748b;
  color: white;
  border: 5px solid #020617;
  border-radius: 999px;
  font-size: 18px;
  cursor: pointer;
  font-family: 'Baloo 2', cursive;
  transition: 0.2s;
}

.back-btn:hover {
  background: #475569;
  transform: scale(1.05);
}

.voted-message {
  text-align: center;
  padding: 40px;
  background: #22c55e;
  border: 5px solid #16a34a;
  border-radius: 24px;
  color: #020617;
}

.voted-message p {
  margin: 8px 0;
  font-size: 18px;
}

.voted-message p:first-child {
  font-size: 26px;
  font-weight: 700;
}

.vote-status {
  margin-top: 20px;
  padding: 16px;
  background: #fbbf24;
  border: 4px solid #f59e0b;
  border-radius: 20px;
  text-align: center;
  color: #020617;
  font-weight: 700;
  font-size: 16px;
}

/* ========================================= */
/* RESPONSIVE */
/* ========================================= */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 15px;
    padding: 18px 20px;
  }
  
  .header h1 {
    font-size: 24px;
  }
  
  .profile-content {
    flex-direction: column;
    align-items: center;
  }
  
  .profile-info {
    width: 100%;
  }

  .match-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .vote-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .vote-actions {
    flex-direction: column;
  }

  .menu {
    flex-wrap: wrap;
  }

  .menu-btn {
    font-size: 15px;
    padding: 8px 18px;
  }
  
}
