/* =========================
   3D Dice Styles para dados individuais no pool
========================= */

.pool-dice-3d {
  position: relative;
  width: 100px;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(26, 26, 46, 0.6);
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-radius: 16px;
  padding: 0.5rem 0.5rem 0.5rem 0.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pool-dice-3d:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

/* Estado selecionado */
.pool-dice-3d.selected {
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
  background: rgba(42, 42, 66, 0.8);
}

/* Dado 3D */
.dice-3d {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 0.25rem auto;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.42, 1.57, 0.62, 0.86);
}

/* Faces do dado 3D em miniatura */
.dice-face-3d {
  box-sizing: border-box;
  position: absolute;
  width: 80px;
  height: 80px;
  background-color: #2a2a42;
  border: 2px solid #d4af37;
  border-radius: 16px;
  transform-style: preserve-3d;
}

.dice-face-3d::before {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  background-color: #1a1a2e;
  border-radius: 16px;
  transform: translateZ(-1px);
}

.dice-face-3d::after {
  position: absolute;
  content: "";
  width: 12px;
  height: 12px;
  top: 50%;
  left: 50%;
  margin: -6px 0 0 -6px;
  background-color: #000000;
  border-radius: 100%;
  transform: translateZ(1px);
}

/* Posicionamento das faces */
.dice-face-3d.front {
  transform: translateZ(40px);
}

.dice-face-3d.front::after {
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  background-color: #000000;
}

.dice-face-3d.up {
  transform: rotateX(90deg) translateZ(40px);
}

.dice-face-3d.up::after {
  margin: -18px 0 0 -18px;
  box-shadow: 24px 24px #000000;
}

.dice-face-3d.left {
  transform: rotateY(-90deg) translateZ(40px);
}

.dice-face-3d.left::after {
  margin: -24px 0 0 -24px;
  box-shadow: 18px 18px #000000, 36px 36px #000000;
}

.dice-face-3d.right {
  transform: rotateY(90deg) translateZ(40px);
}

.dice-face-3d.right::after {
  margin: -18px 0 0 -18px;
  background-color: #000000;
  box-shadow: 24px 0px #000000, 0px 24px #000000, 24px 24px #000000;
}

.dice-face-3d.bottom {
  transform: rotateX(-90deg) translateZ(40px);
}

.dice-face-3d.bottom::after {
  margin: -21px 0 0 -21px;
  box-shadow: 16px 16px #000000, 32px 32px #000000, 32px 0px #000000, 0px 32px #000000;
}

.dice-face-3d.back {
  transform: rotateX(180deg) translateZ(40px);
}

.dice-face-3d.back::after {
  margin: -24px 0 0 -18px;
  box-shadow: 24px 0px #000000, 0px 18px #000000, 24px 18px #000000, 0px 36px #000000, 24px 36px #000000;
}

/* Informações do dado */
.dice-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem; /* Aumentado para dar espaço */
  transition: opacity 0.2s ease;
  position: relative;
  z-index: 10;
}

.dice-sides {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: bold;
  font-family: 'Cinzel', serif;
}

.dice-value-badge {
  background: var(--gold);
  color: #1a1a1a;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  border: 2px solid var(--surface);
}


/* =========================
   D3 Specific Styles
========================= */

.dice-3d.d3 .dice-face-3d::after {
  all: initial;
  position: absolute;
  content: "";
  width: 14px;
  height: 14px;
  top: 50%;
  left: 50%;
  margin: -6px 0 0 -6px;
  background-color: #000000;
  border-radius: 100%;
  transform: translateZ(1px);
  box-shadow: none !important;
}

.dice-3d.d3 .dice-face-3d.front::after,
.dice-3d.d3 .dice-face-3d.up::after {
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  background-color: #000000;
  box-shadow: none !important;
}

.dice-3d.d3 .dice-face-3d.left::after,
.dice-3d.d3 .dice-face-3d.right::after {
  width: 16px;
  height: 16px;
  margin: -18px 0 0 -18px;
  background-color: #000000;
  box-shadow: 24px 24px #000000 !important;
}

.dice-3d.d3 .dice-face-3d.bottom::after,
.dice-3d.d3 .dice-face-3d.back::after {
  width: 14px;
  height: 14px;
  margin: -24px 0 0 -24px;
  background-color: #000000;
  box-shadow: 18px 18px #000000, 36px 36px #000000 !important;
}

.dice-3d.d3 .dice-face-3d::before {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  background-color: #1a1a2e;
  border-radius: 16px;
  transform: translateZ(-1px);
}

/* Responsivo para D3 */
@media (max-width: 400px) {
  .dice-3d.d3 .dice-face-3d::after {
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
  }
  
  .dice-3d.d3 .dice-face-3d.front::after,
  .dice-3d.d3 .dice-face-3d.up::after {
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
  }
  
  .dice-3d.d3 .dice-face-3d.left::after,
  .dice-3d.d3 .dice-face-3d.right::after {
    margin: -14px 0 0 -14px;
    box-shadow: 18px 18px #000000 !important;
  }
  
  .dice-3d.d3 .dice-face-3d.bottom::after,
  .dice-3d.d3 .dice-face-3d.back::after {
    margin: -14px 3 0 -14px;
    box-shadow: 14px 14px #000000, 28px 28px #000000 !important;
  }
}

/* =========================
   D2 Specific Styles
========================= */

.dice-3d.d2 .dice-face-3d::after {
  all: initial;
  position: absolute;
  content: "";
  width: 14px;
  height: 14px;
  top: 50%;
  left: 50%;
  margin: -6px 0 0 -6px;
  background-color: #000000;
  border-radius: 100%;
  transform: translateZ(1px);
  box-shadow: none !important;
}

/* Faces 1, 2, 3 (valor 1) - UM círculo central */
.dice-3d.d2 .dice-face-3d.front::after,
.dice-3d.d2 .dice-face-3d.up::after,
.dice-3d.d2 .dice-face-3d.left::after {
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  background-color: #000000;
  box-shadow: none !important;
}

/* Faces 4, 5, 6 (valor 2) - DOIS círculos em diagonal */
.dice-3d.d2 .dice-face-3d.right::after,
.dice-3d.d2 .dice-face-3d.bottom::after,
.dice-3d.d2 .dice-face-3d.back::after {
  width: 16px;
  height: 16px;
  margin: -18px 0 0 -18px;
  background-color: #000000;
  box-shadow: 24px 24px #000000 !important;
}

.dice-3d.d2 .dice-face-3d::before {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  background-color: #1a1a2e;
  border-radius: 16px;
  transform: translateZ(-1px);
}

/* Responsivo para D2 */
@media (max-width: 400px) {
  .dice-3d.d2 .dice-face-3d::after {
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
  }
  
  .dice-3d.d2 .dice-face-3d.front::after,
  .dice-3d.d2 .dice-face-3d.up::after,
  .dice-3d.d2 .dice-face-3d.left::after {
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
  }
  
  .dice-3d.d2 .dice-face-3d.right::after,
  .dice-3d.d2 .dice-face-3d.bottom::after,
  .dice-3d.d2 .dice-face-3d.back::after {
    margin: -14px 0 0 -14px;
    box-shadow: 18px 18px #000000 !important;
  }
}

/* Botão remover */
.remove-dice-3d {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 22px;
  height: 22px;
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: bold;
  transition: all 0.2s ease;
  z-index: 10;
  
  /* Começa escondido */
  opacity: 0;
  pointer-events: none;
}

/* Quando o dado está selecionado, mostra o botão */
.pool-dice-3d.selected .remove-dice-3d {
  opacity: 1;
  pointer-events: auto;
}

.remove-dice-3d:hover {
  background: #2e3788;
  transform: scale(1.1);
}

/* Responsivo */
@media (max-width: 400px) {
  .pool-dice-3d {
    width: 80px;
    height: 100px;
  }
  
  .dice-3d {
    width: 60px;
    height: 60px;
  }
  
  .dice-face-3d {
    width: 60px;
    height: 60px;
  }
  
  .dice-face-3d::after {
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
  }
  
  .dice-face-3d.front {
    transform: translateZ(30px);
  }
  
  .dice-face-3d.front::after {
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
  }
  
  .dice-face-3d.up {
    transform: rotateX(90deg) translateZ(30px);
  }
  
  .dice-face-3d.left {
    transform: rotateY(-90deg) translateZ(30px);
  }
  
  .dice-face-3d.right {
    transform: rotateY(90deg) translateZ(30px);
  }
  
  .dice-face-3d.bottom {
    transform: rotateX(-90deg) translateZ(30px);
  }
  
  .dice-face-3d.back {
    transform: rotateX(180deg) translateZ(30px);
  }
}