/* Online bingo caller (/games/bingo-caller/, public/games/bingo-caller.js). Uses the tokens in style.css.
   Big screen (TV) mode: .bc-tv fills the screen (and goes fullscreen where allowed), white and yellow on dark blue. */
.bc { --bc-navy: #10163a; --bc-cell: #1c2452; margin: var(--s5) 0 0; padding: 16px; border: 2px solid var(--line-2); border-radius: var(--radius-lg); background: var(--card); }
.bc-setup { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin: 0 0 var(--s4); }
.bc-sel { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 800; max-width: 100%; }
.bc-sel select { font: inherit; font-weight: 700; min-height: 48px; padding: 6px 12px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); max-width: 100%; }
.bc-print { margin: 0; font-weight: 700; }
.bc-main { display: grid; gap: var(--s4); }
@media (min-width: 760px) { .bc-main { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }

/* the last call */
.bc-now { background: var(--bc-navy); color: #fff; border-radius: var(--radius); padding: 14px 16px 16px; text-align: center; min-height: 260px; display: flex; flex-direction: column; justify-content: center; }
.bc-now p { margin: 0; }
.bc-now-k, .bc-recent-h { font-size: var(--t-sm); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #ffe08a; }
.bc-now-v { display: flex; align-items: center; justify-content: center; gap: .2em; flex-wrap: wrap; min-height: 1.2em; font-size: clamp(4rem, 20vw, 8.5rem); font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; }
.bc-l { display: inline-grid; place-items: center; width: 1.05em; height: 1.05em; border-radius: 50%; background: var(--sun); color: var(--bc-navy); font-size: .62em; }
.bc-ready { font-size: .45em; color: #dfe3ff; }
.bc-w { font-size: .32em; line-height: 1.1; overflow-wrap: anywhere; }
.bc-is-word .bc-w { font-size: .42em; }
.bc-pic { display: block; width: 44px; height: 44px; flex: none; }
.bc-pic-big { width: clamp(110px, 32vw, 190px); height: auto; aspect-ratio: 1; background: #fff; border-radius: 18px; padding: 6px; }
.bc-pic-s { width: 28px; height: 28px; background: #fff; border-radius: 6px; }
.bc-count { font-size: var(--t-lg); font-weight: 800; margin: 6px 0 10px !important; }
.bc-recent { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 40px; }
.bc-recent li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--bc-cell); color: #fff; font-weight: 800; font-size: var(--t-md); }
@media (prefers-reduced-motion: no-preference) {
  .bc-pop .bc-now-v { animation: bc-pop .35s ease-out; }
  @keyframes bc-pop { from { transform: scale(.85); opacity: .4; } to { transform: none; opacity: 1; } }
}

/* controls */
.bc-ctl { display: grid; gap: var(--s3); }
.bc-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0; }
.bc-next { min-height: 64px; font-size: 1.35rem; flex: 1 1 180px; }
.bc-row [data-bc="auto"] { min-height: 64px; flex: 1 1 140px; font-size: var(--t-lg); }
.bc-row [data-bc="auto"][aria-pressed="true"] { --b-bg: var(--ink); --b-fg: #fff; }
.bc-speed { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-weight: 700; }
.bc-speed span { font-weight: 900; font-variant-numeric: tabular-nums; }
.bc-speed input { grid-column: 1 / -1; width: 100%; min-height: 32px; accent-color: var(--coral); }
.bc-hint { margin: -6px 0 0; color: var(--muted); font-size: var(--t-xs); }
.bc-status { min-height: 1.4em; margin: var(--s3) 0 0; font-weight: 800; }

/* board */
.bc-board-h { margin: var(--s4) 0 var(--s2); font-size: var(--t-lg); }
.bc-board ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bc-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 34px; border: 2px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; line-height: 1.1; }
.bc-cell.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.bc-cell.last { background: var(--sun); border-color: var(--ink); color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.bc-b75 .bc-brow { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 6px; align-items: start; margin: 0 0 6px; }
.bc-bl { display: grid; place-items: center; height: 34px; border-radius: 8px; background: var(--sun); font-weight: 900; font-size: 1.2rem; }
.bc-b75 ul { grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); }
.bc-b90 ul { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.bc-bp ul, .bc-bw ul { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.bc-bp .bc-cell, .bc-bw .bc-cell { padding: 6px 4px; gap: 4px; font-size: .85rem; min-height: 56px; }
.bc-bp .bc-cell .bc-pic { background: #fff; border-radius: 8px; }
.bc-order { margin: var(--s4) 0 0; }
.bc-order summary { cursor: pointer; font-weight: 800; min-height: 44px; display: flex; align-items: center; }
.bc-order ol { margin: 0; padding-left: 2.2em; columns: 4 8em; font-variant-numeric: tabular-nums; }

/* dialogs */
.bc-dlg { max-width: min(560px, calc(100vw - 32px)); width: 100%; border: 2px solid var(--ink); border-radius: var(--radius-lg); padding: 20px; color: var(--ink); background: #fff; }
.bc-dlg::backdrop { background: rgba(16, 22, 58, .6); }
.bc-dlg h2 { margin-top: 0; }
.bc-dlg label { display: block; font-weight: 700; margin: 0 0 6px; }
.bc-dlg input { font: inherit; font-size: 1.25rem; min-height: 52px; width: 100%; padding: 6px 12px; border: 2px solid var(--ink); border-radius: 12px; }
.bc-good, .bc-bad { font-weight: 800; font-size: var(--t-lg); padding: 10px 12px; border-radius: 12px; }
.bc-good { background: var(--green-soft); color: var(--green); border: 2px solid var(--green); }
.bc-bad { background: var(--coral-soft); color: var(--coral-dark); border: 2px solid var(--coral); }
.bc-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.bc-chips li { padding: 6px 12px; border-radius: 999px; font-weight: 800; border: 2px solid var(--ink); }
.bc-chips li.on { background: var(--ink); color: #fff; }
.bc-chips li.on::before { content: "✓ "; }
.bc-chips li.off { background: #fff; color: var(--coral-dark); border-style: dashed; }
.bc-card { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; gap: 4px; }
.bc-card5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bc-card3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bc-card li { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 4px 2px; border: 2px solid var(--line-2); border-radius: 8px; font-size: clamp(.62rem, 2.5vw, .8rem); font-weight: 700; text-align: center; line-height: 1.05; }
.bc-card .bc-pic { width: 36px; height: 36px; }
.bc-card li.on { background: var(--sun); border-color: var(--ink); }
.bc-card li.on::after { content: "✓"; position: absolute; top: 1px; right: 4px; font-weight: 900; }
.bc-card li.hit { outline: 3px solid var(--green); outline-offset: -1px; }
.bc-keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: baseline; }
.bc-keys dt { margin: 0; } .bc-keys dd { margin: 0; }
.bc-keys kbd { display: inline-block; padding: 2px 8px; border: 2px solid var(--ink); border-radius: 6px; font: inherit; font-weight: 800; }
.bc-nojs { font-weight: 700; }

/* ---------- big screen / TV ---------- */
html.bc-tv-on { overflow: hidden; }
.bc.bc-tv { position: fixed; inset: 0; z-index: 10000; margin: 0; border: 0; border-radius: 0; padding: 2vh 2vw; background: var(--bc-navy); color: #fff; overflow: auto;
  display: grid; gap: 2vh 2vw; grid-template-columns: minmax(0, 1fr); align-content: start; }
.bc-tv > *, .bc-tv .bc-main > * { min-height: auto; }
.bc.bc-tv:fullscreen { width: 100vw; height: 100vh; }
.bc-tv .bc-setup, .bc-tv .bc-board-h, .bc-tv .bc-order, .bc-tv .bc-speed, .bc-tv .bc-hint, .bc-tv [data-bc="undo"], .bc-tv [data-bc="check"], .bc-tv [data-bc="keys"], .bc-tv [data-bc="new"], .bc-tv .bc-print { display: none; }
.bc-tv .bc-main { display: contents; }
.bc-tv .bc-now { padding: 1vh 1vw; background: var(--bc-navy); }
.bc-tv .bc-now-k, .bc-tv .bc-recent-h { font-size: clamp(1rem, 2.4vh, 1.6rem); }
.bc-tv .bc-now-v { font-size: min(34vh, 30vw); }
.bc-tv .bc-pic-big { width: min(36vh, 40vw); }
.bc-tv .bc-is-word .bc-w { font-size: .45em; }
.bc-tv .bc-count { font-size: clamp(1.2rem, 3.4vh, 2.4rem); }
.bc-tv .bc-recent li { font-size: clamp(1.1rem, 3.6vh, 2.6rem); padding: .2em .6em; }
.bc-tv .bc-ctl { align-content: start; }
.bc-tv .bc-row { justify-content: center; }
.bc-tv .bc-ctl button { --b-bg: #fff; --b-fg: var(--bc-navy); --b-bd: #fff; min-height: 52px; font-size: clamp(1rem, 2.4vh, 1.5rem); }
.bc-tv .bc-ctl .primary, .bc-tv .bc-ctl [aria-pressed="true"] { --b-bg: var(--sun); --b-bd: var(--sun); --b-fg: var(--bc-navy); }
.bc-tv .bc-status { color: #ffe08a; text-align: center; margin: 0; }
.bc-tv .bc-status:empty { display: none; }
.bc-tv .bc-board { align-self: start; }
.bc-tv .bc-cell { background: var(--bc-cell); border-color: #2c3670; color: #c9cde8; font-size: clamp(.9rem, 2.6vh, 1.9rem); min-height: clamp(30px, 5.4vh, 64px); }
.bc-tv .bc-cell.on { background: #fff; border-color: #fff; color: var(--bc-navy); }
.bc-tv .bc-cell.last { background: var(--sun); border-color: var(--sun); color: var(--bc-navy); box-shadow: 0 0 0 3px #fff; }
.bc-tv .bc-b75 .bc-brow { grid-template-columns: clamp(30px, 5.4vh, 64px) minmax(0, 1fr); }
.bc-tv .bc-bl { height: clamp(30px, 5.4vh, 64px); color: var(--bc-navy); font-size: clamp(1rem, 3vh, 2rem); }
.bc-tv .bc-b75 ul { grid-template-columns: repeat(15, minmax(0, 1fr)); }
.bc-tv .bc-bp ul, .bc-tv .bc-bw ul { grid-template-columns: repeat(auto-fill, minmax(clamp(80px, 10vw, 150px), 1fr)); }
.bc-tv .bc-bp .bc-cell .bc-pic { width: clamp(32px, 6vh, 72px); height: clamp(32px, 6vh, 72px); }
.bc-tv.bc-nocursor, .bc-tv.bc-nocursor * { cursor: none; }
@media (min-aspect-ratio: 5/4) {
  .bc.bc-tv { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-content: stretch; grid-template-rows: 1fr auto auto; grid-template-areas: "now board" "ctl board" "st board"; }
  .bc-tv .bc-now { grid-area: now; }
  .bc-tv .bc-ctl { grid-area: ctl; }
  .bc-tv .bc-board { grid-area: board; align-self: center; }
  .bc-tv .bc-status { grid-area: st; }
}
@media (max-width: 420px) {
  .bc { padding: 12px; }
  .bc-b90 .bc-cell { font-size: .85rem; }
}
/* picture and word sets on the big screen: six across so 30 to 36 calls fit beside the last call */
.bc-tv .bc-bp ul, .bc-tv .bc-bw ul { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .6vh .5vw; }
.bc-tv .bc-bp .bc-cell, .bc-tv .bc-bw .bc-cell { font-size: clamp(.7rem, 1.7vh, 1.25rem); min-height: 0; padding: .5vh 2px; gap: 2px; }
.bc-tv .bc-bp .bc-cell .bc-pic { width: clamp(26px, 5vh, 60px); height: clamp(26px, 5vh, 60px); }
.bc-tv[data-mode="pictures"] .bc-pic-big { width: min(28vh, 34vw); }
.bc-tv[data-mode="pictures"] .bc-now-v { font-size: min(26vh, 20vw); }
.bc-tv[data-mode="pictures"] .bc-recent li, .bc-tv[data-mode="words"] .bc-recent li { font-size: clamp(1rem, 2.6vh, 1.8rem); }
.bc-cell, .bc-card li { overflow-wrap: break-word; hyphens: auto; }
.bc-tv .bc-bw .bc-cell { min-height: clamp(36px, 6.5vh, 76px); }
@media (max-width: 520px) { .bc:not(.bc-tv) .bc-b75 ul { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
