/* ===== game.css: 棋盘 / 方块 / 特效 ===== */

.game-page {
  width: 100%;
  max-width: 520px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 顶部栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.topbar .btn { padding: 8px 16px; font-size: 0.95rem; }

.stats {
  flex: 1;
  display: flex;
  gap: 8px;
  justify-content: center;
}
.stat {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  text-align: center;
  min-width: 70px;
  box-shadow: var(--shadow-card);
}
.stat .label { font-size: 0.7rem; color: var(--text-soft); }
.stat .value { font-size: 1.1rem; font-weight: 800; color: var(--pink-deep); }
.stat.target .value { color: var(--blue-deep); }
.stat.moves .value { color: var(--green); }

/* 棋盘容器 */
.board-wrap {
  position: relative;
  margin: 0 auto;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 2px 8px rgba(90, 58, 74, 0.1);
}
.board {
  position: relative;
  background-image: url("../assets/bg/background.jpg");
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* 方块 */
.tile {
  position: absolute;
  width: var(--cell);
  height: var(--cell);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 0.18s ease, top 0.18s ease, transform 0.18s ease;
  cursor: pointer;
}
.tile img {
  width: 92%;
  height: 92%;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.15));
}

/* 选中高亮 */
.tile.selected { z-index: 5; }
.tile.selected img {
  transform: scale(1.15);
  filter: drop-shadow(0 0 8px var(--yellow));
}

/* 提示道具高亮 */
.tile.hint-pulse img {
  animation: hintPulse 0.6s ease-in-out infinite;
}
@keyframes hintPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); }
  50% { transform: scale(1.2); filter: drop-shadow(0 0 10px var(--yellow)); }
}

/* 消除动画 */
.tile.clearing {
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform: scale(0) rotate(180deg);
  opacity: 0;
  z-index: 6;
}

/* 新生成方块弹入 */
.tile.spawn-in { animation: spawnIn 0.25s ease; }
@keyframes spawnIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* special=1 直线特效: 流光边 */
.tile.special-1::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 30%;
  border: 2px solid #fff;
  box-shadow: 0 0 8px 2px var(--yellow);
  animation: shine 1.2s linear infinite;
  pointer-events: none;
}
@keyframes shine {
  0% { box-shadow: 0 0 6px 1px var(--yellow); }
  50% { box-shadow: 0 0 14px 4px #fff; }
  100% { box-shadow: 0 0 6px 1px var(--yellow); }
}

/* special=2 爆炸: 光晕 */
.tile.special-2::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,150,80,0.7) 0%, rgba(255,150,80,0) 70%);
  animation: burstGlow 1s ease-in-out infinite;
  pointer-events: none;
}
@keyframes burstGlow {
  0%, 100% { transform: scale(0.8); opacity: 0.6; }
  50% { transform: scale(1.25); opacity: 1; }
}

/* special=3 彩虹万能 */
.tile.special-3 img {
  filter: hue-rotate(0deg) drop-shadow(0 0 6px #fff);
  animation: rainbowHue 2s linear infinite;
}
@keyframes rainbowHue {
  0% { filter: hue-rotate(0deg) drop-shadow(0 0 6px #fff); }
  100% { filter: hue-rotate(360deg) drop-shadow(0 0 6px #fff); }
}

/* 底部道具栏 */
.item-bar {
  display: flex;
  justify-content: space-around;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.item-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: none;
  background: #f6eef2;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: transform 0.1s;
}
.item-btn:hover { transform: translateY(-2px); }
.item-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.item-btn img { width: 34px; height: 34px; pointer-events: none; }
.item-btn .item-name { font-size: 0.8rem; font-weight: 700; }
.item-btn .item-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--pink-deep);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  padding: 0 5px;
}

/* 暂停遮罩 */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(60, 30, 50, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(3px);
}
.overlay-box {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 240px;
  animation: pop-in 0.3s ease;
}
