/* ==========================================================================
   Ludo Pro - Ultra-Responsive 2D Modern Flat/Glossy Dice System
   (Zero 3D lag, Instant 65ms Snap Response, Color Themed)
   ========================================================================== */

.dice-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
}

.dice-hub.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.modern-dice {
  width: 48px;
  height: 48px;
  background: #ffffff;
  background-image: radial-gradient(circle at 35% 35%, #ffffff 0%, #f8fafc 60%, #e2e8f0 100%);
  border: 2.5px solid #cbd5e1;
  border-radius: 13px;
  box-shadow: 
    0 8px 18px rgba(0, 0, 0, 0.55),
    inset 0 2px 3px #ffffff,
    inset 0 -2px 3px rgba(0, 0, 0, 0.12);
  display: grid;
  padding: 6px;
  box-sizing: border-box;
  cursor: pointer;
  transition: transform 0.06s ease-out, border-color 0.15s, box-shadow 0.15s;
  user-select: none;
  pointer-events: auto;
}

.modern-dice:active {
  transform: scale(0.90);
}

/* Color Themed Glows matching Active Player */
.modern-dice.dice-red {
  border-color: #ff2e63;
  box-shadow: 0 0 16px rgba(255, 46, 99, 0.65), inset 0 2px 3px #ffffff;
}
.modern-dice.dice-green {
  border-color: #00e676;
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.65), inset 0 2px 3px #ffffff;
}
.modern-dice.dice-yellow {
  border-color: #ffb703;
  box-shadow: 0 0 16px rgba(255, 183, 3, 0.65), inset 0 2px 3px #ffffff;
}
.modern-dice.dice-blue {
  border-color: #00d2ff;
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.65), inset 0 2px 3px #ffffff;
}

.dice-hub.can-roll .modern-dice {
  animation: dicePulseGlow 0.9s infinite alternate cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dicePulseGlow {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.12); filter: brightness(1.08); }
}

.modern-dice.rolling-anim {
  animation: diceQuickSnap 0.065s linear;
}

@keyframes diceQuickSnap {
  0% { transform: scale(0.92) rotate(-5deg); }
  50% { transform: scale(1.15) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* ==========================================================================
   2D Dice Pips Layouts (1 to 6)
   ========================================================================== */

.dice-pip {
  width: 8px;
  height: 8px;
  background: #0f172a;
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
  justify-self: center;
  align-self: center;
}

/* 1 Pip (Center Ruby) */
.pip-layout-1 {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.pip-layout-1 .dice-pip {
  width: 14px;
  height: 14px;
  background: #ff2e63;
  background-image: radial-gradient(circle at 35% 35%, #ff7597, #ff2e63, #990026);
  box-shadow: inset 0 1.5px 2px rgba(255, 255, 255, 0.8), 0 0 8px rgba(255, 46, 99, 0.6);
}

/* 2 Pips */
.pip-layout-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 100%;
  height: 100%;
}
.pip-layout-2 .dice-pip:nth-child(1) { grid-area: 1 / 1; }
.pip-layout-2 .dice-pip:nth-child(2) { grid-area: 2 / 2; }

/* 3 Pips */
.pip-layout-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  width: 100%;
  height: 100%;
}
.pip-layout-3 .dice-pip:nth-child(1) { grid-area: 1 / 1; }
.pip-layout-3 .dice-pip:nth-child(2) { grid-area: 2 / 2; }
.pip-layout-3 .dice-pip:nth-child(3) { grid-area: 3 / 3; }

/* 4 Pips */
.pip-layout-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 100%;
  height: 100%;
}
.pip-layout-4 .dice-pip:nth-child(1) { grid-area: 1 / 1; }
.pip-layout-4 .dice-pip:nth-child(2) { grid-area: 1 / 2; }
.pip-layout-4 .dice-pip:nth-child(3) { grid-area: 2 / 1; }
.pip-layout-4 .dice-pip:nth-child(4) { grid-area: 2 / 2; }

/* 5 Pips */
.pip-layout-5 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  width: 100%;
  height: 100%;
}
.pip-layout-5 .dice-pip:nth-child(1) { grid-area: 1 / 1; }
.pip-layout-5 .dice-pip:nth-child(2) { grid-area: 1 / 3; }
.pip-layout-5 .dice-pip:nth-child(3) { grid-area: 2 / 2; }
.pip-layout-5 .dice-pip:nth-child(4) { grid-area: 3 / 1; }
.pip-layout-5 .dice-pip:nth-child(5) { grid-area: 3 / 3; }

/* 6 Pips */
.pip-layout-6 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  width: 100%;
  height: 100%;
}
.pip-layout-6 .dice-pip:nth-child(1) { grid-area: 1 / 1; }
.pip-layout-6 .dice-pip:nth-child(2) { grid-area: 1 / 2; }
.pip-layout-6 .dice-pip:nth-child(3) { grid-area: 2 / 1; }
.pip-layout-6 .dice-pip:nth-child(4) { grid-area: 2 / 2; }
.pip-layout-6 .dice-pip:nth-child(5) { grid-area: 3 / 1; }
.pip-layout-6 .dice-pip:nth-child(6) { grid-area: 3 / 2; }

/* Compact Prompt Badge */
.roll-prompt-badge {
  position: absolute;
  top: -24px;
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #0f172a;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.7);
  white-space: nowrap;
  pointer-events: none;
}
