body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Nunito', 'Segoe UI', Arial, sans-serif;
  color: #e9f0ff;
  /* Sfumatura principale basata su #102450 */
  /* background: radial-gradient(120% 120% at 50% 30%, #17306a 0%, #102450 45%, #0c1a3a 75%, #08122a 100%); */
  background: #102450;
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;

}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* Vignettatura fredda e morbida */
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 65%, rgba(8, 14, 32, 0.55) 100%);
}

header {
  text-align: center;
  padding: 36px 0 8px 0;
  position: relative;
  z-index: 1;
}
header h1 {
  font-family: 'Nunito', 'Segoe UI', Arial, sans-serif;
  font-weight: 700;
  font-size: 4em;
  color: #e9f0ff;
  letter-spacing: 1px;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.5);
  margin-bottom: 0.2em;
}
header .subtitle {
  font-family: 'Nunito', 'Segoe UI', Arial, sans-serif;
  color: #cdd9ff;
  font-size: 1.1em;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.description {
  max-width: 900px;
  margin: 40px auto 0 auto;
  background: rgba(16, 28, 64, 0.6);
  border-radius: 16px;
  padding: 28px 38px 22px 38px;
  font-size: 1.13em;
  text-align: center;
  position: relative;
  z-index: 1;
  box-shadow:
    0 0 32px 8px rgba(10, 20, 60, 0.6),
    0 0 0 20px rgba(0,0,0,0.07) inset,
    0 0 80px 22px #0006 inset;
}
.description h2 {
  color: #d6e2ff;
  margin-bottom: 0.2em;
  letter-spacing: 1px;
}
.description p {
  color: #e9f0ff;
  margin-bottom: 1.2em;
}
.rules-btn, .start-btn {
  padding: 0.8em 1.8em;
  background: linear-gradient(135deg, #4d76ff 0%, #1e3a8a 100%);
  border: none;
  color: #e9f0ff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.05rem;
  box-shadow: 0 2px 8px #0007;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: background 0.18s, color 0.14s, transform 0.12s;
  margin: 0.5em 0.4em;
  display: inline-block;
}
.rules-btn:hover, .start-btn:hover {
  background: linear-gradient(135deg, #7aa0ff 0%, #3151b5 100%);
  color: #fff;
  transform: translateY(-1px);
}
.rules-box {
  display: none;
  margin: 0.7em auto 0 auto;
  background: rgba(37,30,18,0.97);
  border-left: 4px solid #e1b873;
  border-radius: 10px;
  padding: 1.2em;
  font-size: 1.03em;
  text-align: left;
  max-width: 600px;
  box-shadow: 0 2px 10px #2a1800;
  color: #ffeabf;
}

#landing-overlay {
  position: fixed;
  z-index: 9999;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  /* background: radial-gradient(120% 120% at 50% 30%, #17306a 0%, #102450 45%, #0c1a3a 75%, #08122a 100%); */
  background: #08122a;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
}

#unity-container {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #231a1000;
  margin: 0; padding: 0;
  box-shadow: none;
  border-radius: 0;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
}

#unity-canvas {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  margin: 0;
  background: radial-gradient(120% 120% at 50% 30%, #17306a 0%, #102450 45%, #0c1a3a 75%, #08122a 100%);
  border-radius: 0;
  box-shadow: none;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
}
#unity-loading-bar {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 2;
}
#unity-logo {
  width: 1024px;
  height: 1024px;
  background: url("LogoAnimato10FPS.gif") no-repeat center;
  background-size: 512px;
}
#unity-fullscreen-button {
  width: 16px;
  height: 16px;
  /* Icona sopra, gradiente sotto: l'icona resta visibile anche in hover */
  background-image: url('https://img.icons8.com/ios-filled/50/c9d7ff/full-screen.png'), linear-gradient(135deg, #4d76ff 0%, #1e3a8a 100%);
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-size: 60%, 100% 100%;
  border-radius: 50%;
  box-shadow: 0 2px 8px #000a;
  border: 3px solid #c9d7ff;
  cursor: pointer;
  margin: 0 auto;
  display: block;
  transition: filter 0.2s, transform 0.15s;
}
#unity-fullscreen-button:hover {
  background-image: url('https://img.icons8.com/ios-filled/50/c9d7ff/full-screen.png'), linear-gradient(135deg, #7aa0ff 0%, #3151b5 100%);
  filter: brightness(1.05);
  transform: scale(1.09);
}
#unity-footer {
  display: flex;
  justify-content:right;
  align-items: center;
  padding: 16px 0 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (max-width: 900px) {
  header h1 { font-size: 2em; }
  .description { padding: 16px 7vw; }
  .rules-box { padding: 0.7em 2vw; }
}
@media (max-width: 700px) {
  .description { font-size: 1em; }
  #unity-container, #unity-canvas {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
  }
}

#landing-overlay {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling su iOS */
}

/* Assicura che il contenuto possa essere scrollabile su mobile */
@media (max-width: 700px) {
  #landing-overlay {
    justify-content: flex-start;
    align-items: stretch;
    padding: 20px 15px;
  }
  
  .description {
    margin: 20px auto;
    max-height: none;
  }
  
  /* Forza lo scroll se il contenuto è più alto del viewport */
  body {
    overflow: hidden; /* Previene lo scroll della pagina quando l'overlay è attivo */
  }
}
