/* ===== 推箱子场景 ===== */
.sokoban-scene {
  background: linear-gradient(180deg, #1f2d3a 0%, #314755 45%, #4a6670 100%);
  padding: 24px;
  justify-content: flex-start;
}

.sokoban-topbar {
  width: 100%;
  max-width: 1180px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.sokoban-back-button,
.sokoban-restart-button {
  font-size: 14px;
  padding: 10px 18px;
  background: #f7d774;
}

.sokoban-top-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.sokoban-badge {
  min-width: 160px;
  padding: 10px 14px;
  border: 4px solid #000;
  background: #f6e7b0;
  color: #2b1d0e;
  box-shadow: 4px 4px 0 #000;
  font-size: 14px;
  line-height: 1.5;
}

.sokoban-title {
  font-size: 34px;
  color: #ffe08a;
  margin-bottom: 18px;
  text-shadow: 3px 3px 0 #000;
  letter-spacing: 4px;
}

.sokoban-content {
  width: 100%;
  max-width: 1180px;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  align-items: start;
}

.sokoban-board-panel,
.sokoban-side-panel {
  border: 4px solid #000;
  box-shadow: 6px 6px 0 #000;
}

.sokoban-board-panel {
  background: #d9c28a;
  padding: 18px;
}

.sokoban-subtitle {
  font-size: 22px;
  color: #5c3415;
  margin-bottom: 14px;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.18);
}

.sokoban-board-wrap {
  display: flex;
  justify-content: center;
}

.sokoban-board {
  display: grid;
  gap: 0;
  border: 4px solid #000;
  background: #2b2b2b;
  overflow: hidden;
}

.sokoban-tile {
  width: 56px;
  height: 56px;
  position: relative;
  border: 2px solid rgba(0, 0, 0, 0.25);
}

/* 地块 */
.tile-wall {
  background:
    linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.08) 75%, transparent 75%, transparent),
    #4f5d75;
  background-size: 16px 16px;
}

.tile-floor {
  background:
    linear-gradient(90deg, #b08b57 0 25%, #bc9660 25% 50%, #b08b57 50% 75%, #bc9660 75% 100%);
}

.tile-target {
  background:
    radial-gradient(circle at center, #ffd166 0 10px, transparent 10px),
    linear-gradient(90deg, #b08b57 0 25%, #bc9660 25% 50%, #b08b57 50% 75%, #bc9660 75% 100%);
}

/* 贡品箱 */
.crate {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 40px;
  height: 40px;
  background: #a05a2c;
  border: 4px solid #000;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.15);
}

.crate::before,
.crate::after {
  content: "";
  position: absolute;
  background: #e9c46a;
}

.crate::before {
  left: 14px;
  top: 0;
  width: 4px;
  height: 32px;
}

.crate::after {
  left: 0;
  top: 14px;
  width: 32px;
  height: 4px;
}

.crate.on-target {
  background: #c97a1f;
  box-shadow:
    inset -4px -4px 0 rgba(0, 0, 0, 0.15),
    0 0 0 3px #ffe066;
}

/* 角色 */
.player {
  position: absolute;
  left: 8px;
  top: 6px;
  width: 40px;
  height: 42px;
}

.player-head {
  position: absolute;
  left: 8px;
  top: 0;
  width: 20px;
  height: 18px;
  background: #ffd8a8;
  border: 4px solid #000;
}

.player-hat {
  position: absolute;
  left: 2px;
  top: -6px;
  width: 32px;
  height: 10px;
  background: #7b2cbf;
  border: 4px solid #000;
}

.player-body {
  position: absolute;
  left: 4px;
  top: 18px;
  width: 28px;
  height: 20px;
  background: #2a9d8f;
  border: 4px solid #000;
}

.player-leg-left,
.player-leg-right {
  position: absolute;
  top: 36px;
  width: 8px;
  height: 8px;
  background: #3d405b;
  border: 4px solid #000;
}

.player-leg-left {
  left: 6px;
}

.player-leg-right {
  right: 6px;
}

.sokoban-side-panel {
  background: #fff4d6;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sokoban-info-box,
.sokoban-message-box,
.sokoban-instruction-box {
  border: 4px solid #000;
  background: #fffdf6;
  padding: 14px;
  color: #53351b;
  line-height: 1.7;
}

.sokoban-message-box {
  min-height: 96px;
  background: #ffe08a;
  color: #4b2d00;
}

.sokoban-win {
  border: 4px solid #000;
  background: #d4f8c4;
  color: #204b22;
  padding: 16px;
  line-height: 1.8;
  font-size: 18px;
}

.move-tip {
  border: 4px solid #000;
  background: #f7ebc8;
  padding: 14px;
  color: #5c3c1c;
  line-height: 1.7;
}

@media (max-width: 960px) {
  .sokoban-content {
    grid-template-columns: 1fr;
  }

  .sokoban-topbar {
    align-items: stretch;
  }
}
