.hero-carousel{width:100%;max-width:400px;margin-left:auto;min-width:0;--cube-depth:200px;--cube-rest:rotateX(-14deg) rotateY(-22deg) scale3d(.76,.76,.76)}
.hero-cube-stage{position:relative;--ground-shadow-opacity:.78}
.hero-cube-stage::after{content:"";position:absolute;left:50%;bottom:-42px;width:72%;height:26px;background:radial-gradient(ellipse at center,#000 0%,#000b 30%,#0000 72%);border-radius:50%;pointer-events:none;translate:var(--cube-push-x,0px) var(--cube-shadow-y,0px);scale:var(--cube-shadow-scale,1);transition:translate .36s cubic-bezier(.2,.75,.2,1),scale .36s cubic-bezier(.2,.75,.2,1);animation:hero-cube-ground-shadow 6s ease-in-out infinite}
:root[data-theme=light] .hero-cube-stage{--ground-shadow-opacity:.25}
.hero-cube-scene{display:block;position:relative;width:100%;aspect-ratio:1;perspective:1400px;perspective-origin:50% 50%;padding:0;border:0;background:transparent;border-radius:0;touch-action:manipulation;translate:var(--cube-push-x,0px) var(--cube-push-y,0px);transition:translate .36s cubic-bezier(.2,.75,.2,1);animation:hero-cube-float 6s ease-in-out infinite}
.hero-carousel.is-rolling .hero-cube-scene,.hero-cube-scene:has(:focus-visible),.hero-carousel.is-rolling .hero-cube-stage::after,.hero-cube-stage:has(:focus-visible)::after{animation-play-state:paused}
@keyframes hero-cube-float{0%,100%{transform:translateY(0) rotate(0deg)}50%{transform:translateY(-7px) rotate(.45deg)}}
@keyframes hero-cube-ground-shadow{0%,100%{transform:translateX(-50%) scale(1);opacity:var(--ground-shadow-opacity);filter:blur(4px)}50%{transform:translateX(-50%) scale(1.1,1.15);opacity:calc(var(--ground-shadow-opacity) * .8);filter:blur(6px)}}
.hero-cube-trigger{position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;border-radius:inherit;background:transparent}
.hero-cube-trigger:disabled{opacity:1;cursor:default}
.hero-carousel.is-ready .hero-cube-scene{cursor:pointer}
.hero-cube-object{display:block;position:relative;width:100%;height:100%;transform-style:preserve-3d;transform:translateZ(calc(-1 * var(--cube-depth))) var(--cube-rest) rotateX(0deg) rotateY(90deg) rotateZ(0deg);pointer-events:none}
.hero-carousel.is-ready .hero-cube-object{transition:transform 1700ms cubic-bezier(.16,.66,.24,1)}
.hero-cube-face{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:18px;backface-visibility:hidden;-webkit-backface-visibility:hidden;border:1px solid color-mix(in srgb,var(--ink) 24%,transparent);border-radius:0;background:#e8c047;box-shadow:none;filter:saturate(.6) brightness(.94);transition:filter .18s ease}
.hero-cube-face[data-highlight]{filter:saturate(1) brightness(1);transition-duration:.55s}
/* Restore colour during the final 550ms of the 1700ms roll. */
.hero-carousel.is-rolling .hero-cube-face[data-highlight]{transition-delay:1.15s}
.hero-cube-face::after{content:"";position:absolute;inset:0;z-index:1;background:#000;opacity:var(--cube-shade,.16);pointer-events:none}
.hero-cube-face img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:0}
.hero-cube-artwork{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-width:0;border-radius:0}
.hero-cube-artwork[data-background]{background:#2c2f26;padding:12px}
:root[data-theme=light] .hero-cube-artwork[data-background]{background:#fff}
.hero-cube-face[data-tooltip]{pointer-events:auto}
.hero-cube-use{position:absolute;left:32px;right:32px;bottom:32px;z-index:2;min-height:54px;font-size:15px;padding:12px 10px;opacity:0;pointer-events:none;box-shadow:0 6px 22px #0005;transition:opacity .16s,background .15s}
.hero-cube-face[data-tooltip]:hover .hero-cube-use,.hero-cube-face[data-tooltip]:focus-within .hero-cube-use{opacity:1;pointer-events:auto}
@media(hover:hover){.hero-cube-scene:has(.hero-cube-face[data-tooltip]:hover),.hero-cube-stage:has(.hero-cube-face[data-tooltip]:hover)::after{animation-play-state:paused}}
@media(hover:none){.hero-cube-face[data-tooltip] .hero-cube-use{opacity:1;pointer-events:auto}}
.hero-cube-face[data-face="0"]{transform:translateZ(var(--cube-depth))}
.hero-cube-face[data-face="1"]{transform:rotateY(90deg) translateZ(var(--cube-depth))}
.hero-cube-face[data-face="2"]{transform:rotateY(180deg) translateZ(var(--cube-depth))}
.hero-cube-face[data-face="3"]{transform:rotateX(90deg) translateZ(var(--cube-depth))}
.hero-cube-face[data-face="4"]{transform:rotateY(-90deg) translateZ(var(--cube-depth))}
.hero-cube-face[data-face="5"]{transform:rotateX(-90deg) translateZ(var(--cube-depth))}
.hero-cube-controls{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:8px;margin-top:50px;min-height:88px}
.hero-cube-actions{position:relative;display:flex;align-items:center;justify-content:center;min-height:44px}
.hero-cube-mute{position:absolute;left:calc(100% + 8px);width:44px;height:44px;color:var(--muted);background:transparent;border:1px solid var(--line);border-radius:8px;transition:color .15s,border-color .15s,background .15s}
.hero-cube-mute:hover,.hero-cube-mute:focus-visible{color:var(--text);border-color:var(--gold);background:var(--surface)}
.hero-cube-mute .dice-sound-off,.hero-cube-mute[aria-pressed=true] .dice-sound-on{display:none}
.hero-cube-mute[aria-pressed=true] .dice-sound-off{display:block}
.hero-cube-roll{min-width:118px}.hero-cube-result{min-height:36px;text-decoration:underline;text-underline-offset:3px}
.hero-cube-trigger[aria-disabled=true],.hero-cube-roll[aria-disabled=true]{cursor:wait}
.hero-cube-roll[aria-disabled=true]{opacity:.7}
.hero-cube-caption{margin-top:10px;text-align:center;font-size:12px;color:var(--muted);min-height:20px}
.admin-hero-panel>p{margin:14px 0;max-width:780px;line-height:1.8;color:var(--muted)}
.admin-hero-faces{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px;margin-top:28px}
.admin-hero-face{min-width:0}.admin-hero-face select{width:100%}
.admin-hero-preview{aspect-ratio:1.4;display:flex;align-items:center;justify-content:center;background:var(--bg);border:1px solid var(--line);border-radius:10px;padding:20px;margin-top:14px}
.admin-hero-preview img{max-width:100%;max-height:100%;object-fit:contain;width:auto;height:auto}
.admin-hero-save{display:flex;flex-wrap:wrap;align-items:center;gap:18px;margin-top:28px}
@media(max-width:800px){.hero-carousel{max-width:340px}.admin-hero-faces{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}}
@media(max-width:760px){.page-home .hero-carousel{display:none}.page-home .hero{grid-template-columns:1fr}}
@media(max-width:560px){.hero-carousel{max-width:min(300px,82vw);margin:12px auto 0}.hero-cube-controls .button{padding:10px 12px;min-width:0}.admin-hero-faces{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.hero-cube-scene{animation:none;translate:none;transition:none}.hero-cube-stage::after{animation:none;translate:none;scale:1;transition:none;transform:translateX(-50%);opacity:var(--ground-shadow-opacity);filter:blur(4px)}.hero-carousel.is-ready .hero-cube-object,.hero-cube-face{transition:none}}
