/* Bridge: the table, the bidding box, the hands and the sheets. Everything is laid out against the game's own box
   (.brg), which the script measures; sizes arrive as --cw / --ch (hand cards), --dw / --dh (dummy) and --tw / --th
   (trick cards). */
.brg { position: relative; display: flex; flex-direction: column; gap: 6px; height: clamp(540px, calc(100vh - 96px), 800px); height: var(--room, clamp(540px, calc(100svh - 96px), 800px)); max-width: 1180px; margin: 0 auto; font-size: 14px; line-height: 1.35; outline: none; --cw: 58px; --ch: 82px; --fs: 18px; --dw: 42px; --dh: 59px; --tw: 50px; --th: 70px; --gold: #ffd166; --sky: #55d6ff; --ink: #0b1328; --line: #223660; }
.stage.is-immersive .stage-body > .brg { height: auto; max-width: none; width: 100%; align-self: stretch; flex: 1 1 auto; min-height: 0; }
.brg { --ty: 36px; --tx: 0px; --kh: 44px; }
.brg *, .brg *::before, .brg *::after { box-sizing: border-box; }
.brg button { font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.brg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.brg .s0 { color: #2fbf71; } .brg .s1 { color: #6aa8ff; } .brg .s2 { color: #ff6b81; } .brg .s3 { color: #e9eefc; } .brg .s4 { color: var(--gold); }

/* ---- top bar ---- */
.brg-bar { display: flex; align-items: center; gap: 6px; flex: none; min-height: 44px; }
.brg-b { min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line); background: #0d1730; font-weight: 750; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s, border-color .15s, transform .1s; }
.brg-b:hover { background: #14224a; border-color: #35508c; }
.brg-b:active { transform: scale(0.96); }
.brg-b:disabled { opacity: .4; cursor: default; }
.brg-ib { width: 44px; padding: 0; }
.brg-ib svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.brg-b:focus-visible, .brg-chip:focus-visible, .brg-k:focus-visible, .brg-hc:focus-visible, .brg-cell:focus-visible, .brg-tile:focus-visible, .brg-opt:focus-visible, .brg-seg button:focus-visible { outline: 2.5px solid var(--sky); outline-offset: 2px; }
#brg-mute .brg-off { display: none; } #brg-mute[aria-pressed="true"] .brg-on { display: none; } #brg-mute[aria-pressed="true"] .brg-off { display: inline; } #brg-mute[aria-pressed="true"] { color: #8fa3cc; }
.brg-chip { min-height: 44px; min-width: 0; padding: 3px 12px; border-radius: 11px; border: 1px solid var(--line); background: #0d1730; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; line-height: 1.15; text-align: left; overflow: hidden; }
.brg-chip b { font-size: 14px; font-weight: 800; white-space: nowrap; }
.brg-chip span { font-size: 11.5px; color: #9fb2d9; white-space: nowrap; }
.brg-vul { flex: none; padding: 4px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; white-space: nowrap; background: #16223f; color: #9fb2d9; border: 1px solid var(--line); }
.brg-vul.on { background: #4a1220; border-color: #c2334d; color: #ffc9d2; }
.brg-sp { flex: 1 1 0; min-width: 0; }
.brg-tr { flex: none; display: flex; gap: 8px; padding: 5px 10px; border-radius: 10px; background: #0d1730; border: 1px solid var(--line); font-size: 12px; font-weight: 750; color: #9fb2d9; white-space: nowrap; }
.brg-tr b { color: #fff; font-size: 14px; }

/* ---- the table ---- */
.brg-table { position: relative; flex: 1 1 auto; min-height: 0; border-radius: 14px; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-areas: "n n n" "w m e" "y y y" "h h h"; padding: 6px 6px 4px; }
.brg-plate { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: rgba(5, 10, 24, 0.62); border: 1px solid rgba(255, 255, 255, 0.1); font-size: 12px; font-weight: 750; white-space: nowrap; transition: box-shadow .2s, border-color .2s; }
.brg-plate small { font-size: 11px; font-weight: 600; color: #a9b9da; }
.brg-plate.vul { border-color: #c2334d; box-shadow: inset 0 -2px 0 #c2334d; }
.brg-plate.cur { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 16px rgba(255, 209, 102, 0.4); }
.brg-plate .brg-d { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--gold); color: #1a1200; font-size: 10.5px; font-weight: 900; }
.brg-plate .brg-dots { display: inline-flex; gap: 3px; }
.brg-plate .brg-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); animation: brg-dot 1s ease-in-out infinite; }
.brg-plate .brg-dots i:nth-child(2) { animation-delay: .15s; } .brg-plate .brg-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes brg-dot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
.brg-tag { padding: 2px 8px; border-radius: 999px; background: var(--gold); color: #1a1200; font-size: 10.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }

.brg-north { grid-area: n; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 30px; }
.brg-cols { display: flex; justify-content: center; gap: 6px; padding: 3px 8px; border-radius: 10px; transition: box-shadow .2s, background .2s; }
.brg-cols.cur { background: rgba(255, 209, 102, 0.1); box-shadow: 0 0 0 1.5px var(--gold); }
.brg-col { position: relative; width: var(--dw); flex: none; }
.brg-col.none::after { content: '—'; position: absolute; left: 0; right: 0; top: 4px; text-align: center; color: rgba(255, 255, 255, 0.35); font-weight: 800; }
.brg-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
.brg-west { grid-area: w; } .brg-east { grid-area: e; }
.brg-rows { width: 100%; max-width: 150px; padding: 5px 6px; border-radius: 9px; background: rgba(5, 10, 24, 0.55); border: 1px solid rgba(255, 255, 255, 0.1); display: grid; gap: 2px; font-weight: 800; font-size: 14.5px; line-height: 1.25; }
.brg-rows.cur { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.brg-row { display: flex; gap: 4px; align-items: baseline; min-height: 19px; }
.brg-row i { font-style: normal; flex: none; width: 15px; text-align: center; }
.brg-row span { display: flex; flex-wrap: wrap; gap: 0 4px; color: #f2f5fd; min-width: 0; }
.brg-row em { font-style: normal; color: rgba(255, 255, 255, 0.35); }
.brg-backs { font-size: 11.5px; color: #a9b9da; font-weight: 700; }
.brg-mid { grid-area: m; position: relative; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.brg-you { grid-area: y; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 26px; }
.brg-hand { grid-area: h; position: relative; isolation: isolate; height: calc(var(--ch) + 16px); border-radius: 10px; transition: box-shadow .2s, background .2s; }
.brg-hand.cur { background: rgba(255, 209, 102, 0.08); box-shadow: 0 0 0 1.5px var(--gold); }
.brg-fly { position: absolute; inset: 0; pointer-events: none; z-index: 30; }

/* ---- cards: the hand (rank above suit in the corner, so both show in a tight fan), dummy's columns ---- */
.brg-hc { position: absolute; left: 0; top: 12px; width: var(--cw); height: var(--ch); padding: 0; margin: 0; border: 0; background: none; border-radius: calc(var(--cw) * 0.1); cursor: pointer; transition: transform .16s cubic-bezier(.2, .8, .3, 1), left .22s ease; outline: none; }
.brg-hc .ck-card { box-shadow: 0 0 0 0.6px rgba(0, 0, 0, 0.42), -2px 2px 5px rgba(0, 0, 0, 0.28); transition: filter .18s, box-shadow .18s; }
.brg-fan .ck-ix { right: auto; left: calc(var(--cw) * 0.075); top: calc(var(--fs) * 0.14); height: auto; flex-direction: column; align-items: center; justify-content: flex-start; gap: calc(var(--fs) * 0.04); }
.brg-fan .ck-big { left: 58%; top: 62%; }
.brg-fan .ck-court { left: 30%; }
.brg-hc.no { cursor: default; }
.brg-hc.no .ck-card { filter: brightness(0.6) saturate(0.6); }
.brg-hc.sel { transform: translateY(-12px); }
.brg-hc.sel .ck-card { box-shadow: 0 0 0 2.5px var(--gold), 0 8px 16px rgba(0, 0, 0, 0.45); }
.brg-hc.hint .ck-card { box-shadow: 0 0 0 2.5px var(--sky), 0 0 14px rgba(85, 214, 255, 0.7); }
@media (hover: hover) { .brg-hc.can:not(.sel):hover { transform: translateY(-6px); } }
.brg-hc:focus-visible .ck-card { box-shadow: 0 0 0 3px var(--sky), 0 8px 16px rgba(0, 0, 0, 0.45); }
.brg-col .brg-hc { top: 0; width: var(--dw); height: var(--dh); --cw: var(--dw); --ch: var(--dh); --fs: calc(var(--dw) * 0.36); }
.brg-col .brg-hc.sel { transform: translateX(7px); }
@media (hover: hover) { .brg-col .brg-hc.can:not(.sel):hover { transform: translateX(4px); } }
.brg-hand.quiet .brg-hc, .brg-cols.quiet .brg-hc { cursor: default; }

/* ---- the trick ---- */
.brg-trick { position: relative; width: calc(var(--tw) * 3.3); height: calc(var(--th) + var(--ty) * 2 + 4px); flex: none; pointer-events: none; --cw: var(--tw); --ch: var(--th); --fs: calc(var(--tw) * 0.32); }
.brg-tc { position: absolute; left: 50%; top: 50%; width: var(--tw); height: var(--th); margin: calc(var(--th) / -2) 0 0 calc(var(--tw) / -2); transition: transform .26s cubic-bezier(.2, .8, .3, 1), opacity .3s; }
.brg-tc.p0 { transform: translate(calc(var(--tx) * -1), calc(var(--ty) * -1)); } .brg-tc.p2 { transform: translate(var(--tx), var(--ty)); z-index: 2; }
.brg-tc.p3 { transform: translate(-94%, 0); } .brg-tc.p1 { transform: translate(94%, 0); }
.brg-tc.win .ck-card { box-shadow: 0 0 0 2.5px var(--gold), 0 6px 14px rgba(0, 0, 0, 0.4); }
.brg-tc.go { opacity: 0; }
.brg-tc.go.t0 { transform: translate(0, -190%) scale(.6); } .brg-tc.go.t2 { transform: translate(0, 190%) scale(.6); }
.brg-tc.go.t3 { transform: translate(-260%, 0) scale(.6); } .brg-tc.go.t1 { transform: translate(260%, 0) scale(.6); }
.brg-lastlab { position: absolute; left: 50%; top: -4px; transform: translate(-50%, -100%); white-space: nowrap; }

/* ---- the auction: four columns, west to south; a vulnerable side's heading is red; every call can be tapped ---- */
.brg-auc { width: 100%; max-width: 380px; max-height: 100%; display: flex; flex-direction: column; border-radius: 12px; background: rgba(5, 10, 24, 0.6); border: 1px solid rgba(255, 255, 255, 0.1); overflow: hidden; }
.brg-auc-h { display: grid; grid-template-columns: repeat(4, 1fr); flex: none; }
.brg-auc-h span { padding: 4px 2px; text-align: center; font-size: 11.5px; font-weight: 800; color: #c9d5ef; background: rgba(255, 255, 255, 0.07); }
.brg-auc-h span.vul { background: #7d1d31; color: #ffe1e6; }
.brg-auc-h span.me { text-decoration: underline; text-underline-offset: 3px; }
.brg-auc-b { display: grid; grid-template-columns: repeat(4, 1fr); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.brg-cell { min-height: 40px; padding: 0; border: 0; border-top: 1px solid rgba(255, 255, 255, 0.07); background: none; font-weight: 800; font-size: 15.5px; cursor: pointer; display: grid; place-items: center; color: #f2f5fd; }
.brg-cell:hover, .brg-cell.on { background: rgba(85, 214, 255, 0.16); }
.brg-cell.pass { color: #8ea2cb; font-weight: 700; font-size: 13.5px; }
.brg-cell.dbl { color: #ff8a9c; } .brg-cell.rdbl { color: #7cc4ff; }
.brg-void { min-height: 40px; border-top: 1px solid rgba(255, 255, 255, 0.07); display: grid; place-items: center; color: rgba(255, 255, 255, 0.3); font-weight: 800; }
.brg-void.turn { color: var(--gold); animation: brg-blink 1.1s ease-in-out infinite; }
@keyframes brg-blink { 50% { opacity: .35; } }
.brg-kline { position: absolute; left: 50%; top: 4px; transform: translateX(-50%); z-index: 3; white-space: nowrap; }

/* ---- the dock: what is going on, the bidding box, the action buttons ---- */
.brg-dock { flex: none; display: flex; flex-direction: column; gap: 6px; }
.brg-say { min-height: 40px; padding: 6px 12px; border-radius: 11px; background: #0d1730; border: 1px solid var(--line); display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #dfe9ff; }
.brg-say b { color: #fff; }
.brg-say .brg-call { font-weight: 900; font-size: 15px; white-space: nowrap; }
.brg-say.coach { border-color: var(--sky); background: #0c2238; }
.brg-say.warn { border-color: #c2334d; background: #2a0f1a; }
.brg-box { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; max-width: 560px; width: 100%; margin: 0 auto; }
.brg-box[hidden], .brg-acts[hidden] { display: none; }
.brg-lv, .brg-st, .brg-cl { display: grid; gap: 6px; }
.brg-lv { grid-template-columns: repeat(7, minmax(0, 1fr)); } .brg-st { grid-template-columns: repeat(5, minmax(0, 1fr)); } .brg-cl { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); }
.brg-k { min-height: 44px; border-radius: 10px; border: 1px solid #2a4174; background: #13224a; font-weight: 850; font-size: 17px; cursor: pointer; display: grid; place-items: center; padding: 0 4px; transition: background .12s, transform .1s, border-color .12s; }
.brg-k:hover:not(:disabled) { background: #1b2f63; }
.brg-k:active:not(:disabled) { transform: scale(0.95); }
.brg-k:disabled { opacity: .28; cursor: default; }
.brg-k.on { background: #f4f7fb; color: #0b1328; border-color: #fff; }
.brg-st .brg-k { font-size: 21px; } .brg-st .brg-k.s4 { font-size: 15.5px; }
.brg-st .brg-k.on.s0 { color: #13803d; } .brg-st .brg-k.on.s1 { color: #1d5fcc; } .brg-st .brg-k.on.s2 { color: #cf1d31; } .brg-st .brg-k.on.s3, .brg-st .brg-k.on.s4 { color: #0b1328; }
.brg-cl .brg-k { font-size: 14px; }
.brg-k.pass { background: #12402b; border-color: #1f7a4d; } .brg-k.pass.on { background: #c9f5dc; color: #063; border-color: #fff; }
.brg-k.dbl { background: #4a1220; border-color: #a02a40; } .brg-k.dbl.on { background: #ffd0d8; color: #7d0f24; border-color: #fff; }
.brg-k.rdbl { background: #10305c; border-color: #2b62b5; } .brg-k.rdbl.on { background: #cfe4ff; color: #0c3c82; border-color: #fff; }
.brg-k.go { background: var(--gold); color: #1a1200; border-color: var(--gold); font-size: 15px; }
.brg-k.go:hover:not(:disabled) { background: #ffdc85; }
.brg-acts { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.brg-acts .brg-b { flex: 0 1 auto; }
.brg-b.primary { background: var(--gold); color: #1a1200; border-color: var(--gold); }
.brg-b.primary:hover { background: #ffdc85; }
.brg-b .brg-n { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--sky); color: #04121c; font-size: 11.5px; font-weight: 900; }

/* ---- sheets (menu, result, help, stats, auction review): inside the game's own box, never fixed ---- */
.brg-over { position: absolute; inset: 0; z-index: 80; display: grid; place-items: center; padding: 10px; background: rgba(4, 8, 20, 0.74); border-radius: 12px; animation: brg-fade .18s ease; }
.brg-over[hidden] { display: none; }
.brg-note[hidden] { display: none; }
.brg-over.peek { background: none; pointer-events: none; place-items: end center; }
.brg-over.peek .brg-sheet { pointer-events: auto; }
@keyframes brg-fade { from { opacity: 0; } }
.brg-sheet { width: min(540px, 100%); max-height: 100%; overflow-y: auto; overscroll-behavior: contain; background: #0e1830; border: 1px solid #2a4174; border-radius: 16px; padding: 14px 16px 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); outline: none; }
.brg-sheet.wide { width: min(760px, 100%); }
.brg-sh-top { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.brg-sh-top h3 { flex: 1; margin: 0; font-size: 19px; font-weight: 850; color: #fff; }
.brg-sheet h4 { margin: 14px 0 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #9fb2d9; }
.brg-sheet p { margin: 6px 0; color: #cfdaf2; }
.brg-sheet ul { margin: 6px 0; padding-left: 18px; color: #cfdaf2; } .brg-sheet li { margin: 3px 0; }
.brg-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.brg-tile { min-height: 62px; padding: 8px 12px; border-radius: 12px; border: 1px solid #2a4174; background: #13224a; cursor: pointer; text-align: left; display: flex; flex-direction: column; justify-content: center; gap: 2px; transition: background .12s, transform .1s; }
.brg-tile:hover { background: #1b2f63; } .brg-tile:active { transform: scale(0.98); }
.brg-tile b { font-size: 15.5px; color: #fff; } .brg-tile small { font-size: 12px; color: #a9b9da; line-height: 1.25; }
.brg-tile.wide { grid-column: 1 / -1; }
.brg-tile.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.brg-tile [data-rg-daily] { font-size: 11.5px; color: var(--gold); }
.brg-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.brg-seg button { min-height: 44px; border-radius: 10px; border: 1px solid #2a4174; background: #13224a; font-weight: 800; cursor: pointer; padding: 2px 6px; line-height: 1.15; }
.brg-seg button small { display: block; font-size: 10.5px; font-weight: 600; color: #a9b9da; }
.brg-seg button[aria-pressed="true"] { background: #f4f7fb; color: #0b1328; border-color: #fff; } .brg-seg button[aria-pressed="true"] small { color: #44506b; }
.brg-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 4px 10px; border-radius: 10px; border: 1px solid transparent; background: none; cursor: pointer; text-align: left; }
.brg-opt:hover { background: rgba(255, 255, 255, 0.05); }
.brg-opt i { flex: none; width: 38px; height: 22px; border-radius: 999px; background: #2a3a5e; position: relative; transition: background .15s; }
.brg-opt i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.brg-opt[aria-checked="true"] i { background: #2fbf71; } .brg-opt[aria-checked="true"] i::after { transform: translateX(16px); }
.brg-opt span { flex: 1; } .brg-opt small { display: block; color: #a9b9da; font-size: 12px; }
.brg-row2 { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; } .brg-row2 .brg-b { flex: 1 1 120px; }
/* ---- the result card ---- */
.brg-res-k { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.brg-res-k b { font-size: 26px; font-weight: 900; color: #fff; } .brg-res-k span { font-size: 14px; color: #cfdaf2; }
.brg-res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.brg-stat { padding: 8px 10px; border-radius: 11px; background: #13224a; border: 1px solid #223660; min-width: 0; }
.brg-stat small { display: block; font-size: 11px; font-weight: 700; color: #9fb2d9; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brg-stat b { font-size: 19px; font-weight: 900; color: #fff; white-space: nowrap; } .brg-stat b.up { color: #5fe39a; } .brg-stat b.down { color: #ff8a9c; }
.brg-meter { position: relative; height: 12px; border-radius: 999px; background: #1a2a52; overflow: hidden; margin: 4px 0 2px; }
.brg-meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, #55d6ff, #5fe39a); transition: width .7s cubic-bezier(.2, .8, .3, 1); }
.brg-meter::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, 0.55); }
.brg-field { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.brg-field td { padding: 5px 6px; border-top: 1px solid rgba(255, 255, 255, 0.08); white-space: nowrap; }
.brg-field td:nth-child(2), .brg-field td:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }
.brg-field tr.me td { background: rgba(255, 209, 102, 0.14); color: #fff; font-weight: 800; }
.brg-field tr.me td:first-child::before { content: 'You  '; color: var(--gold); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.brg-note { padding: 8px 11px; border-radius: 10px; background: #0c2238; border: 1px solid #1f5c80; color: #d6ecff; margin: 10px 0 0; font-size: 13.5px; }
.brg-sheet-score { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.brg-sheet-score th, .brg-sheet-score td { padding: 5px 6px; text-align: right; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.brg-sheet-score th:first-child, .brg-sheet-score td:first-child { text-align: left; } .brg-sheet-score th { color: #9fb2d9; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; border-top: 0; }
.brg-sheet-score tr.line td { border-top: 2px solid #c9d5ef; } .brg-sheet-score tr.sum td { font-weight: 900; color: #fff; }

/* ---- review: all four hands after a deal ---- */
.brg-rev { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.brg-rev .brg-rows { max-width: none; } .brg-rev h5 { margin: 0 0 3px; font-size: 12px; color: #9fb2d9; font-weight: 800; }

/* ---- lessons ---- */
.brg-lesson { grid-column: 1 / -1; grid-row: 1; z-index: 4; margin: 0 0 6px; padding: 9px 12px; border-radius: 12px; background: rgba(8, 16, 36, 0.9); border: 1px solid #2a4174; max-height: var(--lh, 180px); overflow-y: auto; font-size: 14px; color: #e6edfc; width: 100%; max-width: 720px; justify-self: center; align-self: start; }
.brg-lesson[hidden] { display: none; }
.brg-lesson .brg-step { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); display: flex; gap: 8px; align-items: center; }
.brg-lesson .brg-ask { margin: 6px 0 0; font-weight: 800; color: #fff; }
.brg-lesson p { margin: 4px 0 0; }
.brg-opts { display: grid; gap: 6px; margin-top: 8px; }
.brg-opts .brg-b { justify-content: flex-start; text-align: left; min-height: 44px; padding: 6px 12px; white-space: normal; }
.brg-opts .brg-b.right { background: #12402b; border-color: #2fbf71; } .brg-opts .brg-b.wrong { background: #4a1220; border-color: #c2334d; }
.brg[data-phase="lesson"] .brg-north { grid-row: 2; grid-column: 1 / -1; }
.brg[data-phase="lesson"] .brg-table { grid-template-rows: auto auto minmax(0, 1fr) auto auto; grid-template-areas: "l l l" "n n n" "w m e" "y y y" "h h h"; }
.brg-llist { display: grid; gap: 6px; }
.brg-litem { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px; border-radius: 11px; border: 1px solid #2a4174; background: #13224a; cursor: pointer; text-align: left; width: 100%; }
.brg-litem:hover { background: #1b2f63; }
.brg-litem i { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #223660; font-style: normal; font-weight: 900; font-size: 12px; color: #c9d5ef; }
.brg-litem.done i { background: #2fbf71; color: #04121c; }
.brg-litem span { flex: 1; min-width: 0; } .brg-litem b { display: block; color: #fff; } .brg-litem small { color: #a9b9da; font-size: 12px; }
.brg-prog { height: 8px; border-radius: 999px; background: #1a2a52; overflow: hidden; margin: 2px 0 10px; } .brg-prog i { display: block; height: 100%; background: #2fbf71; border-radius: 999px; }

/* ---- wide screens: a roomier table; small phones: tighter ---- */
@media (min-width: 900px) {
  .brg { font-size: 15px; }
  .brg-table { padding: 10px 14px 8px; }
  .brg-rows { font-size: 19px; max-width: 220px; padding: 10px 14px; gap: 4px; } .brg-row { gap: 7px; min-height: 25px; } .brg-row i { width: 20px; } .brg-row span { gap: 0 6px; }
  .brg-rev .brg-rows { font-size: 16px; padding: 8px 10px; gap: 2px; } .brg-rev .brg-row { min-height: 20px; gap: 4px; }
  .brg-plate { font-size: 13px; }
  .brg-cell { font-size: 17px; }
  .brg-cols { gap: 10px; }
  .brg-dock { flex-direction: row; flex-wrap: wrap; align-items: stretch; justify-content: center; }
  .brg-say { flex: 1 1 100%; justify-content: center; text-align: center; }
  .brg-box { flex: 0 1 560px; margin: 0; }
  .brg-acts { align-items: center; }
}
@media (max-width: 430px) {
  .brg-b { padding: 0 9px; font-size: 13px; }
  .brg-chip { padding: 3px 9px; } .brg-chip b { font-size: 13px; }
  .brg-vul { padding: 4px 7px; font-size: 11px; }
  .brg-tr { padding: 5px 7px; gap: 6px; }
  .brg-rows { font-size: 13px; padding: 4px 3px; } .brg-row { gap: 2px; } .brg-row i { width: 13px; } .brg-row span { gap: 0 2px; }
  .brg-side .brg-plate { flex-wrap: wrap; justify-content: center; gap: 0 5px; padding: 3px 8px; border-radius: 12px; max-width: 100%; line-height: 1.2; }
  .brg-side .brg-plate small { flex-basis: 100%; text-align: center; }
  .brg-res-k b { font-size: 22px; } .brg-stat b { font-size: 16.5px; } .brg-stat { padding: 7px 8px; }
  .brg-stat.wrap small { white-space: normal; overflow: visible; line-height: 1.25; min-height: 2.5em; letter-spacing: .03em; }
  .brg-sheet { padding: 12px 12px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .brg *, .brg *::before, .brg *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---- later additions ---- */
.brg-auc[hidden], .brg-trick[hidden], .brg-box[hidden], .brg-acts[hidden], .brg-vul[hidden], .brg-b[hidden] { display: none; }
.brg-nrow { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 26px; }
.brg-backs { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; }
.brg-backs i { width: 15px; height: 21px; border-radius: 3px; background: repeating-linear-gradient(45deg, #2a4a9c 0 3px, #1f3a80 3px 6px); border: 1px solid #5f7fd0; }
.brg-tr span { color: #9fb2d9; font-weight: 700; }
.brg-chip small { font-size: 11px; color: #9fb2d9; }
#brg-last[aria-pressed="true"] { background: var(--gold); color: #1a1200; border-color: var(--gold); }
.brg-say { min-height: 46px; line-height: 1.3; }
.brg-say > span:last-child { min-width: 0; }
.brg[data-phase="bid"] .brg-say { height: 58px; overflow: hidden; }
.brg-mean { display: flex; gap: 10px; align-items: baseline; margin: 5px 0 !important; }
.brg-mean .brg-call { flex: 0 0 104px; font-weight: 850; color: #fff; white-space: nowrap; }
.brg-note.good { background: #0d2a1e; border-color: #2fbf71; color: #d9ffe9; }
.brg-note.bad { background: #331019; border-color: #c2334d; color: #ffdbe1; }
.brg-daily { margin: 8px 0 0; font-size: 13px; color: var(--gold); min-height: 0; }
.brg-daily:empty, .brg-daily span:empty { display: none; }
.brg-rub td { vertical-align: bottom; width: 50%; text-align: left !important; }
.brg-rub td div { display: flex; gap: 6px; align-items: baseline; font-weight: 800; color: #fff; }
.brg-rub td small { font-weight: 600; color: #9fb2d9; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brg-rub th { text-align: left !important; }
.brg-rub tr.gm td { border-top: 1px dashed rgba(201, 213, 239, 0.55); }
.brg-field td:nth-child(2), .brg-field th:nth-child(2) { text-align: center; }
@media (max-width: 430px) {
  #brg-help { display: none; }
  .brg[data-phase="bid"] .brg-say { height: 62px; font-size: 12.5px; }
  .brg-mean .brg-call { flex-basis: 86px; }
}
.brg-field th { font-size: 11px; font-weight: 700; color: #9fb2d9; text-transform: uppercase; letter-spacing: .05em; text-align: left; padding: 4px 6px; }
.brg-field th:nth-child(3) { text-align: right; }
.brg-cell { display: flex; align-items: center; justify-content: center; gap: 1px; white-space: nowrap; }
.brg-k { min-width: 0; }
.brg-cols.wide { gap: 14px; padding: 6px 12px; }
.brg-cols.row { padding: 3px 5px 5px; }
.brg-cols.row .brg-hc { --fs: calc(var(--dw) * 0.33); }
.brg-cols.row .brg-hc.sel { transform: translateY(7px); }
@media (hover: hover) { .brg-cols.row .brg-hc.can:not(.sel):hover { transform: translateY(4px); } }
.brg-cols.wide .brg-hc.sel { transform: translateY(-9px); }
@media (hover: hover) { .brg-cols.wide .brg-hc.can:not(.sel):hover { transform: translateY(-5px); } }
.brg-cols.wide .brg-col.none::after { top: 34%; }
.brg-tile .brg-prog { display: block; width: 100%; margin-top: 6px; }
.brg-lesson.fb { max-height: var(--lh2, 360px); }
.brg-lesson.fb .brg-ltxt, .brg-lesson.fb .brg-ask { display: none; }
.brg-lesson.fb .brg-note { margin-top: 2px; }
.brg[data-step="quiz"] .brg-table { grid-template-rows: minmax(0, 1fr) auto 0 auto auto; }
.brg[data-step="quiz"] .brg-lesson { max-height: 100%; }
.brg[data-step="quiz"] .brg-mid, .brg[data-step="quiz"] .brg-side { display: none; }
.brg-opts .brg-b { display: block; }

/* the coach's suggestion: a ring on the keys, never a pick */
.brg-k.tip { box-shadow: inset 0 0 0 2px var(--sky), 0 0 10px rgba(110, 190, 255, .45); }
.brg-k.tip.on { box-shadow: inset 0 0 0 2px #fff, 0 0 10px rgba(110, 190, 255, .45); }

/* ---- a phone on its side (the site's full-window view): the felt on the left, bar and bidding box down the right ---- */
.brg.land { display: grid; grid-template-columns: minmax(0, 1fr) clamp(304px, 40%, 330px); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "t b" "t d"; gap: 6px; }
.brg.land > .brg-table { grid-area: t; padding: 5px 6px 3px; }
.brg.land > .brg-bar { grid-area: b; min-width: 0; }
.brg.land #brg-vul { position: absolute; left: 9px; top: 9px; z-index: 3; }
.brg.land > .brg-dock { grid-area: d; min-width: 0; min-height: 0; flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; align-items: stretch; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.brg.land .brg-chip { flex: 1 1 0; }
.brg.land .brg-sp, .brg.land #brg-help { display: none; }
.brg.land .brg-say { flex: none; font-size: 12.5px; text-align: left; justify-content: flex-start; }
.brg.land[data-phase="bid"] .brg-say { height: 62px; }
.brg.land .brg-box { flex: none; max-width: none; gap: 5px; }
.brg.land .brg-lv, .brg.land .brg-st, .brg.land .brg-cl { gap: 4px; }
.brg.land .brg-cl .brg-k { font-size: 12.5px; padding: 0 2px; }
.brg.land .brg-k { min-height: var(--kh); }
.brg.land .brg-north { gap: 2px; }
.brg-turn { position: absolute; inset: 0; z-index: 95; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px 22px; text-align: center; background: #0a1226; border-radius: 12px; }
.brg-turn[hidden] { display: none; }
.brg-turn svg { width: 54px; height: 54px; fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brg-turn b { font-size: 18px; color: #fff; }
.brg-turn span { font-size: 13.5px; color: #c9d5ef; max-width: 340px; }

/* lessons: the text never hides behind a scroll, and answers are put right in the dock so the table never moves */
.brg[data-phase="lesson"] .brg-say { height: 58px; overflow: hidden; }
.brg.lfb .brg-say { display: none; }
.brg.lfb .brg-acts { min-height: 58px; align-items: center; }
.brg.lfb .brg-acts .brg-b { flex: 0 1 280px; min-height: 48px; }
.brg-box { position: relative; }
.brg-box.done > .brg-lv, .brg-box.done > .brg-st, .brg-box.done > .brg-cl { visibility: hidden; }
.brg-lcard { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.brg-lcard .brg-note { margin: 0; font-size: 14px; }
.brg-lcard .brg-b { min-height: 48px; }
.brg-stepc { display: none; }
.brg.lt .brg-stepc { display: inline; }
.brg.lt .brg-lesson { font-size: 13px; line-height: 1.32; padding: 7px 11px; }
.brg.lt .brg-lesson .brg-step { display: none; }
.brg.lt .brg-lesson .brg-step + p { margin-top: 0; }
.brg.lt[data-step="bid"] .brg-north, .brg.lt[data-step="bid"] .brg-you, .brg.lt[data-step="quiz"] .brg-north, .brg.lt[data-step="quiz"] .brg-you { display: none; }
.brg.lt[data-step="bid"] .brg-cell, .brg.lt[data-step="bid"] .brg-void { min-height: 30px; }
.brg.lt2[data-step="bid"] .brg-lesson .brg-ask { display: none; }
.brg[data-step="bid"] .brg-lesson { max-height: var(--lhb, var(--lh, 180px)); }
@media (max-width: 430px) { .brg[data-phase="lesson"] .brg-say { height: 62px; font-size: 12.5px; } .brg.lfb .brg-acts { min-height: 62px; } }
.brg.land[data-phase="lesson"] .brg-say { height: 62px; } .brg.land.lfb .brg-acts { min-height: 62px; }
.brg-say.long { display: block; padding: 3px 10px; text-align: left; line-height: 1.28; }
.brg-say.long .brg-call { font-size: 12px; line-height: 1; margin-right: 6px; }
