/* ===== 宫殿场景 ===== */
.palace-scene {
  background: linear-gradient(180deg, #3f0d12 0%, #6a1b1a 45%, #8c2f39 100%);
  padding: 24px;
  justify-content: flex-start;
}

.palace-topbar {
  width: 100%;
  max-width: 1100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

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

.palace-status {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

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

.palace-content {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  align-items: stretch;
}

.emperor-panel {
  border: 4px solid #000;
  background: #f4d9a6;
  box-shadow: 6px 6px 0 #000;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.emperor-stage {
  width: 100%;
  height: 420px;
  border: 4px solid #000;
  background: linear-gradient(180deg, #f6e8c3 0%, #e8b96b 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* 地面 */
.emperor-stage::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 72px;
  background:
    linear-gradient(90deg, #8a5a2b 0 25%, #9c6732 25% 50%, #8a5a2b 50% 75%, #9c6732 75% 100%);
  border-top: 4px solid #000;
}

.emperor-pixel {
  position: relative;
  width: 180px;
  height: 320px;
  margin-bottom: 48px;
}

/* 头 */
.emperor-head {
  position: absolute;
  top: 24px;
  left: 54px;
  width: 72px;
  height: 72px;
  background: #ffd8a8;
  border: 4px solid #000;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.12);
}

/* 帽子 */
.emperor-hat {
  position: absolute;
  top: 0;
  left: 38px;
  width: 104px;
  height: 34px;
  background: #2c2c54;
  border: 4px solid #000;
}

.emperor-hat::before,
.emperor-hat::after {
  content: "";
  position: absolute;
  top: 6px;
  width: 12px;
  height: 42px;
  background: #2c2c54;
  border: 4px solid #000;
}

.emperor-hat::before {
  left: -18px;
}

.emperor-hat::after {
  right: -18px;
}

/* 脸 */
.emperor-eye {
  position: absolute;
  top: 52px;
  width: 8px;
  height: 8px;
  background: #000;
}

.emperor-eye.left {
  left: 74px;
}

.emperor-eye.right {
  left: 102px;
}

.emperor-mouth {
  position: absolute;
  top: 74px;
  left: 82px;
  width: 18px;
  height: 8px;
  border-bottom: 4px solid #000;
}

/* 身体 */
.emperor-body {
  position: absolute;
  top: 98px;
  left: 34px;
  width: 112px;
  height: 140px;
  background: #e63946;
  border: 4px solid #000;
}

.emperor-body::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 42px;
  width: 20px;
  height: 92px;
  background: #f1c40f;
}

/* 袖子 */
.emperor-sleeve.left,
.emperor-sleeve.right {
  position: absolute;
  top: 110px;
  width: 34px;
  height: 90px;
  background: #e63946;
  border: 4px solid #000;
}

.emperor-sleeve.left {
  left: 4px;
}

.emperor-sleeve.right {
  right: 4px;
}

/* 腿 */
.emperor-leg.left,
.emperor-leg.right {
  position: absolute;
  top: 238px;
  width: 26px;
  height: 52px;
  background: #3d405b;
  border: 4px solid #000;
}

.emperor-leg.left {
  left: 56px;
}

.emperor-leg.right {
  left: 98px;
}

.emperor-nameplate {
  margin-top: 16px;
  padding: 10px 18px;
  border: 4px solid #000;
  background: #fff4c2;
  color: #5b2c06;
  font-size: 18px;
  box-shadow: 4px 4px 0 #000;
}

.dialog-panel {
  border: 4px solid #000;
  background: #fff6da;
  box-shadow: 6px 6px 0 #000;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dialog-title {
  font-size: 24px;
  color: #7a1f1f;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
}

.dialog-box {
  min-height: 180px;
  border: 4px solid #000;
  background: #fffdf4;
  padding: 18px;
  color: #3a2a18;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.08);
}

.dialog-speaker {
  font-size: 16px;
  color: #a33b2f;
  margin-bottom: 12px;
}

.dialog-text {
  font-size: 18px;
  line-height: 1.8;
  white-space: pre-line;
}

.reward-box {
  min-height: 64px;
  border: 4px solid #000;
  background: #ffe38a;
  color: #4b2d00;
  padding: 14px 16px;
  font-size: 18px;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.12);
}

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

.palace-action-button {
  font-size: 18px;
  padding: 14px 22px;
}

.palace-action-button[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
  background: #c8b98b;
  color: #4f4a3f;
}

.palace-hint {
  font-size: 14px;
  color: #75583c;
  line-height: 1.6;
}

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

  .palace-topbar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .palace-status {
    justify-content: center;
  }

  .map-title,
  .palace-title {
    text-align: center;
  }
}
