/* ===========================================================
   DUO RANKED — STILE COMPLETO PRODUZIONE 2025
   Allineato a PROFILO + DRAFT + MODALE + CHAT
=========================================================== */

/* -----------------------------------------------------------
   UTILITY
----------------------------------------------------------- */

.hidden { display: none !important; }


/* -----------------------------------------------------------
   CONTAINER PRINCIPALE
----------------------------------------------------------- */

.duo-container {
  max-width: 950px;
  margin: 2.5rem auto 4rem;
  padding: 0 1rem;
  text-align: center;
}

.page-title {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  color: #FFD700;
  margin-bottom: 2rem;
  text-shadow: 0 0 14px rgba(255,215,0,0.4);
}


/* ===========================================================
   SEZIONE CREA ANNUNCIO
=========================================================== */

.duo-create-section {
  margin-top: 3rem;
}

.duo-create-btn {
  background: linear-gradient(145deg, #FFD700, #B8860B);
  padding: 0.85rem 2.4rem;
  border-radius: 12px;
  border: 1.5px solid #D4AF37;
  font-weight: 800;
  color: #0A0F2C;
  font-size: 1.05rem;
  box-shadow: 0 0 20px rgba(255,215,0,0.45);
  cursor: pointer;
  transition: .2s;
}

.duo-create-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 0 26px rgba(255,215,0,0.65);
}


/* ===========================================================
   MODALE CREA ANNUNCIO
=========================================================== */

.duo-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(5px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s, visibility .25s;
}

.duo-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s, visibility .25s;
}

.duo-modal.active,
.duo-modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.duo-modal-content {
  width: 92%;
  max-width: 540px;
  background: radial-gradient(circle at top, #1c254f 0%, #06091e 85%);
  border: 1.5px solid rgba(255,215,0,0.45);
  box-shadow: 0 0 26px rgba(255,215,0,0.45);
  border-radius: 18px;
  padding: 2rem 2rem;
  color: #EAF0FF;
  transform: scale(0.88);
  opacity: 0;
  transition: .28s;
}

.duo-modal.active .duo-modal-content {
  transform: scale(1);
  opacity: 1;
}

.modal-title {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  color: #FFD700;
  margin-bottom: 1rem;
  text-align: center;
}

.duo-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 1px solid rgba(255,215,0,0.5);
  color: #FFD97D;
  background: transparent;
  border-radius: 8px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
}

#duo-msg {
  width: 100%;
  padding: .7rem .8rem;
  border-radius: 10px;
  border: 1px solid #445178;
  background: rgba(5,8,25,0.85);
  color: #fff;
  margin-bottom: 1rem;
}

/* Ruoli modale */

.duo-modal-role-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.duo-modal-role-btn {
  min-width: 62px;
  padding: .35rem .8rem;
  border-radius: 999px;
  border: 2px solid #D4AF37;
  background: rgba(10,15,44,0.92);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: .15s ease;
}

.duo-modal-role-btn.selected {
  background: linear-gradient(145deg,#FFD700,#B8860B);
  color: #0A0F2C;
  box-shadow: 0 0 15px rgba(255,215,0,0.65);
}

.publish-btn {
  width: 100%;
  padding: .75rem 1.2rem;
  border-radius: 12px;
  border: 1px solid #D4AF37;
  background: linear-gradient(145deg,#FFD700,#B8860B);
  color: #0A0F2C;
  font-weight: 800;
  cursor: pointer;
}



/* ===========================================================
   CARD ANNUNCIO DUO
=========================================================== */

.duo-card {
  background: rgba(10,15,44,0.55);
  border: 1.5px solid #D4AF37;
  border-radius: 18px;
  padding: 1.7rem 1.3rem 2.7rem;
  margin-top: 2.5rem;
  box-shadow: 0 0 22px rgba(212,175,55,0.28);
  position: relative;
}



/* ===========================================================
   HEADER CARD
=========================================================== */

.duo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.duo-title-block {
  flex: 1;
  text-align: center;
}

.duo-title {
  font-family: 'Cinzel', serif;
  font-size: 1.7rem;
  color: #FFD700;
}

.duo-cerco span {
  color: white;
  font-weight: 600;
}



/* ===========================================================
   CHAT — POSIZIONE COME DRAFT
=========================================================== */

.duo-chat-wrapper {
  position: absolute;
  top: -38px;
  left: 45px;
  z-index: 88;
}

.duo-chat-btn {
  background: rgba(255,215,0,0.18);
  border: 1px solid rgba(255,215,0,0.4);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.25rem;
  color: #FFD700;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.duo-chat-box {
  position: absolute;
  top: 48px;
  left: 0;
  width: 270px;
  background: rgba(10,12,30,0.95);
  border: 1px solid rgba(255,215,0,0.4);
  border-radius: 12px;
  padding-bottom: .65rem;
  z-index: 90;
}

.duo-chat-header {
  padding: .4rem .6rem;
  border-bottom: 1px solid rgba(255,215,0,0.35);
  background: rgba(255,215,0,0.12);
  display: flex;
  justify-content: space-between;
}

.duo-chat-close {
  border: 1px solid rgba(255,215,0,0.5);
  background: transparent;
  border-radius: 6px;
  padding: 0 .4rem;
  color: #FFD97D;
  cursor: pointer;
}



/* ===========================================================
   STRUTTURA 3 COLONNE — ALLINEAMENTO PERFETTO
=========================================================== */

.duo-scheda {
  border-radius: 16px;
  border: 1.6px solid #D4AF37;
  background: rgba(15,20,50,0.78);
  margin-bottom: 1.4rem;
  padding: 1.25rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
}

.col1, .col2, .col3 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.col1 { width: 30%; }
.col2 { width: 40%; }
.col3 { width: 30%; }



/* ===========================================================
   AVATAR + NICKNAME + LIVELLO (ALLINEATI)
=========================================================== */

.duo-avatar {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #FFD700;
  margin-bottom: .45rem;
}

.duo-nickname {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  color: #fff;
  margin: .2rem 0;
}

.duo-lvl {
  font-size: .95rem;
  color: #d9d9d9;
}



/* ===========================================================
   RUOLI CARD — PIÙ PICCOLI E ORDINATI
=========================================================== */

.role-small {
  padding: .25rem .55rem !important;
  min-width: 54px !important;
  font-size: .7rem !important;
}

.duo-role-picker {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .32rem;
}

.role-pill {
  padding: .32rem .75rem;
  min-width: 60px;
  border-radius: 999px;
  border: 2px solid #D4AF37;
  background: rgba(15,20,50,0.92);
  font-weight: 700;
  font-size: .74rem;
  color: #fff;
  cursor: pointer;
}

.role-pill.selected {
  background: linear-gradient(145deg,#FFD700,#B8860B);
  color: #0A0F2C;
}

.duo-role-picker.disabled .role-pill {
  opacity: .4;
  pointer-events: none;
}


/* ===========================================================
   RECENSIONI — BOX FLUO
=========================================================== */

.rec-box {
  width: 175px;
  padding: .8rem .9rem;
  border-radius: 18px;
  background: rgba(10,12,30,0.65);
  margin: .6rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
}

.rec-title-pos { color: #00FF9C; }
.rec-title-neg { color: #FF2F6F; }

.rec-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.rec-pos {
  border: 2px solid #00FF9C;
  box-shadow: 0 0 20px rgba(0,255,156,0.45);
}

.rec-neg {
  border: 2px solid #FF2F6F;
  box-shadow: 0 0 20px rgba(255,47,111,0.45);
}


/* ===========================================================
   CERCHIO JOIN — CENTRATO
=========================================================== */

.duo-join-wrapper {
  position: relative;
  width: 100%;
  height: 0;
}

.duo-join-btn {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle,#3f4ea8,#0b1033,#050617);
  border: 2px solid rgba(255,215,0,0.6);
  color: #FFE9B0;
  font-size: 2.7rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: .25s;
}

.duo-join-btn.fade-out {
  opacity: 0;
  transform: translateX(-50%) scale(.55);
  pointer-events: none;
}


/* ===========================================================
   BOTTONI SCHEDA
=========================================================== */

.duo-actions-center {
  display: flex;
  justify-content: center;
  gap: 1.3rem;
  margin-bottom: 1.4rem;
}

.duo-btn {
  background: #0A0F2C;
  border: 2px solid #D4AF37;
  color: #FFD700;
  padding: .52rem 1.3rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.duo-btn:hover {
  background: #FFD700;
  color: #0A0F2C;
}


/* ===========================================================
   AGGIUNGI AGLI AMICI
=========================================================== */

.duo-friends-btn {
  position: absolute;
  bottom: 14px;
  left: 18px;
  background: #0A0F2C;
  border: 1.5px solid #FFD700;
  padding: .45rem 1rem;
  border-radius: 12px;
  color: #FFD700;
  font-weight: 700;
  cursor: pointer;
}


/* ===========================================================
   PARTITA COMPLETA
=========================================================== */

.duo-card.completata {
  opacity: .45;
  filter: grayscale(.6);
  position: relative;
}

.completata-banner {
  position: absolute;
  bottom: 14px;
  right: 14px;
  padding: .55rem 1.1rem;
  background: linear-gradient(145deg,#FFD700,#B8860B);
  border-radius: 12px;
  font-family: 'Cinzel',serif;
  font-weight: 800;
  color: #0A0F2C;
}


/* ===========================================================
   RESPONSIVE BASE
=========================================================== */

@media(max-width: 900px) {
  .col1, .col2, .col3 {
    width: 100%;
  }

  .duo-scheda {
    flex-direction: column;
    gap: 1.4rem;
  }

  .duo-join-btn {
    bottom: -32px;
  }
}


/* ===========================================================
   JOIN BUTTON — POSIZIONE FISSA E CORRETTA
=========================================================== */

.duo-join-btn {
  position: absolute;
  bottom: -38px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;

  width: 74px;
  height: 74px;
  border-radius: 50%;

  background: radial-gradient(circle,#3f4ea8,#0b1033,#050617);
  border: 2px solid rgba(255,215,0,0.6);

  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2.7rem;
  font-weight: 900;
  color: #FFE9B0;

  box-shadow:
    0 0 18px rgba(255,215,0,0.75),
    0 0 26px rgba(80,110,255,0.75);

  transition: .25s;
}

.duo-join-btn:hover {
  transform: translateX(-50%) scale(1.12);
}


/* ===========================================================
   OVERLAY della SECONDA SCHEDA (NON blocca il JOIN)
=========================================================== */

.seconda-scheda.opaca {
  position: relative;
}

.seconda-scheda.opaca::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5,7,18,0.62);
  backdrop-filter: blur(1px);
  border-radius: 16px;
  z-index: 1;
  pointer-events: none;
}

.seconda-scheda .col {
  position: relative;
  z-index: 2;
}


/* ===========================================================
   MODALE — Label & Campo Input Cerco
=========================================================== */

.duo-modal-content label {
  display: block;
  text-align: left;
  margin-top: 0.8rem;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #D9E2FF;
}

/* Riga compatta */
.duo-cerco-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0.6rem 0 1.2rem;
}

.duo-cerco-inline label {
  margin: 0;
  text-align: right;
  font-size: 0.95rem;
  font-weight: 600;
  color: #D9E2FF;
  white-space: nowrap;
}

#duo-msg {
  width: 110px;
  height: 32px;
  padding: 0 0.55rem;
  border-radius: 999px;
  border: 1.5px solid #FFD700;
  background: rgba(5, 8, 25, 0.9);
  color: #ffffff;
  font-size: 0.9rem;
  text-align: center;
  outline: none;
  box-shadow: 0 0 8px rgba(255,215,0,0.25);
}

#duo-msg::placeholder {
  color: #c7c7c7;
  opacity: 0.6;
  font-size: 0.85rem;
}

/* ===========================================================
   CHAT DUO — VERSIONE FLOTTEGGIANTE (ANCORATA ALLA CARD)
=========================================================== */

/* La card deve essere il contenitore di riferimento */
.duo-card {
  position: relative;
}

/* Wrapper della chat agganciato alla card, NON al viewport */
.duo-chat-wrapper {
  position: absolute;
  top: 10px;           /* dentro il bordo oro, non sopra */
  left: 18px;
  z-index: 5;          /* sotto la navbar, sopra il contenuto della card */
  pointer-events: none;  /* evita che l’area vuota cambi il cursore */
}

/* Il contenuto della chat rimane cliccabile */
.duo-chat {
  pointer-events: auto;
}

/* Icona */
.duo-chat-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,215,0,0.18);
  border: 1px solid rgba(255,215,0,0.45);

  display: flex;
  justify-content: center;
  align-items: center;

  color: #FFD700;
  font-size: 1.35rem;
  cursor: pointer;

  backdrop-filter: blur(4px);
  box-shadow: 0 0 10px rgba(0,0,0,0.45);

  transition: .2s;
}

.duo-chat-btn:hover {
  background: rgba(255,215,0,0.35);
  box-shadow: 0 0 16px rgba(255,215,0,0.55);
}


/* BOX CHAT */
.duo-chat-box {
  position: absolute;
  top: 50px;             /* subito sotto l’icona */
  left: 0;

  width: 260px;
  background: rgba(10,12,30,0.97);
  border-radius: 14px;
  border: 1px solid rgba(255,215,0,0.45);

  box-shadow: 0 0 25px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;

  overflow: hidden;
  z-index: 6;            /* un pelo sopra l’icona */
}


/* Header */
.duo-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: .45rem .6rem;
  background: rgba(255,215,0,0.12);
  border-bottom: 1px solid rgba(255,215,0,0.25);
}

.duo-chat-header h4 {
  margin: 0;
  color: #FFD700;
  font-size: 0.9rem;
  font-weight: 700;
}

/* X */
.duo-chat-close {
  background: transparent;
  border: 1px solid rgba(255,215,0,0.45);
  border-radius: 6px;
  padding: 0 .38rem;
  color: #FFD97D;
  font-size: 0.8rem;
  cursor: pointer;
  transition: .2s;
}

.duo-chat-close:hover {
  background: rgba(255,215,0,0.15);
  color: #FFF7CF;
}


/* Messaggi */
.duo-chat-messages {
  max-height: 165px;
  overflow-y: auto;

  padding: .45rem .55rem;
  display: flex;
  flex-direction: column;
  gap: .34rem;
}

.duo-chat-msg {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,215,0,0.18);
  padding: .35rem .45rem;
  border-radius: 8px;
}

.duo-chat-msg-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
  color: #FFD700;
}

.duo-chat-msg-text {
  color: white;
  font-size: 0.85rem;
}


/* Input */
.duo-chat-input {
  display: flex;
  gap: .35rem;

  padding: .4rem .45rem;
  background: rgba(255,255,255,0.04);
  border-top: 1px solid rgba(255,215,0,0.18);
}

.duo-chat-input input {
  flex: 1;

  border-radius: 8px;
  border: 1px solid rgba(255,215,0,0.35);

  background: rgba(255,255,255,0.08);
  padding: .35rem .45rem;

  color: white;
  font-size: .85rem;
}

.duo-chat-input button {
  background: rgba(255,215,0,0.25);
  border: 1px solid rgba(255,215,0,0.45);
  border-radius: 8px;

  padding: 0 .7rem;
  color: #FFD700;
  font-weight: 700;

  cursor: pointer;
  transition: .2s;
}

.duo-chat-input button:hover {
  background: #FFD700;
  color: #0A0F2C;
}
/* Spazio tra Ruolo Duo e Ruolo 2 */
.col2 .duo-role2 {
  margin-top: 1rem;   /* distanza verticale */
}

.col2 .roles-main {
  margin-bottom: 1rem; /* aggiunge aria sotto i primi bottoni */
}


/* ===========================================================
   RESPONSIVE CHAT
=========================================================== */

@media (max-width: 900px) {
  .duo-chat-wrapper {
    top: 6px;       /* un po’ più vicino al bordo in mobile */
    left: 14px;
  }

  .duo-chat-box {
    width: 240px;
    top: 46px;
  }
}
.notif-focus {
  outline: 2px solid #FFD700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
  border-radius: 12px;
  transition: box-shadow 0.3s ease;
}
/* ✅ Bottone "visivamente disabilitato" ma cliccabile (JS gestisce i permessi) */
.disabled-btn{
  opacity: .45;
  filter: grayscale(1);
  cursor: not-allowed;
  pointer-events: auto; /* <-- IMPORTANTISSIMO: riabilita il click */
}

/* ✅ I bottoni devono stare sempre sopra eventuali overlay/assoluti */
.duo-actions-center {
  position: relative;
  z-index: 20;
}
.duo-join-wrapper { position: relative; z-index: 5; }




/* Rank wrap (sotto "Cerco") — premium e più compatto */
.sc-rank-wrap{
  margin: 10px 0 14px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;

  /* ✅ più corto e “premium” */
  max-width: 520px;     /* cambia 520 se vuoi più/meno corto */
  width: 100%;
}

.sc-rank-label{
  font-weight: 700;
  color: #e6e6e6;
  text-align: left;
  font-size: 14px;
}

.sc-rank-input{
  width: 30%;
  box-sizing: border-box;
  height: 38px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 215, 0, 0.35);
  background: rgba(0, 0, 0, 0.20);
  color: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.sc-rank-input:focus{
  border-color: rgba(255, 215, 0, 0.65);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.12);
  background: rgba(0, 0, 0, 0.24);
}

.sc-rank-counter{
  font-size: 11px;
  opacity: 0.7;
  color: #d9d9d9;
  text-align: right;
  line-height: 1;
  user-select: none;
  margin-top: -4px;
}




/* ✅ riga label + input affiancati */
.sc-rank-wrap{
  display: grid;
  grid-template-columns: auto 1fr; /* label | input */
  column-gap: 12px;
  row-gap: 6px;
  align-items: center;
}

/* label a sinistra */
.sc-rank-label{
  margin: 0;
  white-space: nowrap;
}

/* input a destra */
.sc-rank-input{
  width: 30%;
  box-sizing: border-box;
}

/* counter sotto, allineato a destra sotto l'input */
.sc-rank-counter{
  grid-column: 2;     /* sotto la colonna dell’input */
  justify-self: end;  /* allineato a destra */
}


