:root {
  --ink: #2B2927;
  --ink-deep: #1A1A1A;
  --paper: #EFEDE4;
  --blue: #78B0FF;
  --green: #93C36D;
  --lime: #C3F58F;
  --dim: #5f5e58;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background-color: var(--ink);
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 16px 16px;
  color: var(--paper);
  font-family: "VT323", "Courier New", monospace;
  font-size: 22px;
  line-height: 1.25;
  padding-top: 28px;
  padding-bottom: 36px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

header, main, footer { max-width: 1100px; margin: 0 auto; min-width: 0; }

header { text-align: center; padding-bottom: 4px; }
.logo { display: block; width: min(220px, 60%); height: auto; margin: 0 auto; }

.hero { padding: 26px 0 24px; text-align: center; }
.hero h1 {
  font-family: "Press Start 2P", monospace;
  font-weight: normal;
  font-size: clamp(16px, 4.2vw, 30px);
  line-height: 1.5;
  margin: 0 0 16px;
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--green); }
.hero p { margin: 0 auto; max-width: 60ch; font-size: 26px; color: #cfccc0; }

.dots {
  height: 12px; margin: 8px 0 26px;
  background-image: radial-gradient(var(--green) 2px, transparent 2.5px);
  background-size: 18px 12px;
  opacity: .7;
}

.grid { display: grid; grid-template-columns: 1fr; gap: 26px; }

/* Finestra retro */
.win {
  background: var(--paper);
  color: var(--ink);
  border: 3px solid;
  border-color: #fff var(--ink-deep) var(--ink-deep) #fff;
  box-shadow: 6px 6px 0 #000;
  min-width: 0;
}
.titlebar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--blue);
  border-bottom: 3px solid var(--ink-deep);
  padding: 8px 8px 8px 10px;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  color: var(--ink-deep);
  min-width: 0;
}
.titlebar .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.btns { display: flex; gap: 4px; flex: none; }
.btns span {
  width: 18px; height: 18px; display: grid; place-items: center;
  background: var(--paper); border: 2px solid var(--ink-deep);
  font-family: "Press Start 2P", monospace; font-size: 8px; line-height: 1;
}
.winbody { padding: 18px; min-width: 0; }
.winbody h2 {
  font-family: "Press Start 2P", monospace; font-weight: normal;
  font-size: 13px; line-height: 1.6; margin: 0 0 12px; color: var(--ink-deep);
}

/* Testo Chi siamo */
.board {
  white-space: pre-wrap; word-break: break-word;
  background: #fff; color: var(--ink-deep);
  border: 3px solid; border-color: var(--dim) #fff #fff var(--dim);
  padding: 14px; font-size: 24px;
}

/* Social in pixel */
.social {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px; padding: 8px 0;
}
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 18px 10px 14px;
  border: 3px solid var(--ink-deep);
  box-shadow: 4px 4px 0 var(--ink-deep);
  text-decoration: none; color: var(--ink-deep);
  font-family: "Press Start 2P", monospace; font-size: 10px; line-height: 1.4;
  min-width: 0;
}
.tile:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink-deep); }
.tile:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink-deep); }
.t-green { background: var(--green); }
.t-blue { background: var(--blue); }
.t-lime { background: var(--lime); }
.t-pink { background: #D62976 ;}
.ico svg { display: block; width: 84px; height: 84px; }

/* Footer: partner + icona, sulla stessa griglia pixel */
footer { margin-top: 44px; text-align: center; }
.partners-title {
  font-family: "Press Start 2P", monospace; font-size: 11px; line-height: 1.6;
  color: var(--green); margin: 0 0 16px;
}
/* I loghi restano su pannello bianco, senza modifiche, come richiesto dalle linee guida */
.logo-panel {
  background: #fff; color: var(--ink-deep);
  border: 3px solid var(--ink-deep); box-shadow: 6px 6px 0 #000;
  padding: 18px 18px 14px; margin: 0 auto; max-width: 960px;
}
.logo-panel img { display: block; width: 100%; height: auto; }
.strip-panel {
  background: #fff; color: var(--ink-deep);
  border: 3px solid var(--ink-deep); box-shadow: 6px 6px 0 #000;
  padding: 14px; margin: 0 auto 26px; max-width: 960px;
}
.strip-panel img { display: block; width: 100%; height: auto; }
.dicitura {
  margin: 14px 0 0; font-size: 20px; line-height: 1.25; color: var(--ink-deep);
  text-align: center;
}
/* Tre blocchi separati, stessa altezza: Netti a sinistra, blocco GO! al centro, Primavera a destra */
.trio {
  display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 3fr) minmax(120px, 1fr);
  gap: 18px; align-items: stretch; max-width: 960px; margin: 0 auto;
}
.trio .center-card { margin: 0; max-width: none; }
.side-card {
  background: #fff; border: 3px solid var(--ink-deep); box-shadow: 6px 6px 0 #000;
  padding: 12px; display: flex; align-items: center; justify-content: center; min-width: 0;
}
.side-card img { display: block; width: 100%; height: 100%; object-fit: contain; }

.footer-icon { display: block; width: 8%; height: auto; margin: 34px auto 0; }

/* =========================================
   MODIFICHE PER SMARTPHONE (Max 700px)
   ========================================= */
@media (max-width: 700px) {
  body {
    /* Testo base molto più grande per la lettura da mobile */
    font-size: 28px; 
    padding-left: 10px;
    padding-right: 10px;
  }

  /* Titolo principale (Press Start 2P è già largo, 20px è ottimo) */
  .hero h1 {
    font-size: 20px; 
    line-height: 1.4;
  }

  /* Paragrafo introduttivo */
  .hero p { 
    font-size: 30px; 
    line-height: 1.2;
  }

  /* Testo dentro il riquadro "La nostra storia" */
  .board { 
    font-size: 30px; 
    line-height: 1.3;
    padding: 16px 12px;
  }

  /* Titolo della finestra "La nostra storia" */
  .winbody h2 {
    font-size: 16px;
  }

  /* Titolo "I NOSTRI PARTNER" */
  .partners-title {
    font-size: 14px;
  }

  /* Mantiene la disposizione a 3 colonne per i partner, riducendo i loghi laterali */
  .trio { 
    grid-template-columns: minmax(70px, 1fr) minmax(0, 2.5fr) minmax(70px, 1fr); 
    gap: 8px; 
  }
  
  .side-card { 
    padding: 6px; 
  }
  
  .side-card img { 
    /* Loghi laterali (Netti e Primavera) più piccoli */
    max-height: 70px; 
    height: auto;
  }

  .logo-panel {
    padding: 8px;
  }

  .dicitura {
    font-size: 16px; 
    margin-top: 10px;
  }

  /* Tasti Social: forzati su 2 colonne per non stringere troppo il testo */
  .social {
    grid-template-columns: 1fr 1fr; 
    gap: 12px;
  }
  
  .tile {
    padding: 12px 8px;
    font-size: 12px; 
  }
  
  .ico svg {
    width: 64px;
    height: 64px;
  }
}
