/* ===========================
   Snake & Ladder — styles.css
   =========================== */

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: url("../images/dice-bg.jpg") no-repeat center center;
  background-size: cover;
  position: relative;
}

body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 0;
}

/* ===== Dice face transforms ===== */
.front  { transform: rotateY(0deg)    translateZ(40px); }
.back   { transform: rotateY(180deg)  translateZ(40px); }
.right  { transform: rotateY(90deg)   translateZ(40px); }
.left   { transform: rotateY(-90deg)  translateZ(40px); }
.top    { transform: rotateX(90deg)   translateZ(40px); }
.bottom { transform: rotateX(-90deg)  translateZ(40px); }

/* ===== Layout ===== */
.wrapper {
  width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* ===== Board ===== */
#board {
  position: relative;
  width: 700px;
  height: 700px;
  background: url("../images/board.png") no-repeat center;
  background-size: contain;
  border-radius: 25px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

/* ===== Player tokens ===== */
.player {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  position: absolute;
  transition: 0.25s linear;
  border: 3px solid white;
}

#p1 { background: #ff6b6b; }
#p2 { background: #4ecdc4; }
#p3 { background: #ffe66d; }
#p4 { background: #c77dff; }

/* ===== Side panel ===== */
.panel {
  width: 350px;
  padding: 30px;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(18px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
  color: white;
}

.panel h2 {
  text-align: center;
  margin-bottom: 20px;
}

select {
  width: 100%;
  height: 34px;
  border-radius: 14px;
  border: none;
  margin-bottom: 12px;
}

input {
  width: 100%;
  height: 24px;
  border-radius: 10px;
  border: none;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  box-sizing: border-box;
  padding: 0 8px;
}

#name1 { background: #ff6b6b; }
#name2 { background: #4ecdc4; }
#name3 { background: #ffe66d; color: #333; }
#name4 { background: #c77dff; }

button {
  width: 100%;
  padding: 10px;
  border-radius: 16px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  background: #00f5d4;
}

#turn {
  text-align: center;
  margin: 15px 0;
  font-weight: 600;
}

/* ===== 3D Dice ===== */
.dice-container {
  width: 80px;
  height: 80px;
  margin: 25px auto;
  perspective: 800px;
}

.dice {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s ease;
}

.face {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 18px;
  background: #fff;
}

/* ===== Dice dots ===== */
.dot {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #222;
  border-radius: 50%;
}

.tl     { top: 12px;  left: 12px; }
.tr     { top: 12px;  right: 12px; }
.ml     { top: 50%;   left: 12px;  transform: translateY(-50%); }
.mr     { top: 50%;   right: 12px; transform: translateY(-50%); }
.bl     { bottom: 12px; left: 12px; }
.br     { bottom: 12px; right: 12px; }
.center { top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* ===== Winner popup ===== */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 9999;
}

.popup.show {
  visibility: visible;
  opacity: 1;
}

.popup-content {
  background: white;
  padding: 35px;
  border-radius: 20px;
  text-align: center;
}

/* ===== Active turn blink ===== */
@keyframes blinkField {
  0%   { box-shadow: 0 0 0  rgba(255, 255, 255, 0); }
  50%  { box-shadow: 0 0 15px rgba(255, 255, 255, 0.9); }
  100% { box-shadow: 0 0 0  rgba(255, 255, 255, 0); }
}

.active-turn {
  animation: blinkField 1s infinite;
}
