/**
 * 棋盘专属样式与棋子动效 (Board & Pawns Styling)
 */

.board-grid-wrapper {
  display: grid;
  grid-template-columns: repeat(8, minmax(75px, 1fr));
  grid-template-rows: repeat(5, minmax(75px, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 10px;
  background: #FFFDF9;
  border-radius: 20px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* 地块基础样式 */
.board-tile {
  position: relative;
  background: #FFF;
  border-radius: 14px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border: 2px solid #E2E8F0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.03);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  min-height: 80px;
}

.board-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

/* 地块角落序号角标 */
.tile-id-badge {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 9px;
  color: #94A3B8;
  font-weight: 700;
}

/* 地块图标 */
.tile-icon {
  font-size: 24px;
  margin-top: 4px;
  transition: transform 0.2s;
}

.board-tile:hover .tile-icon {
  transform: scale(1.15);
}

/* 地块名称 */
.tile-name {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* 地块各类型专属风格 */
.type-start {
  background: linear-gradient(135deg, #FFF0F5, #FFE3EC);
  border-color: #FF70A6;
}
.type-coin_plus {
  background: linear-gradient(135deg, #F0F9FF, #E0F2FE);
  border-color: #38BDF8;
}
.type-coin_minus {
  background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
  border-color: #FB923C;
}
.type-card {
  background: linear-gradient(135deg, #FAF5FF, #F3E8FF);
  border-color: #C084FC;
}
.type-minigame {
  background: linear-gradient(135deg, #F0FDF4, #DCFCE7);
  border-color: #4ADE80;
}
.type-trap {
  background: linear-gradient(135deg, #FEF2F2, #FEE2E2);
  border-color: #F87171;
}
.type-shop {
  background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
  border-color: #FBBF24;
}
.type-branch {
  background: linear-gradient(135deg, #FFFBEB, #FDE68A);
  border-color: #F59E0B;
}
.type-warp {
  background: linear-gradient(135deg, #F5F3FF, #EDE9FE);
  border-color: #8B5CF6;
}
.type-duel {
  background: linear-gradient(135deg, #FFF1F2, #FFE4E6);
  border-color: #FB7185;
}

/* 激活的星愿祭坛：豪华高光与呼吸光晕 */
.board-tile.star-active {
  background: radial-gradient(circle, #FFFBEB 20%, #FEF08A 100%) !important;
  border: 3px solid #EAB308 !important;
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.8) !important;
  animation: starPulsate 1.6s infinite ease-in-out;
  z-index: 5;
}

@keyframes starPulsate {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(234, 179, 8, 0.4); }
  50% { transform: scale(1.06); box-shadow: 0 0 24px rgba(234, 179, 8, 0.8); }
  100% { transform: scale(1); box-shadow: 0 0 10px rgba(234, 179, 8, 0.4); }
}

/* 玩家棋子停靠区 (Tile Dock) */
.tile-players-dock {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  width: 100%;
  min-height: 24px;
  position: relative;
}

/* 棋子外观与动画 */
.player-pawn {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  border: 2px solid #FFF;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: pawnBob 1.8s infinite ease-in-out;
}

.pawn-emoji {
  font-size: 15px;
}

.shield-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 11px;
}

@keyframes pawnBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* 玩家头顶拟人化思考气泡 (Speech Bubble) */
.bubble-speech {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: #FFF;
  color: #1E293B;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1.5px solid #FFCCD5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
}

.bubble-speech.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

.bubble-speech::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 5px 0;
  border-style: solid;
  border-color: #FFF transparent;
  display: block;
  width: 0;
}
