/* Patch 133 - Dadi 3D */
.dice-config-dialog{width:min(760px,calc(100vw - 28px));}
.dice-config-body{display:grid;gap:18px;}
.dice-type-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;}
.dice-type-grid>button{display:grid;justify-items:center;gap:4px;min-height:104px;padding:12px 8px;border:1px solid #d6deea;border-radius:12px;background:#fff;color:#26313d;cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease,background .15s ease;}
.dice-type-grid>button:hover{border-color:#7e9cbd;box-shadow:0 6px 18px rgba(36,60,86,.09);transform:translateY(-1px);}
.dice-type-grid>button.selected{border-color:#315f91;background:#eef5fc;box-shadow:0 0 0 2px rgba(49,95,145,.13);}
.dice-type-grid>button strong{font-size:14px;}
.dice-type-grid>button small{font-size:10px;color:#778391;text-align:center;line-height:1.25;}
.dice-type-icon{display:grid;place-items:center;width:42px;height:42px;border:1.5px solid #21252a;border-radius:10px;background:#f4ead4;color:#151719;font-size:24px;font-weight:900;box-shadow:inset 0 0 0 2px rgba(255,255,255,.45),0 4px 10px rgba(0,0,0,.08);}
.dice-count-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,.7fr);gap:14px;align-items:stretch;}
.dice-count-row>label,.dice-roll-summary{border:1px solid #dce3eb;border-radius:10px;background:#f8fafc;padding:14px;}
.dice-count-row>label{display:grid;gap:8px;}
.dice-count-row>label>span{font-weight:700;font-size:12px;color:#344454;}
.dice-count-row>label>div{display:grid;grid-template-columns:42px 70px 42px;gap:8px;align-items:center;}
.dice-count-row>label button{height:36px;border:1px solid #bdc9d6;border-radius:8px;background:#fff;font-size:20px;cursor:pointer;}
.dice-count-row>label button:disabled{opacity:.35;cursor:default;}
.dice-count-row>label b{text-align:center;font-size:22px;}
.dice-count-row>label small,.dice-roll-summary small{color:#778391;font-size:10px;}
.dice-roll-summary{display:flex;flex-direction:column;justify-content:center;gap:7px;}
.dice-roll-summary strong{font-size:20px;color:#1f2a36;}
.dice-result-dialog{width:min(620px,calc(100vw - 28px));}
.dice-result-body{display:grid;gap:18px;}
.dice-result-values{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;}
.dice-result-values>span{display:grid;place-items:center;min-width:82px;min-height:82px;padding:8px;border:1px solid #222;border-radius:16px;background:#f4ead4;box-shadow:0 8px 18px rgba(0,0,0,.12);}
.dice-result-values small{font-size:10px;color:#60666c;}
.dice-result-values b{font-size:28px;color:#111;}
.dice-result-total{display:grid;place-items:center;gap:2px;padding:17px;border-radius:12px;background:#eef5fc;border:1px solid #cbdbea;}
.dice-result-total small{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:#5f7183;}
.dice-result-total strong{font-size:34px;color:#20364f;}
.dice-admin-config .form-grid{align-items:start;}
.dice-admin-config .check-label span{display:grid;gap:2px;}
.dice-admin-config .check-label small{font-weight:400;color:#7c8794;}
.tackora-dice-stage{position:fixed;inset:0;z-index:2147482500;pointer-events:auto;cursor:wait;overflow:hidden;opacity:1;transition:opacity .18s ease;background:radial-gradient(circle at 50% 45%,rgba(255,255,255,.08),rgba(0,0,0,.08));backdrop-filter:blur(.2px);}
.tackora-dice-stage canvas{display:block;width:100%;height:100%;}
.tackora-dice-stage.settled{filter:saturate(1.03);}
.tackora-dice-stage.leaving{opacity:0;}
.tackora-dice-stage.fallback{background:rgba(17,24,31,.12);}
.tackora-die-fallback{position:absolute;width:var(--die-size);height:var(--die-size);display:grid;place-items:center;transform:translate(-50%,-50%) rotate(12deg);border:3px solid #171717;border-radius:20%;background:#f4ead4;color:#111;font:900 calc(var(--die-size)*.38)/1 Inter,Segoe UI,Arial,sans-serif;box-shadow:0 15px 24px rgba(0,0,0,.24);animation:tackora-die-fallback-roll .22s linear infinite;}
.tackora-dice-stage.settled .tackora-die-fallback{animation:none;}
@keyframes tackora-die-fallback-roll{0%{transform:translate(-50%,-50%) rotate(0deg) scale(.96)}50%{transform:translate(-50%,-58%) rotate(180deg) scale(1.04)}100%{transform:translate(-50%,-50%) rotate(360deg) scale(.96)}}
@media(max-width:780px){.dice-type-grid{grid-template-columns:repeat(3,minmax(0,1fr));}.dice-count-row{grid-template-columns:1fr;}}


/* Patch 137 - DICE come widget persistente di board, allineato a Orologio/Timer */
.board-element-dice {
    min-width:40px;
    min-height:40px;
    aspect-ratio:1 / 1;
    background:transparent !important;
    border:0 !important;
}
.board-dice-launcher {
    width:100%;
    height:100%;
    min-width:0;
    min-height:0;
    padding:4%;
    border:0;
    border-radius:14%;
    background:transparent;
    display:grid;
    place-items:center;
    cursor:pointer;
    user-select:none;
    -webkit-tap-highlight-color:transparent;
}
.board-dice-launcher:hover .board-die-face {
    transform:translateY(-2px) rotate(-2deg);
    box-shadow:0 9px 18px rgba(0,0,0,.28);
}
.board-dice-launcher:active .board-die-face {
    transform:translateY(0) scale(.96);
}
.board-die-face {
    --board-die-background:#f4ead4;
    --board-die-border:#151515;
    --board-die-number:#111111;
    position:relative;
    width:92%;
    aspect-ratio:1 / 1;
    box-sizing:border-box;
    border:3px solid var(--board-die-border);
    border-radius:18%;
    background:var(--board-die-background);
    box-shadow:0 6px 14px rgba(0,0,0,.24);
    transition:transform .14s ease,box-shadow .14s ease;
    color:var(--board-die-number);
}
.board-die-face .pip {
    position:absolute;
    width:15%;
    aspect-ratio:1 / 1;
    border-radius:50%;
    background:var(--board-die-number);
    transform:translate(-50%,-50%);
}
.board-die-face .p1 { left:27%; top:27%; }
.board-die-face .p2 { left:73%; top:27%; }
.board-die-face .p3 { left:50%; top:50%; }
.board-die-face .p4 { left:27%; top:73%; }
.board-die-face .p5 { left:73%; top:73%; }


.board-die-face-gem {
    border-radius:24%;
    transform:rotate(10deg);
}
.board-die-face-gem .pip {
    width:13%;
}
.board-die-face-gem::after {
    content:"";
    position:absolute;
    inset:12%;
    border-radius:22%;
    border:2px solid rgba(17,17,17,.28);
    transform:rotate(45deg);
}
.board-die-face-rune {
    clip-path:polygon(50% 2%, 91% 25%, 91% 75%, 50% 98%, 9% 75%, 9% 25%);
    border-radius:0;
}
.board-die-face-rune .die-rune-core {
    position:absolute;
    inset:0;
    display:grid;
    place-items:center;
    font-size:26px;
    font-weight:900;
    color:var(--board-die-number);
}
.board-die-face-rune .die-rune-mark {
    position:absolute;
    width:18%;
    height:3px;
    border-radius:999px;
    background:var(--board-die-number);
    left:50%;
    transform:translateX(-50%);
}
.board-die-face-rune .die-rune-mark.m1 { top:22%; }
.board-die-face-rune .die-rune-mark.m2 { bottom:22%; }
.board-die-face-rune .die-rune-mark.m3 { top:50%; width:28%; }

.dice-style-dialog {
    width:min(760px,calc(100vw - 28px));
}
.dice-style-body {
    padding-top:14px;
    padding-bottom:14px;
}
.dice-style-grid {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:12px;
}
.dice-style-card {
    border:1px solid #d7dfeb;
    border-radius:14px;
    background:#fff;
    padding:12px;
    display:grid;
    gap:10px;
}
.dice-style-card.selected {
    border-color:#b77900;
    box-shadow:0 0 0 1px rgba(183,121,0,.15);
}
.dice-style-preview-wrap {
    min-height:92px;
    display:grid;
    place-items:center;
}
.dice-style-preview-wrap .board-die-face {
    width:72px;
}
.dice-style-card-text {
    display:grid;
    gap:4px;
}
.dice-style-card-text small.muted {
    color:#697586;
}
.dice-style-card-actions {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:8px;
}
.tool-card-top-actions {
    position:absolute;
    top:8px;
    right:8px;
    display:flex;
    gap:6px;
    z-index:2;
}
.tool-style-pencil {
    width:28px;
    height:28px;
    border-radius:999px;
    border:1px solid #d0d8e4;
    background:#fff;
    color:#5d6b82;
    font-size:13px;
    cursor:pointer;
}
.tool-style-pencil.selected {
    border-color:#b77900;
    color:#925d00;
    background:#fff7e6;
}
.tool-style-note {
    display:block;
    color:#925d00;
}
.tool-catalog-card.preferred-dice-style {
    box-shadow:0 0 0 1px rgba(183,121,0,.12);
}

/* Patch 139 - lancio dadi condiviso */
.dice-share-option {
    margin-top:10px;
    padding:10px 12px;
    align-items:flex-start;
    white-space:normal;
    border:1px solid #dbe3ec;
    border-radius:9px;
    background:#f8fafc;
}
.dice-share-option > span { display:grid; gap:2px; min-width:0; }
.dice-share-option strong { font-size:10px; color:#253247; }
.dice-share-option small { font-size:9px; line-height:1.35; color:#697586; }


/* Patch 142 - Dadi / modali configurazione / Asset & Catalogo */

/* La modale Dadi deve restare compatta e senza scrollbar interna. */
.dice-config-dialog {
    width:min(700px,calc(100vw - 28px));
    max-height:none;
}
.dice-config-dialog .admin-modal-body {
    overflow:hidden;
}
.dice-config-body {
    gap:12px;
    padding-top:12px;
    padding-bottom:12px;
}
.dice-type-grid {
    gap:7px;
}
.dice-type-grid > button {
    min-height:84px;
    padding:8px 6px;
    border-radius:10px;
}
.dice-type-grid > button strong {
    font-size:13px;
}
.dice-type-grid > button small {
    font-size:9px;
}
.dice-type-icon {
    width:34px;
    height:34px;
    border-radius:8px;
    font-size:20px;
}
.dice-count-row {
    gap:10px;
    grid-template-columns:minmax(0,1fr) minmax(190px,.65fr);
}
.dice-count-row > label,
.dice-roll-summary {
    padding:10px;
}
.dice-share-option {
    margin-top:0;
    padding:8px 10px;
}

/* Le configurazioni DICE del System Admin devono adattarsi anche quando
   la finestra viene ridimensionata: nessun testo o checkbox può uscire. */
.dice-admin-config {
    min-width:0;
}
.dice-admin-config .form-grid {
    grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
}
.dice-admin-config .form-grid > label {
    min-width:0;
}
.dice-admin-config .check-label {
    min-width:0;
    align-items:flex-start;
    white-space:normal;
}
.dice-admin-config .check-label > span {
    min-width:0;
    white-space:normal;
    overflow-wrap:anywhere;
}
.dice-admin-config .check-label small {
    white-space:normal;
    overflow-wrap:anywhere;
    line-height:1.35;
}

/* Le griglie dei form dentro modali ridimensionabili non devono imporre
   una larghezza minima orizzontale superiore alla finestra. */
.admin-modal .form-grid {
    grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr));
}
.admin-modal .form-grid > * {
    min-width:0;
}

/* Patch 145 - editor skin Dadi */
.dice-texture-editor {
    display:grid;
    gap:10px;
    min-width:0;
    padding:10px;
    border:1px solid #dbe3ec;
    border-radius:10px;
    background:#f8fafc;
}
.dice-texture-editor-head,
.dice-texture-upload-row {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    min-width:0;
}
.dice-texture-editor-head > div {
    display:grid;
    gap:3px;
    min-width:0;
}
.dice-texture-editor-head small,
.dice-texture-status {
    color:#697586;
    white-space:normal;
    overflow-wrap:anywhere;
}
.dice-texture-preview {
    width:58px;
    height:58px;
    border-radius:10px;
    object-fit:cover;
    border:1px solid #cfd8e5;
    background:#fff;
}
@media(max-width:720px) {
    .dice-texture-editor-head,
    .dice-texture-upload-row {
        align-items:flex-start;
        flex-direction:column;
    }
}


/* Patch 147 - Modifica stile Dadi: card compatte e controlli coerenti */
.tool-style-pencil-bottom {
    position:absolute;
    right:8px;
    bottom:8px;
    top:auto;
    z-index:3;
}
.tool-catalog-card:has(.tool-style-pencil-bottom) .tool-catalog-main {
    padding-bottom:28px;
}

/* La griglia non allunga una singola skin per tutta la modale:
   ogni variante mantiene lo stesso box, come una card Shop. */
.dice-style-dialog {
    width:min(820px,calc(100vw - 28px));
}
.dice-style-body {
    padding:14px;
    overflow:auto;
}
.dice-style-grid {
    display:grid;
    grid-template-columns:repeat(auto-fill,240px);
    grid-auto-rows:198px;
    align-items:stretch;
    justify-content:start;
    gap:12px;
}
.dice-style-card {
    width:240px;
    height:198px;
    min-width:240px;
    max-width:240px;
    box-sizing:border-box;
    padding:10px;
    gap:7px;
    grid-template-rows:70px minmax(0,1fr) 30px;
    overflow:hidden;
}
.dice-style-preview-wrap {
    min-height:70px;
    height:70px;
    border:1px solid #e2e7ef;
    border-radius:9px;
    background:#f8fafc;
}
.dice-style-preview-wrap .board-die-face {
    width:52px;
    max-width:52px;
}
.dice-style-card-text {
    min-width:0;
    align-content:start;
    gap:2px;
    overflow:hidden;
}
.dice-style-card-text > strong {
    font-size:11px;
    line-height:1.25;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.dice-style-card-text > small {
    font-size:9px;
    line-height:1.3;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.dice-style-card-text > small.muted {
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    white-space:normal;
    overflow:hidden;
}
.dice-style-card-actions {
    min-height:30px;
    height:30px;
    align-items:center;
}
.dice-style-card-actions .primary-button.compact {
    margin-left:auto;
    white-space:nowrap;
}
@media(max-width:560px) {
    .dice-style-grid {
        grid-template-columns:1fr;
        grid-auto-rows:198px;
    }
    .dice-style-card {
        width:100%;
        min-width:0;
        max-width:none;
    }
}


/* Patch 148 - layering modale stile e configuratore SysAdmin Dadi */
.dice-style-backdrop {
    z-index:60000 !important;
}
.dice-style-card.selected {
    border-color:#2f8f55 !important;
    background:#f4fbf6;
    box-shadow:0 0 0 2px rgba(47,143,85,.15) !important;
}
.dice-style-card-actions .active-style-button {
    margin-left:auto;
    border-color:#2f8f55;
    color:#236b40;
    background:#edf8f0;
    opacity:1;
}

.dice-admin-section {
    margin-top:14px;
    border:1px solid #dbe3ec;
    border-radius:12px;
    background:#fff;
    padding:12px;
    display:grid;
    gap:12px;
}
.dice-admin-section > header {
    display:flex;
    align-items:baseline;
    gap:8px;
    flex-wrap:wrap;
}
.dice-admin-section > header strong { font-size:12px; color:#263247; }
.dice-admin-section > header small { font-size:9px; color:#6e7a8e; }
.dice-icon-style-grid {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:9px;
}
.dice-icon-style-card {
    min-width:0;
    border:1px solid #d8e0ea;
    border-radius:10px;
    background:#f9fbfd;
    padding:9px;
    display:grid;
    grid-template-columns:60px minmax(0,1fr);
    align-items:center;
    gap:9px;
    text-align:left;
    cursor:pointer;
}
.dice-icon-style-card.selected {
    border-color:#d28a00;
    background:#fff8e8;
    box-shadow:0 0 0 1px rgba(210,138,0,.12);
}
.dice-icon-style-card > span:last-child { display:grid; gap:2px; min-width:0; }
.dice-icon-style-card strong { font-size:10px; }
.dice-icon-style-card small { font-size:8px; color:#68758a; }
.dice-admin-icon-preview {
    width:58px;
    height:58px;
    display:grid;
    place-items:center;
    border:1px solid #e0e6ef;
    border-radius:9px;
    background:#fff;
}
.dice-admin-icon-preview .board-die-face { width:42px; }

.dice-appearance-layout {
    display:grid;
    grid-template-columns:minmax(0,1fr) 190px;
    gap:14px;
    align-items:stretch;
}
.dice-appearance-fields { min-width:0; display:grid; gap:12px; align-content:start; }
.dice-appearance-fields > label { display:grid; gap:5px; font-size:9px; color:#536176; }
.dice-color-common-grid {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(125px,1fr));
    gap:9px;
}
.dice-color-field {
    display:flex !important;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    min-height:48px;
    padding:7px 9px;
    border:1px solid #dde4ed;
    border-radius:9px;
    background:#fafbfd;
}
.dice-color-field > span { font-size:9px; color:#4f5d72; }
.dice-color-picker-box {
    width:44px !important;
    height:34px !important;
    min-width:44px;
    padding:2px !important;
    border:1px solid #cbd5e1 !important;
    border-radius:7px !important;
    background:#fff !important;
    cursor:pointer;
}
.dice-random-palette-editor {
    border:1px solid #dde4ed;
    border-radius:9px;
    background:#fafbfd;
    padding:9px;
    display:grid;
    gap:8px;
}
.dice-random-palette-head { display:grid; gap:2px; }
.dice-random-palette-head strong { font-size:10px; }
.dice-random-palette-head small { font-size:8px; color:#6a778a; }
.dice-random-palette-colors {
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:7px;
}
.dice-palette-color {
    display:flex;
    align-items:center;
    gap:3px;
    padding:4px;
    border:1px solid #d9e1eb;
    border-radius:8px;
    background:#fff;
}
.dice-palette-color input[type="color"] {
    width:38px;
    height:32px;
    padding:2px;
    border:1px solid #cbd5e1;
    border-radius:6px;
    background:#fff;
    cursor:pointer;
}
.dice-admin-model-preview {
    min-width:0;
    border:1px solid #dbe3ec;
    border-radius:11px;
    background:#f8fafc;
    display:grid;
    place-items:center;
    align-content:center;
    gap:9px;
    padding:12px;
}
.dice-admin-preview-label { font-size:8px; font-weight:700; color:#66748a; text-transform:uppercase; letter-spacing:.04em; }
.dice-admin-d6 {
    --dice-preview-body:#f4ead4;
    --dice-preview-edge:#171717;
    --dice-preview-number:#111111;
    position:relative;
    width:92px;
    aspect-ratio:1;
    box-sizing:border-box;
    border:4px solid var(--dice-preview-edge);
    border-radius:16px;
    background-color:var(--dice-preview-body);
    box-shadow:0 10px 20px rgba(15,23,42,.18);
}
.dice-admin-d6 .pip {
    position:absolute;
    width:13px;
    height:13px;
    border-radius:50%;
    background:var(--dice-preview-number);
    transform:translate(-50%,-50%);
}
.dice-admin-d6 .p1 { left:27%; top:27%; }
.dice-admin-d6 .p2 { left:73%; top:27%; }
.dice-admin-d6 .p3 { left:50%; top:50%; }
.dice-admin-d6 .p4 { left:27%; top:73%; }
.dice-admin-d6 .p5 { left:73%; top:73%; }
.dice-admin-model-preview > small { font-size:8px; color:#657286; text-align:center; }
.dice-texture-editor-conditional { margin-top:0; }
.dice-behavior-grid { grid-template-columns:repeat(3,minmax(0,1fr)) !important; }

@media(max-width:900px) {
    .dice-icon-style-grid { grid-template-columns:1fr; }
    .dice-appearance-layout { grid-template-columns:1fr; }
    .dice-admin-model-preview { min-height:150px; }
    .dice-behavior-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
}
@media(max-width:620px) {
    .dice-behavior-grid { grid-template-columns:1fr !important; }
}


/* Patch 150 - Dadi */
.board-die-face { border-width:var(--board-die-border-width,3px); background-position:center; background-size:cover; }
.dice-icon-style-grid.single { grid-template-columns:minmax(0,1fr); }
.dice-icon-style-card.static { cursor:default; }
.dice-small-number { width:72px; min-width:72px; }
.dice-admin-model-preview { background:linear-gradient(180deg,#fbfcfe 0%,#f1f5f9 100%); }
.dice-admin-preview-stage { width:120px; height:120px; display:grid; place-items:center; perspective:720px; }
.dice-admin-d6 { border-width:var(--dice-preview-edge-width,4px); background-position:center; background-size:cover; }
.dice-admin-d6.isometric { transform-style:preserve-3d; transform:rotateX(58deg) rotateZ(-45deg); box-shadow:-18px 24px 28px rgba(15,23,42,.14); }
.dice-admin-d6.isometric::before, .dice-admin-d6.isometric::after { content:""; position:absolute; inset:0; border-radius:16px; pointer-events:none; }
.dice-admin-d6.isometric::before { transform:translateZ(-1px) translateY(10px) skewX(-45deg); background:linear-gradient(180deg,rgba(0,0,0,.14),rgba(0,0,0,.04)); opacity:.26; filter:blur(1px); }
.dice-admin-d6.auto-rotate { animation:tackora-dice-preview-spin 8s linear infinite; }
@keyframes tackora-dice-preview-spin { 0% { transform:rotateX(58deg) rotateZ(-45deg) rotateY(0deg); } 100% { transform:rotateX(58deg) rotateZ(-45deg) rotateY(360deg); } }


/* Patch 151 - preview Shop Dadi legata al ConfigJson reale */
.shop-dice-preview {
    width:100%;
    height:100%;
    min-height:110px;
    display:grid;
    place-items:center;
    perspective:640px;
    overflow:visible;
}
.shop-dice-preview.compact {
    width:42px;
    height:42px;
    min-height:42px;
}
.shop-dice-preview-detail {
    min-height:250px;
}
.shop-dice-cube {
    --dice-shop-body:#f4ead4;
    --dice-shop-edge:#171717;
    --dice-shop-edge-width:4px;
    --dice-shop-number:#111111;
    --dice-shop-texture:none;
    position:relative;
    width:82px;
    height:82px;
    box-sizing:border-box;
    border:var(--dice-shop-edge-width) solid var(--dice-shop-edge);
    border-radius:16px;
    background-color:var(--dice-shop-body);
    background-image:var(--dice-shop-texture);
    background-size:cover;
    background-position:center;
    background-blend-mode:multiply;
    transform:rotateX(58deg) rotateZ(-45deg);
    box-shadow:-18px 22px 24px rgba(15,23,42,.18);
}
.shop-dice-preview.compact .shop-dice-cube {
    width:30px;
    height:30px;
    border-radius:7px;
    box-shadow:-6px 8px 9px rgba(15,23,42,.18);
}
.shop-dice-preview-detail .shop-dice-cube {
    width:132px;
    height:132px;
    border-radius:22px;
    box-shadow:-26px 32px 36px rgba(15,23,42,.20);
}
.shop-dice-cube .pip {
    position:absolute;
    width:14%;
    aspect-ratio:1;
    border-radius:50%;
    background:var(--dice-shop-number);
    transform:translate(-50%,-50%);
}
.shop-dice-cube .p1 { left:27%; top:27%; }
.shop-dice-cube .p2 { left:73%; top:27%; }
.shop-dice-cube .p3 { left:50%; top:50%; }
.shop-dice-cube .p4 { left:27%; top:73%; }
.shop-dice-cube .p5 { left:73%; top:73%; }

/* Patch 152 - preview Dadi realmente 3D e layout Asset v2 */
.shop-dice-preview,
.dice-admin-preview-stage {
    --die-number:var(--dice-shop-number,#111111);
}
.shop-dice-preview {
    overflow:visible;
    perspective:720px;
}
.shop-dice-cube3d,
.dice-admin-cube3d {
    position:relative;
    width:var(--dice-cube-size,88px);
    height:var(--dice-cube-size,88px);
    transform-style:preserve-3d;
}
.shop-dice-cube3d {
    --dice-cube-size:88px;
    --dice-cube-half:44px;
    transform:rotateX(-24deg) rotateY(38deg) rotateZ(2deg);
    filter:drop-shadow(0 18px 14px rgba(15,23,42,.18));
}
.shop-dice-preview.compact .shop-dice-cube3d { --dice-cube-size:32px; --dice-cube-half:16px; }
.shop-dice-preview-detail .shop-dice-cube3d {
    --dice-cube-size:138px;
    --dice-cube-half:69px;
    animation:tackora-shop-dice-turn 10s ease-in-out infinite alternate;
}
.shop-dice-face,
.dice-admin-cube-face {
    position:absolute;
    inset:0;
    box-sizing:border-box;
    backface-visibility:hidden;
    background-color:var(--dice-shop-body,var(--dice-preview-body,#f4ead4));
    background-image:var(--dice-shop-texture,var(--dice-preview-texture,none));
    background-size:cover;
    background-position:center;
    background-blend-mode:multiply;
    border:var(--dice-shop-edge-width,var(--dice-preview-edge-width,4px)) solid var(--dice-shop-edge,var(--dice-preview-edge,#171717));
    border-radius:16%;
    box-shadow:inset 0 0 18px rgba(255,255,255,.16), inset 0 -10px 22px rgba(0,0,0,.06);
    --die-number:var(--dice-shop-number,var(--dice-preview-number,#111111));
}
.shop-dice-preview.compact .shop-dice-face { border-radius:18%; }
.shop-dice-face.front,
.dice-admin-cube-face.front { transform:translateZ(var(--dice-cube-half,44px)); }
.shop-dice-face.back,
.dice-admin-cube-face.back { transform:rotateY(180deg) translateZ(var(--dice-cube-half,44px)); }
.shop-dice-face.right,
.dice-admin-cube-face.right { transform:rotateY(90deg) translateZ(var(--dice-cube-half,44px)); }
.shop-dice-face.left,
.dice-admin-cube-face.left { transform:rotateY(-90deg) translateZ(var(--dice-cube-half,44px)); }
.shop-dice-face.top,
.dice-admin-cube-face.top { transform:rotateX(90deg) translateZ(var(--dice-cube-half,44px)); }
.shop-dice-face.bottom,
.dice-admin-cube-face.bottom { transform:rotateX(-90deg) translateZ(var(--dice-cube-half,44px)); }

.shop-dice-face::after,
.dice-admin-cube-face::after {
    content:"";
    position:absolute;
    inset:0;
    border-radius:inherit;
    pointer-events:none;
}
.shop-dice-face.face-one::after,.dice-admin-cube-face.face-one::after {
    background:radial-gradient(circle at 50% 50%,var(--die-number) 0 7%,transparent 8%);
}
.shop-dice-face.face-two::after,.dice-admin-cube-face.face-two::after {
    background:radial-gradient(circle at 28% 28%,var(--die-number) 0 7%,transparent 8%),radial-gradient(circle at 72% 72%,var(--die-number) 0 7%,transparent 8%);
}
.shop-dice-face.face-three::after,.dice-admin-cube-face.face-three::after {
    background:radial-gradient(circle at 28% 28%,var(--die-number) 0 7%,transparent 8%),radial-gradient(circle at 50% 50%,var(--die-number) 0 7%,transparent 8%),radial-gradient(circle at 72% 72%,var(--die-number) 0 7%,transparent 8%);
}
.shop-dice-face.face-four::after,.dice-admin-cube-face.face-four::after {
    background:radial-gradient(circle at 28% 28%,var(--die-number) 0 7%,transparent 8%),radial-gradient(circle at 72% 28%,var(--die-number) 0 7%,transparent 8%),radial-gradient(circle at 28% 72%,var(--die-number) 0 7%,transparent 8%),radial-gradient(circle at 72% 72%,var(--die-number) 0 7%,transparent 8%);
}
.shop-dice-face.face-five::after,.dice-admin-cube-face.face-five::after {
    background:radial-gradient(circle at 28% 28%,var(--die-number) 0 7%,transparent 8%),radial-gradient(circle at 72% 28%,var(--die-number) 0 7%,transparent 8%),radial-gradient(circle at 50% 50%,var(--die-number) 0 7%,transparent 8%),radial-gradient(circle at 28% 72%,var(--die-number) 0 7%,transparent 8%),radial-gradient(circle at 72% 72%,var(--die-number) 0 7%,transparent 8%);
}
.shop-dice-face.face-six::after,.dice-admin-cube-face.face-six::after {
    background:radial-gradient(circle at 28% 24%,var(--die-number) 0 7%,transparent 8%),radial-gradient(circle at 72% 24%,var(--die-number) 0 7%,transparent 8%),radial-gradient(circle at 28% 50%,var(--die-number) 0 7%,transparent 8%),radial-gradient(circle at 72% 50%,var(--die-number) 0 7%,transparent 8%),radial-gradient(circle at 28% 76%,var(--die-number) 0 7%,transparent 8%),radial-gradient(circle at 72% 76%,var(--die-number) 0 7%,transparent 8%);
}
@keyframes tackora-shop-dice-turn {
    from { transform:rotateX(-22deg) rotateY(28deg) rotateZ(0deg); }
    to { transform:rotateX(-30deg) rotateY(58deg) rotateZ(3deg); }
}

.dice-admin-preview-stage {
    --dice-cube-size:94px;
    --dice-cube-half:47px;
    --die-number:var(--dice-preview-number,#111111);
    perspective:760px;
}
.dice-admin-cube3d {
    --dice-cube-size:94px;
    --dice-cube-half:47px;
    filter:drop-shadow(0 16px 13px rgba(15,23,42,.18));
}
.dice-admin-cube3d.auto-rotate { animation:tackora-admin-dice-spin 9s linear infinite; }
.dice-admin-preview-stage:hover .dice-admin-cube3d.auto-rotate { animation-play-state:paused; }
@keyframes tackora-admin-dice-spin {
    0% { transform:rotateX(-25deg) rotateY(25deg); }
    25% { transform:rotateX(-18deg) rotateY(115deg); }
    50% { transform:rotateX(-32deg) rotateY(205deg); }
    75% { transform:rotateX(-20deg) rotateY(295deg); }
    100% { transform:rotateX(-25deg) rotateY(385deg); }
}


/* Patch 155 - Shop dadi con thumbnail 3D reali e preview WebGL */
.shop-dice-thumbnail { display:block; object-fit:contain; margin-inline:auto; filter:drop-shadow(0 16px 18px rgba(15,23,42,.16)); }
.shop-dice-thumbnail-card { width:min(150px,78%); max-height:150px; }
.shop-dice-thumbnail-compact { width:34px; height:34px; }
.shop-dice-live-preview { width:100%; height:100%; min-height:110px; display:grid; place-items:center; }
.shop-dice-live-preview canvas { width:100% !important; height:100% !important; display:block; }
.shop-dice-live-preview-card { min-height:150px; }
.shop-dice-live-preview-compact { width:38px; height:38px; min-height:38px; }
.shop-dice-live-preview-detail { min-height:260px; }

