.puzzle-setup {
  width: min(960px, 100%);
}

.puzzle-progress-summary {
  margin: 0 0 1rem;
  color: #f0c26b;
  font-size: 0.82rem;
  font-weight: 700;
}

.puzzle-level-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.puzzle-level {
  display: flex;
}

.puzzle-level__button {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  gap: 0.25rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid #5a5140;
  border-radius: 12px;
  background: linear-gradient(160deg, #221e18, #191612);
  color: #efe6d5;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.puzzle-level__button:hover {
  border-color: #b98a3c;
  background: linear-gradient(160deg, #2e271d, #1d1913);
}

.puzzle-level__button:focus-visible {
  outline: 2px solid #f0c26b;
  outline-offset: 2px;
}

.puzzle-level__button--cleared {
  border-color: #b98a3c;
  background: linear-gradient(160deg, #35291a, #1d1913);
}

.puzzle-level__index {
  color: #cfc2ab;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.puzzle-level__name {
  color: #f7e7b8;
  font-size: 1rem;
  font-weight: 700;
}

.puzzle-level__meta {
  color: #e7dcc7;
  font-size: 0.78rem;
}

.puzzle-level__desc {
  color: #cfc2ab;
  font-size: 0.76rem;
  line-height: 1.5;
}

.puzzle-level__status {
  margin-top: 0.2rem;
  color: #cfc2ab;
  font-size: 0.76rem;
  font-weight: 700;
}

.puzzle-level__button--cleared .puzzle-level__status {
  color: #8fd18f;
}

.puzzle-goal {
  margin: 0;
  padding: 0.4rem 0.8rem;
  border-bottom: 1px solid #3c362c;
  background: #1a1712;
  color: #f0c26b;
  font-size: 0.78rem;
  line-height: 1.5;
}

.puzzle-hint {
  margin: 0;
  padding: 0.4rem 0.8rem;
  border-bottom: 1px solid #443d31;
  background: #241f17;
  color: #f0d9a8;
  font-size: 0.78rem;
  line-height: 1.5;
}

.puzzle-highlight {
  border-radius: 10px;
  outline: 3px solid #f0c26b;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(240, 194, 107, 0.28);
  animation: puzzle-highlight-pulse 1.6s ease-in-out infinite;
}

@keyframes puzzle-highlight-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(240, 194, 107, 0.18);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(240, 194, 107, 0.42);
  }
}

@media (prefers-reduced-motion: reduce) {
  .puzzle-highlight {
    animation: none;
  }

  .puzzle-level__button {
    transition: none;
  }
}

[data-motion="reduced"] .puzzle-highlight {
  animation: none;
}

[data-motion="reduced"] .puzzle-level__button {
  transition: none;
}

@media (max-height: 800px) {
  .puzzle-goal,
  .puzzle-hint {
    padding: 0.26rem 0.7rem;
    font-size: 0.74rem;
    line-height: 1.4;
  }

  .puzzle-hint {
    max-height: 3rem;
    overflow-y: auto;
  }
}

@media (max-height: 640px) {
  .puzzle-goal,
  .puzzle-hint {
    padding: 0.18rem 0.6rem;
    font-size: 0.7rem;
    line-height: 1.35;
  }
}

@media (max-height: 540px) {
  .puzzle-goal,
  .puzzle-hint {
    padding: 0.08rem 0.45rem;
    font-size: 0.64rem;
    line-height: 1.2;
  }
}
