/* STB Dice Lab v1.4.3 - admin-only procedural marble D20 preview */
.stb-dice-app{--bg:#100f15;--panel:#211a25;--panel2:#2b2030;--ink:#f4eae7;--muted:#bbacbb;--red:#ed4458;--gold:#f8c579;color:var(--ink);max-width:1380px;margin:20px 24px 34px 0;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.stb-dice-app *{box-sizing:border-box}
.stb-dice-app .stb-dice-kicker{font-size:11px;letter-spacing:2.3px;color:#ffa5b0;font-weight:800;text-transform:uppercase}
.stb-dice-head{display:flex;justify-content:space-between;align-items:center;gap:24px;margin-bottom:20px}
.stb-dice-head h1{color:var(--ink);margin:5px 0 8px;font-size:clamp(25px,2.7vw,38px);font-weight:800;line-height:1.06}
.stb-dice-head p{color:var(--muted);font-size:13px;max-width:720px;line-height:1.6;margin:0}
.stb-dice-pill{border:1px solid #6c4654;background:#2a2029;color:#ffd0d4;border-radius:999px;padding:9px 13px;font-size:11px;font-weight:800;white-space:nowrap;letter-spacing:.7px}
.stb-dice-grid{display:grid;grid-template-columns:minmax(0,1.9fr) minmax(310px,.85fr);gap:18px;align-items:start}
.stb-dice-scene{background:radial-gradient(circle at 48% 42%,#34232a 0,#17111b 53%,#100f17 100%);border:1px solid #5a3543;border-radius:18px;box-shadow:0 16px 48px #0005;overflow:hidden;position:relative}
.stb-dice-scene-head{height:54px;padding:0 21px;display:flex;align-items:center;justify-content:space-between;background:linear-gradient(90deg,#2e202a,#1c1721);border-bottom:1px solid #49313d}
.stb-dice-scene-head strong{font-size:12px;letter-spacing:1px;color:#f3c6ca}
.stb-dice-stage-wrap{position:relative;min-height:338px;overflow:hidden;background:radial-gradient(ellipse at 60% 95%,#4a202b 0%,transparent 65%)}
.stb-dice-stage-wrap canvas{display:block;width:100%;height:338px;touch-action:pan-y}
.stb-dice-orbit{position:absolute;inset:8% 18%;border:1px solid #c5496425;border-radius:50%;transform:scaleY(.37);pointer-events:none;box-shadow:0 0 40px #b52f5220}
.stb-dice-result{position:absolute;left:50%;top:31%;transform:translate(-50%,-50%) scale(.5);pointer-events:none;opacity:0;min-width:180px;text-align:center;filter:drop-shadow(0 8px 28px #000b)}
.stb-dice-result.is-active{animation:stb-num-reveal .95s cubic-bezier(.2,1.5,.23,1) both}
.stb-dice-result small{display:block;letter-spacing:4px;color:#f7b1b5;font-size:11px;font-weight:850}
.stb-dice-result strong{font-size:clamp(88px,11vw,158px);font-weight:950;display:block;line-height:.96;background:linear-gradient(115deg,#fff7e6 0%,#fac7aa 27%,#fff 45%,#f3b257 70%,#fff9dd 95%);-webkit-background-clip:text;background-clip:text;color:transparent;text-shadow:0 0 45px #ffbf7544}
.stb-dice-result span{font-size:12px;letter-spacing:2px;color:#fff4eb;font-weight:800}
@keyframes stb-num-reveal{0%{opacity:0;transform:translate(-50%,-50%) scale(.35);filter:blur(9px)}54%{opacity:1;transform:translate(-50%,-50%) scale(1.22);filter:blur(0)}100%{opacity:1;transform:translate(-50%,-50%) scale(1);filter:blur(0)}}
.stb-dice-flash{position:absolute;inset:0;pointer-events:none;opacity:0;background:radial-gradient(circle at 50% 46%,#fff4e1c7,#ff7f8182 17%,transparent 65%)}
.stb-dice-flash.is-active{animation:stb-dice-flash .72s ease-out both}
@keyframes stb-dice-flash{0%{opacity:0}15%{opacity:.92}100%{opacity:0}}
.stb-dice-status{position:absolute;bottom:17px;left:22px;right:22px;display:flex;gap:8px;align-items:center;font-size:12px;color:#f6d6d9;font-weight:750;text-shadow:0 1px 4px #000a}
.stb-dice-status:before{content:"";height:7px;width:7px;border-radius:50%;background:#f0b575;box-shadow:0 0 12px #f0b575}
.stb-dice-progress{height:3px;background:#34232e}
.stb-dice-progress span{display:block;width:0;height:100%;background:linear-gradient(90deg,#cc3148,#ffd9a7);box-shadow:0 0 12px #ed6876;transition:width .08s linear}
.stb-dice-reward-bar{display:grid;grid-template-columns:200px 1fr;gap:20px;align-items:center;padding:18px 22px 21px;background:linear-gradient(115deg,#1c1721,#281c27 54%,#1b161e);min-height:295px;border-top:1px solid #49303c}
.stb-dice-card-pad{perspective:850px;height:250px;display:grid;place-items:center}
.stb-dice-card{position:relative;height:234px;width:157px;transform-style:preserve-3d;transform:rotateY(-180deg) translateY(4px) scale(.88);border-radius:12px;box-shadow:0 12px 25px #000b;transition:transform 2s cubic-bezier(.14,.78,.22,1),filter 1.3s ease;filter:grayscale(.35) brightness(.65)}
.stb-dice-card.is-revealed{transform:rotateY(0deg) translateY(0) scale(1);filter:none}
.stb-dice-card-side{position:absolute;inset:0;overflow:hidden;border-radius:11px;backface-visibility:hidden;display:flex;flex-direction:column;justify-content:space-between;padding:9px;border:3px solid #f5c376;background:radial-gradient(circle at 40% 32%,#793346,#271020 65%,#150d18);box-shadow:inset 0 0 0 1px #cba561,0 0 0 1px #24121c}
.stb-dice-card-back{transform:rotateY(180deg);display:flex;align-items:center;justify-content:center;color:#f5bb7c;font-size:48px;font-weight:950;text-shadow:0 0 18px #b73b4b;text-align:center;background:repeating-linear-gradient(45deg,#211421,#211421 12px,#2b192b 12px,#2b192b 24px)}
.stb-dice-card-front .stb-dice-card-sigil{display:flex;align-items:center;justify-content:center;flex:1;font-size:64px;color:#ffcab0;text-shadow:0 0 32px #e04c6c}
.stb-dice-card-front .stb-dice-card-label{border-top:1px solid #ffdfab55;padding-top:9px;font-weight:850;font-size:12px;line-height:1.25;letter-spacing:1px;color:#ffe2bf}
.stb-dice-card-front small{font-size:9px;letter-spacing:2px;color:#f7a3aa}
.stb-dice-foil{position:absolute;inset:-35%;background:linear-gradient(110deg,transparent 31%,#fc9c991f 42%,#efffff79 50%,#fbc6748a 53%,#e29eff4d 57%,transparent 67%);mix-blend-mode:screen;transform:translateX(-105%) rotate(8deg);pointer-events:none}
.stb-dice-card.is-revealed .stb-dice-foil{animation:stb-foil-sweep 2.5s ease-in-out .8s both}
@keyframes stb-foil-sweep{0%{transform:translateX(-110%) rotate(8deg)}100%{transform:translateX(115%) rotate(8deg)}}
.stb-dice-card.is-revealed .stb-dice-card-front{animation:stb-legend-glow 3.8s ease-in-out infinite alternate}
@keyframes stb-legend-glow{from{box-shadow:0 0 15px #ed4e6255,inset 0 0 0 1px #cba561}to{box-shadow:0 0 33px #ffb96d9c,0 0 12px #f3427b66,inset 0 0 0 1px #ffe4bc}}
.stb-dice-reward-copy .stb-dice-kicker{margin-bottom:10px;display:block}
.stb-dice-reward-copy h3{font-size:26px;line-height:1.14;color:#fff1e9;margin:0 0 10px;font-weight:850}
.stb-dice-reward-copy p{color:#c9b3bf;line-height:1.55;font-size:13px;margin:0 0 15px}
.stb-dice-statrow{display:flex;gap:12px;flex-wrap:wrap}
.stb-dice-stat{border:1px solid #5c3949;border-radius:8px;padding:7px 10px;font-size:11px;color:#f0c4c9;background:#261b26}
.stb-dice-controls{background:#1d1922;border:1px solid #523743;border-radius:16px;padding:22px;color:var(--ink)}
.stb-dice-controls h2{color:var(--ink);font-size:21px;margin:0 0 8px}
.stb-dice-controls .sub{color:#bbaab5;font-size:12px;line-height:1.6;margin:0 0 19px}
.stb-dice-controls .stb-field{margin:16px 0}
.stb-dice-controls label{display:flex;justify-content:space-between;align-items:center;font-weight:750;font-size:12px;margin-bottom:8px;color:#e9dbe2}
.stb-dice-controls label output{color:#f7b7a4}
.stb-dice-controls select{width:100%;min-height:39px;border:1px solid #614351;background:#100f15;color:#fff0ec;border-radius:7px;padding:8px 10px;font-size:13px}
.stb-dice-controls input[type=range]{accent-color:#ec4255;width:100%;cursor:pointer}
.stb-dice-btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;width:100%;padding:13px;border:1px solid #f5656f;border-radius:9px;color:white;font-weight:850;font-size:13px;cursor:pointer;background:linear-gradient(110deg,#bf283b,#ed4458 60%,#ad233b);box-shadow:0 6px 22px #a8284f38}
.stb-dice-btn:hover{filter:brightness(1.1)}
.stb-dice-btn:disabled{opacity:.45;cursor:not-allowed}
.stb-dice-btn.secondary{background:#2d222e;border-color:#6b4a59;box-shadow:none;margin-top:9px}
.stb-dice-note{padding:13px;border-radius:10px;background:#2b222e;border:1px solid #604050;font-size:11.5px;color:#c7b4c1;line-height:1.55;margin-top:19px}
.stb-dice-particles{position:absolute;inset:0;overflow:hidden;pointer-events:none}
.stb-dice-particle{position:absolute;width:5px;height:13px;border-radius:2px;left:50%;top:45%;opacity:0;background:var(--pcolor,#ffde91);transform:rotate(var(--prot,0deg))}
.stb-dice-particle.is-active{animation:stb-particle-fly var(--pdur,1.2s) cubic-bezier(.18,.76,.22,1) forwards}
@keyframes stb-particle-fly{0%{opacity:0;transform:translate(0,0) scale(.3) rotate(0deg)}12%{opacity:1}100%{opacity:0;transform:translate(var(--px,50px),var(--py,-80px)) scale(.8) rotate(var(--prot,120deg))}}
.stb-dice-app:focus-within :focus-visible{outline:2px solid #ffb6ad;outline-offset:4px}
@media(max-width:1060px){.stb-dice-grid{grid-template-columns:1fr}.stb-dice-app{max-width:850px}}
@media(max-width:650px){.stb-dice-head{align-items:flex-start;flex-direction:column}.stb-dice-app{margin-right:10px}.stb-dice-stage-wrap,.stb-dice-stage-wrap canvas{min-height:270px;height:270px}.stb-dice-reward-bar{grid-template-columns:130px 1fr;gap:13px;padding:18px 14px}.stb-dice-card{width:120px;height:180px}.stb-dice-card-pad{height:200px}.stb-dice-reward-copy h3{font-size:20px}}
html.stb-reduce-motion .stb-dice-app *,html.stb-reduce-motion .stb-dice-app *::before,html.stb-reduce-motion .stb-dice-app *::after{animation-duration:.01ms!important;transition-duration:.01ms!important}

/* v1.4.3 - Epic test card, black-marble / cosmic preview polish */
.stb-dice-app[data-effect="epic"] .stb-dice-card-front{border-color:#a58ef2;box-shadow:inset 0 0 0 1px #d1c4ff,0 0 19px #8e57cf35}
.stb-dice-app[data-effect="epic"] .stb-dice-card.is-revealed .stb-dice-card-front{animation:stb-epic-card-glow 3.1s ease-in-out infinite alternate}
@keyframes stb-epic-card-glow{0%{box-shadow:0 0 16px #8169cf44,inset 0 0 0 1px #d1c4ff}100%{box-shadow:0 0 29px #a35ffc85,0 0 13px #52d1e24c,inset 0 0 0 1px #f9edff}}
.stb-dice-card-front .stb-dice-card-sigil{min-height:0;overflow:hidden;margin:2px 0 4px}
.stb-dice-card-front .stb-dice-card-sigil img{filter:saturate(1.04);max-width:100%}
.stb-dice-app[data-effect="epic"] .stb-dice-card.is-revealed .stb-dice-foil{background:linear-gradient(110deg,transparent 30%,#7edcff22 43%,#f0f3ffb9 50%,#dd9bff80 54%,#80d8eb31 58%,transparent 69%)}

/* Hide the front image while the card is face-down; don't show mirrored art through the back. */
.stb-dice-card:not(.is-revealed) .stb-dice-card-front{visibility:hidden}
.stb-dice-card.is-revealed .stb-dice-card-front{visibility:visible}

/* Decorative back face while waiting to unlock; prevents blank or mirrored artwork. */
.stb-dice-card-pad{position:relative}
.stb-dice-card-pad::before{content:"STB";position:absolute;display:grid;place-items:center;width:157px;height:234px;border-radius:12px;border:3px solid #6d4b8a;background:repeating-linear-gradient(45deg,#211421,#211421 12px,#2e1a31 12px,#2e1a31 24px);font:bold 36px Georgia,serif;color:#e99cbd;letter-spacing:3px;text-shadow:0 0 18px #c15ca5;box-shadow:0 12px 25px #000b;pointer-events:none}
.stb-dice-card-pad .stb-dice-card:not(.is-revealed){opacity:0}
.stb-dice-card-pad:has(.stb-dice-card.is-revealed)::before{opacity:0;transition:opacity .65s ease}
.stb-dice-card.is-revealed{opacity:1}
@media(max-width:650px){.stb-dice-card-pad::before{width:120px;height:180px}}

/* v1.9.0: real 3D dice layer, dice picker, new-die popup */
.stb-dice-stage-wrap.has-gl{min-height:420px}
.stb-dice-stage-wrap.has-gl canvas#stb-dice-canvas{visibility:hidden;height:420px}
.stb-dice-gl{position:absolute;inset:0;z-index:1}
.stb-dice-gl canvas{display:block;width:100%;height:100%;touch-action:pan-y}
.stb-dice-stage-wrap .stb-dice-flash,.stb-dice-stage-wrap .stb-dice-result,.stb-dice-stage-wrap .stb-dice-particles,.stb-dice-stage-wrap .stb-dice-status{z-index:3}
.stb-dice-picker{margin:14px 0 4px}
.stb-dice-picker h3{margin:0 0 8px;font-size:15px}
.stb-dice-picker h4{margin:12px 0 6px;font-size:13px}
.stb-dice-skin-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
.stb-dice-skin{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid rgba(255,255,255,.18);border-radius:12px;background:rgba(255,255,255,.04);color:inherit;font:inherit;text-align:left;position:relative;min-height:48px}
button.stb-dice-skin{cursor:pointer}
button.stb-dice-skin:hover{border-color:rgba(255,255,255,.5)}
button.stb-dice-skin:focus-visible,.stb-dice-chip:focus-visible{outline:2px solid #ffd54a;outline-offset:2px}
.stb-dice-skin.is-selected{border-color:#ffd54a;box-shadow:0 0 0 1px #ffd54a inset}
.stb-dice-skin.is-locked{opacity:.62}
.stb-dice-dot{flex:0 0 28px;width:28px;height:28px;border-radius:50%;box-shadow:0 1px 4px rgba(0,0,0,.5) inset}
.stb-dice-skin-name{display:flex;flex-direction:column;font-size:13px;line-height:1.25}
.stb-dice-skin-name small{font-size:11px;opacity:.75}
.stb-dice-lock{position:absolute;right:8px;top:6px;font-size:12px}
.stb-dice-chips{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.stb-dice-chip{width:30px;height:30px;border-radius:50%;border:2px solid rgba(255,255,255,.5);cursor:pointer;padding:0}
.stb-dice-chip.is-selected{border-color:#ffd54a;box-shadow:0 0 0 2px #ffd54a}
.stb-dice-freepick{display:inline-flex;align-items:center;gap:6px;font-size:12px;margin-top:8px}
.stb-dice-picker-note{font-size:12px;min-height:1em;margin:8px 0 0;opacity:.85}
.stb-dice-found{position:fixed;inset:0;z-index:100000;display:flex;align-items:center;justify-content:center;background:rgba(5,3,10,.78);padding:16px}
.stb-dice-found[hidden]{display:none}
.stb-dice-found-panel{max-width:380px;width:100%;text-align:center;background:#17101f;color:#fff;border:1px solid rgba(255,213,74,.5);border-radius:18px;padding:26px 22px}
.stb-dice-found-panel h2{margin:6px 0 8px;font-size:24px;color:#ffd54a}
@media (prefers-reduced-motion:reduce){.stb-dice-skin{transition:none}}
@media(max-width:650px){.stb-dice-stage-wrap.has-gl,.stb-dice-stage-wrap.has-gl canvas#stb-dice-canvas{min-height:340px;height:340px}}
.stb-dice-skipmotion{display:flex;align-items:center;gap:8px;font-size:12px;margin-top:10px;cursor:pointer}
.stb-dice-customize{margin:12px 0 0}
.stb-dice-btn-secondary{display:inline-block;background:transparent!important;border:1px solid rgba(255,255,255,.35)!important;box-shadow:none!important;text-decoration:none;padding:10px 16px;border-radius:12px;color:inherit;font-size:14px}
.stb-dice-preview{display:flex;align-items:center;gap:10px;margin:12px 0;font-size:12px;opacity:.9}
.stb-dice-preview-die{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;box-shadow:0 2px 10px rgba(0,0,0,.5),inset 0 -6px 12px rgba(0,0,0,.35)}
.stb-dice-preview-die.is-glass{opacity:.9;box-shadow:0 0 0 2px rgba(207,233,255,.5),0 2px 10px rgba(0,0,0,.5)}
.stb-dice-preview-die b{font-size:22px;text-shadow:0 1px 2px rgba(0,0,0,.6)}
.stb-dice-prefs .stb-dice-skin-grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}

/* v1.10: roll button lives in a bar attached under the dice, never over them */
.stb-dice-actionbar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:12px 16px;background:rgba(0,0,0,.28);border-top:1px solid rgba(255,255,255,.08)}
.stb-dice-actionbar .stb-dice-btn{flex:0 0 auto;min-height:48px;min-width:200px;font-size:16px}
.stb-dice-actionbar .stb-vault-cooldown{margin:0;font-size:13px;opacity:.9;flex:1 1 180px}
@media(max-width:650px){.stb-dice-actionbar{flex-direction:column;align-items:stretch;gap:8px;padding:10px 12px}.stb-dice-actionbar .stb-dice-btn{width:100%}.stb-dice-actionbar .stb-vault-cooldown{text-align:center}}
