/* =============================================================
   GAME: Bunco — party table: violet felt, confetti, three big dice
   ============================================================= */
.board-bunco {
  --bc-glow: #c77dff;
  --bc-glow-rgb: 199, 125, 255;
  --bc-hot: #ff4fd8;
  --die: min(calc((100vw - 130px) / 3), 78px);
  width: min(calc(100vw - 44px), 600px);
  display: flex; flex-direction: column; align-items: stretch; gap: 12px;
}

/* ----- small 2D die (round tracker, target face) ----- */
.bc-mini {
  --m: 22px;
  display: inline-grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); place-items: center; flex: none;
  width: var(--m); height: var(--m); padding: calc(var(--m) * .13); border-radius: calc(var(--m) * .24);
  background: linear-gradient(145deg, #ffffff, #ece4ff); box-shadow: inset 0 -2px 0 rgba(60, 20, 110, .18), 0 1px 3px rgba(0, 0, 0, .45);
  vertical-align: middle;
}
.bc-mini i { width: 78%; aspect-ratio: 1; border-radius: 50%; background: #2a0d48; }

/* ----- six rounds ----- */
.bc-rounds { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 6px; }
.bc-rnd {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); opacity: .55; transition: opacity .2s, box-shadow .2s, transform .2s;
}
.bc-rnd.cur { opacity: 1; transform: translateY(-2px); box-shadow: 0 0 0 2px var(--bc-glow), 0 0 16px rgba(var(--bc-glow-rgb), .6); }
.bc-rnd.won { opacity: 1; background: color-mix(in srgb, var(--c) 22%, var(--bg)); box-shadow: inset 0 0 0 2px var(--c); }
.bc-rnd.won::after {
  content: "✓"; position: absolute; right: -4px; bottom: -4px; width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; font: 900 .62rem/1 var(--font-body); color: #12051f; background: var(--c);
}

/* ----- the party table ----- */
.bc-felt {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 10px 12px; border-radius: 22px; overflow: hidden;
  background:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><g opacity='.32'><rect x='12' y='18' width='5' height='9' rx='1.5' fill='%23ff4fd8' transform='rotate(25 14 22)'/><rect x='92' y='14' width='5' height='9' rx='1.5' fill='%233df5ff' transform='rotate(-30 94 18)'/><rect x='58' y='70' width='5' height='9' rx='1.5' fill='%23ffd23f' transform='rotate(60 60 74)'/><rect x='118' y='96' width='5' height='9' rx='1.5' fill='%237dff6a' transform='rotate(15 120 100)'/><rect x='22' y='112' width='5' height='9' rx='1.5' fill='%23c77dff' transform='rotate(-50 24 116)'/><circle cx='50' cy='30' r='2.5' fill='%23ffd23f'/><circle cx='126' cy='52' r='2.5' fill='%23ff4fd8'/><circle cx='88' cy='122' r='2.5' fill='%233df5ff'/><circle cx='20' cy='70' r='2' fill='%237dff6a'/></g></svg>"),
    radial-gradient(ellipse at 50% 45%, #44186e 0%, #2a0e4a 50%, #140726 100%);
  box-shadow: 0 0 0 2px var(--bc-glow), 0 0 28px rgba(var(--bc-glow-rgb), .35), inset 0 0 44px rgba(0, 0, 0, .55);
}
.bc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; }
.bc-rlabel { font: 800 .78rem var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bc-target {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 10px; border-radius: 999px;
  font-weight: 800; color: #fff; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px rgba(var(--bc-glow-rgb), .55);
}
.bc-target .bc-mini { --m: 26px; box-shadow: 0 0 0 2px var(--bc-hot), 0 0 14px rgba(255, 79, 216, .7); }
.bc-target strong { color: var(--bc-hot); text-shadow: 0 0 10px rgba(255, 79, 216, .6); }

/* players around the table */
.bc-seats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: 100%; }
.bc-seat {
  display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 0; max-width: 150px; padding: 5px 8px 5px 5px; border-radius: 999px;
  background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); transition: box-shadow .2s, background .2s;
}
.bc-seat.turn { background: color-mix(in srgb, var(--c) 18%, rgba(0, 0, 0, .3)); box-shadow: 0 0 0 2px var(--c), 0 0 14px color-mix(in srgb, var(--c) 55%, transparent); }
.bc-av {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font: 900 .8rem/1 var(--font-body); color: #14061f; background: var(--c); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2);
}
.bc-sn { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.bc-pn { font-weight: 800; font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-role { font-size: .64rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.bc-bn { margin-left: auto; flex: none; font: 800 .72rem/1 var(--font-body); color: #ffd23f; text-shadow: 0 0 8px rgba(255, 210, 63, .6); }

/* ----- the three dice ----- */
.bc-stage { position: relative; width: 100%; display: grid; place-items: center; padding: 10px 0 6px; min-height: calc(var(--die) + 26px); }
.bc-dice { display: flex; justify-content: center; gap: calc(var(--die) * .3); }
.bc-die {
  --c: calc(var(--die) * .7);
  position: relative; width: var(--die); height: var(--die); display: grid; place-items: center; perspective: calc(var(--die) * 5);
  border-radius: calc(var(--die) * .22); transition: transform .2s, box-shadow .2s, background .2s;
}
.bc-die::before {
  content: ""; position: absolute; left: 12%; right: 12%; bottom: 0; height: 22%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .7), transparent);
}
.bc-cube {
  position: relative; width: var(--c); height: var(--c); transform-style: preserve-3d;
  transition: transform .8s cubic-bezier(.2, .75, .3, 1.06), opacity .2s; transition-delay: calc(var(--k, 0) * 40ms);
}
.bc-die.instant .bc-cube { transition: opacity .2s; }
.bc-side {
  position: absolute; inset: 0; padding: 15%; border-radius: 19%; backface-visibility: hidden;
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); place-items: center;
  background: radial-gradient(circle at 30% 25%, #ffffff, #f1eaff 55%, #cdbcf0);
  box-shadow: inset 0 0 0 1px rgba(60, 20, 110, .2), inset -2px -3px 5px rgba(80, 40, 140, .3), inset 2px 2px 4px #fff;
}
.bc-side.f1 { transform: translateZ(calc(var(--c) / 2)); }
.bc-side.f6 { transform: rotateY(180deg) translateZ(calc(var(--c) / 2)); }
.bc-side.f3 { transform: rotateY(90deg) translateZ(calc(var(--c) / 2)); }
.bc-side.f4 { transform: rotateY(-90deg) translateZ(calc(var(--c) / 2)); }
.bc-side.f2 { transform: rotateX(90deg) translateZ(calc(var(--c) / 2)); }
.bc-side.f5 { transform: rotateX(-90deg) translateZ(calc(var(--c) / 2)); }
.bc-side i { width: 74%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #6b2fa8, #1d0638 70%); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 255, 255, .8); }
.bc-side.f1 i { width: 90%; background: radial-gradient(circle at 40% 35%, #ff8ae6, #c4129b 70%); }
.bc-die.blank .bc-cube { opacity: .25; }
.bc-die.blank::before { opacity: .3; }
/* a die that scores glows in the party colour */
.bc-die.hit { transform: translateY(-4px); background: radial-gradient(closest-side, rgba(255, 79, 216, .45), transparent); }
.bc-die.hit .bc-side { background: radial-gradient(circle at 30% 25%, #fff, #ffe3f8 55%, #f39ad9); }
.bc-die.bunco { animation: bc-bounce .9s ease-in-out 2; animation-delay: calc(var(--k, 0) * 90ms); }
.bc-die.bunco .bc-side { background: radial-gradient(circle at 30% 25%, #fffbe6, #ffe98a 55%, #f0b92a); }
@keyframes bc-bounce { 0%, 100% { transform: translateY(-4px); } 50% { transform: translateY(-16px) rotate(-6deg); } }
.bc-die.rolling { animation: bc-toss .8s ease-out both; animation-delay: calc(var(--k, 0) * 40ms); }
@keyframes bc-toss {
  0% { transform: translate(0, 0); }
  25% { transform: translate(calc(var(--k, 1) * 6px - 6px), -26px); }
  60% { transform: translate(0, 2px); }
  78% { transform: translate(0, -6px); }
  100% { transform: translate(0, 0); }
}

/* +2 pop, stamps, confetti */
.bc-pop { position: absolute; right: 8%; top: 4px; font: 900 1.7rem/1 var(--font-head); opacity: 0; pointer-events: none; text-shadow: 0 0 12px currentColor; }
.bc-pop.show { animation: bc-pop 1.1s ease-out both; }
@keyframes bc-pop { 0% { opacity: 0; transform: translateY(14px) scale(.6); } 20% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.bc-stamp {
  position: absolute; left: 50%; top: 46%; z-index: 3; transform: translate(-50%, -50%) rotate(-7deg) scale(.6); opacity: 0; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 20px; border-radius: 14px; border: 3px solid currentColor;
  font: 900 clamp(1.8rem, 9vw, 3rem)/1 var(--font-head); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
  background: rgba(20, 6, 36, .82);
}
.bc-stamp small { font: 800 .95rem/1 var(--font-body); letter-spacing: .08em; }
.bc-stamp.bunco { color: #ffd23f; text-shadow: 0 0 18px rgba(255, 210, 63, .9), 0 0 4px #ff4fd8; box-shadow: 0 0 30px rgba(255, 79, 216, .6); }
.bc-stamp.three { color: #3df5ff; font-size: clamp(1.2rem, 6vw, 1.8rem); text-shadow: 0 0 14px rgba(61, 245, 255, .8); }
.bc-stamp.show { animation: bc-stamp 2.2s ease-out both; }
.bc-stamp.three.show { animation-duration: 1.3s; }
@keyframes bc-stamp {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-7deg) scale(2.2); }
  12% { opacity: 1; transform: translate(-50%, -50%) rotate(-7deg) scale(.95); }
  20% { transform: translate(-50%, -50%) rotate(-7deg) scale(1.05); }
  28%, 84% { opacity: 1; transform: translate(-50%, -50%) rotate(-7deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(-7deg) scale(.95); }
}
.bc-confetti { position: absolute; left: 50%; top: 45%; width: 0; height: 0; pointer-events: none; z-index: 2; }
.bc-confetti i {
  position: absolute; left: -4px; top: -5px; width: 8px; height: 11px; border-radius: 2px; opacity: 0;
  animation: bc-confetti 1.9s cubic-bezier(.15, .7, .4, 1) both; animation-delay: var(--d);
}
.bc-confetti i.round { border-radius: 50%; width: 9px; height: 9px; }
@keyframes bc-confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(.4); }
  55% { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1); }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 90px)) rotate(calc(var(--r) * 2)) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .bc-stamp.show { opacity: 1; transform: translate(-50%, -50%) rotate(-7deg); }
  .bc-pop.show { opacity: 1; transform: none; }
  .bc-die.bunco, .bc-die.rolling { animation: none; }
}

.bc-note { margin: 0; min-height: 2.6em; text-align: center; color: var(--ink); opacity: .85; font-weight: 600; font-size: .92rem; line-height: 1.3; max-width: 460px; }
.bc-actions { display: flex; gap: 10px; justify-content: center; width: 100%; }
.bc-actions .btn { flex: 0 1 240px; font-size: 1.08rem; letter-spacing: .02em; }
.bc-roll { background: linear-gradient(135deg, #b93dff, #ff4fd8); box-shadow: 0 6px 24px rgba(255, 79, 216, .4); }
.bc-next { background: linear-gradient(135deg, #3d8bff, #3df5ff); color: #06122a; box-shadow: 0 6px 24px rgba(61, 245, 255, .35); }
.bc-skip { min-height: 34px; }
.bc-skip[hidden] { visibility: hidden; display: inline-flex; }

/* ----- scoreboard ----- */
.bc-board {
  width: 100%; border-collapse: separate; border-spacing: 0; background: var(--bg); border-radius: 14px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(var(--bc-glow-rgb), .5), 0 0 18px rgba(var(--bc-glow-rgb), .15); font-variant-numeric: tabular-nums;
}
.bc-cap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.bc-board th, .bc-board td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.bc-board tbody tr:last-child th, .bc-board tbody tr:last-child td { border-bottom: 0; }
.bc-board thead th { background: var(--surface-2); font: 800 .68rem var(--font-body); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.bc-board .bc-num { text-align: right; white-space: nowrap; width: 1%; }
.bc-board tbody th { font-weight: 700; max-width: 0; width: 100%; } /* lets long names truncate instead of widening the table */
.bc-sname { display: flex; align-items: center; gap: 7px; min-width: 0; }
.bc-sname .dot { width: 11px; height: 11px; }
.bc-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-members { display: block; font-size: .72rem; font-weight: 600; color: var(--muted); margin-left: 18px; line-height: 1.2; }
.bc-rp { min-width: 74px; }
.bc-rpv { font: 800 1rem/1 var(--font-body); }
.bc-rpv small { font-size: .7rem; color: var(--muted); font-weight: 700; }
.bc-bar { display: block; height: 5px; margin-top: 4px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bc-bar span { display: block; height: 100%; border-radius: 3px; background: var(--c); box-shadow: 0 0 8px var(--c); transition: width .5s ease; }
.bc-tot { font-weight: 800; }
.bc-star { color: #ffd23f; margin-right: 2px; }
.bc-board tr.cur th, .bc-board tr.cur td { background: color-mix(in srgb, var(--c) 9%, transparent); }
.bc-board tr.cur th { box-shadow: inset 4px 0 0 var(--c); }
.bc-board tr.best th, .bc-board tr.best td { background: color-mix(in srgb, var(--c) 16%, transparent); }
.statusbar .bc-goal { font-size: .85rem; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }

@media (max-width: 480px) {
  .bc-rnd { width: 36px; height: 36px; }
  .bc-rnd .bc-mini { --m: 20px; }
  .bc-board th, .bc-board td { padding: 5px 6px; }
  .bc-board thead th { font-size: .6rem; letter-spacing: .02em; }
  .bc-seat { padding: 4px 6px 4px 4px; gap: 4px; flex-basis: calc(50% - 6px); max-width: none; }
  .bc-actions .btn { padding: 10px 14px; }
}
