* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f8f9fa;
  color: #1a1a1a;
  /* Centratura assoluta */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

main {
  width: 100%;
  max-width: 500px; /* Ridotto leggermente per compattezza */
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  text-align: center;
}

header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #888888;
}

#rgb-color {
  font-size: clamp(1.5rem, 8vw, 2.5rem);
  font-weight: 800;
  letter-spacing: 1px;
}

#game-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.balls-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
  max-width: 300px;
}

.ball {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.ball:hover {
  transform: scale(1.08);
}

#answer {
  font-size: 1rem;
  font-weight: 500;
  height: 1.2rem;
  margin-top: 10px;
}

button {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.8rem 1.8rem;
  border: none;
  border-radius: 12px;
  background-color: #1a1a1a;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover {
  background-color: #444444;
  transform: translateY(-1px);
}

.score-section {
  padding-top: 1.5rem;
  border-top: 1px solid #eeeeee;
}

#score-paragraph {
  font-size: 1.1rem;
  font-weight: 500;
  color: #888888;
}

#score {
  color: #1a1a1a;
  font-weight: 700;
}