body {
  font-family: "Hachi Maru Pop", cursive;
  font-weight: 400;
  font-style: normal;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90vh;
  margin: 0;
  background-color: #fff6c7;
  padding: 10px;
  color: #5a3e2b;
}

.container {
  width: 95%;
  max-width: 400px;
  padding: 20px 15px;
  border-radius: 10px;
  background-color: #fffdf2;
  box-shadow: 0 10px 20px rgba(120, 82, 45, 0.12);
  text-align: center;
}

h1 {
  color: #5a3e2b;
  font-size: clamp(1.5em, 5vw, 1.8em);
  margin-bottom: 15px;
}



.score-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px 15px;

  border: 1px solid #f1dca8;
  border-radius: 10px;
  background-color: #fff9df;

  color: #5a3e2b;
}

#movesDisplay,
#bestScoreDisplay {
  font-size: 1.1em;
  font-weight: bold;
  color: #d97878;
  white-space: nowrap;
}

#message {
  font-size: 1.1em;
  font-weight: bold;
  color: #5a3e2b;
}



#puzzleBoard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: min(90vw, 400px);
  aspect-ratio: 1 / 1;
  margin: 20px auto;
}

.tile {
  width: 100%;
  height: 100%;
  background-size: 300% 300%;
  background-repeat: no-repeat;
  box-sizing: border-box;
  border: 2px solid #fffdf2;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

.tile.empty {
  background-image: none;
  background-color: #dcebd5;
  cursor: default;
}

.tile.correct {
  box-shadow: inset 0 0 0 3px #9acb9a;
}


#resetButton {
  padding: 10px 20px;
  font-size: 1.1em;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  background-color: #e88989;
  color: #fffdf2;

  border: none;
  border-radius: 25px;

  margin-top: 20px;

  box-shadow: 0 4px 8px rgba(120, 82, 45, 0.15);

  transition:
    background-color 0.2s ease,
    transform 0.15s ease;
}

#resetButton:hover {
  background-color: #d97878;
  transform: translateY(-1px);
}

#resetButton:active {
  transform: translateY(1px);
}



.reference-image {
  width: 95%;
  max-width: 400px;

  margin: 20px auto 0;

  border: 1px solid #f1dca8;
  border-radius: 12px;

  background-color: #fffdf2;

  box-shadow: 0 5px 10px rgba(120, 82, 45, 0.08);

  overflow: hidden;
  box-sizing: border-box;

  text-align: left;
}

.reference-image summary {
  padding: 12px 15px;

  cursor: pointer;

  font-size: 1em;
  font-weight: bold;
  color: #5a3e2b;
  background-color: #fff9df;

  list-style: none;
  box-sizing: border-box;
  transition: background-color 0.2s ease;
}



.reference-image summary::-webkit-details-marker {
  display: none;
}



.reference-image summary::before {
  content: "🍙";
  display: inline-block;
  margin-right: 8px;
  font-size: 0.8em;
  color: #e88989;

  transition: transform 0.2s ease;
}



.reference-image[open] summary::before {
  transform: rotate(90deg);
}

.reference-image summary:hover {
  background-color: #fff3c4;
}



.reference-image__content {
  padding: 10px;

  background-color: #fffdf2;

  box-sizing: border-box;
}

.reference-image__content img {
  display: block;

  width: 100%;
  max-width: 100%;
  height: auto;

  margin: 0 auto;

  border-radius: 7px;

  box-sizing: border-box;
}



@media (max-width: 480px) {

  body {
    padding: 8px;
  }

  .container {
    width: 95%;
    padding: 18px 12px;
  }

  .reference-image {
    width: 95%;
    margin-top: 15px;
  }

  .reference-image summary {
    padding: 10px 12px;
    font-size: 0.95em;
  }

  .reference-image__content {
    padding: 8px;
  }
}
