/*! B2 Bingo — © 2026 B2 Stealthy Solutions. All rights reserved. */
/* B2 Bingo ● shares the B2 paper-and-coral design system */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --cream: #faf6f0; --paper: #fffdf8; --sand: #f1e9dd; --line: #e7dccd;
  --ink: #2b2622; --muted: #6b625a;
  --coral: #d97757; --coral-dark: #a84f33; --coral-deep: #9a4529;
  --plum: #7b5ea7; --sage: #5b9a8b; --sage-text: #3f7a6c; --gold: #f2c14e; --navy: #3d5a80; --rose: #c2185b;
  --dab: #c2185b; --ok: #2e7d4f; --err: #b3261e;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(43, 38, 34, .06), 0 10px 30px rgba(43, 38, 34, .08);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--sans); color: var(--ink); line-height: 1.5;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(217, 119, 87, .12), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(123, 94, 167, .1), transparent 60%),
    var(--cream);
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--coral-dark); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--paper); padding: .5rem 1rem; border-radius: 8px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem clamp(1rem, 4vw, 2rem); padding-top: max(.7rem, env(safe-area-inset-top));
  background: rgba(250, 246, 240, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { min-height: 44px; display: inline-flex; align-items: center; gap: .5rem; font-family: var(--serif); font-weight: 700; color: var(--ink); text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-company { font-family: var(--sans); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--coral-dark); white-space: nowrap; }
.brand-name { font-size: 1.2rem; }
.brand-mark { color: var(--coral); font-size: 1.5rem; }
.top-stats { display: flex; gap: .5rem; }
.icon-btn { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; width: 2.75rem; height: 2.75rem; cursor: pointer; }

.view { width: min(100% - 2rem, 1080px); margin: 0 auto; padding: 1.2rem 0 4rem; outline: none; }
.back { display: inline-block; margin-bottom: .8rem; font-weight: 650; text-decoration: none; min-height: 44px; line-height: 44px; }

.site-footer { text-align: center; color: var(--muted); font-size: .8rem; width: min(100% - 2rem, 760px); margin: 0 auto; padding: 1.5rem 0 6rem; border-top: 1px solid var(--line); }
.site-footer p { margin: .35rem 0; }
.footer-brand { font-family: var(--serif); font-size: 1rem; color: var(--ink); }
.footer-copy { font-weight: 700; color: var(--ink); }
.footer-legal { font-size: .75rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px;
  border: 1px solid transparent; border-radius: 999px; padding: .65rem 1.2rem; font-weight: 650; cursor: pointer;
  text-decoration: none; transition: transform .15s ease, background .15s ease; touch-action: manipulation;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--coral-dark); color: #fff; box-shadow: 0 6px 16px rgba(217, 119, 87, .35); }
.btn.primary:hover:not(:disabled) { background: var(--coral-deep); }
.btn.ghost { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn.danger { background: var(--err); color: #fff; }
.btn.big { padding: .95rem 1.6rem; font-size: 1.05rem; }
.btn.small { padding: .35rem .9rem; font-size: .9rem; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.row.center { justify-content: center; }

/* ---------- home ---------- */
.hero { text-align: center; padding: 1.5rem 0 1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--coral-dark); margin: 0; }
.hero h1 { font-family: var(--serif); font-size: clamp(2.6rem, 11vw, 4.2rem); margin: .2rem 0; line-height: 1; }
.hero .accent { color: var(--coral-dark); }
.lede { max-width: 34rem; margin: .6rem auto 0; color: var(--muted); }
.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 1.2rem; }
.tile {
  display: grid; gap: .2rem; padding: 1.3rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform .15s ease;
}
.tile:hover { transform: translateY(-2px); }
.tile-e { font-size: 2rem; }
.tile-t { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; }
.tile-d { color: var(--muted); font-size: .95rem; }
.install { margin: 1.5rem auto 0; max-width: 560px; padding: 1rem 1.2rem; border: 1px dashed var(--coral); border-radius: 16px; background: var(--paper); text-align: center; }
.install p { margin: .3rem 0 0; color: var(--muted); }
.install .btn { margin-top: .6rem; }

/* ---------- panels & forms ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.1rem, 4vw, 2rem); box-shadow: var(--shadow); max-width: 760px; margin: 0 auto; }
.panel h2 { font-family: var(--serif); font-size: clamp(1.5rem, 5vw, 2rem); margin: 0 0 .4rem; }
.panel h3 { font-family: var(--serif); margin: 1.2rem 0 .4rem; }
fieldset { border: 0; padding: 0; margin: 1rem 0 0; min-width: 0; }
legend { font-weight: 700; margin-bottom: .45rem; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chips legend { width: 100%; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--cream); font-weight: 600; }
.chip input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip input:checked + span::before { content: "✓ "; white-space: pre; }
.chip input:focus-visible + span { outline: 3px solid var(--coral); outline-offset: 2px; }
.names { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-top: .7rem; }
.name-field { display: flex; align-items: center; gap: .5rem; }
.name-field input, textarea { width: 100%; min-height: 44px; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .95rem; resize: vertical; }
.block { display: grid; gap: .35rem; margin-top: .8rem; font-weight: 600; }
.check { display: flex; align-items: center; gap: .6rem; min-height: 44px; margin-top: .6rem; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--coral-dark); }
.msg { margin: 1rem 0 0; font-weight: 600; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--err); }
.packs { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.packs legend { grid-column: 1 / -1; }
.pack { position: relative; display: grid; gap: .1rem; padding: .8rem; border: 1px solid var(--line); border-radius: 16px; background: var(--cream); cursor: pointer; }
.pack input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pack:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); background: #fff; }
.pack:has(input:checked)::after { content: "✓"; position: absolute; top: .5rem; right: .7rem; font-weight: 900; }
.pack:has(input:focus-visible) { outline: 3px solid var(--coral); outline-offset: 2px; }
.pack-e { font-size: 1.5rem; }
.pack-t { font-weight: 700; }
.pack-d { font-size: .8rem; color: var(--muted); }
.pdot { flex: none; display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; color: #fff; font-weight: 800; font-size: .85rem; }
.pdot.p0 { background: var(--coral-dark); } .pdot.p1 { background: var(--plum); } .pdot.p2 { background: var(--sage-text); } .pdot.p3 { background: var(--navy); }

/* ---------- balls ---------- */
.ball { --c: var(--muted); flex: none; display: inline-grid; place-items: center; align-content: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #fff 0 52%, var(--c) 53%); color: var(--ink); font-weight: 800; font-size: .72rem; line-height: 1;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .18); }
.ball .ball-l { font-size: .55em; }
.ball.big { width: clamp(5rem, 22vw, 7rem); height: clamp(5rem, 22vw, 7rem); font-size: clamp(1.4rem, 7vw, 2.2rem); }
.ball.big.col-W .ball-n { font-size: .55em; max-width: 80%; text-align: center; overflow-wrap: anywhere; }
.ball.col-B { --c: var(--coral); } .ball.col-I { --c: var(--plum); } .ball.col-N { --c: var(--sage); } .ball.col-G { --c: var(--gold); } .ball.col-O { --c: var(--navy); }
.ball.col-W { --c: var(--coral-dark); background: radial-gradient(circle at 50% 50%, #fff 0 62%, var(--c) 63%); }
.ball.pop { animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both; }

/* ---------- caller bar ---------- */
.callbar { position: sticky; top: calc(64px + env(safe-area-inset-top)); z-index: 10; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.call-now { display: flex; align-items: center; gap: 1rem; }
.call-meta { min-width: 0; display: grid; gap: .15rem; }
.call-title { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; }
.recent { display: flex; gap: .3rem; flex-wrap: wrap; min-height: 2.2rem; }
.recent .ball.col-W { width: auto; min-width: 2.2rem; border-radius: 999px; padding: 0 .5rem; background: var(--sand); max-width: 9rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pace { height: 6px; background: var(--sand); border-radius: 999px; overflow: hidden; margin: .7rem 0 .2rem; }
.pace i { display: block; height: 100%; width: 0; background: var(--coral); }
@keyframes pace { from { width: 0; } to { width: 100%; } }
.call-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
@media (max-width: 600px) {
  .callbar { padding: .55rem .7rem; border-radius: 16px; top: calc(60px + env(safe-area-inset-top)); }
  .call-now { gap: .7rem; }
  .ball.big { width: 4.2rem; height: 4.2rem; font-size: 1.5rem; }
  .call-title { font-size: .95rem; line-height: 1.2; }
  #call-count { font-size: .85rem; }
  .recent { min-height: 1.8rem; }
  .recent .ball { width: 1.8rem; height: 1.8rem; font-size: .62rem; }
  .recent .ball:nth-child(n+5) { display: none; }
  .pace { margin: .45rem 0 .1rem; }
  .call-actions { margin-top: .35rem; }
}
.dot-line { margin: .35rem 0 0; font-size: .85rem; color: var(--muted); min-height: 1.3em; }
.dot-line:not(:empty)::before { content: "● Dot: "; color: var(--coral-dark); font-weight: 700; }
.score { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.combo { color: var(--dab); font-weight: 800; font-size: 1rem; }

/* ---------- player cards ---------- */
.cards { display: grid; gap: 1rem; }
@media (min-width: 760px) { .cards.n2, .cards.n3, .cards.n4 { grid-template-columns: 1fr 1fr; } }
.pcard { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; box-shadow: var(--shadow); border-top: 6px solid var(--coral-dark); max-width: 520px; width: 100%; margin: 0 auto; }
.pcard.p1 { border-top-color: var(--plum); } .pcard.p2 { border-top-color: var(--sage-text); } .pcard.p3 { border-top-color: var(--navy); }
.pcard-h { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.pstatus { margin-left: auto; color: var(--err); font-size: .85rem; font-weight: 700; }
.bingo-btn { width: 100%; margin-top: .7rem; background: var(--ink); color: var(--paper); font-size: 1.15rem; letter-spacing: .06em; min-height: 52px; }
.bingo-btn.ready { background: var(--ok); animation: pulse 1.1s ease-in-out infinite; }

.bcard { display: grid; gap: 4px; grid-template-columns: repeat(5, minmax(0, 1fr)); user-select: none; -webkit-user-select: none; }
.bcard.s3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bcard.frozen { filter: grayscale(.8); opacity: .6; }
.bhdr { text-align: center; font-family: var(--serif); font-weight: 900; font-size: clamp(1.2rem, 5vw, 1.7rem); color: var(--coral-dark); }
.bhdr.col-B { color: var(--coral-dark); } .bhdr.col-I { color: var(--plum); } .bhdr.col-N { color: var(--sage-text); } .bhdr.col-G { color: #9a7311; } .bhdr.col-O { color: var(--navy); }
.sq {
  position: relative; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 3px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-weight: 750; line-height: 1.1;
  font-size: clamp(1rem, 4.8vw, 1.5rem); overflow: hidden; overflow-wrap: anywhere; hyphens: auto; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.bcard.words .sq { font-size: clamp(.62rem, 2.9vw, .95rem); font-weight: 650; }
.bcard.words.s3 .sq { font-size: clamp(.9rem, 4.6vw, 1.3rem); }
.bcard.words .sq.len-m { font-size: clamp(.56rem, 2.5vw, .85rem); }
.bcard.words .sq.len-l { font-size: clamp(.5rem, 2.2vw, .76rem); }
.bcard.words .sq.len-xl { font-size: clamp(.46rem, 1.9vw, .68rem); }
.sq .sq-t { position: relative; z-index: 1; }
.sq.free { background: var(--sand); font-size: clamp(.7rem, 3vw, .95rem); letter-spacing: .05em; }
/* Daub: a solid dabber circle + ✓ badge — never colour alone. */
.sq.daubed:not(.free)::before { content: ""; position: absolute; inset: 9%; border-radius: 50%; background: var(--dab); opacity: .2; }
.sq.daubed:not(.free)::after {
  content: "✓"; position: absolute; top: 3px; right: 3px; width: 1.25rem; height: 1.25rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--dab); color: #fff; font-size: .72rem; font-weight: 900; z-index: 2;
}
.sq.daubed:not(.free) { border-color: var(--dab); }
.sq.hint:not(.daubed) { box-shadow: inset 0 0 0 3px var(--gold); }
.sq.hint:not(.daubed)::after { content: "•"; position: absolute; bottom: 1px; right: 5px; color: #9a7311; font-size: 1.2rem; }
.sq.win { box-shadow: inset 0 0 0 4px var(--ok); }
.sq.was-called:not(.daubed) { background: #fff7e0; }
.shake { animation: shake .4s ease; }

/* ---------- board modal ---------- */
.board { display: grid; gap: 3px; }
.board.numbers.s5 { grid-template-columns: 1.6rem repeat(15, minmax(0, 1fr)); }
.board.numbers.s3 { grid-template-columns: 2rem repeat(10, minmax(0, 1fr)); }
.board.words { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.board .bhdr { font-size: 1rem; align-self: center; }
.bcell { text-align: center; padding: .3rem 0; border-radius: 6px; background: var(--cream); font-size: .7rem; font-weight: 650; color: var(--muted); overflow-wrap: anywhere; }
.board.words .bcell { padding: .4rem; font-size: .8rem; }
.bcell.on { background: var(--ink); color: var(--paper); }
.bcell.on::before { content: "✓"; margin-right: 1px; }
@media (max-width: 520px) { .board.numbers.s5 { grid-template-columns: repeat(8, minmax(0, 1fr)); } .board.numbers.s5 .bhdr { grid-column: 1 / -1; text-align: left; } }

/* ---------- stats ---------- */
.statgrid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: .8rem; }
.stat { background: var(--cream); border: 1px solid var(--line); border-radius: 16px; padding: .9rem; display: grid; }
.stat strong { font-family: var(--serif); font-size: 2rem; }
.stat span { color: var(--muted); font-size: .85rem; }
.list { padding-left: 1.2rem; }
.list li { margin: .25rem 0; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center; padding: 1rem; background: rgba(43, 38, 34, .5); }
.modal.open { display: flex; }
.modal-box { width: min(100%, 560px); max-height: calc(100vh - 2rem); overflow: auto; background: var(--paper); border-radius: var(--radius); padding: clamp(1.1rem, 4vw, 1.8rem); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); outline: none; animation: pop .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.modal-box h2 { font-family: var(--serif); margin: 0 0 .6rem; }
.modal-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.2rem; justify-content: flex-end; }
.result { text-align: center; }
.result .bcard { max-width: 360px; margin: .8rem auto 0; }
.big-win { font-family: var(--serif); font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 700; margin: 0; }
.sleepers { margin-top: 1rem; text-align: left; background: var(--cream); border-radius: 14px; padding: .6rem 1rem; }
.sleepers h3 { margin: .2rem 0; }
.sleepers p { margin: .2rem 0; }
.settings .check { margin-top: .2rem; }

/* ---------- host ---------- */
.host {
  position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); transform: translate(-50%, 150%); z-index: 30;
  display: flex; align-items: center; gap: .7rem; max-width: min(92vw, 520px); background: var(--ink); color: var(--paper);
  padding: .6rem 1.1rem .6rem .6rem; border-radius: 20px; box-shadow: 0 12px 40px rgba(43, 38, 34, .3);
  opacity: 0; pointer-events: none; transition: transform .4s cubic-bezier(.2, 1.2, .4, 1), opacity .3s ease; cursor: pointer;
}
.host.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.host p { margin: 0; font-size: .92rem; }
.host strong { color: var(--coral); margin-right: .2rem; }
.host-avatar { flex: none; width: 2.3rem; height: 2.3rem; display: grid; place-items: center; border-radius: 50%; background: var(--coral); color: var(--ink); font-size: 1.2rem; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

@keyframes pop { from { transform: scale(.85); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes pulse { 50% { transform: scale(1.03); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .pace i { animation: none !important; width: 0; }
}

/* paused: make it obvious the caller is waiting, and how to carry on */
.callbar.paused { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(217, 119, 87, .25), var(--shadow); }
.callbar.paused .dot-line { color: var(--ink); font-weight: 650; font-size: .95rem; }
.btn.resume { animation: resumePulse 1.4s ease-in-out infinite; }
@keyframes resumePulse { 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .btn.resume { animation: none; } }
