/* ==========================================================================
   趣味迷你游戏：包裹分拣员 (Parcel Sorter) 样式
   草莓牛奶邮局互动专区
   ========================================================================== */

.section-game {
  padding: 80px 0;
  position: relative;
}

.game-station-container {
  background: var(--white);
  border: 3px solid var(--strawberry-pink);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(168, 72, 96, 0.12);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

/* 顶部告示标语 */
.game-disclaimer-banner {
  background: var(--cream-light);
  border: 1px dashed var(--cream-dark);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 0.82rem;
  color: var(--cream-dark);
  text-align: center;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* 仪表盘面板：时间、得分、漏件、连击、最高分 */
.game-dashboard {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.dashboard-stat-card {
  background: var(--bg-milky);
  border: 1.5px solid var(--stamp-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  text-align: center;
  transition: var(--transition);
}

.dashboard-stat-card .stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.dashboard-stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--strawberry-dark);
  line-height: 1.1;
}

.dashboard-stat-card.stat-score .stat-value {
  color: var(--strawberry-deep);
}

.dashboard-stat-card.stat-time .stat-value {
  color: #D35400;
}

.dashboard-stat-card.stat-missed .stat-value {
  color: #C0392B;
}

.dashboard-stat-card.stat-high .stat-value {
  color: #8E44AD;
}

/* 控制按钮组 */
.game-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.game-btn-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 20px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.game-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.game-btn-start {
  background: var(--strawberry-deep);
  color: var(--white);
  border-color: var(--strawberry-dark);
  box-shadow: 0 4px 12px rgba(168, 72, 96, 0.25);
}

.game-btn-start:hover:not(:disabled) {
  background: var(--strawberry-dark);
  transform: translateY(-2px);
}

.game-btn-pause {
  background: var(--cream-yellow);
  color: var(--cream-dark);
  border-color: var(--cream-dark);
}

.game-btn-pause:hover:not(:disabled) {
  background: #EED798;
}

.game-btn-restart {
  background: var(--lavender-light);
  color: var(--lavender-dark);
  border-color: var(--lavender);
}

.game-btn-restart:hover:not(:disabled) {
  background: var(--lavender);
}

.game-instructions-tip {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 传送带主舞台 */
.conveyor-belt-stage {
  position: relative;
  height: 170px;
  background: #F8F1F3;
  border: 2px dashed var(--strawberry-pink);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* 传送带履带装饰线 */
.conveyor-tracks {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  height: 18px;
  background: repeating-linear-gradient(
    90deg,
    #E4D0D6 0px,
    #E4D0D6 16px,
    #D0B5BD 16px,
    #D0B5BD 24px
  );
  border-top: 2px solid #C0A4AD;
  border-bottom: 2px solid #C0A4AD;
}

/* 传送带运动动画 */
.conveyor-belt-stage.running .conveyor-tracks {
  animation: beltMove 1.2s linear infinite;
}

@keyframes beltMove {
  0% { background-position: 0 0; }
  100% { background-position: 48px 0; }
}

/* 传送带空闲覆盖层 */
.conveyor-idle-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 243, 245, 0.88);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  gap: 12px;
}

.conveyor-idle-overlay.hidden {
  display: none;
}

.idle-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--strawberry-dark);
}

.idle-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 480px;
  text-align: center;
}

/* 包裹实体样式 */
.parcel-item {
  position: absolute;
  top: 24px;
  width: 90px;
  height: 104px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px;
  cursor: grab;
  user-select: none;
  box-shadow: 0 6px 14px rgba(81, 67, 78, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 10;
  box-sizing: border-box;
}

.parcel-item:active {
  cursor: grabbing;
}

/* 选中包裹时的高亮光晕 */
.parcel-item.selected {
  outline: 3px solid var(--strawberry-dark);
  box-shadow: 0 0 16px rgba(168, 72, 96, 0.5);
  transform: translateY(-8px) scale(1.08) !important;
  z-index: 15;
}

/* 4 种类型包裹定制视觉（双重辨识：图标+背景色+边框纹理+文字） */
.parcel-type-star {
  background: linear-gradient(145deg, #FFF9E6 0%, #FCE8A2 100%);
  border: 2px dashed #B8860B;
  color: #7D5700;
}

.parcel-type-moon {
  background: linear-gradient(145deg, #F5F0FC 0%, #DED3EE 100%);
  border: 2px dashed #6C548F;
  color: #4A3366;
}

.parcel-type-flower {
  background: linear-gradient(145deg, #FFF0F4 0%, #F9C8D4 100%);
  border: 2px dashed #C55D77;
  color: #8C2E48;
}

.parcel-type-cloud {
  background: linear-gradient(145deg, #F0F8FF 0%, #CFE2FE 100%);
  border: 2px dashed #3D73B8;
  color: #1A4980;
}

.parcel-icon-svg {
  width: 38px;
  height: 38px;
  margin-top: 2px;
}

.parcel-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
}

.parcel-stamp-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  background: rgba(255, 255, 255, 0.8);
  padding: 1px 4px;
  border-radius: 2px;
}

/* 四个投递箱 (Drop Bins) */
.drop-bins-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.drop-bin-box {
  background: var(--bg-milky);
  border: 3px dashed var(--stamp-border);
  border-radius: var(--radius-md);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 130px;
}

.drop-bin-box:hover {
  transform: translateY(-4px);
  background: var(--white);
  box-shadow: var(--shadow-hover);
}

.drop-bin-box.drag-over {
  border-color: var(--strawberry-deep);
  background: var(--strawberry-light);
  transform: scale(1.04);
}

.bin-type-star {
  border-color: #E6C875;
}
.bin-type-star:hover {
  border-color: #B8860B;
  background: #FFFBF0;
}

.bin-type-moon {
  border-color: #C3B4DE;
}
.bin-type-moon:hover {
  border-color: #6C548F;
  background: #FAF8FE;
}

.bin-type-flower {
  border-color: #F1BDCB;
}
.bin-type-flower:hover {
  border-color: #C55D77;
  background: #FFF5F7;
}

.bin-type-cloud {
  border-color: #ADC8EA;
}
.bin-type-cloud:hover {
  border-color: #3D73B8;
  background: #F4F8FD;
}

.bin-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 8px;
}

.bin-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--strawberry-dark);
  margin-bottom: 2px;
}

.bin-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.bin-slot-indicator {
  position: absolute;
  bottom: 6px;
  width: 60%;
  height: 4px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 2px;
}

/* 飘字与连击动效 */
.feedback-floating-text {
  position: absolute;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.4rem;
  pointer-events: none;
  animation: floatUpFade 0.9s ease forwards;
  z-index: 50;
}

.feedback-floating-text.plus {
  color: #27AE60;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.feedback-floating-text.minus {
  color: #C0392B;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.feedback-floating-text.combo {
  color: #D35400;
  font-size: 1.6rem;
  text-shadow: 0 2px 8px rgba(211, 84, 0, 0.3);
}

@keyframes floatUpFade {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) scale(1.2);
  }
}

/* 游戏结束结算模态框 */
.game-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(81, 67, 78, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.game-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.game-modal-card {
  background: var(--white);
  border: 3px solid var(--strawberry-pink);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  text-align: center;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.game-modal-backdrop.open .game-modal-card {
  transform: translateY(0);
}

.game-modal-seal {
  width: 80px;
  height: 80px;
  margin: -60px auto 16px;
  background: var(--cream-yellow);
  border: 3px solid var(--cream-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.game-modal-seal svg {
  width: 42px;
  height: 42px;
  fill: var(--cream-dark);
}

.modal-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--strawberry-dark);
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.modal-stat-box {
  background: var(--bg-milky);
  border: 1px dashed var(--stamp-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.modal-stat-box .v {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--strawberry-deep);
}

.modal-stat-box .l {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.modal-btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* 响应式调整 */
@media (max-width: 900px) {
  .game-dashboard {
    grid-template-columns: repeat(3, 1fr);
  }
  .drop-bins-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .game-station-container {
    padding: 20px 14px;
  }
  .game-dashboard {
    grid-template-columns: repeat(2, 1fr);
  }
  .game-controls-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .game-btn-group {
    justify-content: center;
  }
  .drop-bins-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .drop-bin-box {
    min-height: 110px;
    padding: 12px 8px;
  }
  .bin-icon {
    width: 32px;
    height: 32px;
  }
  .bin-title {
    font-size: 0.95rem;
  }
}
