.SlidePuzzle {
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 100vh;
  padding: 32px 16px 48px;
  background: #efe9dd;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  line-height: 1.6;
  color: #1c1a17;
  -webkit-tap-highlight-color: transparent;
}
.SlidePuzzle * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.Builder {
  width: 100%;
  max-width: 420px;
  margin-bottom: 26px;
  padding: 20px;
  border: 1.5px solid #3a352d;
  background: #f6f2e8;
}

.Step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #d8cfbd;
}
.Step:last-of-type {
  border-bottom: none;
}
.Step-Number {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border: 1.5px solid #3a352d;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
}
.Step-Body {
  flex: 1;
}
.Step-Label {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
}
.Step-Hint {
  margin-bottom: 10px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 11.5px;
  color: #7a7468;
}

.Drop {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1.5px dashed #3a352d;
  background: #efe9dd;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.Drop[data-drag] {
  border-color: #c2491d;
  background: #ece4d3;
}
.Drop-Image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.Drop-Placeholder {
  padding: 18px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  color: #8a8276;
}
.Drop-Placeholder-Title {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: #1c1a17;
}

.Row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
}

.Segment {
  display: inline-flex;
  border: 1.5px solid #3a352d;
}
.Segment-Button {
  padding: 7px 13px;
  border: none;
  border-right: 1px solid #3a352d;
  background: transparent;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  color: #1c1a17;
  cursor: pointer;
}
.Segment-Button:last-child {
  border-right: none;
}
.Segment-Button[data-on] {
  background: #1c1a17;
  color: #efe9dd;
}

.Field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.Field-Label {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
}
.Field-Input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid #3a352d;
  background: #efe9dd;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  color: #1c1a17;
}

.Generate {
  width: 100%;
  margin-top: 18px;
  padding: 15px;
  border: none;
  background: #c2491d;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  transition: filter 0.15s, opacity 0.15s;
}
.Generate:hover {
  filter: brightness(1.08);
}
.Generate:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.Output {
  display: none;
  gap: 10px;
  margin-top: 12px;
}
.Output[data-show] {
  display: flex;
}
.Output-Button {
  flex: 1;
  padding: 11px;
  border: 1.5px solid #3a352d;
  background: transparent;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: #1c1a17;
  cursor: pointer;
}
.Output-Button:hover {
  background: #1c1a17;
  color: #efe9dd;
}

.Stage {
  width: 100%;
  max-width: 420px;
}
.Stage[data-hidden] {
  display: none;
}
.Stage-Head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  font-family: "Helvetica Neue", Arial, sans-serif;
}
.Stage-Title {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #6a6358;
}
.Stage-Moves {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.Stage-Moves-Value {
  font-size: 20px;
  color: #c2491d;
}
.Stage-Bar {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.Stage-Button {
  flex: 1;
  padding: 12px;
  border: 1.5px solid #3a352d;
  background: transparent;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #1c1a17;
  cursor: pointer;
}
.Stage-Button[data-variant=primary] {
  background: #1c1a17;
  color: #efe9dd;
}
.Stage-Button:hover {
  filter: brightness(0.95);
}

.Board {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1.5px solid #3a352d;
  background: #000;
  touch-action: none;
}
.Board-Tiles {
  position: absolute;
  inset: 0;
}
.Board-Tile {
  position: absolute;
  background-repeat: no-repeat;
  outline: 1px solid rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: left 0.14s ease, top 0.14s ease;
}
.Board-Tile-Number {
  position: absolute;
  left: 4px;
  top: 2px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}
.Board-Win {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(28, 26, 23, 0.78);
  font-family: "Helvetica Neue", Arial, sans-serif;
  text-align: center;
  color: #efe9dd;
}
.Board-Win-Title {
  margin-bottom: 6px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.Board-Win-Detail {
  font-size: 13px;
  opacity: 0.85;
}
.Board[data-numbers-off] .Board-Tile-Number {
  display: none;
}
.Board[data-solved] .Board-Tile {
  outline: none;
  cursor: default;
}
.Board[data-solved] .Board-Win {
  display: flex;
}

.Footer {
  margin-top: 30px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  text-align: center;
  color: #9a9384;
}