body {
            background-color: #020203;
            -webkit-tap-highlight-color: transparent;
        }

        .apple-glass {
            background: rgba(10, 10, 14, 0.7);
            backdrop-filter: saturate(180%) blur(24px);
            -webkit-backdrop-filter: saturate(180%) blur(24px);
            border: 1px solid rgba(255, 255, 255, 0.05);
        }

        .bg-subtle-grid-violet {
            background-size: 50px 50px;
            background-image:
                linear-gradient(to right, rgba(139, 92, 246, 0.015) 1px, transparent 1px),
                linear-gradient(to bottom, rgba(139, 92, 246, 0.015) 1px, transparent 1px);
        }

        .custom-scroll::-webkit-scrollbar {
            width: 5px;
        }

        .custom-scroll::-webkit-scrollbar-track {
            background: transparent;
        }

        .custom-scroll::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 9999px;
        }

        /* Interactive 3D Dice Tray Perspective */
        .tray-perspective {
            perspective: 1200px;
            perspective-origin: 50% 30%;
        }

        .tray-surface {
            position: relative;
            width: 100%;
            height: 400px;
            overflow: hidden;
            border-radius: 32px;
            background: radial-gradient(circle at 50% 50%, rgba(20, 15, 38, 0.9) 0%, rgba(2, 2, 4, 0.98) 100%);
            border: 1px solid rgba(139, 92, 246, 0.12);
            box-shadow: inset 0 20px 80px rgba(0, 0, 0, 0.9), 0 25px 70px rgba(0, 0, 0, 0.4);
            transform-style: preserve-3d;
        }

        /* Dice Container & Multi-grid Layout on Mobile */
        .dice-grid {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 40px;
            width: 100%;
            height: 100%;
            padding: 20px;
            flex-wrap: wrap;
        }

        /* 3D Dice Object & Face Layout Mechanics */
        .dice-viewport {
            width: 80px;
            height: 80px;
            transform-style: preserve-3d;
            perspective: 1000px;
            transition: transform 0.15s ease-out, top 0.05s linear, left 0.05s linear;
            position: relative;
        }

        .dice-cube {
            position: absolute;
            width: 100%;
            height: 100%;
            transform-style: preserve-3d;
            transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.3, 1.05);
        }

        /* 3D Dice Face Panels */
        .dice-face {
            position: absolute;
            width: 80px;
            height: 80px;
            border-radius: 16px;
            border: 2px solid rgba(255, 255, 255, 0.12);
            box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.4), 0 5px 15px rgba(0, 0, 0, 0.5);
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            grid-template-rows: repeat(3, 1fr);
            padding: 8px;
            box-sizing: border-box;
            backface-visibility: visible;
        }

        /* Pips Layout Engine mapping */
        .pip {
            display: block;
            background-color: currentColor;
            border-radius: 50%;
            width: 10px;
            height: 10px;
            margin: auto;
        }

        /* Face Placement Translations */
        .face-1 {
            transform: rotateY(0deg) translateZ(40px);
        }

        .face-6 {
            transform: rotateY(180deg) translateZ(40px);
        }

        .face-2 {
            transform: rotateX(90deg) translateZ(40px);
        }

        .face-5 {
            transform: rotateX(-90deg) translateZ(40px);
        }

        .face-3 {
            transform: rotateY(90deg) translateZ(40px);
        }

        .face-4 {
            transform: rotateY(-90deg) translateZ(40px);
        }

        /* PIP POSITIONAL GRID ALIGNMENTS */
        /* Center Column/Row */
        .p-center {
            grid-area: 2 / 2;
        }

        /* Corners */
        .p-top-left {
            grid-area: 1 / 1;
        }

        .p-top-right {
            grid-area: 1 / 3;
        }

        .p-bottom-left {
            grid-area: 3 / 1;
        }

        .p-bottom-right {
            grid-area: 3 / 3;
        }

        /* Edges */
        .p-mid-left {
            grid-area: 2 / 1;
        }

        .p-mid-right {
            grid-area: 2 / 3;
        }

        /* SKINS */
        /* Class Ivory Style */
        .skin-ivory .dice-face {
            background: radial-gradient(circle at 35% 35%, #ffffff 0%, #eae7e0 60%, #cecac0 100%);
            color: #1c1c1f;
        }

        .skin-ivory .face-1 .pip {
            background-color: #dc2626;
            /* Crimson central pip for ivory style */
            width: 14px;
            height: 14px;
        }

        /* Obsidian Glass Style */
        .skin-obsidian .dice-face {
            background: linear-gradient(135deg, rgba(30, 30, 40, 0.85) 0%, rgba(10, 10, 15, 0.95) 100%);
            border: 2px solid rgba(139, 92, 246, 0.25);
            color: #fbbf24;
            /* Royal Gold pips */
            box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.2), 0 5px 15px rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(4px);
        }

        /* Cyber Neon Style */
        .skin-cyber .dice-face {
            background: radial-gradient(circle at 30% 30%, #1c1917 0%, #0c0a09 100%);
            border: 2px solid #ff007f;
            color: #06b6d4;
            /* Neon Blue Pips */
            box-shadow: 0 0 12px rgba(255, 0, 127, 0.35), inset 0 0 10px rgba(6, 182, 212, 0.2);
        }

        .skin-cyber .pip {
            box-shadow: 0 0 8px #06b6d4;
        }

        /* Royal Gold Style */
        .skin-gold .dice-face {
            background: radial-gradient(circle at 35% 35%, #fef08a 0%, #eab308 50%, #854d0e 100%);
            border: 2px solid #ca8a04;
            color: #171717;
            /* Charcoal Pips */
            box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.4), 0 5px 15px rgba(0, 0, 0, 0.5);
        }

        /* Rolling State Jitter & Rotations */
        @keyframes jitterRoll {
            0% {
                transform: translateY(0) rotate(0deg);
            }

            20% {
                transform: translateY(-30px) rotate(140deg);
            }

            40% {
                transform: translateY(15px) rotate(280deg);
            }

            60% {
                transform: translateY(-10px) rotate(420deg);
            }

            80% {
                transform: translateY(5px) rotate(560deg);
            }

            100% {
                transform: translateY(0) rotate(720deg);
            }
        }

        .is-rolling-anim {
            animation: jitterRoll 0.8s ease-in-out;
        }

        /* Tactile Roll Shadow scale dynamics */
        .dice-shadow {
            position: absolute;
            bottom: -15px;
            left: 50%;
            transform: translateX(-50%);
            width: 70px;
            height: 10px;
            background: rgba(0, 0, 0, 0.65);
            border-radius: 50%;
            filter: blur(5px);
            opacity: 0.8;
            transition: transform 0.05s linear, opacity 0.05s linear;
            pointer-events: none;
        }
