/* Sic bo demo. Classes use the sb- prefix; shared table pieces come from /demos/_tables/table.css (tb-). */

.sb-screen { display: grid; grid-template-columns: 268px minmax(0, 1fr) 296px; gap: 16px; align-items: start; padding: 12px 16px 14px; }
.sb-left, .sb-right, .sb-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ---------- shaker ---------- */
.sb-shaker { border-radius: 14px; background: radial-gradient(120% 90% at 50% 0%, #22252e, #12141a 70%); border: 1px solid var(--s-line); padding: 8px 12px 12px; }
.sb-plinth { position: relative; height: 214px; }
.sb-plinth::before { content: ''; position: absolute; left: 6%; right: 6%; bottom: 8px; height: 58px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 30%, #5a1a22, #2c0a10 70%); box-shadow: 0 0 0 4px #b98a3a, 0 0 0 6px #3b2810, 0 18px 30px -10px rgba(0, 0, 0, .8), inset 0 6px 16px rgba(0, 0, 0, .6); }
.sb-plinth::after { content: ''; position: absolute; left: 4%; right: 4%; bottom: 0; height: 30px; border-radius: 0 0 50% 50% / 0 0 100% 100%; background: linear-gradient(180deg, #3b2810, #1c1208); z-index: -1; }
.sb-tray { position: absolute; left: 14%; right: 14%; bottom: 22px; height: 112px; z-index: 2; --ds: 44px; }
.sb-tray.shaking { animation: sbjig .09s linear infinite alternate; }
.sb-dw { position: absolute; width: var(--ds); height: var(--ds); margin: calc(var(--ds) / -2) 0 0 calc(var(--ds) / -2); }
.sb-dw .tb-die { --ds: inherit; }
.sb-drop { position: absolute; left: 50%; top: -30px; width: 1px; height: 1px; }
.sb-dome { position: absolute; z-index: 3; left: 9%; right: 9%; bottom: 30px; height: 140px; pointer-events: none;
  border-radius: 50% 50% 10% 10% / 78% 78% 12% 12%;
  background: radial-gradient(ellipse 40% 30% at 30% 22%, rgba(255, 255, 255, .42), transparent 70%), radial-gradient(ellipse 20% 40% at 82% 50%, rgba(255, 255, 255, .14), transparent 70%), linear-gradient(180deg, rgba(220, 235, 255, .1), rgba(220, 235, 255, .03));
  border: 1.5px solid rgba(255, 255, 255, .3); box-shadow: inset 0 -14px 26px rgba(255, 255, 255, .07), inset 0 4px 10px rgba(255, 255, 255, .12), 0 0 30px rgba(170, 200, 255, .06);
  transition: transform .55s cubic-bezier(.3, .7, .25, 1), opacity .55s; }
.sb-dome::after { content: ''; position: absolute; left: 44%; right: 44%; top: -10px; height: 14px; border-radius: 6px 6px 3px 3px; background: linear-gradient(#e7c66f, #8a6020); box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.sb-dome.shaking { animation: sbshake .1s linear infinite alternate; }
.sb-dome.up { transform: translateY(-38%); opacity: .45; }
@keyframes sbshake { 0% { transform: translate(-3px, 1px) rotate(-1.5deg); } 100% { transform: translate(3px, -2px) rotate(1.5deg); } }
@keyframes sbjig { 0% { transform: translate(-2px, 0); } 100% { transform: translate(2px, -1px); } }
.sb-readout { display: flex; flex-direction: column; align-items: center; margin-top: 2px; min-height: 66px; text-align: center; }
.sb-readout small { font: 600 10.5px 'IBM Plex Mono', monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--s-dim); }
.sb-readout b { font: 900 22px/1.1 Inter, sans-serif; letter-spacing: -.02em; margin-top: 2px; }
.sb-readout span { font: 700 11px 'IBM Plex Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--you); }
.sb-readout.show b { font-size: 34px; animation: tbpop .42s cubic-bezier(.2, .9, .3, 1.4); }
.sb-readout.tri b, .sb-readout.tri span { color: #f3d27a; }

.sb-ph { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.sb-ph-r { font-size: 11px; color: var(--s-dim); white-space: nowrap; }
.sb-hist { display: flex; flex-direction: column; }
.sb-hr { display: grid; grid-template-columns: auto 30px 1fr auto; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--s-line); animation: dkfeed .35s cubic-bezier(.2, .9, .3, 1); }
.sb-hr:first-child { border-top: 0; }
.sb-hr i { display: flex; gap: 3px; }
.sb-md { width: 13px; height: 13px; display: block; }
.sb-md rect { fill: #f2efe7; } .sb-md circle { fill: #15161a; } .sb-md circle.one { fill: #c8202f; }
.sb-hr b { font: 800 14px Inter, sans-serif; text-align: right; }
.sb-hr em { font-style: normal; justify-self: start; font: 700 9.5px 'IBM Plex Mono', monospace; letter-spacing: .1em; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; }
.sb-hr em.sm { background: rgba(127, 214, 255, .12); color: #8fd8ff; } .sb-hr em.bg { background: rgba(255, 178, 30, .14); color: var(--you); } .sb-hr em.tri { background: #f3d27a; color: #2a1d05; }
.sb-hr small { font-size: 10.5px; color: var(--s-dim); }
.sb-hr.sim { opacity: .55; }
.sb-hot { display: grid; grid-template-columns: repeat(16, 1fr); gap: 2px; height: 66px; align-items: end; }
.sb-hb { position: relative; height: 100%; }
.sb-hb i { position: absolute; left: 1px; right: 1px; bottom: 14px; max-height: calc(100% - 14px); border-radius: 2px 2px 0 0; background: #3a3f4c; transition: height .4s; }
.sb-hb.hot i { background: linear-gradient(180deg, #ff6b4a, #c2321e); }
.sb-hb.tri i { background: #8a7330; }
.sb-hb small { position: absolute; bottom: 0; left: -2px; right: -2px; text-align: center; font: 600 8.5px 'IBM Plex Mono', monospace; color: var(--s-dim); }
.sb-hotnote { font-size: 11px; line-height: 1.45; color: var(--s-dim); margin-top: 8px; }

/* ---------- felt layout ---------- */
.sb-table { --rail: 22px; }
.sb-table > .tb-tray { position: absolute; z-index: 5; top: -6px; left: 50%; transform: translateX(-50%); }
.sb-table > .tb-tray .tb-tray-col { width: 15px; height: 28px; }
.sb-felt { overflow: visible; }
.sb-board { position: relative; width: 100%; aspect-ratio: 1000 / 560; --chip: 26px; user-select: none; -webkit-user-select: none; }
.sb-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sb-ln { fill: rgba(0, 0, 0, .06); stroke: rgba(243, 210, 122, .72); stroke-width: 1.6px; vector-effect: non-scaling-stroke; }
.sb-t { font-family: Inter, system-ui, sans-serif; font-weight: 900; fill: #f3d27a; text-transform: uppercase; }
.sb-t.big { fill: #fbf3dc; }
.sb-t.sub { font-family: 'IBM Plex Mono', monospace; font-weight: 600; fill: rgba(255, 255, 255, .8); }
.sb-t.pay { font-family: 'IBM Plex Mono', monospace; font-weight: 600; fill: rgba(243, 210, 122, .9); }
.sb-t.note { font-family: 'IBM Plex Mono', monospace; font-weight: 500; fill: rgba(255, 255, 255, .5); }
.sb-t.num { fill: #fbf3dc; }
.sb-t.gold { fill: #f3d27a; }
.sb-pd { fill: #f6f2ea; stroke: rgba(0, 0, 0, .35); stroke-width: .8px; vector-effect: non-scaling-stroke; }
.sb-pp { fill: #1a1b20; } .sb-pp.one { fill: #c8202f; }
.sb-hots { position: absolute; inset: 0; }
.sb-hotc { position: absolute; border-radius: 6px; cursor: pointer; outline: none; transition: background .2s, box-shadow .2s; }
.sb-hotc:hover, .sb-hotc:focus-visible { background: rgba(255, 228, 160, .1); box-shadow: inset 0 0 0 2px rgba(255, 214, 130, .6); }
.sb-hotc.lit { background: rgba(255, 214, 110, .2); box-shadow: inset 0 0 0 2.5px #ffd36e, 0 0 22px rgba(255, 200, 90, .45); animation: sblit 1.1s ease-out; }
@keyframes sblit { 0% { background: rgba(255, 228, 150, .55); } }
.sb-hotc > .tb-stack { position: absolute; left: var(--px); top: var(--py); width: var(--chip); height: var(--chip); transform: translate(-50%, -50%); display: flex; flex-direction: column; justify-content: flex-end; align-items: center; z-index: 2; pointer-events: none; --ct: calc(var(--chip) * .11); }
.sb-hotc > .tb-stack .tb-pile { flex: none; }
.sb-hotc > .tb-stack .tb-stack-amt { position: absolute; top: calc(100% + 1px); left: 50%; transform: translateX(-50%); margin: 0; font-size: 9.5px; padding: 0 5px; line-height: 1.4; }
.sb-hotc.k-tri > .tb-stack .tb-stack-amt, .sb-hotc.k-tot > .tb-stack .tb-stack-amt { top: auto; bottom: calc(100% + 2px); }
.sb-heat { position: absolute; left: 8%; bottom: 5px; height: 3px; max-width: 84%; border-radius: 2px; background: rgba(255, 255, 255, .25); transition: width .4s; }
.sb-hotc.hotnum .sb-heat { background: #ff7a52; }
.sb-hotc.hotnum::after { content: 'HOT'; position: absolute; right: 4px; top: 4px; font: 700 7.5px 'IBM Plex Mono', monospace; letter-spacing: .1em; color: #ff8f6b; }

/* ---------- controls and info ---------- */
.sb-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; background: var(--s-panel); border: 1px solid var(--s-line); }
.sb-controls .tb-rchip { --chip: 44px; }
.sb-controls .tb-rack { gap: 8px; }
.sb-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.sb-go { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.sb-betsum { display: flex; flex-direction: column; align-items: flex-end; }
.sb-betsum small { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--s-dim); }
.sb-betsum b { font-size: 18px; font-weight: 700; }
.sb-roll { min-width: 128px; }
.sb-roll.wait { filter: saturate(.35) brightness(.8); }
.sb-info { border-left: 3px solid var(--you); padding: 10px 14px; min-height: 96px; }
.sb-info.hover { border-left-color: #7fd6ff; }
.sb-info.bad { border-left-color: var(--tb-lose); }
.sb-info-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.sb-info-r { font-size: 11.5px; color: var(--s-dim); }
.sb-info-r b { color: var(--s-text); font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.sb-info h4 { font-size: 16px; font-weight: 800; margin: 3px 0 2px; }
.sb-info.bad h4 { color: #ffb3bd; }
.sb-info p { font-size: 12.5px; line-height: 1.5; color: var(--s-dim); }

/* ---------- right ---------- */
.sb-pay { padding: 10px 14px 8px; }
.sb-pr { padding: 4px 8px; font-size: 12px; }
.sb-pr b { font-size: 11.5px; display: flex; gap: 10px; align-items: baseline; }
.sb-pr b em { font-style: normal; min-width: 48px; text-align: right; color: var(--s-dim); font-weight: 500; }
.sb-right .tb-fair { padding: 10px 12px; gap: 7px; }
.sb-edgetable { margin-top: 14px; }
.sb-edgetable h5 { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--s-dim); margin-bottom: 4px; }
.sb-edgetable div { display: flex; justify-content: space-between; padding: 5px 0; border-top: 1px solid var(--s-line); font-size: 12.5px; }
.sb-edgetable small { color: var(--s-dim); margin-left: 6px; }
.sb-edgetable b { font: 600 12px 'IBM Plex Mono', monospace; }
.sb-stage .tb-drawer .s-seg { flex-wrap: wrap; }

@media (max-width: 1280px) {
  .sb-screen { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sb-main { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 760px) {
  .sb-screen { display: flex; flex-direction: column; align-items: stretch; padding: 10px; gap: 10px; }
  .sb-left, .sb-right, .sb-main { display: contents; }
  .sb-table { order: 2; --rail: 12px; } .sb-shaker { order: 1; } .sb-controls { order: 3; } .sb-info { order: 4; } #sbBal { order: 5; } .sb-histp { order: 6; } .sb-hotp { order: 7; } .sb-pay { order: 8; } #sbFair { order: 9; }
  .sb-table > .tb-tray { display: none; }
  .sb-plinth { height: 200px; }
  .sb-dome { height: 124px; }
  .sb-go { margin-left: 0; width: 100%; justify-content: space-between; }
  .sb-roll { flex: 1; max-width: 220px; }
  .sb-controls .tb-rchip { --chip: 40px; }
  .sb-controls .tb-rack { gap: 6px; }
}
