/* Bunco: a felt table in a wooden rim, three tumbling dice, the room's other tables down the side.
   Every class starts with bn-. Layout classes set by game.js from the root's own box: bn-narrow, bn-wide, bn-short, bn-fit. */
.bn {
  --bn-text: #dfe9ff; --bn-muted: #8aa3c4; --bn-panel: #0b1328; --bn-line: #1c2b4a; --bn-accent: #55d6ff; --bn-warm: #ffd166; --bn-pink: #ff6b81; --bn-green: #5fe0a0;
  --bn-f1: #1a936c; --bn-f2: #0d5a48; --bn-f3: #07362f; --bn-rim: rgba(85, 214, 255, .28);
  --bn-df: #fffdf4; --bn-df2: #e7dfca; --bn-dp: #1c2333; --bn-de: #b9b09a;
  --bn-ds: 52px; --bn-fh: 400px; --bn-side: var(--bn-accent);
  position: relative; max-width: 1000px; margin: 0 auto; padding: 10px 8px 12px; color: var(--bn-text);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums; border-radius: 12px;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "head" "room" "felt" "bar"; gap: 8px;
}
.bn[data-felt="blue"] { --bn-f1: #2b6fc0; --bn-f2: #17458a; --bn-f3: #0c2a5c; }
.bn[data-felt="plum"] { --bn-f1: #8a3a86; --bn-f2: #58215a; --bn-f3: #351338; }
.bn[data-felt="red"] { --bn-f1: #b23a48; --bn-f2: #7a2130; --bn-f3: #4a121d; }
.bn[data-felt="slate"] { --bn-f1: #47536e; --bn-f2: #2a3247; --bn-f3: #171c2b; }
.bn[data-dice="ruby"] { --bn-df: #e2364e; --bn-df2: #a8172f; --bn-dp: #fff; --bn-de: #7c0f22; }
.bn[data-dice="sapphire"] { --bn-df: #3f86f2; --bn-df2: #1c55c2; --bn-dp: #fff; --bn-de: #123c8f; }
.bn[data-dice="emerald"] { --bn-df: #24bd80; --bn-df2: #0f8457; --bn-dp: #fff; --bn-de: #0a5f3e; }
.bn[data-dice="midnight"] { --bn-df: #2a3358; --bn-df2: #141a36; --bn-dp: #ffd166; --bn-de: #0b0f22; }
.bn[data-dice="pink"] { --bn-df: #ff9ebb; --bn-df2: #f06292; --bn-dp: #fff; --bn-de: #b93d69; }
.bn [hidden] { display: none !important; }
.bn.bn-wide { grid-template-columns: minmax(0, 1fr) 238px; grid-template-areas: "top top" "head head" "felt room" "bar room"; }
.bn.bn-fit { max-width: 1280px; width: 100%; box-sizing: border-box; grid-template-rows: auto auto auto minmax(0, 1fr) auto; }
.bn.bn-fit.bn-wide { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.bn.bn-short { grid-template-columns: minmax(0, 1fr) 252px; grid-template-areas: "felt top" "felt head" "felt room" "felt bar"; grid-template-rows: auto auto minmax(0, 1fr) auto; padding: 6px; gap: 6px; }

/* ---------- top bar ---------- */
.bn-top { grid-area: top; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.bn-seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--bn-panel); border: 1px solid var(--bn-line); }
.bn-seg button { min-height: 40px; min-width: 40px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; color: var(--bn-muted); font: 700 13.5px/1 inherit; font-family: inherit; cursor: pointer; white-space: nowrap; }
.bn-seg button[aria-pressed="true"] { background: var(--bn-accent); color: #04121c; }
@media (hover: hover) { .bn-seg button[aria-pressed="false"]:hover { color: #fff; } }
.bn-s { display: none; }
.bn-narrow .bn-top .bn-l, .bn-short .bn-top .bn-l { display: none; }
.bn-narrow .bn-top .bn-s, .bn-short .bn-top .bn-s { display: inline; }
.bn-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.bn-btn { background: var(--bn-panel); color: var(--bn-text); border: 1px solid var(--bn-line); border-radius: 10px; padding: 0 13px; min-height: 40px; font-weight: 700; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; font-family: inherit; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .bn-btn:hover:not(:disabled) { border-color: var(--bn-accent); } }
.bn-btn:disabled { opacity: .42; cursor: default; }
.bn-btn:active:not(:disabled) { transform: translateY(1px); }
.bn-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.bn-btn-primary { background: var(--bn-warm); color: #1a1200; border-color: var(--bn-warm); }
@media (hover: hover) { .bn-btn-primary:hover:not(:disabled) { background: #ffe08a; border-color: #ffe08a; } }
.bn-icon { width: 40px; padding: 0; }
.bn-narrow .bn-tool, .bn-short .bn-tool { width: 40px; padding: 0; }
.bn-narrow .bn-tool span, .bn-short .bn-tool span { display: none; }
#bn-sound[aria-pressed="false"] .on, #bn-sound[aria-pressed="true"] .off { display: none; }
.bn-btn:focus-visible, .bn-seg button:focus-visible, .bn-roll:focus-visible, .bn-bell:focus-visible, .bn-dialog input:focus-visible, .bn-sw:focus-visible, .bn-felt:focus-visible { outline: 2px solid var(--bn-accent); outline-offset: 2px; }

/* ---------- round track and scores ---------- */
.bn-head { grid-area: head; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; }
.bn-track { display: flex; align-items: center; gap: 7px; min-width: 0; }
.bn-round { font-weight: 800; font-size: 14.5px; color: #fff; white-space: nowrap; margin-right: 3px; }
.bn-round small { display: block; color: var(--bn-muted); font-weight: 600; font-size: 11.5px; }
.bn-rd { position: relative; width: 28px; height: 28px; flex: none; opacity: .4; transition: transform .25s, opacity .25s; }
.bn-rd.bn-past { opacity: .78; }
.bn-rd.bn-on { opacity: 1; transform: scale(1.2); filter: drop-shadow(0 0 5px rgba(255, 209, 102, .9)); margin: 0 3px; }
.bn-rd em { position: absolute; right: -5px; top: -5px; width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center; font: 800 9px/1 system-ui, sans-serif; font-style: normal; color: #06101c; background: var(--bn-green); }
.bn-rd em.bn-l { background: var(--bn-pink); }
.bn-rd em.bn-n { background: var(--bn-warm); }
.bn-fd { display: block; width: 100%; height: 100%; }
.bn-fd rect { fill: var(--bn-df); stroke: rgba(0, 0, 0, .3); stroke-width: 3; }
.bn-fd circle { fill: var(--bn-dp); }
.bn-score { display: flex; gap: 8px; align-items: stretch; justify-content: flex-end; flex: 1 1 300px; min-width: 0; }
.bn-sc { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 8px; border-radius: 12px; background: var(--bn-panel); border: 1px solid var(--bn-line); border-left: 4px solid var(--bn-side); min-width: 0; transition: box-shadow .3s; }
.bn-sc.bn-lead { box-shadow: 0 0 0 1px var(--bn-side), 0 0 14px color-mix(in srgb, var(--bn-side) 35%, transparent); }
.bn-sc-n { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.bn-sc-n b { font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bn-sc-n small { font-size: 11px; color: var(--bn-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 12em; }
.bn-sc > strong { font-size: 25px; font-weight: 800; color: #fff; min-width: 1.25em; text-align: center; line-height: 1; }
.bn-sc.bn-bump > strong { animation: bn-bump .35s; }
.bn-tally { display: block; flex: none; }
.bn-tally path { stroke: var(--bn-side); }
.bn-tally-more { color: var(--bn-side); font-weight: 800; }
.bn-sc .bn-tallybox { display: flex; align-items: center; max-width: 132px; overflow: hidden; }
.bn-narrow .bn-head { gap: 6px; }
.bn-narrow .bn-track { width: 100%; justify-content: center; }
.bn-narrow .bn-score { flex: 1 1 100%; justify-content: center; }
.bn-narrow .bn-sc { flex: 1 1 0; }
.bn-narrow .bn-score.bn-many .bn-tallybox, .bn-short .bn-tallybox { display: none; }
.bn-narrow .bn-score.bn-many .bn-sc { padding: 4px 6px; gap: 5px; }
.bn-short .bn-head { flex-direction: column; align-items: stretch; gap: 5px; }
.bn-short .bn-track { justify-content: center; gap: 3px; }
.bn-short .bn-round { font-size: 13px; margin-right: 3px; }
.bn-short .bn-rd { width: 19px; height: 19px; }
.bn-short .bn-rd.bn-on { margin: 0 2px; }
.bn-short .bn-score { flex: none; gap: 5px; }
.bn-short .bn-sc { flex: 1 1 0; padding: 3px 6px; }
.bn-short .bn-sc > strong { font-size: 21px; }

/* ---------- the room: the other tables ---------- */
.bn-room { grid-area: room; display: flex; gap: 6px; min-width: 0; }
.bn-wide .bn-room, .bn-short .bn-room { flex-direction: column; overflow: auto; min-height: 0; }
.bn-room-h { display: none; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--bn-muted); padding: 2px 4px 0; }
.bn-wide .bn-room-h { display: block; }
.bn-card { flex: 1 1 0; min-width: 0; padding: 6px 8px; border-radius: 12px; background: var(--bn-panel); border: 1px solid var(--bn-line); display: flex; flex-direction: column; gap: 4px; position: relative; }
.bn-wide .bn-card, .bn-short .bn-card { flex: 0 0 auto; }
.bn-card.bn-here { border-color: var(--bn-accent); box-shadow: 0 0 0 1px var(--bn-accent), 0 0 14px rgba(85, 214, 255, .22); }
.bn-card.bn-flash { animation: bn-flash .45s; }
.bn-card.bn-boom { animation: bn-boom 1.1s; }
.bn-card-h { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; font-weight: 800; color: #fff; min-width: 0; }
.bn-card-n { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bn-card-n svg { width: 16px; height: 16px; flex: none; }
.bn-card.bn-ding .bn-card-n svg { animation: bn-ding .6s; }
.bn-card-tag { font-size: 10.5px; font-weight: 700; color: var(--bn-accent); white-space: nowrap; }
.bn-card-tag.bn-t-done { color: var(--bn-warm); }
.bn-card-s { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 19px; font-weight: 800; color: #fff; line-height: 1; }
.bn-card-s i { font-style: normal; color: var(--bn-muted); font-weight: 600; font-size: 14px; }
.bn-card-s b.bn-w { color: var(--bn-warm); }
.bn-pair { display: inline-flex; flex: none; }
.bn-pair .bn-av { width: 22px; height: 22px; border-radius: 50%; margin-left: -6px; box-shadow: 0 0 0 1.5px var(--bn-panel); }
.bn-pair .bn-av:first-child { margin-left: 0; }
.bn-card-bar { height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .09); overflow: hidden; }
.bn-card-bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, #ffd166, #ff9f43); transition: width .35s; }
.bn-card-l { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--bn-muted); min-height: 17px; min-width: 0; white-space: nowrap; overflow: hidden; }
.bn-card-l .bn-fd { width: 15px; height: 15px; flex: none; }
.bn-card-l span { overflow: hidden; text-overflow: ellipsis; }
.bn-card-l b { color: var(--bn-warm); }
.bn-card-tok { position: absolute; right: 5px; bottom: 4px; width: 20px; height: 20px; }
.bn-card-tok svg { width: 100%; height: 100%; display: block; }
.bn-narrow .bn-pair, .bn-short .bn-pair { display: none; }
.bn-narrow .bn-card { padding: 5px 6px; gap: 3px; }
.bn-narrow .bn-card-tag { display: none; }
.bn-narrow .bn-card-l span { display: none; }
.bn-narrow .bn-card-s { font-size: 17px; }
/* a phone on its side: each table is one line (name, last dice, score) so the whole room stays in view */
.bn-short .bn-card { flex-direction: row; align-items: center; padding: 5px 8px; gap: 7px; }
.bn-short .bn-card-h { flex: 1 1 auto; }
.bn-short .bn-card-s { order: 3; flex: none; font-size: 16px; }
.bn-short .bn-card-l { order: 2; flex: none; min-height: 0; }
.bn-short .bn-card-l span, .bn-short .bn-card-bar, .bn-short .bn-card-tag { display: none; }
.bn-short .bn-card-tok { position: static; order: 4; flex: none; }
/* quick game: the scoreboard takes the room's place */
.bn-qrow { display: flex; align-items: center; gap: 7px; min-width: 0; }
.bn-qrow .bn-av { width: 26px; height: 26px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--bn-side); }
.bn-qrow b { font-size: 13px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
.bn-qwins { display: flex; gap: 3px; flex: none; }
.bn-qwins i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.bn-qwins i.bn-on { background: var(--bn-warm); box-shadow: 0 0 6px rgba(255, 209, 102, .7); }
.bn-qsub { font-size: 11.5px; color: var(--bn-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bn-narrow .bn-qrow .bn-av { display: none; }

/* ---------- the table ---------- */
.bn-felt { grid-area: felt; position: relative; height: var(--bn-fh); min-height: 230px; border-radius: 26px; overflow: hidden; outline-offset: 3px; cursor: default;
  background: radial-gradient(120% 95% at 50% 38%, var(--bn-f1), var(--bn-f2) 62%, var(--bn-f3));
  box-shadow: inset 0 0 0 7px #6b4526, inset 0 0 0 9px #2c190b, inset 0 0 0 10px rgba(255, 220, 160, .18), inset 0 14px 40px rgba(0, 0, 0, .45), 0 0 0 1px var(--bn-rim), 0 0 22px var(--bn-rim); }
.bn-fit .bn-felt { height: auto; }
.bn-short .bn-felt { min-height: 200px; }
.bn-felt::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1.4px), radial-gradient(rgba(0, 0, 0, .09) 1px, transparent 1.4px); background-size: 5px 5px, 7px 7px; background-position: 0 0, 2px 3px; }
.bn-felt::after { content: ''; position: absolute; inset: 20% 22%; pointer-events: none; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .1); }
.bn-felt.bn-can { cursor: pointer; }
.bn-felt.bn-shake { animation: bn-shake .5s; }
.bn-seats { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.bn-seat { position: absolute; display: flex; align-items: center; gap: 7px; padding: 5px 12px 5px 5px; border-radius: 999px; background: rgba(6, 12, 28, .84); border: 1.5px solid rgba(255, 255, 255, .16); box-shadow: 0 3px 10px rgba(0, 0, 0, .4); max-width: 48%; transition: box-shadow .25s, border-color .25s; }
.bn-at-bottom { left: 50%; bottom: 16px; transform: translateX(-50%); }
.bn-at-top { left: 50%; top: 16px; transform: translateX(-50%); }
.bn-at-left, .bn-at-right { top: 50%; transform: translateY(-50%); flex-direction: column; gap: 3px; padding: 7px 7px 6px; border-radius: 18px; text-align: center; width: 84px; box-sizing: border-box; max-width: none; }
.bn-at-left { left: 16px; }
.bn-at-right { right: 16px; }
.bn-ava { position: relative; width: 40px; height: 40px; flex: none; border-radius: 50%; box-shadow: 0 0 0 2.5px var(--bn-side); }
.bn-av { display: block; width: 100%; height: 100%; border-radius: 50%; }
.bn-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.18; max-width: 100%; }
.bn-nm { font-weight: 800; font-size: 14px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-sub { font-size: 11px; color: var(--bn-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bn-seat.bn-cur { border-color: var(--bn-warm); box-shadow: 0 0 0 2px var(--bn-warm), 0 0 22px rgba(255, 209, 102, .6); }
.bn-seat.bn-cur .bn-nm { color: var(--bn-warm); }
.bn-seat.bn-in { animation: bn-seat-in .45s both; }
.bn-seat.bn-hop .bn-ava { animation: bn-hop .6s; }
.bn-tok { position: absolute; right: -9px; top: -11px; width: 24px; height: 24px; transform-origin: 50% 0; animation: bn-swing 2.4s ease-in-out infinite; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
.bn-tok svg, .bn-fly svg { display: block; width: 100%; height: 100%; }
.bn-fly { position: fixed; z-index: 2000; width: 30px; height: 30px; pointer-events: none; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5)); }
.bn-say { position: absolute; z-index: 6; left: 50%; bottom: calc(100% + 9px); transform: translateX(-50%); padding: 5px 10px; border-radius: 12px; background: #fff; color: #18203a; font-size: 13px; font-weight: 800; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); animation: bn-say .22s both; pointer-events: none; }
.bn-say::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -6px; border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; }
.bn-at-top .bn-say { bottom: auto; top: calc(100% + 9px); }
.bn-at-top .bn-say::after { top: auto; bottom: 100%; border: 6px solid transparent; border-bottom-color: #fff; border-top: 0; }
.bn-at-left .bn-say { left: 6px; transform: none; }
.bn-at-left .bn-say::after { left: 26px; }
.bn-at-right .bn-say { left: auto; right: 6px; transform: none; }
.bn-at-right .bn-say::after { left: auto; right: 20px; }
.bn-bell { position: absolute; left: 18px; top: 16px; z-index: 5; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 3px 12px 3px 7px; border-radius: 999px; background: rgba(6, 12, 28, .7); border: 1.5px solid rgba(255, 255, 255, .16); color: var(--bn-text); font: 800 12px/1.1 inherit; font-family: inherit; cursor: default; text-align: left; }
.bn-bell svg { width: 30px; height: 30px; flex: none; transform-origin: 50% 80%; }
.bn-bell small { display: block; font-weight: 600; font-size: 10.5px; color: var(--bn-muted); }
.bn-bell.bn-can { cursor: pointer; border-color: var(--bn-warm); animation: bn-pulse 1.3s ease-in-out infinite; }
.bn-bell.bn-ding svg { animation: bn-ding .6s; }
.bn-bell.bn-nobell svg { opacity: .35; }
.bn-aim { position: absolute; right: 18px; top: 16px; z-index: 3; display: flex; align-items: center; gap: 7px; padding: 5px 7px 5px 11px; border-radius: 999px; background: rgba(6, 12, 28, .7); border: 1.5px solid rgba(255, 255, 255, .16); font: 800 12px/1.1 inherit; color: var(--bn-text); }
.bn-aim small { display: block; font-weight: 600; font-size: 10.5px; color: var(--bn-muted); }
.bn-aim .bn-fd { width: 30px; height: 30px; filter: drop-shadow(0 0 5px rgba(255, 209, 102, .8)); }
.bn-narrow .bn-bell { padding: 3px 7px; }
.bn-narrow .bn-bell span, .bn-narrow .bn-aim span { display: none; }
.bn-narrow .bn-aim { padding: 5px; }
.bn-narrow .bn-at-left, .bn-narrow .bn-at-right { width: 68px; padding: 6px 4px 5px; }
.bn-narrow .bn-at-left { left: 13px; }
.bn-narrow .bn-at-right { right: 13px; }
.bn-narrow .bn-nm { font-size: 13px; }
.bn-short .bn-ava { width: 32px; height: 32px; }
.bn-short .bn-at-bottom { bottom: 12px; }
.bn-short .bn-at-top { top: 12px; }
.bn-short .bn-bell { top: 12px; left: 14px; min-height: 40px; }
.bn-short .bn-aim { top: 12px; right: 14px; }
.bn-short .bn-bell span, .bn-short .bn-aim span { display: none; }
.bn-short .bn-aim { padding: 5px; }

/* ---------- dice ---------- */
.bn-tray { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.bn-die { position: absolute; left: 0; top: 0; width: var(--bn-ds); height: var(--bn-ds); margin: calc(var(--bn-ds) / -2) 0 0 calc(var(--bn-ds) / -2); will-change: transform; }
.bn-die-sh { position: absolute; left: 4%; top: 30%; width: 104%; height: 100%; border-radius: 34%; background: radial-gradient(closest-side, rgba(0, 0, 0, .6), rgba(0, 0, 0, .3) 62%, transparent); }
.bn-die-lift { position: absolute; inset: 0; perspective: 620px; }
.bn-cube { position: absolute; inset: 0; transform-style: preserve-3d; }
.bn-face { position: absolute; inset: 0; border-radius: 17%; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: radial-gradient(circle at 36% 30%, var(--bn-df), var(--bn-df2) 88%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.bn-face svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--bn-dp); }
.bn-face i { position: absolute; inset: 0; background: #000; opacity: 0; }
.bn-core { position: absolute; inset: 0; background: var(--bn-de); }
.bn-die.bn-hit .bn-die-lift { filter: drop-shadow(0 0 5px #ffd166) drop-shadow(0 0 13px rgba(255, 209, 102, .75)); animation: bn-hit .5s; }
.bn-die.bn-dim .bn-die-lift { filter: brightness(.74) saturate(.85); }
.bn-die.bn-fade { animation: bn-fade .16s; }
.bn-pops { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.bn-pop { position: absolute; transform: translate(-50%, -50%); font-size: 30px; font-weight: 900; color: var(--bn-warm); text-shadow: 0 2px 0 #7a4a00, 0 0 14px rgba(255, 209, 102, .8); animation: bn-pop 1s ease-out both; white-space: nowrap; }
.bn-pop.bn-pop-miss { font-size: 15px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); opacity: .9; }
.bn-confetti { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 7; pointer-events: none; }
.bn-banner { position: absolute; left: 50%; top: 50%; z-index: 8; transform: translate(-50%, -50%); text-align: center; pointer-events: none; white-space: nowrap; font-weight: 900; letter-spacing: .02em; color: var(--bn-warm); font-size: clamp(34px, 11vw, 84px); line-height: 1; text-shadow: 0 3px 0 #a3541a, 0 6px 0 #5a2a08, 0 0 30px rgba(255, 209, 102, .85), 0 0 60px rgba(255, 107, 129, .6); animation: bn-banner .5s cubic-bezier(.2, 1.5, .4, 1) both; }
.bn-banner small { display: block; width: max-content; max-width: min(340px, 56vw); margin: 8px auto 0; padding: 5px 12px; border-radius: 12px; background: rgba(4, 10, 24, .72); white-space: normal; line-height: 1.25; font-size: clamp(14px, 3.4vw, 20px); letter-spacing: 0; color: #fff; text-shadow: none; font-weight: 800; }
.bn-banner.bn-b-sm { font-size: clamp(24px, 6.5vw, 44px); }
.bn-banner.bn-b-bell { color: #fff; font-size: clamp(22px, 6vw, 40px); text-shadow: 0 3px 0 #23406b, 0 0 24px rgba(85, 214, 255, .8); }
.bn-toast { position: absolute; left: 50%; bottom: 76px; z-index: 9; transform: translateX(-50%); max-width: 86%; padding: 7px 13px; border-radius: 999px; background: rgba(6, 12, 28, .92); border: 1px solid var(--bn-warm); color: #fff; font-size: 13px; font-weight: 700; text-align: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); animation: bn-say .25s both; pointer-events: none; }

/* ---------- action bar ---------- */
.bn-bar { grid-area: bar; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.bn-status { flex: 1 1 220px; min-width: 0; font-size: 15px; font-weight: 700; color: #fff; line-height: 1.3; min-height: 20px; }
.bn-status b { color: var(--bn-warm); }
.bn-acts { display: flex; gap: 6px; align-items: center; flex: 0 1 auto; }
.bn-mini { min-height: 44px; padding: 0 11px; font-size: 13px; }
.bn-mini[aria-pressed="true"] { border-color: var(--bn-accent); color: var(--bn-accent); box-shadow: inset 0 0 0 1px var(--bn-accent); }
.bn-roll { min-height: 52px; min-width: 200px; padding: 0 22px; border-radius: 14px; border: 0; font: 800 18px/1 inherit; font-family: inherit; color: #2a1a00; background: linear-gradient(180deg, #ffe596, #ffc23d); box-shadow: 0 4px 0 #b0721a, 0 8px 20px rgba(255, 190, 60, .32); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; white-space: nowrap; transition: transform .06s, box-shadow .06s; -webkit-tap-highlight-color: transparent; }
.bn-roll:active:not([aria-disabled="true"]) { transform: translateY(3px); box-shadow: 0 1px 0 #b0721a; }
.bn-roll[aria-disabled="true"] { background: #16203a; color: #6f85a8; box-shadow: 0 4px 0 #0c1426; cursor: default; }
.bn-roll.bn-go { animation: bn-go 1.4s ease-in-out infinite; }
.bn-roll kbd { font: 700 11px/1 inherit; font-family: inherit; padding: 3px 6px; border-radius: 5px; background: rgba(0, 0, 0, .14); }
.bn-roll[aria-disabled="true"] kbd { display: none; }
@media (hover: none) { .bn-roll kbd { display: none; } }
.bn-narrow .bn-bar { gap: 6px; }
.bn-narrow .bn-status { flex: 1 1 100%; text-align: center; font-size: 14.5px; min-height: 38px; display: grid; place-items: center; }
.bn-narrow .bn-acts { flex: 1 1 100%; }
.bn-narrow .bn-roll { flex: 1 1 auto; min-width: 0; }
.bn-narrow .bn-roll kbd { display: none; }
.bn-short .bn-bar { flex-direction: column; align-items: stretch; gap: 5px; }
.bn-short .bn-status { flex: none; font-size: 13.5px; text-align: center; min-height: 34px; display: grid; place-items: center; }
.bn-short .bn-acts { flex: none; }
.bn-short .bn-mini { display: none; }
.bn-short .bn-roll { flex: 1 1 auto; min-width: 0; min-height: 46px; }
.bn-short .bn-roll kbd { display: none; }

/* ---------- dialogs ---------- */
.bn-overlay { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 10px; background: rgba(3, 6, 15, .76); border-radius: 12px; }
.bn-dialog { box-sizing: border-box; width: min(580px, 100%); max-height: 100%; overflow: auto; overscroll-behavior: contain; background: #0d1730; border: 1px solid var(--bn-line); border-radius: 18px; padding: 16px 18px 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 0 1px rgba(85, 214, 255, .16); outline: none; animation: bn-dlg .22s both; -webkit-overflow-scrolling: touch; }
.bn-dialog[data-view="sheet"], .bn-dialog[data-view="awards"] { width: min(660px, 100%); }
.bn-dialog h2 { margin: 0 0 4px; font-size: 21px; color: #fff; line-height: 1.2; }
.bn-dialog h3 { margin: 14px 0 6px; font-size: 13px; letter-spacing: .07em; text-transform: uppercase; color: var(--bn-accent); }
.bn-dialog p { margin: 6px 0; font-size: 14.5px; line-height: 1.5; color: var(--bn-text); }
.bn-dialog p.bn-note { font-size: 13px; color: var(--bn-muted); }
.bn-dialog ul { margin: 6px 0; padding-left: 20px; font-size: 14.5px; line-height: 1.5; }
.bn-dialog li { margin: 3px 0; }
.bn-dlg-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; position: sticky; bottom: -16px; padding: 10px 0 2px; background: linear-gradient(180deg, rgba(13, 23, 48, 0), #0d1730 34%); }
.bn-dlg-foot .bn-btn { min-height: 46px; padding: 0 18px; font-size: 15px; }
.bn-dlg-foot .bn-btn-primary { flex: 1 1 auto; }
.bn-x { float: right; margin: -4px -6px 0 8px; }
.bn-kv { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 8px 0; }
.bn-kv span { padding: 5px 10px; border-radius: 10px; background: #0a1226; border: 1px solid var(--bn-line); font-size: 13px; color: var(--bn-muted); }
.bn-kv b { color: #fff; font-size: 15px; margin-right: 3px; }
/* round result */
.bn-stampbox { display: flex; align-items: center; gap: 14px; margin: 2px 0 8px; }
.bn-stamp { flex: none; padding: 5px 13px 4px; border: 4px solid currentColor; border-radius: 10px; font-size: 30px; font-weight: 900; letter-spacing: .08em; line-height: 1; transform: rotate(-8deg); color: var(--bn-green); animation: bn-stamp .35s cubic-bezier(.2, 1.4, .5, 1) both; text-shadow: 0 0 12px currentColor; }
.bn-stamp.bn-l { color: var(--bn-pink); }
.bn-stamp.bn-n { color: var(--bn-warm); font-size: 22px; }
.bn-stampbox p { margin: 0; }
.bn-res { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 13.5px; }
.bn-res td { padding: 5px 6px; border-top: 1px solid var(--bn-line); vertical-align: middle; }
.bn-res tr:first-child td { border-top: 0; }
.bn-res td.bn-num { text-align: center; font-weight: 800; font-size: 16px; color: var(--bn-muted); white-space: nowrap; width: 1%; }
.bn-res td.bn-num.bn-w { color: var(--bn-warm); }
.bn-res td.bn-tn { color: var(--bn-muted); font-weight: 700; white-space: nowrap; width: 1%; }
.bn-res .bn-me { color: var(--bn-accent); font-weight: 800; }
.bn-res td:last-child { text-align: right; }
.bn-res small { color: var(--bn-muted); }
.bn-move { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; padding: 9px 11px; border-radius: 12px; background: #0a1226; border: 1px solid var(--bn-line); font-size: 14.5px; line-height: 1.4; }
.bn-move .bn-av { width: 38px; height: 38px; flex: none; }
.bn-move svg.bn-arrow { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--bn-warm); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
/* awards */
.bn-prizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 7px; margin: 8px 0; }
.bn-prize { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 12px; background: #0a1226; border: 1px solid var(--bn-line); min-width: 0; animation: bn-say .3s both; }
.bn-prize.bn-mine { border-color: var(--bn-warm); box-shadow: 0 0 0 1px var(--bn-warm), 0 0 16px rgba(255, 209, 102, .3); }
.bn-prize .bn-pico { width: 34px; height: 34px; flex: none; }
.bn-prize .bn-pico svg { width: 100%; height: 100%; display: block; }
.bn-prize div { min-width: 0; line-height: 1.25; }
.bn-prize small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--bn-accent); }
.bn-prize b { display: block; font-size: 15px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-prize span { display: block; font-size: 12px; color: var(--bn-muted); }
.bn-champ { display: flex; align-items: center; gap: 12px; margin: 6px 0 4px; }
.bn-champ .bn-av { width: 58px; height: 58px; flex: none; box-shadow: 0 0 0 3px var(--bn-warm), 0 0 22px rgba(255, 209, 102, .5); }
.bn-champ p { margin: 0; }
/* score sheet: paper */
.bn-tabs { display: flex; gap: 4px; margin: 8px 0; flex-wrap: wrap; }
.bn-tabs .bn-btn { min-height: 40px; }
.bn-tabs .bn-btn[aria-pressed="true"] { background: var(--bn-accent); color: #04121c; border-color: var(--bn-accent); }
.bn-paper { margin: 8px 2px; padding: 12px 12px 14px; border-radius: 5px; color: #2b2a26; background: #fdf8e6 repeating-linear-gradient(180deg, transparent 0 27px, rgba(70, 120, 190, .22) 27px 28px); box-shadow: 0 6px 20px rgba(0, 0, 0, .45), inset 0 0 0 1px #e3d9bd; transform: rotate(-.35deg); font-family: "Bradley Hand", "Segoe Print", "Chalkboard SE", "Comic Sans MS", cursive; overflow-x: auto; }
.bn-paper h4 { margin: 0 0 4px; font-size: 19px; line-height: 28px; color: #b3243b; font-family: inherit; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bn-paper h4 span { color: #2b2a26; font-size: 16px; }
.bn-paper table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.bn-paper th { text-align: left; font-size: 12px; line-height: 28px; font-weight: 700; color: #7b7461; padding: 0 5px; white-space: nowrap; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; text-transform: uppercase; letter-spacing: .04em; }
.bn-paper td { height: 28px; line-height: 28px; padding: 0 5px; white-space: nowrap; }
.bn-paper td.bn-c, .bn-paper th.bn-c { text-align: center; }
.bn-paper .bn-mk { font-weight: 800; font-size: 19px; color: #1d7a45; }
.bn-paper .bn-mk.bn-l { color: #b3243b; }
.bn-paper .bn-tally path { stroke: #2b2a26; }
.bn-paper .bn-tally { display: inline-block; vertical-align: middle; }
.bn-paper .bn-fd { display: inline-block; width: 20px; height: 20px; vertical-align: middle; }
.bn-paper .bn-fd rect { fill: #fff; stroke: #2b2a26; stroke-width: 5; }
.bn-paper .bn-fd circle { fill: #2b2a26; }
.bn-paper tr.bn-now td { background: rgba(255, 209, 102, .35); }
.bn-paper tr.bn-mine td { background: rgba(85, 214, 255, .22); font-weight: 700; }
.bn-paper .bn-tot { display: flex; flex-wrap: wrap; gap: 0 22px; margin-top: 0; font-size: 16px; line-height: 28px; }
.bn-paper .bn-tot b { color: #b3243b; }
.bn-narrow .bn-paper { padding: 12px 7px 14px; }
.bn-narrow .bn-paper table { font-size: 14.5px; }
.bn-narrow .bn-paper th { font-size: 10px; padding: 0 2px; letter-spacing: 0; }
.bn-narrow .bn-paper td { padding: 0 2px; }
.bn-narrow .bn-paper .bn-fd { width: 17px; height: 17px; }
.bn-narrow .bn-paper .bn-tot { gap: 0 14px; font-size: 15px; }
.bn-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; margin: 8px 0; }
.bn-badge { padding: 7px 10px; border-radius: 11px; background: #0a1226; border: 1px solid var(--bn-line); font-size: 12px; color: var(--bn-muted); line-height: 1.3; opacity: .62; }
.bn-badge b { display: block; font-size: 13.5px; color: #fff; }
.bn-badge.bn-got { opacity: 1; border-color: var(--bn-warm); }
.bn-badge.bn-got b { color: var(--bn-warm); }
.bn-coll { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.bn-coll span { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 800; color: var(--bn-muted); opacity: .45; }
.bn-coll span.bn-got { opacity: 1; color: var(--bn-warm); }
.bn-coll .bn-fd { width: 34px; height: 34px; }
/* options */
.bn-opt { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; padding: 7px 0; border-top: 1px solid var(--bn-line); }
.bn-opt:first-of-type { border-top: 0; }
.bn-opt > span { font-size: 14px; font-weight: 700; color: #fff; flex: 1 1 130px; min-width: 0; }
.bn-opt > span small { display: block; font-weight: 500; font-size: 12px; color: var(--bn-muted); }
.bn-opt .bn-seg { flex-wrap: wrap; background: #0a1226; }
.bn-opt .bn-seg button { min-height: 40px; min-width: 42px; padding: 0 12px; }
.bn-dialog input[type="text"] { min-height: 40px; box-sizing: border-box; width: 150px; max-width: 100%; padding: 0 10px; border-radius: 10px; border: 1px solid var(--bn-line); background: #0a1226; color: #fff; font: 600 16px/1 inherit; font-family: inherit; user-select: text; -webkit-user-select: text; }
.bn-sws { display: flex; gap: 6px; flex-wrap: wrap; }
.bn-sw { width: 40px; height: 40px; border-radius: 11px; border: 2px solid transparent; background: #0a1226; padding: 5px; cursor: pointer; box-sizing: border-box; }
.bn-sw[aria-pressed="true"] { border-color: var(--bn-warm); box-shadow: 0 0 10px rgba(255, 209, 102, .5); }
.bn-sw i { display: block; width: 100%; height: 100%; border-radius: 6px; }
.bn-seatrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
/* how to play */
.bn-ex { display: flex; flex-direction: column; gap: 5px; margin: 8px 0; }
.bn-ex div { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.bn-ex .bn-fd { width: 26px; height: 26px; flex: none; }
.bn-ex span.bn-d3 { display: inline-flex; gap: 3px; flex: none; }
.bn-ex b { color: var(--bn-warm); min-width: 4.9em; }
.bn-keys { display: flex; flex-wrap: wrap; gap: 5px 12px; font-size: 13px; color: var(--bn-muted); margin: 6px 0; }
.bn-keys kbd { background: #16213a; color: #bfe9ff; border-radius: 4px; padding: 1px 6px; font-family: inherit; font-weight: 700; }
.bn-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- motion ---------- */
@keyframes bn-bump { 40% { transform: scale(1.35); color: var(--bn-warm); } }
@keyframes bn-flash { 0% { background: #1b2c55; } 100% { background: var(--bn-panel); } }
@keyframes bn-boom { 0%, 60% { border-color: var(--bn-warm); box-shadow: 0 0 0 2px var(--bn-warm), 0 0 22px rgba(255, 209, 102, .7); background: #2a2440; } 100% { background: var(--bn-panel); } }
@keyframes bn-ding { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-18deg); } 35% { transform: rotate(15deg); } 55% { transform: rotate(-10deg); } 75% { transform: rotate(6deg); } }
@keyframes bn-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 209, 102, .65); } 50% { box-shadow: 0 0 0 9px rgba(255, 209, 102, 0); } }
@keyframes bn-go { 0%, 100% { box-shadow: 0 4px 0 #b0721a, 0 8px 20px rgba(255, 190, 60, .32); } 50% { box-shadow: 0 4px 0 #b0721a, 0 8px 30px rgba(255, 200, 80, .75); } }
@keyframes bn-shake { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-5px, 3px); } 40% { transform: translate(5px, -3px); } 60% { transform: translate(-3px, -2px); } 80% { transform: translate(3px, 2px); } }
@keyframes bn-seat-in { from { opacity: 0; scale: .7; } to { opacity: 1; scale: 1; } }
@keyframes bn-hop { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-12px); } 60% { transform: translateY(0); } 80% { transform: translateY(-5px); } }
@keyframes bn-swing { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
@keyframes bn-say { from { opacity: 0; scale: .8; } to { opacity: 1; scale: 1; } }
@keyframes bn-hit { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes bn-fade { from { opacity: .2; } to { opacity: 1; } }
@keyframes bn-pop { 0% { opacity: 0; margin-top: 10px; scale: .6; } 18% { opacity: 1; margin-top: 0; scale: 1.15; } 30% { scale: 1; } 75% { opacity: 1; } 100% { opacity: 0; margin-top: -34px; } }
@keyframes bn-banner { from { opacity: 0; scale: .3; rotate: -8deg; } to { opacity: 1; scale: 1; rotate: -3deg; } }
@keyframes bn-dlg { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes bn-stamp { from { opacity: 0; scale: 2.4; } to { opacity: 1; scale: 1; } }
@media (prefers-reduced-motion: reduce) {
  .bn *, .bn *::before, .bn *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition-duration: .01s !important; }
  .bn-felt.bn-shake { animation: none; }
  .bn-tok { animation: none; }
}
