/* #dice-roller */
#dice-roller .container {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  width: 100%;
  padding: 20px 24px;
  max-width: 800px;
  margin: 20px auto;
}

#dice-roller .controls-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background-color: var(--bg-card);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 14px;
  border-left: 4px solid #6a11cb;
  flex-wrap: wrap;
}

#dice-roller .ctrl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#dice-roller .ctrl-divider {
  width: 1px;
  height: 24px;
  background: color-mix(in srgb, var(--text-tertiary) 30%, transparent);
  flex-shrink: 0;
}

#dice-roller .ctrl-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

#dice-roller .ctrl-slider-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

#dice-roller .value-badge {
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
}

#dice-roller .dice-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, #6a11cb, #2575fc);
  outline: none;
  cursor: pointer;
}

#dice-roller .dice-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #6a11cb;
  box-shadow: 0 2px 4px rgba(106, 17, 203, 0.35);
  cursor: pointer;
  transition: transform 0.15s;
}

#dice-roller .dice-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

#dice-roller .dice-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #6a11cb;
  box-shadow: 0 2px 4px rgba(106, 17, 203, 0.35);
  cursor: pointer;
}

#dice-roller .skip-input {
  width: 70px;
  padding: 5px 8px;
  border: 2px solid color-mix(in srgb, var(--accent-primary) 30%, transparent);
  border-radius: 6px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

#dice-roller .skip-input:focus {
  border-color: var(--accent-primary);
}

#dice-roller .checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

#dice-roller .checkbox-wrapper input[type="checkbox"] {
  display: none;
}

#dice-roller .custom-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid color-mix(in srgb, var(--accent-primary) 50%, transparent);
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

#dice-roller .checkbox-wrapper input[type="checkbox"]:checked+.custom-checkbox {
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  border-color: transparent;
}

#dice-roller .custom-checkbox i {
  color: #fff;
  font-size: 10px;
  opacity: 0;
  transform: scale(0);
  transition: all 0.2s;
}

#dice-roller .checkbox-wrapper input[type="checkbox"]:checked+.custom-checkbox i {
  opacity: 1;
  transform: scale(1);
}

#dice-roller .roll-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(106, 17, 203, 0.35);
}

#dice-roller .roll-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(106, 17, 203, 0.5);
}

#dice-roller .roll-btn:active {
  transform: translateY(0);
}

#dice-roller .roll-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#dice-roller .dice-area {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px;
  min-height: 180px;
  background-color: var(--bg-card);
  border-radius: 12px;
  padding: 24px 16px;
}

#dice-roller .dice-area.empty {
  border: 2px dashed color-mix(in srgb, var(--accent-primary) 25%, transparent);
}

#dice-roller .dice-area.empty::after {
  content: 'Press Roll to begin!';
  color: var(--text-tertiary);
  font-size: 16px;
  font-weight: 500;
}

#dice-roller .die {
  position: relative;
  background: linear-gradient(145deg, #e8edf2, #d5dce4);
  border-radius: 16%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.3s;
  aspect-ratio: 1;
}

html[data-theme="dark"] #dice-roller .die {
  background: linear-gradient(145deg, #ffffff, #eaeaea);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

#dice-roller .die-face {
  position: absolute;
  inset: 8%;
  transition: opacity 0.2s;
}

#dice-roller .die-dot {
  position: absolute;
  width: 20%;
  height: 20%;
  background: #f25f5c;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

@keyframes diceRoll {
  0% {
    transform: rotateX(0) rotateZ(0);
  }

  25% {
    transform: rotateX(90deg) rotateZ(90deg);
  }

  50% {
    transform: rotateX(180deg) rotateZ(180deg);
  }

  75% {
    transform: rotateX(270deg) rotateZ(270deg);
  }

  100% {
    transform: rotateX(360deg) rotateZ(360deg);
  }
}

#dice-roller .die.rolling {
  animation: diceRoll 0.5s ease-in-out;
}

@keyframes diePop {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  60% {
    transform: scale(1.1);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

#dice-roller .die.pop-in {
  animation: diePop 0.3s ease-out forwards;
}

#dice-roller .error-msg {
  background-color: #fee2e2;
  color: #991b1b;
  border-left: 4px solid #dc3545;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  margin-bottom: 12px;
  display: none;
  font-size: 13px;
}

html[data-theme="dark"] #dice-roller .error-msg {
  background-color: rgba(220, 53, 69, 0.15);
  color: #fca5a5;
}

#dice-roller .dice-area[data-count="1"] .die {
  width: 150px;
}

#dice-roller .dice-area[data-count="2"] .die {
  width: 135px;
}

#dice-roller .dice-area[data-count="3"] .die {
  width: 115px;
}

#dice-roller .dice-area[data-count="4"] .die {
  width: 105px;
}

@media (max-width: 480px) {
  #dice-roller .dice-area[data-count="1"] .die {
    width: 125px;
  }

  #dice-roller .dice-area[data-count="2"] .die {
    width: 110px;
  }

  #dice-roller .dice-area[data-count="3"] .die {
    width: 90px;
  }

  #dice-roller .dice-area[data-count="4"] .die {
    width: 80px;
  }

  #dice-roller .controls-row {
    gap: 8px;
    padding: 8px 10px;
  }

  #dice-roller .ctrl-divider {
    display: none;
  }
}