.sta-puzzle {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 1.25rem;
  background: #ffffff;
  border: 1px solid #e7e7ee;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(26, 26, 44, 0.06);
}

.sta-puzzle-title {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  line-height: 1.2;
}

.sta-puzzle-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.sta-btn {
  border: 1px solid #cfd3e2;
  background: #f7f8fc;
  color: #2a3150;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.sta-btn:hover {
  background: #eef1fb;
}

.sta-puzzle-count {
  font-size: 0.95rem;
  color: #555e7a;
}

.sta-puzzle-stage {
  display: grid;
  gap: 1rem;
}

.sta-puzzle-board-wrap {
  overflow-x: auto;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.sta-puzzle-board {
  --sta-cols: 12;
  --sta-rows: 10;
  display: grid;
  grid-template-columns: repeat(var(--sta-cols), minmax(40px, 1fr));
  gap: 2px;
  width: min(100%, 900px);
  margin: 0 auto;
  background: #dfe4f2;
  padding: 6px;
  border-radius: 16px;
  aspect-ratio: 1.2 / 1;
}

.sta-piece {
  background-repeat: no-repeat;
  background-color: #ffffff;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  cursor: grab;
  min-height: 42px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.sta-piece:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 12px rgba(30, 40, 80, 0.12);
}

.sta-piece.is-dragging {
  opacity: 0.6;
}

.sta-piece.is-selected {
  outline: 3px solid rgba(77, 63, 114, 0.5);
  box-shadow: 0 0 0 3px rgba(77, 63, 114, 0.14);
}

.sta-piece.is-drop-target {
  outline: 3px solid rgba(99, 132, 255, 0.45);
}

.sta-piece.is-correct {
  outline: 2px solid rgba(120, 140, 220, 0.28);
}

.sta-puzzle-preview-wrap {
  text-align: center;
}

.sta-puzzle-preview {
  max-width: 320px;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid #d9deec;
  box-shadow: 0 10px 20px rgba(26, 26, 44, 0.08);
}

.sta-puzzle-status {
  margin-top: 1rem;
  font-size: 1rem;
  color: #434c68;
}

.sta-puzzle-error {
  padding: 1rem;
  background: #fff4f4;
  border: 1px solid #efc9c9;
  border-radius: 12px;
  color: #8a2b2b;
}

.sta-difficulty-group,
.sta-preview-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sta-difficulty-btn,
.sta-preview-btn {
  background: #ffffff;
}

.sta-difficulty-btn:hover,
.sta-preview-btn:hover {
  background: #f3f0fa;
}

.sta-difficulty-btn.is-active,
.sta-preview-btn.is-active {
  background: #4d3f72;
  border-color: #4d3f72;
  color: #ffffff;
}

.sta-control-label {
  font-size: 0.95rem;
  color: #555e7a;
  margin-right: 0.1rem;
}

.sta-puzzle-resume {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  background: #f6f4fb;
  border: 1px solid #ddd6ef;
  border-radius: 14px;
}

.sta-puzzle-resume-text {
  color: #3f3658;
  font-size: 0.95rem;
}

.sta-puzzle-resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .sta-puzzle {
    padding: 1rem;
  }

  .sta-puzzle-board {
    width: 100%;
  }

  .sta-piece {
    min-height: 28px;
  }

  .sta-puzzle-resume {
    align-items: flex-start;
  }

  .sta-puzzle-resume-actions {
    width: 100%;
  }
}
