/* RESET E BASE */
body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: white;
  font-family: 'Inter', -apple-system, sans-serif;
}

#pixelCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
  background-color: white;
}

/* UI PRINCIPALE */
#ui {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.controls { 
  pointer-events: auto; 
  display: flex; 
  gap: 10px; 
  align-items: center;
}

button {
  background: #333;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: 0.2s;
}

button:hover { opacity: 0.9; transform: translateY(-1px); }

.stats {
  color: #333;
  background: rgba(255,255,255,0.8);
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 12px;
  border: 1px solid #ddd;
}

/* OVERLAY SFOCATO (SISTEMATO) */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* FINESTRA MODALE */
.modal {
  background: white;
  padding: 40px;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.1);
  text-align: center;
  width: 90%;
  max-width: 400px;
}

.modal h1 { margin-top: 0; font-size: 24px; color: #111; }
.modal p { color: #666; line-height: 1.6; }

.rules {
  list-style: none;
  padding: 0;
  margin: 25px 0;
  text-align: left;
}

.rules li {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  color: #333;
}

/* BOTTONI MODAL E LOGIN */
.modal button {
  background: #111;
  color: white;
  padding: 15px 30px;
  border-radius: 12px;
  width: 100%;
  margin-top: 10px;
}

.modal input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border-radius: 8px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

.btn-guest { background: #f1f1f1 !important; color: #333 !important; }
.btn-back { background: transparent !important; color: #999 !important; text-decoration: underline; font-size: 14px; }