/* Autonomous inventory thumbnails and previews. */
.np-hall-card[data-dice-skin] .np-hall-card-art,
.np-hall-card[data-roll-effect] .np-hall-card-art{position:relative!important;isolation:isolate!important;overflow:hidden!important}
.np-hall-card .np-v18-effect-canvas{position:absolute!important;inset:0!important;z-index:2!important;display:block!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;visibility:visible!important;opacity:1!important;pointer-events:none!important}
/* One renderer everywhere: this is the very same canvas implementation that
   replaces the live dice during an actual game roll. */
.np-hall-card .np-v18-dice-canvas{display:none!important}
.np-hall-card[data-dice-skin] .np-inventory-dice-canvas{position:absolute!important;inset:0!important;z-index:2!important;display:block!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;visibility:visible!important;opacity:1!important;pointer-events:none!important;filter:drop-shadow(0 12px 10px #0009)}
.np-hall-card .np-hall-card-art>b{z-index:6!important}
.np-hall-card[data-dice-skin] .np-hall-card-art:after,
.np-hall-card[data-roll-effect] .np-hall-card-art:after{position:absolute;right:14%;bottom:8%;left:14%;z-index:1;height:18%;border-radius:50%;background:radial-gradient(ellipse,#000b,transparent 70%);filter:blur(7px);content:""}
.np-hall-card[data-roll-effect] .np-roll-effect-thumb{display:none!important}
.np-hall-card[data-dice-skin],.np-hall-card[data-roll-effect]{cursor:pointer!important}
.np-hall-card[data-dice-skin]:hover .np-inventory-dice-canvas,
.np-hall-card[data-roll-effect]:hover .np-v18-effect-canvas{filter:brightness(1.12) saturate(1.1)}

.np-v18-preview{position:fixed!important;inset:0!important;z-index:2147483000!important;display:grid!important;padding:18px;place-items:center;background:#060403f2;backdrop-filter:blur(10px);opacity:0;isolation:isolate!important;transform:none!important;transition:opacity .18s ease}
.np-v18-preview~*{pointer-events:none}
.np-v18-preview.is-visible{opacity:1}
.np-v18-preview-dialog{--accent:#c7974e;position:relative;width:min(760px,96vw);max-height:calc(100dvh - 28px);overflow:auto;border:1px solid color-mix(in srgb,var(--accent) 75%,#f5dfb7);border-radius:20px;padding:24px;color:#f0ddb8;background:radial-gradient(circle at 50% 28%,color-mix(in srgb,var(--accent) 16%,transparent),transparent 44%),linear-gradient(155deg,#21160f,#090706 72%);box-shadow:0 32px 100px #000,0 0 38px color-mix(in srgb,var(--accent) 26%,transparent)}
.np-v18-preview-close{position:absolute;top:17px;right:17px;z-index:6;width:45px;height:45px;border:1px solid #8b6035;border-radius:50%;color:#f4dfb7;background:#130d09;font-size:1.55rem;cursor:pointer}
.np-v18-preview-dialog header{text-align:center}.np-v18-preview-dialog header small{color:var(--accent);font-size:0.82rem;font-weight:900;letter-spacing:.18em}.np-v18-preview-dialog h2{margin:.55rem 3rem .2rem;color:#f6e2bb;font:700 clamp(1.45rem,4vw,2.25rem) Literata,Georgia,"Times New Roman",serif;text-transform:uppercase}.np-v18-preview-dialog header p{margin:.2rem 0;color:#c9b28e;font-size:.78rem}
.np-v18-preview-arena{position:relative;display:flex;height:min(390px,48vh);min-height:310px;margin:16px 0 8px;border:1px solid #583a22;border-radius:15px;align-items:center;justify-content:center;gap:clamp(8px,5vw,52px);overflow:hidden;background:radial-gradient(ellipse at 50% 76%,color-mix(in srgb,var(--accent) 24%,transparent),transparent 55%),linear-gradient(#090706,#160f0b 72%,#070504);box-shadow:inset 0 0 48px #000d}
.np-v18-preview-arena:after{position:absolute;right:12%;bottom:9%;left:12%;height:18%;border-radius:50%;background:radial-gradient(ellipse,#000d,transparent 70%);filter:blur(11px);content:""}
.np-v18-preview-die{position:relative;z-index:3;width:min(38%,210px);aspect-ratio:1;filter:drop-shadow(0 22px 14px #000b)}
.np-v18-preview-die canvas{display:block;width:100%;height:100%}
.np-v18-preview-die.is-rolling{animation:npV18DiceFlight .92s cubic-bezier(.18,.72,.22,1) both;will-change:transform,filter}
.np-v18-preview-die.is-rolling:nth-of-type(2){animation-name:npV18DiceFlightAlt;animation-delay:.055s}
@keyframes npV18DiceFlight{
  0%{transform:translate3d(-65px,-145px,0) rotate(-165deg) scale(.62);filter:blur(1px) drop-shadow(0 34px 9px #0006)}
  28%{transform:translate3d(38px,-65px,0) rotate(78deg) scale(1.04)}
  55%{transform:translate3d(-19px,12px,0) rotate(238deg) scale(.94)}
  72%{transform:translate3d(10px,-24px,0) rotate(322deg) scale(1.02)}
  86%{transform:translate3d(-4px,5px,0) rotate(368deg) scale(.985)}
  100%{transform:translate3d(0,0,0) rotate(360deg) scale(1);filter:drop-shadow(0 22px 14px #000b)}
}
@keyframes npV18DiceFlightAlt{
  0%{transform:translate3d(70px,-125px,0) rotate(175deg) scale(.65);filter:blur(1px) drop-shadow(0 32px 9px #0006)}
  30%{transform:translate3d(-42px,-48px,0) rotate(-92deg) scale(1.03)}
  57%{transform:translate3d(22px,15px,0) rotate(-248deg) scale(.95)}
  74%{transform:translate3d(-12px,-20px,0) rotate(-326deg) scale(1.02)}
  88%{transform:translate3d(5px,4px,0) rotate(-364deg) scale(.99)}
  100%{transform:translate3d(0,0,0) rotate(-360deg) scale(1);filter:drop-shadow(0 22px 14px #000b)}
}
.np-v18-preview-fx{position:absolute;inset:0;z-index:2;width:100%;height:100%;pointer-events:none;mix-blend-mode:screen}
.np-v18-preview-result{min-height:26px;margin:6px 0 12px;text-align:center;font-size:.88rem;font-weight:900;letter-spacing:.05em}
.np-v18-preview-dialog footer{display:flex;gap:10px}.np-v18-preview-dialog footer button{min-height:50px;border:1px solid color-mix(in srgb,var(--accent) 70%,#f2ddb3);border-radius:8px;flex:1;color:#f9e7c3;background:linear-gradient(180deg,color-mix(in srgb,var(--accent) 24%,#3b281b),#160e09);font-size:0.86rem;font-weight:900;letter-spacing:.06em;cursor:pointer}.np-v18-preview-dialog footer button:last-child{background:#110b08}
@media(max-width:650px){.np-v18-preview{padding:8px}.np-v18-preview-dialog{width:100%;padding:18px 11px}.np-v18-preview-arena{height:330px;min-height:270px;gap:0}.np-v18-preview-die{width:47%}.np-v18-preview-dialog footer{flex-direction:column}.np-v18-preview-dialog footer button{width:100%}}
@media(prefers-reduced-motion:reduce){.np-v18-preview,.np-hall-card canvas{transition:none!important}.np-v18-preview-die.is-rolling{animation:npV18DiceReduced .35s ease both}@keyframes npV18DiceReduced{0%{transform:translateY(-18px) scale(.9)}100%{transform:none}}}
