/* ============================================================
   DRAFT RANKED — STILE PAGINA MATCHMAKING TEAM (REVISIONE 3)
   ============================================================ */

body {
  background: radial-gradient(circle at center, #0a0f2c 0%, #070b1f 100%);
  color: #EAF0FF;
  font-family: 'Montserrat', sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* ===== CONTAINER ===== */
.draft-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.page-title {
  text-align: center;
  font-family: 'Cinzel', serif;
  color: #FFD700;
  font-size: 2.2rem;
  margin-bottom: 3rem;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.45);
}

/* ============================================================
   CARD TEAM
   ============================================================ */
.team-card {
  border: 2px solid #D4AF37;
  border-radius: 14px;
  background: rgba(10, 15, 44, 0.35);
  backdrop-filter: blur(3px);
  padding: 1.8rem 2rem 2.4rem;
  margin-bottom: 2.8rem;
  text-align: center;
  position: relative;
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.12);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.team-card:hover {
  box-shadow: 0 0 35px rgba(212, 175, 55, 0.35);
  transform: translateY(-3px);
}

/* ===== HEADER (Titolo centrato + Elo destra) ===== */
.team-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.4rem;
  position: relative;
}
.team-header h2 {
  font-family: 'Cinzel', serif;
  color: #FFD700;
  font-size: 1.6rem;
  margin: 0 auto;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.45);
}
.team-elo {
  position: absolute;
  right: 0;
  color: #FFD700;
  font-weight: 700;
  font-size: 0.95rem;
  text-shadow: 0 0 6px rgba(255,215,0,0.4);
}

/* ===== DESCRIZIONE TEAM ===== */
.team-desc {
  color: #aeb9df;
  font-size: 0.95rem;
  margin-bottom: 1.4rem;
}

/* ============================================================
   RUOLI — CERCHI + LABEL
   ============================================================ */
.team-roles {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: nowrap;
  margin-bottom: 0.6rem;
}

/* ✅ TUTTI I CERCHI HANNO LO STESSO GRIGIO BASE */
.role-slot {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, #d9d9d9 0%, #bfbfbf 100%);
  border: 3px solid var(--role-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.role-slot:hover {
  transform: scale(1.1);
  box-shadow: 0 0 12px var(--role-color);
}

/* 🔹 "+" leggermente più scuro per maggiore contrasto */
.role-slot .plus {
  color: #00cc66; /* verde più scuro e visibile */
  font-size: 2rem;
  pointer-events: none;
}

.role-slot.occupied {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* Forza tutti i cerchi vuoti a rimanere grigi */
.role-slot:not(.occupied) {
  background: radial-gradient(circle, #d9d9d9 0%, #bfbfbf 100%) !important;
}

.role-slot.occupied .plus {
  display: none;
}

/* ===== "−" (Abbandona Team) più grande ===== */
.role-slot .leave-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(10, 15, 44, 0.7);
  color: #FFD700;
  font-weight: 800;
  font-size: 1.3rem;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  border: 1px solid rgba(255,215,0,0.6);
}
.role-slot.occupied:hover .leave-btn {
  display: flex;
}
.role-slot .leave-btn:hover {
  background: rgba(255, 0, 0, 0.85);
  color: #fff;
  transform: scale(1.1);
}

/* ============================================================
   LABEL RUOLI (sempre visibili e fissi)
   ============================================================ */
.role-infos {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem;
  margin-top: 0.3rem;
  margin-bottom: 0.8rem;
}
.role-infos p {
  min-width: 90px;
  color: #FFD700;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  text-shadow: 0 0 4px rgba(255,215,0,0.25);
  margin: 0;
}

/* ============================================================
   NICKNAME / ELO SOTTO RUOLI — POSIZIONE FISSA
   ============================================================ */
.player-info-list {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem;
  margin-top: 0.2rem;
  margin-bottom: 1rem;
}
.role-info {
  min-width: 90px;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.1rem;
  color: #EAF0FF;
  margin: 0;
}

/* ============================================================
   PULSANTI
   ============================================================ */
.team-card button:not(.invite-btn-team) {
  background: linear-gradient(145deg, #FFD700, #B8860B);
  color: #0A0F2C;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  padding: 0.6rem 1.6rem;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.team-card button:not(.invite-btn-team):hover {
  transform: scale(1.05);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.6);
}
.team-card button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* ===== STATO TEAM ===== */
.team-status {
  color: #00FF9C;
  font-weight: 700;
  margin-top: 0.8rem;
  text-shadow: 0 0 8px rgba(0, 255, 156, 0.45);
}
.hidden { display: none; }

/* ===== SEZIONE CREA TEAM ===== */
.create-team-section {
  text-align: center;
  margin-top: 3rem;
}
#create-team-btn {
  background: linear-gradient(145deg, #FFD700, #B8860B);
  color: #0A0F2C;
  font-weight: 800;
  font-size: 1rem;
  border: none;
  border-radius: 14px;
  padding: 0.9rem 2rem;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#create-team-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
}

/* ============================================================
   RESPONSIVE — MOBILE 3+2 CLEAN LAYOUT
   ============================================================ */
@media (max-width: 900px) {
  /* === CARD === */
  .team-card {
    padding: 1.4rem 1rem 1.8rem;
  }

  /* === Titolo e Elo (Elo sotto titolo) === */
  .team-header {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.6rem;
  }
  .team-header h2 {
    font-size: 1.3rem;
    text-align: center;
    line-height: 1.4rem;
  }
  .team-elo {
    position: static;
    margin-top: 0.3rem;
    font-size: 0.9rem;
  }

  /* === Layout ruoli 3+2 === */
  .team-roles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 1.2rem 2rem;
    justify-items: center;
    align-items: center;
    margin: 1rem auto 0.6rem;
    max-width: 340px;
  }

  /* Ruoli inferiori centrati sotto */
  .team-roles .role-slot:nth-child(4) {
    grid-column: 2 / 3;
  }
  .team-roles .role-slot:nth-child(5) {
    grid-column: 3 / 4;
  }

  .role-slot {
    width: 75px;
    height: 75px;
    margin-bottom: 0.3rem;
  }

  /* === Ruoli sotto i cerchi === */
  .role-infos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 1.2rem 2rem;
    justify-items: center;
    align-items: start;
    margin-top: 0.3rem;
    margin-bottom: 1rem;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
  }
  .role-infos p:nth-child(4) {
    grid-column: 2 / 3;
  }
  .role-infos p:nth-child(5) {
    grid-column: 3 / 4;
  }

  .role-infos p {
    min-width: 75px;
    font-size: 0.8rem;
  }

  /* === Nickname / Posto libero sotto i ruoli === */
  .player-info-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 1.2rem 2rem;
    justify-items: center;
    align-items: start;
    max-width: 340px;
    margin: 0 auto 1rem;
  }
  .player-info-list p:nth-child(4) {
    grid-column: 2 / 3;
  }
  .player-info-list p:nth-child(5) {
    grid-column: 3 / 4;
  }

  .role-info {
    min-width: 75px;
    font-size: 0.8rem;
    text-align: center;
  }

  /* === Pulsanti === */
  .team-card button {
    margin-top: 1rem;
    font-size: 0.9rem;
    padding: 0.5rem 1.2rem;
  }

  .draft-container {
    padding: 3rem 1rem;
  }
}
/* ===============================================
   BLOCCO STABILITÀ — CERCHI NON SI SPOSTANO
   =============================================== */
.role-group {
  width: 110px;              /* 🔹 larghezza fissa per ogni ruolo */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: 0.25rem;
}

/* mantiene l'altezza costante sotto il cerchio */
.role-meta {
  color: #EAF0FF;
  font-size: 0.85rem;
  line-height: 1.1rem;
  min-height: 2.2rem;        /* 🔹 spazio riservato per due righe di testo */
  max-width: 100px;
  overflow-wrap: break-word;
  text-align: center;
  margin: 0;
}

.role-label {
  color: #FFD700;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  margin: 0;
  text-shadow: 0 0 4px rgba(255,215,0,0.25);
}
/* ============================================================
   MODALE CREA TEAM — VERSIONE PREMIUM
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 25, 0.8);
  backdrop-filter: blur(6px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.modal.show {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: rgba(20, 26, 50, 0.95);
  border: 1.5px solid #d4af37;
  border-radius: 18px;
  width: 92%;
  max-width: 520px;
  padding: 2rem 2.4rem;
  color: #eaf0ff;
  text-align: center;
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.modal.show .modal-content {
  transform: scale(1);
  opacity: 1;
  box-shadow: 0 0 35px rgba(212, 175, 55, 0.25);
}

/* === Titolo === */
.modal-content h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  color: #FFD700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  margin-bottom: 1.2rem;
}

/* === Etichette centrali === */
.modal-content label {
  display: block;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: #aeb9df;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
}

/* === Campi input === */
.modal-content input,
.modal-content textarea {
  width: 100%;
  border: 1px solid #445178;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #eaf0ff;
  font-size: 0.95rem;
  padding: 0.7rem 0.9rem;
  text-align: center;
  transition: border 0.25s ease, background 0.25s ease;
}
.modal-content input:focus,
.modal-content textarea:focus {
  border-color: #FFD700;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

/* === Sezione ruoli === */
.modal-content h3 {
  margin-top: 1.4rem;
  font-size: 1.05rem;
  color: #FFD700;
  letter-spacing: 0.5px;
}

.role-choice {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1rem 0 1.6rem;
}

.role-btn {
  border: 2px solid var(--role-color);
  color: var(--role-color);
  font-weight: 600;
  padding: 0.5rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.role-btn:hover,
.role-btn.selected {
  background: var(--role-color);
  color: #0A0F2C;
  box-shadow: 0 0 15px var(--role-color);
}

/* === Pulsante pubblica === */
#publish-team-btn {
  width: 100%;
  background: linear-gradient(145deg, #FFD700, #b4860b);
  color: #0a0f2c;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 12px;
  padding: 0.8rem 1.6rem;
  margin-top: 0.5rem;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#publish-team-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.55);
}

/* === Pulsante chiusura === */
.close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #aeb9df;
  font-size: 1.4rem;
  cursor: pointer;
  transition: color 0.2s ease;
}
.close-btn:hover {
  color: #FF5555;
}
/* ============================================================
   PULSANTI TEAM AZIONI (CREATORE)
   ============================================================ */
.team-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.2rem;
}

/* Chiudi candidature */
.close-btn-team {
  background: linear-gradient(145deg, #FFD700, #B8860B);
  color: #0A0F2C;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.close-btn-team:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}


/* ============================================================
   PULSANTI AZIONI TEAM — STILE DEFINITIVO
   ============================================================ */
.team-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.2rem;
}

/* Pulsante neutro dorato opaco per "Chiudi candidature" */
.close-btn-team {
  background-color: #d4af37;     /* oro opaco */
  color: #0A0F2C;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.close-btn-team:hover {
  background-color: #bfa030;     /* leggermente più scuro */
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

/* Pulsante rosso pieno per "Elimina annuncio" */
.delete-btn-team {
  background-color: #d62828 !important;   /* forza il rosso */
  color: #fff !important;
  font-weight: 700;
  border: none !important;
  border-radius: 10px;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(214, 40, 40, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.delete-btn-team:hover {
  background-color: #a61b1b !important;
  transform: scale(1.05);
  box-shadow: 0 0 18px rgba(214, 40, 40, 0.6);
}

/* Elimina annuncio (rosso pieno elegante) */
.delete-btn-team {
  background-color: #d62828;         /* 🔴 rosso principale */
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(214, 40, 40, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.delete-btn-team:hover {
  background-color: #a61b1b;         /* 🔥 rosso più scuro al passaggio */
  transform: scale(1.05);
  box-shadow: 0 0 18px rgba(214, 40, 40, 0.6);
}
/* ============================================================
   FORZA STILE ROSSO PER "ELIMINA ANNUNCIO"
   ============================================================ */

/* livello più specifico: .team-card .delete-btn-team */
.team-card .delete-btn-team {
  background: none !important;              /* rimuove gradienti ereditati */
  background-color: #d62828 !important;     /* rosso principale */
  color: #fff !important;
  font-weight: 700;
  border: none !important;
  border-radius: 10px;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(214, 40, 40, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* hover effetto elegante */
.team-card .delete-btn-team:hover {
  background-color: #a61b1b !important;
  transform: scale(1.05);
  box-shadow: 0 0 18px rgba(214, 40, 40, 0.6);
}
/* ===== HEADER PAGE ===== */
.draft-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 1.5rem;
}
/* ============================================================
   BARRA SUPERIORE TEAM — Stile definitivo
   ============================================================ */
/* ============================================================
   TEAM TOPBAR (Invita | Titolo | Elo) — Grid pulita
   ============================================================ */
.team-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto; /* btn | title | elo */
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  border: none; /* nessuna riga */
}

/* Pulsante INVITA UN AMICO (supporta due classi per compatibilità) */
.invite-btn-team,
.invite-friend-btn {
  background: transparent;
  border: 1.5px solid rgba(255, 215, 0, 0.6);
  color: #FFD700;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 8px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.3);
  transition: all 0.25s ease;
  white-space: nowrap;
}
.invite-btn-team:hover,
.invite-friend-btn:hover {
  background: rgba(255, 215, 0, 0.1);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
  transform: scale(1.05);
}

/* Titolo al centro tra colonna sinistra e destra */
.team-title {
  justify-self: center; /* centro "reale" fra le colonne */
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 1.55rem;
  color: #FFD700;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.6px;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* Elo a destra */
.team-elo {
  font-weight: 700;
  font-size: 1rem;
  color: #FFD700;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
  margin-right: 6px;
  white-space: nowrap;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .team-topbar {
    grid-template-columns: 1fr; /* una colonna */
    gap: 0.5rem;
    text-align: center;
  }
  .invite-btn-team,
  .invite-friend-btn {
    font-size: 1rem;
    width: 85%;
    max-width: 280px;
    justify-self: center;
  }
  .team-title {
    font-size: 1.4rem;
  }
  .team-elo {
    font-size: 0.95rem;
    justify-self: center;
    margin-right: 0;
  }
}

/* ============================================================
   MODALI — Comportamento affidabile (niente display: none !important)
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  display: flex;               /* sempre in flex: gestiamo visibilità con opacity/visibility */
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ============================================================
   MODALE — INVITA AMICO
   ============================================================ */
.invite-box {
  width: 420px;
  max-width: 92vw;
  background: rgba(25, 30, 60, 0.96);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 16px;
  padding: 1rem;
  color: #fff;
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.16);
}
.invite-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 215, 0, 0.18);
}
.invite-header h3 {
  margin: 0;
  color: #FFD700;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.search-friend {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  margin-top: 0.75rem;
}
.invite-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.8rem;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 215, 0, 0.12);
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
}
.invite-left { display: flex; align-items: center; gap: 0.75rem; }
.invite-left img {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
  border: 1px solid #FFD700;
}
.invite-name { font-weight: 700; color: #fff; letter-spacing: 0.2px; }
.invite-status {
  width: 12px; height: 12px; border-radius: 50%; margin-left: 0.45rem;
}
.invite-status.online   { background: #00FF7F; box-shadow: 0 0 6px rgba(0,255,127,.55); }
.invite-status.in-game  { background: #FFA500; box-shadow: 0 0 6px rgba(255,165,0,.5); }
.invite-status.offline  { background: #b5b5b5; box-shadow: 0 0 6px rgba(180,180,180,.6); }
.invite-plus {
  background: rgba(255, 215, 0, 0.14);
  border: 1px solid rgba(255, 215, 0, 0.4);
  color: #FFD700;
  font-weight: 800;
  font-size: 1.1rem;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: 0.2s;
}
.invite-plus:hover { background: rgba(255, 215, 0, 0.3); color:#fff; transform: scale(1.06) translate(1px,-1px); }
.invite-plus:disabled { opacity: 0.35; cursor: not-allowed; }
/* ============================================================
   SUMMONER CONNECT — DRAFT RANKED (vFinale)
   Layout team + modali + interazioni ruoli
   ============================================================ */

/* === TOPBAR centrata perfettamente === */
.team-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.invite-btn-team {
  background: transparent;
  border: 1.5px solid rgba(255, 215, 0, 0.6);
  color: #FFD700;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 8px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.3);
  transition: all 0.25s ease;
}
.invite-btn-team:hover {
  background: rgba(255, 215, 0, 0.1);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
  transform: scale(1.05);
}

/* === Titolo del Team (centrato) === */
.team-title {
  grid-column: 2;
  justify-self: center;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 1.55rem;
  color: #FFD700;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.6px;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
  left: -90px;
}

/* === Elo medio === */
.team-elo {
  font-weight: 700;
  font-size: 1rem;
  color: #FFD700;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
  margin-right: 6px;
  white-space: nowrap;
}

/* ============================================================
   RUOLI (cerchi cliccabili + hover + label)
   ============================================================ */
.role-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  position: relative;
}

.role-slot {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 2px solid var(--role-color, #888);
  background: radial-gradient(circle at 50% 50%, #D9DDE7 15%, #C7CCD9 70%, #B6BBCB 100%);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  z-index: 5;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.role-slot:hover {
  transform: scale(1.07);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

/* === "+" nei ruoli liberi === */
.role-slot .plus {
  font-weight: 900;
  font-size: 1.4rem;
  line-height: 1;
  color: #1f8d3a; /* verde visibile */
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.25);
}
.role-slot.occupied .plus { display: none; }

/* === Pulsante "−" Abbandona Team === */
.role-slot .leave-btn {
  position: absolute;
  right: -6px;
  top: -6px;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #FFD3D3;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 900;
  cursor: pointer;
  pointer-events: auto;
  z-index: 10;
}
.role-slot:hover .leave-btn { display: flex; }

/* === Testi sotto i cerchi === */
.role-meta, .role-label {
  position: relative;
  z-index: 1;
  pointer-events: none;
  text-align: center;
  color: #FFD700;
}
.role-meta { font-size: 0.92rem; min-height: 1.2rem; }
.role-label { font-size: 0.8rem; opacity: 0.85; }

/* ============================================================
   PULSANTI AZIONE TEAM
   ============================================================ */
.team-card .team-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
}

.team-card .team-actions button {
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border-radius: 12px;
  font-weight: 700;
  padding: 0.55rem 1rem;
  border: none;
}

/* 🟡 Chiudi candidature */
.team-card .close-btn-team {
  background: linear-gradient(145deg, #FFD700, #B8860B);
  color: #0A0F2C;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}
.team-card .close-btn-team:hover {
  transform: scale(1.04);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.55);
}

/* 🔴 Elimina annuncio */
.team-card .delete-btn-team {
  background: #C62828;
  color: #fff;
  border: 1px solid #8B1E1E;
  box-shadow: 0 0 10px rgba(198, 40, 40, 0.35);
  font-weight: 800;
}
.team-card .delete-btn-team:hover {
  background: #B71C1C;
  box-shadow: 0 0 16px rgba(183, 28, 28, 0.5);
  transform: scale(1.03);
}

/* ============================================================
   MODALE CREA TEAM
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-content {
  width: 540px;
  max-width: 94vw;
  background: rgba(15, 20, 45, 0.96);
  border: 1px solid rgba(255, 215, 0, 0.32);
  border-radius: 16px;
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.16);
  padding: 1.2rem 1.1rem 1rem;
  color: #e7ecff;
}
.modal-content h2 {
  margin: 0 0 0.8rem 0;
  font-family: 'Cinzel', serif;
  color: #FFD700;
  letter-spacing: 0.4px;
}

/* === Input e testo === */
.modal-content input,
.modal-content textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.35);
  background: rgba(255,255,255,0.06);
  color: #fff;
  padding: 0.6rem 0.75rem;
}

/* === Scelta ruolo nel modal === */
.role-choice {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin: 0.6rem 0 0.9rem;
}
.role-btn {
  text-align: center;
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 10px;
  padding: 0.5rem 0.3rem;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
  transition: 0.2s;
}
.role-btn:hover { transform: translateY(-2px); }
.role-btn.selected {
  border-color: var(--role-color);
  box-shadow: 0 0 12px var(--role-color);
  background: color-mix(in srgb, var(--role-color) 25%, transparent);
}

/* === Pulsante Pubblica === */
#publish-team-btn {
  background: linear-gradient(145deg, #FFD700, #B8860B);
  color: #0A0F2C;
  font-weight: 800;
  border: none;
  border-radius: 12px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  margin-top: 0.4rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}
#publish-team-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.55);
}

/* === Pulsante chiusura (✖) === */
.close-btn {
  background: transparent;
  border: 1px solid rgba(255, 215, 0, 0.4);
  color: #FFD700;
  border-radius: 8px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: 0.2s;
  float: right;
}
.close-btn:hover { background: rgba(255, 215, 0, 0.1); }

/* === Animazione apertura === */
#create-modal.show .modal-content {
  animation: teamModalPop 0.35s ease forwards;
}
@keyframes teamModalPop {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .team-topbar {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    text-align: center;
  }
  .team-title {
    font-size: 1.4rem;
    justify-self: center;
  }
  .team-elo {
    font-size: 0.95rem;
    justify-self: center;
    margin-right: 0;
  }
  .invite-btn-team {
    width: 85%;
    max-width: 280px;
    text-align: center;
  }
}
/* === TOPBAR con titolo otticamente centrato === */
.team-topbar {
  display: grid;
  grid-template-columns: 160px 1fr 100px; /* Larghezza bilanciata tra sinistra e destra */
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  position: relative;
}

/* === Titolo del Team centrato otticamente === */
.team-title {
  grid-column: 2;
  justify-self: center;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 1.55rem;
  color: #FFD700;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.6px;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
  transform: translateX(-30px); /* ✅ Compensazione visiva perfetta */
}

/* === Elo medio allineato a destra === */
.team-elo {
  font-weight: 700;
  font-size: 1rem;
  color: #FFD700;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
  margin-right: 6px;
  white-space: nowrap;
  text-align: right;
}

/* === Mobile: reset del bilanciamento === */
@media (max-width: 768px) {
  .team-topbar {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    text-align: center;
  }

  .team-title {
    transform: none; /* ✅ Nessuna traslazione su mobile */
    font-size: 1.4rem;
  }

  .team-elo {
    justify-self: center;
    font-size: 0.95rem;
    margin-right: 0;
  }
}
/* === Ruolo selezionato nel modal === */
.role-btn.selected {
  border-color: var(--role-color);
  color: #fff !important; /* ✅ testo resta bianco */
  background: color-mix(in srgb, var(--role-color) 25%, transparent);
  box-shadow: 0 0 12px var(--role-color);
  transition: all 0.2s ease;
}
/* === Topbar centrata perfettamente === */
.team-topbar {
  display: grid;
  grid-template-columns: 160px 1fr 100px;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

/* === Titolo del Team centrato === */
.team-title {
  grid-column: 2;
  justify-self: center;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 1.55rem;
  color: #FFD700;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.6px;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
  transform: translateX(-30px);
}

/* === Elo medio allineato a destra === */
.team-elo {
  font-weight: 700;
  font-size: 1rem;
  color: #FFD700;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
  margin-right: 6px;
  white-space: nowrap;
  text-align: right;
}

/* === Responsive: mobile fix completo === */
@media (max-width: 768px) {
  .team-topbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-align: center;
    margin-bottom: 0.8rem;
  }

  .invite-btn-team {
    order: 1;
    width: 85%;
    max-width: 280px;
  }

  .team-title {
    order: 2;
    transform: none;
    font-size: 1.4rem;
  }

  .team-elo {
    order: 3;
    font-size: 0.95rem;
    margin-right: 0;
  }
}
/* ============================================================
   CHAT INTERNA TEAM
   ============================================================ */
.team-chat {
  position: absolute;
  bottom: 10px;
  left: 15px;
}

.team-chat-btn {
  background: rgba(255,215,0,0.15);
  border: 1px solid rgba(255,215,0,0.4);
  color: #FFD700;
  font-size: 1.3rem;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
}
.team-chat-btn:hover {
  background: rgba(255,215,0,0.3);
  box-shadow: 0 0 10px rgba(255,215,0,0.4);
}

/* === BOX CHAT === */
.team-chat-box {
  position: absolute;
  bottom: 60px;
  left: 0;
  width: 280px;
  background: rgba(10, 12, 30, 0.96);
  border: 1px solid rgba(255,215,0,0.35);
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(255,215,0,0.25);
  display: flex;
  flex-direction: column;
  z-index: 99;
  overflow: hidden;
}
.team-chat-box.hidden { display: none; }

.team-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,215,0,0.08);
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid rgba(255,215,0,0.2);
}
.team-chat-header h4 {
  margin: 0;
  color: #FFD700;
  font-size: 0.9rem;
}
.close-chat {
  background: transparent;
  border: none;
  color: #FFD700;
  cursor: pointer;
  font-size: 1rem;
}

/* === MESSAGGI === */
.team-chat-messages {
  max-height: 180px;
  overflow-y: auto;
  padding: 0.5rem;
  font-size: 0.85rem;
  color: #eaeaea;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.chat-msg {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  border: 1px solid rgba(255,215,0,0.1);
}
.chat-header {
  font-weight: 700;
  color: #FFD700;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  opacity: 0.9;
}
.chat-text {
  color: #fff;
  font-size: 0.9rem;
  word-wrap: break-word;
}

/* === INPUT E INVIO === */
.team-chat-input {
  display: flex;
  padding: 0.3rem;
  border-top: 1px solid rgba(255,215,0,0.15);
}
.team-chat-input input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,215,0,0.25);
  color: #fff;
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
}
.team-chat-input input::placeholder {
  color: rgba(255,255,255,0.4);
}
.team-chat-input button {
  margin-left: 0.4rem;
  background: rgba(255,215,0,0.25);
  border: 1px solid rgba(255,215,0,0.4);
  color: #FFD700;
  border-radius: 8px;
  padding: 0 0.6rem;
  cursor: pointer;
  font-weight: 700;
  transition: 0.2s;
}
.team-chat-input button:hover {
  background: rgba(255,215,0,0.4);
}
/* =======================
   TITOLO PRINCIPALE PAGINA
   ======================= */
.page-title {
  text-align: center;
  color: #FFD700;
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  text-shadow: 0 0 10px rgba(255,215,0,0.4);
  letter-spacing: 0.8px;
  margin: 1rem 0 2rem;
}

@media (max-width: 768px) {
  .page-title {
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
  }
}
.role-btn.selected {
  border-color: var(--role-color);
  box-shadow: 0 0 10px var(--role-color);
  background: color-mix(in srgb, var(--role-color) 25%, transparent);
  color: #fff;
}
