/* ===================================================
   Oyun Tahtası, Piyonlar ve İsim Rozetleri Stilleri
   =================================================== */

.board-viewport {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1400px;
}

#board-container {
  position: relative;
  width: 100%;
  aspect-ratio: 2500 / 1668;
  background: #110524;
  border-radius: 24px;
  overflow: visible;
  user-select: none;
  transform-origin: center center;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.2, 0.85, 0.3, 1.15), box-shadow 0.6s ease;
}

#board-image {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  object-fit: contain;
  display: block;
}

/* 3D Tahta Kenar Kalınlığı ve Masif Gölge Efekti */
.board-3d-active #board-container {
  transform: rotateX(20deg) scale(0.96);
  box-shadow: 
    0 2px 0 #3E1663,
    0 5px 0 #31114E,
    0 9px 0 #250C3D,
    0 14px 0 #1A082B,
    0 20px 0 #10041B,
    0 30px 45px rgba(0, 0, 0, 0.85),
    0 0 40px rgba(255, 193, 7, 0.3);
}

.board-2d-active #board-container {
  transform: rotateX(0deg) scale(1);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
}

/* Kare Çapa / Efekt Katmanı */
#tiles-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform-style: preserve-3d;
}

.tile-anchor {
  position: absolute;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  transition: all 0.3s ease;
}

/* Aktif Kare Parlaması */
.tile-anchor.highlighted {
  border: 3px solid #FFE600;
  box-shadow: 0 0 25px #FFE600, inset 0 0 15px #FFE600;
  animation: tileGlowPulse 1.4s infinite alternate;
}

@keyframes tileGlowPulse {
  0% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

/* ===================================================
   Gerçek 3 Boyutlu Dik Duran Piyonlar (3D Figurines)
   =================================================== */

.pawn-token {
  position: absolute;
  transform-origin: 50% 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 100;
  transition: left 0.38s cubic-bezier(0.34, 1.56, 0.64, 1), top 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
  pointer-events: auto;
  cursor: pointer;
}

/* 3D Görünümde tahta rotateX(20deg) açıyla eğilince, piyon rotateX(-20deg) ters eğilerek tam dik (90 derece) ayakta durur! */
.board-3d-active #board-container .pawn-token {
  transform: translate(-50%, -90%) rotateX(-20deg);
}

.board-2d-active #board-container .pawn-token {
  transform: translate(-50%, -90%) rotateX(0deg);
}

/* Aktif Tur Piyonunun Altındaki 3D Işık Haresi (Beacon Spotlight) */
.pawn-token.active-turn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 52px;
  height: 20px;
  transform: translate(-50%, 40%);
  border-radius: 50%;
  border: 2px solid #FFE600;
  box-shadow: 0 0 16px #FFE600, inset 0 0 10px #FFE600;
  animation: activePawnBeacon 1.2s infinite alternate ease-in-out;
  pointer-events: none;
  z-index: 1;
}

@keyframes activePawnBeacon {
  0% { transform: translate(-50%, 40%) scale(0.85); opacity: 0.45; }
  100% { transform: translate(-50%, 40%) scale(1.25); opacity: 1; }
}

/* Kompakt Takım Amblemi (Rozet) */
.pawn-team-crest {
  font-family: 'Fredoka', 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 900;
  color: #FFFFFF;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1.5px solid #FFFFFF;
  margin-bottom: 2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.5px;
  white-space: nowrap;
  pointer-events: none;
  transform: translateZ(22px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
}

/* 3D Piyon Modeli */
.pawn-3d-model {
  position: relative;
  width: 32px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-style: preserve-3d;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.7));
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pawn-token:hover .pawn-3d-model {
  transform: scale(1.18) translateY(-6px);
}

/* 1. Küre Başlık */
.pawn-sphere-head {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  position: relative;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  z-index: 6;
  transform: translateZ(16px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

.pawn-head-shine {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 6px;
  height: 6px;
  background: #FFFFFF;
  border-radius: 50%;
  filter: blur(0.4px);
}

/* 2. Altın / Metalik Boyun Halkası */
.pawn-gold-collar {
  width: 14px;
  height: 5px;
  background: linear-gradient(90deg, #FFE600, #FFF59D, #B78103);
  border-radius: 4px;
  margin-top: -2px;
  z-index: 5;
  border: 0.5px solid #FFFFFF;
  transform: translateZ(12px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* 3. Konik Gövde (3D Işık Gölgelendirmeli) */
.pawn-torso {
  width: 18px;
  height: 20px;
  clip-path: polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%);
  margin-top: -2px;
  border-radius: 2px;
  z-index: 3;
  transform: translateZ(7px);
  border-left: 1px solid rgba(255, 255, 255, 0.5);
  border-right: 1px solid rgba(0, 0, 0, 0.3);
}

/* 4. Masif Kaide / Taban (Pedestal) */
.pawn-pedestal {
  width: 32px;
  height: 12px;
  border-radius: 50%;
  margin-top: -3px;
  border: 2px solid;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8), inset 0 2px 4px rgba(255, 255, 255, 0.5);
  z-index: 2;
  transform: translateZ(3px);
}

/* Zemin Temas Gölgesi (Tahtanın Yüzeyine Çakılı Düz Gölge) */
.pawn-ground-shadow {
  width: 38px;
  height: 13px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 55%, rgba(0, 0, 0, 0) 75%);
  border-radius: 50%;
  margin-top: -6px;
  transform: translateZ(0);
  transition: transform 0.38s ease, opacity 0.38s ease;
  pointer-events: none;
}

.pawn-token.hopping .pawn-ground-shadow {
  transform: scale(0.35);
  opacity: 0.15;
}
