/* ============================================================
   GioiaGame — WebGL Template stylesheet
   ============================================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  background: #f5e6d3; /* papiro caldo */
  color: #2d2d2d;
  overflow: hidden;
}

/* ============================================================
   Splash screen brandizzato (visibile finché Unity carica)
   ============================================================ */
#gg-splash {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #f5e6d3 0%, #e8d4b8 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease-out;
  padding: 20px;
}

#gg-splash-logo {
  width: 180px;
  height: 180px;
  background: url('logo.png') center/contain no-repeat;
  margin-bottom: 24px;
  animation: gg-breathe 3s ease-in-out infinite;
}

@keyframes gg-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.05); opacity: 0.92; }
}

#gg-splash-title {
  font-size: 48px;
  font-weight: 700;
  color: #2c508c; /* blu navale logo */
  letter-spacing: -1px;
  margin-bottom: 8px;
}

#gg-splash-subtitle {
  font-size: 18px;
  color: #5a5a5a;
  margin-bottom: 36px;
  font-style: italic;
}

#gg-progress-track {
  width: 320px;
  max-width: 80vw;
  height: 6px;
  background: rgba(0,0,0,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 24px;
}

#gg-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #c44 0%, #2c508c 100%);
  border-radius: 3px;
  transition: width 0.2s ease-out;
}

#gg-splash-tip {
  font-size: 12px;
  color: #888;
  text-align: center;
  max-width: 400px;
}

/* ============================================================
   Unity canvas + footer
   ============================================================ */
#unity-container {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#unity-container.unity-mobile {
  position: fixed;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  transform: none;
}

#unity-canvas {
  background: #231F20;
  display: block;
}

#unity-container.unity-mobile #unity-canvas {
  width: 100%;
  height: 100%;
}

#unity-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: rgba(245,230,211,0.95);
  border-top: 1px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 13px;
  color: #5a5a5a;
  z-index: 100;
}

#unity-build-title {
  font-weight: 600;
  color: #2c508c;
}

/* Fullscreen button: SVG icon + text label, clearly clickable */
#unity-fullscreen-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #2c508c;
  background: rgba(44, 80, 140, 0.08);
  border: 1px solid rgba(44, 80, 140, 0.25);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

#unity-fullscreen-button svg { display: block; }

#unity-fullscreen-button:hover {
  background: rgba(44, 80, 140, 0.15);
  border-color: rgba(44, 80, 140, 0.5);
  transform: translateY(-1px);
}

#unity-fullscreen-button:active {
  transform: translateY(0);
}

#unity-warning {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  font-size: 14px;
}

/* Mobile: footer più compatto ma fullscreen sempre visibile (utile su mobile!) */
@media (max-width: 768px) {
  #unity-footer {
    height: 36px;
    padding: 0 10px;
    background: rgba(245,230,211,0.96);
  }
  #unity-fullscreen-button {
    padding: 4px 10px;
    font-size: 12px;
  }
  #unity-fullscreen-button span { display: none; }  /* solo icona su mobile per risparmio spazio */
  #unity-fullscreen-button svg { width: 22px; height: 22px; }
  #unity-build-title { font-size: 12px; }
  #gg-splash-logo { width: 140px; height: 140px; }
  #gg-splash-title { font-size: 36px; }
  #gg-splash-subtitle { font-size: 16px; }
}
