/* Reset base leggero */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #f5f5f5;
  color: #222;
}

/* CONTAINER GENERICO */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* HEADER CON IMMAGINE DI SFONDO */
.header {
  width: 100%;
  height: 250px;
  overflow: hidden;
  position: relative;
}

.header-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
/*DA OPACITA ALL HEADER
.header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.35),
    rgba(0,0,0,0.45)
  );
  z-index: 1;
}*/


/* Contenuto dentro l'header (solo logo) */
.header-inner {
  position: relative;
  z-index: 2;
}


/* Logo nell'header */
.logo {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: #ffffff;
}

/* -------------------------
   MENU SOTTO L'HEADER
-------------------------- */

/* BARRA MENU SOTTO L'HEADER */
/* BARRA MENU SOTTO L'HEADER */
.nav {
  width: 100%;
  background-color: #f3f4f6;   /* grigio chiaro */
  border-bottom: 1px solid #d1d5db;
  z-index: 20;
}

/* contenitore interno nav */
.nav-inner {
  position: relative;          /* FONDAMENTALE per il menu assoluto sotto */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
}

/* LINK MENU (DESKTOP) */
.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-links a {
  color: #111827;   /* nero/grigio scuro */
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: #374151;
  text-decoration: underline;
}

.lang-switcher {
  display: flex;
  gap: 0.35rem;
  margin-left: 0.75rem;
}

.lang-btn {
  background: none;
  border: 1px solid rgba(0,0,0,0.15);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  cursor: pointer;
}

.lang-btn:hover {
  background-color: rgba(0,0,0,0.05);
}

/* HAMBURGER (NASCONTO SU DESKTOP) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  width: 26px;
  height: 3px;
  background-color: #111827;
  border-radius: 2px;
}

/* --------- MOBILE --------- */
@media(max-width:768px){
	.nav-toggle { display: flex;}
	.nav-links {display: none; /* nascosto di base */} 
	.nav-links.active {display: flex;}
	  .lang-switcher {
    justify-content: center;
    padding: 0.75rem 0;
  }
}
/*VECCHIO MENU
@media (max-width: 768px) {

  /* mostra hamburger 
  .nav-toggle {
    display: flex;
  }

  /* il menu diventa a scomparsa sotto la barra 
  .nav-links {
    position: absolute;
    top: 100%;          /* subito sotto .nav-inner 
    left: 0;
    width: 100%;
    background-color: #f3f4f6;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid #d1d5db;

    display: none;      /* NASCOSTO di base su mobile 
  }

  /* quando JS aggiunge .active si vede 
  .nav-links.active {
    display: flex;
  }
}*/



/* -------------------------
   MAIN / HERO
-------------------------- */

.main {
  padding: 1.5rem 0 2.5rem;
}

.hero {
  text-align: center;
  padding: 3rem 1.5rem 2.5rem;
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  text-transform: uppercase;
  /*letter-spacing: 0.08em;*/
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  /*color: #e5e7eb;
  background: rgba(15, 23, 42, 0.7);*/
  margin-bottom: 0.9rem;
}

.hero h2 {
  margin-bottom: 0.75rem;
  font-size: 1.7rem;
  color: #111827;
}

.hero-subtitle {
  margin: 0 auto 1.8rem;
  max-width: 540px;
  color: #4b5563;
  font-size: 0.98rem;
}

.hero_subtitle-center {
  margin: auto;
  max-width: auto;
  color: #4b5563;
  font-size: 0.98rem;
  text-align: center;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}

/* Bottone secondario */
.btn-secondary {
  display: inline-block;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  border: 1px solid #4b5563;
  color: #111827;
  background-color: transparent;
}

.btn-secondary:hover {
  background-color: #e5e7eb;
}

/* Bottone primario (già usato nel menu e hero) */
.btn-primary {
  display: inline-block;
  border: none;
  background-color: #2563eb;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary:hover {
  opacity: 0.9;
}

/* -------------------------
   SEZIONI GENERICHE
-------------------------- */

.section {
  padding: 2.5rem 0;
}

.section-alt {
  background-color: #f3f4f6;
}

.section-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.section-header h3 {
  margin: 0 0 0.4rem;
  font-size: 1.3rem;
  color: #111827;
}

.section-header p {
  margin: 0;
  color: #4b5563;
  font-size: 0.95rem;
}

/* -------------------------
   GRID / CARD / FAQ
-------------------------- */

.features-grid,
.tournaments-grid,
.faq-list {
  display: grid;
  gap: 1rem;
}

/* Card generica */
.card {
  background-color: #fff;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  margin-bottom: 1rem;
  border: 1px solid #2563eb;
}

.card h4 {
  margin-top: 0;
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
  color: #111827;
}

.card p {
  margin: 0;
  font-size: 0.9rem;
  color: #4b5563;
}

/* CTA di sezione */
.section-cta {
  text-align: center;
  margin-top: 1.5rem;
}

/* CTA finale */
.final-cta {
  text-align: center;
  padding-bottom: 3rem;
}

.final-cta h3 {
  margin-bottom: 0.6rem;
}

.final-cta p {
  margin-bottom: 1.2rem;
}

/* -------------------------
   FORM / MESSAGGI (se usati in login/register)
-------------------------- */

.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  font-size: 0.95rem;
}

input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.error-message {
  display: block;
  color: #b91c1c;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.message {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.message.error {
  color: #b91c1c;
}

.message.success {
  color: #15803d;
}

/* -------------------------
   FOOTER
-------------------------- */

.footer {
  width: 100%;
  background-color: #111827;
  color: #9ca3af;
  padding: 0.75rem 0;
  font-size: 0.8rem;
  margin-top: auto;
  text-align: center;
}

/* Utility */
.hidden {
  display: none;
}

/* -------------------------
   RESPONSIVE
-------------------------- */

@media (min-width: 600px) {
  .card {
    padding: 0.5rem;
  }

  .hero h2 {
    font-size: 1.9rem;
  }

  .hero-actions {
    flex-direction: row;
  }

  .features-grid,
  .faq-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tournaments-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile specifico header+menu */
@media (max-width: 768px) {
  .header {
    background-image: url("/images/header/logositoweb_mobile.png");
    background-size: cover;
    background-position: center center;
    height: 200px;   /* oppure 280px se vuoi più impatto */
    min-height: unset;
    max-height: unset;
  }
  
  /*immagine header*/
  .header-img {
     transform: scale(1.35);
  }


  .nav .container {
    flex-direction: column;
    gap: 0.6rem;
  }

  .nav a {
    font-size: 0.95rem;
  }
}

@media (max-width: 768px) {

  /* Bottone hamburger */
  .nav-toggle {
    display: flex;
  }

  /* Menu chiuso */
  .nav-links {
    position: absolute;
    top: 100%;           /* sotto la navbar */
    left: 0;
    right: 0;

    display: flex;
    flex-direction: column;

    background: #fff;
    overflow: hidden;

    max-height: 0;
    transition: max-height 0.3s ease;
    z-index: 999;
  }

  /* Menu aperto */
  .nav-links.nav-open {
    max-height: 500px;
  }

  /* Voci menu */
  .nav-links a,
  .nav-links .lang-switcher {
    padding: 8px 8px;
    /*border-top: 1px solid rgba(0,0,0,0.3);*/
  }
}


/*Per contenuto dell area riservata*/
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.dashboard-card {
  background: #111;
  border: 1px solid #2a2a2a;
  padding: 1.6rem;
  border-radius: 12px;
  text-decoration: none;
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 14px rgba(255, 80, 0, 0.35);
}

.dashboard-card h4 {
  margin-bottom: 0.5rem;
  color: #ff6a00;
}

.rules-extended {
  white-space: pre-line; /* così i \n dei testi i18n vanno a capo */
  font-size: 0.95rem;
  color: #374151;
  line-height: 1.5;
}

.rules-check {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.9rem;
}

.rules-check label {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.rules-check a {
  text-decoration: underline;
}

/*  TEMA AREA PRIVATA */
.theme-private {
  background-color: #ffffff;
  color: #000000;
}

.theme-private .card {
  background: #ffffff;
  border: 1px solid #2563eb;
  box-shadow: 0 0 14px rgba(255, 106, 0, 0.35);
}

.theme-private .btn-primary {
  background-color: #2563eb;
}

.theme-private .btn-secondary {
  border-color: #111827;
  color: #4b5563;
}

/* =====================================================
   TORNEI STAFF – IDENTICI ALLE PARTITE + BADGE VISIVO
   ===================================================== */

/* Card torneo: nessuna differenza strutturale */
.game-card--tournament {
  position: relative;
}

/* Badge STAFF */
.game-card--tournament::before {
  content: "STAFF";
  position: absolute;
  top: 10px;
  right: 10px;

  background-color: #2563eb; /* stesso blu dei btn-primary */
  color: #ffffff;

  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;

  padding: 0.25rem 0.6rem;
  border-radius: 999px;

  z-index: 3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* Hover coerente ma leggermente più autorevole */
.game-card--tournament:hover {
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

/* Mobile: badge più compatto */
@media (max-width: 768px) {
  .game-card--tournament::before {
    top: 6px;
    right: 6px;
    font-size: 0.65rem;
    padding: 0.2rem 0.45rem;
  }
}

.tournament-status-label {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  margin-top: 0.5rem;
}

/* =========================================
   MENU – ASPETTO SOLIDO (NO "SOLO LINK")
   ========================================= */

/* Barra menu più presente */
.nav {
  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

/* Contenitore link */
.nav-links {
  gap: 0.5rem;
}

/* VOCI MENU = PILL */
.nav-links a {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background-color: transparent;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Hover visibile */
.nav-links a:hover {
  background-color: #e5e7eb;
  color: #111827;
  text-decoration: none;
}

/* =========================
   CTA LOGIN / REGISTRATI
   ========================= */

.nav-links a[data-i18n="nav_login"] {
  background-color: #2563eb;
  color: #ffffff;
}

.nav-links a[data-i18n="nav_login"]:hover {
  background-color: #1e4fd8;
}

.nav-links a[data-i18n="nav_register"] {
  border: 1px solid #2563eb;
  color: #2563eb;
}

.nav-links a[data-i18n="nav_register"]:hover {
  background-color: rgba(37,99,235,0.1);
}

/* =========================
   LINGUA
   ========================= */

.lang-switcher {
  margin-left: 0.5rem;
}

.lang-btn {
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  font-weight: 500;
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 768px) {

  .nav-links {
    background-color: #ffffff;
    padding: 0.75rem 0;
  }

  .nav-links a {
    width: auto;
    margin: 0.25rem auto;
    padding: 0.6rem 1.4rem;
    font-size: 1rem;
  }
}

/* =========================================
   LINK "VEDI TUTTI I TORNEI" → BOTTONE
   ========================================= */

/* =========================================
   LINK CTA RIUTILIZZABILI
   ========================================= */

.link-cta {
  display: inline-block;
  margin-top: 0.75rem;

  padding: 0.45rem 1.1rem;
  border-radius: 999px;

  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;

  color: #2563eb;
  border: 1px solid #2563eb;
  background-color: transparent;

  transition: background-color 0.2s ease,
              color 0.2s ease,
              transform 0.15s ease;
}

.link-cta:hover {
  background-color: rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.link-cta.active {
  background-color: #2563eb;
  color: #ffffff;
}

/* =========================
   FIX HAMBURGER MENU (PATCH)
   ========================= */

/* Forza una sola logica quando JS aggiunge .open */
@media (max-width: 768px) {

  .nav-links {
    display: none !important;
  }

  .nav-links.open {
    display: flex !important;
  }
}
/* =========================
   FIX VISIBILITÀ LINK MENU
   ========================= */
@media (max-width: 768px) {

  .nav-links.open {
    max-height: 1000px !important;
    overflow: visible !important;
  }

  .nav-links.open a,
  .nav-links.open .lang-switcher {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

/* ===============================
   Thumbnail risultato partita
   =============================== */

.result-image-thumb{
  width:160px !important;
  height:120px !important;
  max-width:160px !important;
  max-height:120px !important;
  object-fit:cover !important;
  display:block !important;
}