@import url('https://fonts.googleapis.com/css2?family=Fredoka&display=swap');

body {
  font-family: 'Fredoka', sans-serif;
  background-image: url("https://cdn.shopify.com/s/files/1/0615/8522/7975/files/Pet_Pwr_Petsecor.png?v=1752680902");
  background-color: #fce8c9;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center 75%;
  background-attachment: fixed;
  color: #8a4d96;
  margin: 0;
  padding: 0;
  text-align: center;
  position: relative;
  z-index: 0;
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255,255,255,0.8);
  z-index: -1;
}

/* Sidebar/logo */
#sidebar {
  padding: 10px;
}

#logo {
  margin-top: 0;
  margin-bottom: -38px;
}

#logo img {
  width: 90px;
  height: auto;
  margin-bottom: 0;
}

/* Titolo */
h1 {
   text-align: center;
  font-size: 2.2em;
  font-weight: bold;
  color: #6d3685; /* viola scuro */
  margin-top: 40px; /* << Aggiungi o aumenta questo valore */
}

/* Contenuto principale */
#main {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px auto;
  padding: 0 10px;
  max-width: 100vw;
}

/* Wrapper esterno */
#gridWrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
}

/* Contenitore interno da scalare */
#gridScaler {
  transform-origin: top center;
  transform: scale(1);
}

/* Griglia */
#grid {
  display: grid;
  grid-template-columns: repeat(15, minmax(clamp(20px, 6vw, 32px), 1fr));
  gap: clamp(2px, 0.8vw, 5px);
  margin-top: 20px;
  padding: 20px 0;
  background: transparent;
  border-radius: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Celle */
.box {
  aspect-ratio: 1 / 1;
  width: 100%;
  font-size: clamp(12px, 3.5vw, 18px);
  background-color: transparent;
  border: none;
  color: #8a4d96;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  cursor: pointer;
}

.box.highlight {
  background-color: rgba(92, 58, 79, 0.4);
}

.box.found {
  background-color: #d1a7f3 !important;
  color: white !important;
}

/* Lista parole */
#listContainer {
  margin: 20px 0;
}

#list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 800px;
  margin: 0 auto;
}

#list li {
  font-size: 16px;
  color: #8a4d96;
}

#list li.found {
  text-decoration: line-through;
  color: #d1a7f3;
}

/* Pulsante restart */
#restart {
  margin-top: 20px;
  background-color: #d1a7f3;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-block;
  color: white;
  font-weight: bold;
  font-size: 16px;
  text-transform: uppercase;
}

/* 📱 Media query responsive: scala il contenitore interno */
@media (max-width: 1024px) {
  #gridScaler {
    transform: scale(0.95);
  }
}

@media (max-width: 768px) {
  #gridScaler {
    transform: scale(0.95);
  }
}

@media (max-width: 600px) {
  #gridScaler {
    transform: scale(0.95);
  }
}

@media (max-width: 400px) {
  #gridScaler {
    transform: scale(0.95);
  }
}
/* Sfondo sfocato dietro al popup */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(6px);
  background-color: rgba(255, 255, 255, 0.4);
  display: none;
  z-index: 9998;
}

/* Contenitore popup */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 360px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  padding: 30px 20px;
  z-index: 9999;
}

/* Testo popup */
.popup-text {
  font-size: 16px;
  color: #8a4d96;
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

.popup .code {
  font-weight: bold;
  font-size: 18px;
  display: inline-block;
  margin: 10px 0;
}

/* Bottone "chiudi" */
.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 20px;
  color: #999;
  cursor: pointer;
}
/* POPUP overlay */
.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(5px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Finestra */
.popup {
  background: white;
  border-radius: 16px;
  padding: 30px 20px;
  max-width: 90%;
  width: 340px;
  text-align: center;
  position: relative;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Testo */
.popup-text {
  color: #8a4d96;
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Codice sconto */
.popup-text .code {
  font-size: 18px;
  font-weight: bold;
  color: #8a4d96;
}

/* Bottone X */
.close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 20px;
  color: #8a4d96;
  cursor: pointer;
  font-weight: bold;
}

/* Bottone Vai allo shop */
#shopBtn {
  display: inline-block;
  margin-top: 10px;
  background-color: #d1a7f3;
  padding: 10px 20px;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  font-size: 16px;
  text-transform: uppercase;
  text-decoration: none;
}
