/* estils.css - Estils comuns per a tots els nivells del joc d'icones */

body {
  font-family: Arial, sans-serif;
  background: #f0f0f0;
  padding: 2rem;
  text-align: center;
}

.bloquejada {
  opacity: 0.4;
  pointer-events: none;
  border-color: #aaa;
}

.boto {
  margin: 0.5rem;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  background: #4caf50;
  color: white;
  cursor: pointer;
}

.boto:hover {
  background: #388e3c;
}

.casella {
  display: inline-flex;
  width: 3rem;
  height: 3rem;
  font-size: 2rem;
  text-align: center;
  border: 2px dashed #aaa;
  border-radius: 6px;
  margin: 0.2rem;
  cursor: pointer;
  background: #fff;
  vertical-align: middle;
  align-items: center;
  justify-content: center;
}

.casella.seleccionada {
  border-color: #4caf50;
  background: #e8f5e9;
}

.entrada, .historial, .puntuacioFinal {
  margin-top: 1rem;
}

.entrada span {
  font-size: 2rem;
  margin: 0 0.3rem;
}

.icona {
  font-size: 2.5rem;
  cursor: pointer;
  width: 4rem;
  height: 4rem;
  padding: 0;
  background: white;
  border-radius: 10px;
  border: 2px solid #ccc;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icona:hover {
  background: #e0f7fa;
  border-color: #00bcd4;
}

.panell {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

#historial div {
  background: #fff;
  padding: 0.7rem;
  margin: 0.5rem auto;
  width: fit-content;
  border-radius: 10px;
  box-shadow: 1px 1px 4px rgba(0,0,0,0.1);
  font-size: 1.3rem;
}

#historial div span {
  font-size: 2rem;
  margin: 0 0.2rem;
}

#historial .guanyat {
  background: linear-gradient(135deg, #a5d6a7, #dcedc8) !important;
  font-weight: bold;
  animation: celebracio 0.5s ease-out;
  box-shadow: 0 0 15px 5px #66bb6a !important;
  transform: scale(1.02);
}

#puntsAcumulats {
  margin-top: 1rem;
  font-weight: bold;
}

@keyframes celebracio {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@media (max-width: 768px) {
  body {
    padding: 0.6rem;
    
  }

  /* Panell d'icones del nivell 1: 6 icones en una sola línia, sense scroll */
  #icones.panell {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0.2rem;
    margin-bottom: 1rem;
    width: 100%;
    max-width: 100%;
  }

  #icones .icona {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    min-width: 0;
    font-size: clamp(1.35rem, 4.8vw, 1.7rem);
    line-height: 1;
    border-radius: 8px;
  }

  .casella {
    width: 2.7rem;
    height: 2.7rem;
    font-size: 1.6rem;
  }

  .boto {
    font-size: 0.95rem;
    padding: 0.7rem 1rem;
  }

  h2 {
    font-size: 1rem;
    white-space: nowrap;
    text-align: center;
  }

  #historial div {
    font-size: 1rem;
    max-width: 95%;
    white-space: nowrap;
    overflow-x: auto;
  }

  #historial div span {
    font-size: 1.4rem;
  }
}