/* Кубики: the running multiplier on top, tiles 2–7 and 8–12 around two big dice, the roll button */
.g-cubes .g-stage { position: relative; padding: 46px 12px 12px; }
.cub-head { position: absolute; left: 12px; top: 10px; height: 28px; display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 14px; background: #232536; color: var(--fg); font-size: 12px; font-weight: 800; white-space: nowrap; }
.cub-segs { display: inline-flex; gap: 3px; }
.cub-segs i { width: 7px; height: 12px; border-radius: 2px; background: #3d4160; }
.cub-segs i.on { background: var(--accent); box-shadow: 0 0 6px rgba(212,255,58,.5); }
.g-cubes .history { left: 150px; -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0px, rgba(0,0,0,1) 22px); mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0px, rgba(0,0,0,1) 22px); }
.g-cubes.cub-lost { box-shadow: inset 0 0 0 2px rgba(255,93,99,.55); }
.cub-wrap { position: relative; display: grid; gap: 8px; }

/* the running multiplier */
.cub-mult { display: grid; justify-items: center; gap: 2px; padding-bottom: 2px; }
.cub-mult b { font-size: 54px; line-height: 1; font-weight: 900; letter-spacing: -1.5px; color: var(--fg); display: inline-block; }
.cub-mult b.cub-up, .cub-mult b.cub-w { color: var(--win); text-shadow: 0 0 24px rgba(212,255,58,.35); }
.cub-mult b.cub-dn { color: var(--fg); }
.cub-mult b.cub-l { color: var(--loss); }
.cub-mult span { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: var(--fg2); }
.cub-mult span b { font-size: 13px; letter-spacing: 0; color: var(--fg); }
.cub-mult span img { width: 15px; height: 15px; }

/* tiles: a raised slab, the sum small, the multiplier big; colour by size */
.cub-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.cub-row5 { grid-template-columns: repeat(5, calc((100% - 30px) / 6)); justify-content: center; }
.cub-t.kt { height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: linear-gradient(180deg, rgba(255,255,255,.07) 0%, rgba(255,255,255,0) 60%) var(--tile); box-shadow: 0 5px 0 var(--tile-edge), inset 0 1px 0 rgba(255,255,255,.1); }
.cub-ts { font-size: 11px; font-weight: 800; line-height: 1; color: var(--fg2); }
.cub-tm { font-size: 16px; font-weight: 900; line-height: 1; letter-spacing: -.3px; color: var(--fg); }
.cub-low .cub-tm { color: var(--fg2); }
.cub-low.kt { background: linear-gradient(180deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,0) 60%) #262839; }
.cub-l1 .cub-tm { color: #c6f25a; }
.cub-l2 .cub-tm { color: #d4ff3a; }
.cub-l3 .cub-tm { color: #f2e23a; }
.cub-l4 .cub-tm { color: #ffc337; }
.cub-l2.kt { background: linear-gradient(180deg, rgba(212,255,58,.16) 0%, rgba(212,255,58,.03) 70%) var(--tile); }
.cub-l3.kt { background: linear-gradient(180deg, rgba(242,226,58,.22) 0%, rgba(242,226,58,.06) 70%) var(--tile); }
.cub-l4.kt { background: linear-gradient(180deg, rgba(255,195,55,.34) 0%, rgba(255,195,55,.1) 70%) #3a3346; }
.cub-trap.kt { background: linear-gradient(180deg, rgba(255,93,99,.2) 0%, rgba(255,93,99,.06) 70%) #35172a; box-shadow: 0 5px 0 #1d0a14, inset 0 1px 0 rgba(255,255,255,.08); }
.cub-trap .cub-ts { color: #ff9ca0; }
.cub-x { width: 20px; height: 20px; display: block; }
.cub-x svg { width: 100%; height: 100%; display: block; }
/* hit this roll: a solid face; hit earlier this round: an outline; the trap that ended it: solid red */
.cub-t.kt.cub-hit { background: var(--win); box-shadow: 0 5px 0 #8fb012, 0 0 22px rgba(212,255,58,.45); }
.cub-l3.kt.cub-hit { background: #f2e23a; box-shadow: 0 5px 0 #a59a14, 0 0 22px rgba(242,226,58,.45); }
.cub-l4.kt.cub-hit { background: var(--gold); box-shadow: 0 5px 0 #a87a10, 0 0 22px rgba(255,195,55,.5); }
.cub-low.kt.cub-hit { background: #d9dbe8; box-shadow: 0 5px 0 #8c90a8, 0 0 18px rgba(255,255,255,.2); }
.cub-t.kt.cub-hit .cub-tm, .cub-t.kt.cub-hit .cub-ts { color: var(--on-accent); }
.cub-t.kt.cub-was { box-shadow: 0 5px 0 var(--tile-edge), inset 0 0 0 2px rgba(212,255,58,.6); }
.cub-l4.kt.cub-was, .cub-l3.kt.cub-was { box-shadow: 0 5px 0 var(--tile-edge), inset 0 0 0 2px rgba(255,195,55,.65); }
.cub-low.kt.cub-was { box-shadow: 0 5px 0 var(--tile-edge), inset 0 0 0 2px rgba(255,255,255,.4); }
.cub-trap.kt.cub-bust { background: radial-gradient(ellipse at 50% 40%, #ff8f7d 0%, #ff5d63 50%, #c62c38 100%); box-shadow: 0 5px 0 #7a1620, 0 0 26px rgba(255,93,99,.55); }
.cub-trap.kt.cub-bust .cub-ts { color: #ffffff; }

/* the dice */
.cub-dice { height: 92px; display: flex; align-items: center; justify-content: center; gap: 22px; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.cub-die { width: 64px; height: 64px; border-radius: 15px; background: linear-gradient(180deg, #ffffff 0%, #eceef6 100%); box-shadow: 0 6px 0 #9a9fba, 0 14px 20px rgba(0,0,0,.5), inset 0 -2px 0 rgba(0,0,0,.06); padding: 9px; will-change: transform; }
.cub-face { width: 100%; height: 100%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); place-items: center; }
.cub-face i { width: 11px; height: 11px; border-radius: 50%; background: #161826; opacity: 0; box-shadow: inset 0 2px 0 rgba(0,0,0,.4); }
.cub-face i.on { opacity: 1; }
.cub-sum { min-width: 44px; height: 44px; padding: 0 8px; border-radius: 22px; display: grid; place-items: center; font-size: 24px; font-weight: 900; background: #232536; color: var(--fg); box-shadow: inset 0 0 0 2px #3d4160; }
.cub-sum.cub-q { color: var(--fg2); }
.cub-sum.cub-s-w { background: var(--win); color: var(--on-accent); box-shadow: 0 0 20px rgba(212,255,58,.4); }
.cub-sum.cub-s-l { background: var(--loss); color: #ffffff; box-shadow: 0 0 20px rgba(255,93,99,.4); }

/* the multiplier that flies from a tile into the big number */
.cub-fly { position: absolute; left: 0; top: 0; z-index: 9; height: 30px; padding: 0 10px; border-radius: 15px; display: grid; place-items: center; background: var(--win); color: var(--on-accent); font-size: 16px; font-weight: 900; white-space: nowrap; pointer-events: none; box-shadow: 0 8px 18px rgba(0,0,0,.45); }

.cub-fly.cub-f-low { background: #d9dbe8; }
.cub-fly.cub-f-l3 { background: #f2e23a; }
.cub-fly.cub-f-l4 { background: var(--gold); }
/* roll: a big raised violet button */
.cub-roll { position: relative; top: 0; height: 52px; margin-top: 2px; margin-bottom: 5px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; background: linear-gradient(180deg, #a497ff 0%, #8b7bff 100%); color: #ffffff; font-size: 17px; font-weight: 900; box-shadow: 0 5px 0 #4b3fb8, 0 12px 22px rgba(139,123,255,.22); touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.cub-roll:active { top: 3px; box-shadow: 0 2px 0 #4b3fb8; }
.cub-roll.cub-idle { background: var(--tile); color: var(--fg2); box-shadow: 0 5px 0 var(--tile-edge); }
.cub-roll.cub-idle:active { top: 3px; box-shadow: 0 2px 0 var(--tile-edge); }
.cub-roll svg { flex: none; }

/* controls */
.cub-seg { padding: 3px; gap: 2px; }
.cub-seg button { height: 40px; padding: 0; font-size: 13px; min-width: 0; }
.cub-seg button:disabled { opacity: .55; }
.g-cubes .result .big img { width: 24px; height: 24px; vertical-align: -3px; margin-left: 4px; }
