/* ========================= Home2 (Public Tournaments) ========================= */

* {
  box-sizing: border-box;
}

body.home2-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: #0d0d0d;
  background-image: 
    radial-gradient(circle at top right, rgba(10, 171, 56, 0.08), transparent 40vw),
    radial-gradient(circle at bottom left, rgba(171, 2, 16, 0.08), transparent 40vw),
    linear-gradient(135deg, #121212 0%, #080808 100%);
  background-attachment: fixed;
  font-family: 'Orbitron', sans-serif;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
}

body.home2-body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
  z-index: 0;
}

body.home2-body > * {
  position: relative;
  z-index: 1;
}

.home2-header {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2vw;
  padding: 2.5vh 4vw;
  margin: 0;
}

.home2-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.home2-logo {
  height: 9.5vh;
  max-height: 9.5vh;
  width: auto;
  object-fit: contain;
}

.home2-login-link {
  text-decoration: none;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: #0AAB38;
  border: 2px solid rgba(10, 171, 56, 0.65);
  background-color: rgba(0, 0, 0, 0.4);
  padding: 1vh 2.5vw;
  border-radius: 50px;
  font-size: clamp(0.85rem, 1.1vw, 1.1rem);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.home2-login-link:hover {
  transform: translateY(-0.2vh);
  border-color: #AB0210;
  background: linear-gradient(to right, rgba(3,10,5,0.5), rgba(171,2,16,0.5));
  box-shadow: 0 0 15px rgba(171, 2, 16, 0.3);
}

.home2-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2vh 4vw 6vh;
  width: 100%;
  max-width: 100%;
}

.home2-title {
  margin: 0 0 4vh;
  color: #0AAB38;
  font-size: clamp(1.6rem, 3.8vw, 3rem);
  text-align: center;
  text-shadow: 0 0 2vh rgba(10, 171, 56, 0.3);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.home2-empty {
  color: rgba(255, 255, 255, 0.92);
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1rem, 1.2vw, 1.3rem);
  text-align: center;
  padding: 4vh 4vw;
  border: 2px solid rgba(10, 171, 56, 0.25);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 800px;
}

.home2-tornei-grid {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  gap: 1.8vh;
  padding: 0;
}

/* Card ad altezza minima fissa e bilanciamento colonne */
/* Card ad altezza minima uniforme e allineamento rigido */
.home2-torneo-card {
  text-decoration: none;
  font-family: 'Orbitron', sans-serif;
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  min-height: 100px; /* Altezza minima identica per tutti i banner */

  padding: 2vh 2.5vw;
  border-radius: 12px;
  border: 1px solid rgba(10, 171, 56, 0.4);
  background: linear-gradient(90deg, rgba(20, 20, 20, 0.8) 0%, rgba(10, 10, 10, 0.8) 100%);
  backdrop-filter: blur(5px);

  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.home2-torneo-card:hover {
  transform: translateY(-0.3vh);
  border-color: #AB0210;
  box-shadow: 
    0 10px 30px rgba(171, 2, 16, 0.15),
    0 5px 15px rgba(0, 0, 0, 0.6);
}

/* 1. Nome Torneo: si prende tutto lo spazio rimasto a sinistra */
.home2-card-name {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  font-size: clamp(1rem, 1.3vw, 1.5rem);
  flex: 1; 
  padding-right: 20px;
  word-break: break-word;
}

/* 2. Pillola TopXX: Larghezza bloccata al pixel per allineamento verticale */
.home2-card-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  min-width: 90px;
  padding: 8px 0;
  border-radius: 6px;
  font-weight: 700;
  font-size: clamp(0.75rem, 0.9vw, 1rem);
  color: #0AAB38;
  border: 1px solid rgba(10, 171, 56, 0.3);
  background: rgba(3, 10, 5, 0.6);
  text-align: center;
  margin-right: 40px; /* Spazio fisso prima dello stato */
}

/* 3. Stato FINISHED/LIVE: Larghezza bloccata e testo centrato/allineato */
.home2-card-status {
  color: #AB0210;
  font-weight: 700;
  font-size: clamp(0.8rem, 1vw, 1.1rem);
  text-transform: uppercase;
  letter-spacing: 1px;
  width: 120px;
  min-width: 120px;
  text-align: center;
  margin-right: 40px; /* Spazio fisso prima della data */
}

/* 4. Data d'inizio: ancorata rigidamente a sinistra per un incolonnamento perfetto */
.home2-card-date {
  display: flex;
  gap: 6px;
  align-items: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(0.8rem, 1vw, 1.1rem);
  width: 240px;       /* Spazio fisso per la colonna */
  min-width: 240px;   /* Blindiamo la larghezza */
  justify-content: flex-start; /* Spinge il testo a sinistra, allineando gli "Start Date:" */
  text-align: left;
  white-space: nowrap;
}

.home2-card-date-label {
  color: #0AAB38;
  font-weight: 600;
}

.home2-card-date-value {
  color: rgba(255, 255, 255, 0.9);
}

/* ========================= Tab System per Home2 ========================= */

.home2-tabs-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2vw;
  margin: 0 0 4vh;
  width: 100%;
}

.home2-tab-btn {
  background: transparent;
  border: none;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.4rem, 3.2vw, 2.5rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35); /* Stato inattivo sfuocato/grigio */
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 0.5vh 1vw;
  transition: all 200ms ease;
  position: relative;
}

.home2-tab-btn:hover:not(.active) {
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.home2-tab-btn.active {
  color: #0AAB38;
  text-shadow: 0 0 2vh rgba(10, 171, 56, 0.4);
}

/* Sottolineatura fluida sotto il tab attivo */
.home2-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background-color: #0AAB38;
  border-radius: 2px;
  box-shadow: 0 0 10px #0AAB38;
}
.home2-card-pill-right {
  margin-left: auto;
  margin-right: 0;
}
/* Gestione responsiva per schermi piccoli */
@media (max-width: 600px) {
  .home2-tabs-container {
    gap: 4vw;
  }
  
  .home2-tab-btn {
    font-size: 1rem;
  }
}

/* Mobile responsive aggiornato senza la subrow */
@media (max-width: 900px) {
  .home2-torneo-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5vh;
    padding: 2.5vh 4vw;
    min-height: auto;
  }
  
  .home2-card-name {
    width: 100%;
    padding-right: 0;
  }

  .home2-card-pill, 
  .home2-card-status, 
  .home2-card-date {
    width: 100%;
    min-width: auto;
    margin-right: 0;
    justify-content: flex-start;
    text-align: left;
  }
  
  .home2-card-status {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1vh;
  }
}