/* Childe DiceRoll — v5 visual and selection repair for NiebieskaIdylla.
   Loaded as a new stylesheet so browsers/phpBB cannot reuse the stale v3/v4 CSS. */

/* A quiet, integrated surface behind the dice panel. */
.diceroll-panel {
  position: relative !important;
  isolation: isolate !important;
  overflow: hidden !important;
  border: 1px solid rgba(112, 145, 164, .30) !important;
  border-radius: 20px !important;
  background:
    radial-gradient(ellipse at 10% 12%, rgba(255,255,255,.48), transparent 38%),
    radial-gradient(ellipse at 88% 90%, rgba(123,158,174,.13), transparent 42%),
    linear-gradient(128deg, rgba(233,241,244,.96), rgba(222,233,238,.94) 52%, rgba(214,227,233,.96)) !important;
  box-shadow: 0 10px 28px rgba(48,75,91,.08), inset 0 1px 0 rgba(255,255,255,.72) !important;
}
.diceroll-panel:before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  pointer-events: none !important;
  opacity: .24 !important;
  background:
    radial-gradient(ellipse at 50% 115%, rgba(113,148,162,.15), transparent 54%),
    repeating-linear-gradient(145deg, transparent 0 46px, rgba(105,137,151,.025) 47px, transparent 49px) !important;
}
.diceroll-panel .inner { position: relative !important; z-index: 1 !important; }

/* Keep the actual button clickable; decorative pseudo-elements never capture input. */
.diceroll-die-picker { position: relative !important; cursor: pointer !important; -webkit-tap-highlight-color: transparent !important; }
.diceroll-die-picker:before { pointer-events: none !important; }
.diceroll-die-picker:after { pointer-events: none !important; }

/* Selected die: clearly visible compact outline/glow, without the old oversized ring. */
.diceroll-die-picker.is-selected {
  transform: translateY(-4px) !important;
  filter: drop-shadow(0 3px 7px rgba(67,112,135,.20)) !important;
}
.diceroll-die-picker.is-selected:before {
  filter:
    drop-shadow(0 0 0.8px rgba(65,119,145,.95))
    drop-shadow(0 0 7px rgba(103,166,193,.52))
    drop-shadow(0 5px 5px rgba(43,70,86,.14)) !important;
}
.diceroll-die-picker.is-selected:after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: 0 !important;
  width: 78px !important;
  height: 78px !important;
  transform: translateX(-50%) !important;
  border: 1px solid rgba(91,151,178,.56) !important;
  border-radius: 18px !important;
  background: linear-gradient(145deg, rgba(255,255,255,.14), rgba(112,164,187,.07)) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.32), 0 0 12px rgba(105,163,188,.18) !important;
}
.diceroll-die-picker span { position: relative !important; z-index: 3 !important; }

/* Low-contrast ambient texture in light mode. */
.diceroll-editor-title { color: #536f80 !important; }
.diceroll-editor-title:before, .diceroll-editor-title:after { background: linear-gradient(90deg, transparent, #9aafba, transparent) !important; }

/* Dark theme is keyed to the exact attribute used by NiebieskaIdylla. */
html[data-theme="dark"] .diceroll-panel {
  border-color: rgba(119,153,174,.24) !important;
  background:
    radial-gradient(ellipse at 10% 12%, rgba(91,132,155,.13), transparent 40%),
    radial-gradient(ellipse at 90% 92%, rgba(73,112,137,.12), transparent 44%),
    linear-gradient(128deg, rgba(18,30,44,.97), rgba(23,39,55,.96) 52%, rgba(27,45,62,.97)) !important;
  box-shadow: 0 14px 34px rgba(0,0,0,.24), inset 0 1px 0 rgba(211,233,243,.035) !important;
}
html[data-theme="dark"] .diceroll-panel:before {
  opacity: .30 !important;
  background:
    radial-gradient(ellipse at 50% 115%, rgba(120,164,185,.10), transparent 56%),
    repeating-linear-gradient(145deg, transparent 0 46px, rgba(155,190,207,.022) 47px, transparent 49px) !important;
}
html[data-theme="dark"] .diceroll-editor-title { color: #c3d8e3 !important; }
html[data-theme="dark"] .diceroll-editor-title:before,
html[data-theme="dark"] .diceroll-editor-title:after { background: linear-gradient(90deg, transparent, #526e80, transparent) !important; }
html[data-theme="dark"] .diceroll-die-picker { color: #c0d8e4 !important; }
html[data-theme="dark"] .diceroll-die-picker span { color: #d2e3eb !important; text-shadow: 0 1px 3px #101a25 !important; }
html[data-theme="dark"] .diceroll-die-picker small,
html[data-theme="dark"] .diceroll-editor-fields label { color: #91aebe !important; }
html[data-theme="dark"] .diceroll-die-picker.is-selected { filter: drop-shadow(0 3px 8px rgba(0,0,0,.40)) !important; }
html[data-theme="dark"] .diceroll-die-picker.is-selected:before {
  filter: drop-shadow(0 0 1px rgba(140,190,215,.95)) drop-shadow(0 0 8px rgba(83,145,176,.38)) !important;
}
html[data-theme="dark"] .diceroll-die-picker.is-selected:after {
  border-color: rgba(126,177,201,.62) !important;
  background: linear-gradient(145deg, rgba(112,158,181,.12), rgba(10,22,34,.10)) !important;
  box-shadow: inset 0 0 0 1px rgba(210,235,246,.07), 0 0 13px rgba(83,145,176,.17) !important;
}
html[data-theme="dark"] .diceroll-editor-fields input {
  background: rgba(10,20,31,.72) !important;
  border-color: rgba(111,151,174,.42) !important;
  color: #d9e8ef !important;
}
html[data-theme="dark"] .diceroll-editor-fields input::placeholder { color: #8199a7 !important; }
html[data-theme="dark"] .diceroll-editor button.diceroll-roll-button {
  background: linear-gradient(180deg,#385a70,#294356) !important;
  border-color: #52758b !important;
  color: #e5f0f5 !important;
}
html[data-theme="dark"] .diceroll-result {
  background: linear-gradient(135deg,rgba(22,35,49,.92),rgba(31,50,66,.90)) !important;
  border-color: rgba(111,151,174,.30) !important;
}
html[data-theme="dark"] .diceroll-result-label { color: #d1e2ea !important; }

/* Keep die silhouettes as supplied by the SVGs; no paw artwork or image filters that distort them. */
.diceroll-die-picker.diceroll-d4:before { background-image: url('./images/dice/d4.svg') !important; }
.diceroll-die-picker.diceroll-d6:before { background-image: url('./images/dice/d6.svg') !important; }
.diceroll-die-picker.diceroll-d8:before { background-image: url('./images/dice/d8.svg') !important; }
.diceroll-die-picker.diceroll-d10:before { background-image: url('./images/dice/d10.svg') !important; }
.diceroll-die-picker.diceroll-d12:before { background-image: url('./images/dice/d12.svg') !important; }
.diceroll-die-picker.diceroll-d20:before { background-image: url('./images/dice/d20.svg') !important; }
.diceroll-die-picker.diceroll-d100:before { background-image: url('./images/dice/d100.svg') !important; }
html[data-theme="dark"] .diceroll-die-picker.diceroll-d4:before { background-image: url('./images/dice/d4-dark.svg') !important; }
html[data-theme="dark"] .diceroll-die-picker.diceroll-d6:before { background-image: url('./images/dice/d6-dark.svg') !important; }
html[data-theme="dark"] .diceroll-die-picker.diceroll-d8:before { background-image: url('./images/dice/d8-dark.svg') !important; }
html[data-theme="dark"] .diceroll-die-picker.diceroll-d10:before { background-image: url('./images/dice/d10-dark.svg') !important; }
html[data-theme="dark"] .diceroll-die-picker.diceroll-d12:before { background-image: url('./images/dice/d12-dark.svg') !important; }
html[data-theme="dark"] .diceroll-die-picker.diceroll-d20:before { background-image: url('./images/dice/d20-dark.svg') !important; }
html[data-theme="dark"] .diceroll-die-picker.diceroll-d100:before { background-image: url('./images/dice/d100-dark.svg') !important; }
