html {
  box-sizing: border-box;
  font-size: 16px;
}
*, *:before, *:after {
  box-sizing: inherit;
}
body {
  background: #e1f5fe;
  font-family: Arial, sans-serif;
  text-align: center;
  color: #222;
  margin: 0;
  min-height: 100vh;
  line-height: 1.5;
}

h1 {
  margin-top: 2rem;
  color: #01579b;
  font-size: clamp(2rem, 6vw, 3rem); /* más grande en mobile */
}

#game-container {
  margin: 1.5rem auto 1rem auto;
  width: 100%;
  max-width: 340px; /* se aumenta en móvil */
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 1.2em;
  justify-content: center;
  align-items: center;
  padding: 1em;
  border-radius: 1.2em;
  background: #ffffffdd;
  box-shadow: 0 2px 14px #bbbe;
  aspect-ratio: 1 / 1;
}

.color-btn {
  width: 100%;
  height: 100%;
  border-radius: 1.2em;
  box-shadow: 0 2px 8px #bbb;
  cursor: pointer;
  transition: filter 0.2s, border 0.2s;
  filter: brightness(0.85);
  border: 3px solid #fafafa;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
}
#green   { background: #43a047;}
#red     { background: #e53935;}
#yellow  { background: #fbc02d;}
#blue    { background: #1e88e5;}
.color-btn.active {
  filter: brightness(1.1);
  border: 3px solid #333;
}

#status {
  font-size: clamp(1.1em, 2.5vw, 1.3em);
  min-height: 2em;
  margin-bottom: 1em;
  color: #01579b;
}

#start-btn {
  background: #01579b;
  color: #fff;
  font-size: clamp(1.2em, 2.5vw, 1.5em);
  border: none;
  border-radius: 0.8em;
  padding: 0.7em 2.5em;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 2px 8px #01579b33;
  margin-bottom: 2em;
}

/* ==== Pantallas pequeñas/móviles ==== */
@media (max-width: 728px) {
  html {
    font-size: 20px;
  }
  h1 {
    margin-top: 6vw;
    font-size: clamp(2em, 9vw, 2.6em); /* mucho más grande */
    margin-bottom: 4vw;
  }
  #game-container {
    max-width: 92vw;        /* que el panel ocupe casi toda la pantalla */
    gap: 7vw;               /* separa más los botones */
    border-radius: 7vw;
    padding: 3vw;
    margin-top: 5vw;        /* menos espacio arriba */
    margin-bottom: 2vw;
  }
  .color-btn {
    border-radius: 7vw;
    box-shadow: 0 2px 12px #bbb;
    min-width: 0;
    min-height: 0;
  }
  #start-btn {
    font-size: clamp(1em, 7vw, 2em);
    padding: 1.2em 10vw;     /* botón grande, fácil de clicar */
    border-radius: 5vw;
    margin-bottom: 4vw;
  }
  #status {
    font-size: clamp(1em, 6vw, 1.7em);
    margin-bottom: 3vw;
  }
}

/* ==== Pantallas muy pequeñas ==== */
@media (max-width: 350px) {
  html { font-size: 17px; }
  #game-container {
    max-width: 96vw;
    gap: 6vw;
    padding: 2vw;
    border-radius: 9vw;
  }
  .color-btn {
    border-radius: 8vw;
  }
  #start-btn {
    padding: 1em 4vw;
    border-radius: 8vw;
    font-size: clamp(1em, 10vw, 1.5em);
  }
}