/* Realistische CSS-Würfel mit Pip-Mustern */

.die {
  --die-size: 2.6rem;
  width: var(--die-size);
  height: var(--die-size);
  background: #fefefe;
  border-radius: 18%;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15), inset 0 -2px 3px rgba(0, 0, 0, 0.06), inset 0 2px 2px rgba(255, 255, 255, 0.8);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 14%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.die .pip {
  width: 100%;
  aspect-ratio: 1;
  align-self: center;
  justify-self: center;
  border-radius: 50%;
  background: #22303c;
  opacity: 0;
  transform: scale(0.85);
}

.die[data-value='1'] .pip:nth-child(5) { opacity: 1; }
.die[data-value='2'] .pip:nth-child(1),
.die[data-value='2'] .pip:nth-child(9) { opacity: 1; }
.die[data-value='3'] .pip:nth-child(1),
.die[data-value='3'] .pip:nth-child(5),
.die[data-value='3'] .pip:nth-child(9) { opacity: 1; }
.die[data-value='4'] .pip:nth-child(1),
.die[data-value='4'] .pip:nth-child(3),
.die[data-value='4'] .pip:nth-child(7),
.die[data-value='4'] .pip:nth-child(9) { opacity: 1; }
.die[data-value='5'] .pip:nth-child(1),
.die[data-value='5'] .pip:nth-child(3),
.die[data-value='5'] .pip:nth-child(5),
.die[data-value='5'] .pip:nth-child(7),
.die[data-value='5'] .pip:nth-child(9) { opacity: 1; }
.die[data-value='6'] .pip:nth-child(1),
.die[data-value='6'] .pip:nth-child(3),
.die[data-value='6'] .pip:nth-child(4),
.die[data-value='6'] .pip:nth-child(6),
.die[data-value='6'] .pip:nth-child(7),
.die[data-value='6'] .pip:nth-child(9) { opacity: 1; }

.die.die--empty {
  background: repeating-linear-gradient(45deg, #eef1f0, #eef1f0 4px, #e3e8e6 4px, #e3e8e6 8px);
  box-shadow: inset 0 0 0 1px #d7dedb;
}

.die.die--small {
  --die-size: 1.9rem;
}

.die.die--tiny {
  --die-size: 1.4rem;
  border-radius: 22%;
}

/* Antippbarer Würfel (Toggle / Auswahl) */
.die-btn {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease;
}

.die-btn .die {
  transition: box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.die-btn:active {
  transform: scale(0.94);
}

.die-btn.is-off .die {
  opacity: 0.35;
  filter: grayscale(1);
}

.die-btn.is-selected .die {
  box-shadow: 0 0 0 3px #2f9e6a, 0 2px 0 rgba(0, 0, 0, 0.15);
}

.die-btn.is-dim .die {
  opacity: 0.3;
  filter: grayscale(0.6);
}

.die-btn:disabled {
  cursor: default;
}
