/* Bingo: a card (the printable, maker.php + scripts/maker.js, and the on-screen card, index.php + scripts/play.js), the
   caller's list and calling cards, and the caller page (caller.php). A card is --n squares across; square edges are
   centered outlines, so neighbors share one line. */
.ec-bg-cards { display: grid; gap: 22px; justify-items: center; }
.ec-bg-card { container-type: inline-size; width: 100%; max-width: 560px; display: grid; gap: 8px; padding: 14px; border: 3px solid #222; border-radius: 12px; background: #fff; color: #111;
	break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ec-bg-head { display: grid; gap: 2px; text-align: center; }
.ec-bg-title { margin: 0; font: 600 16px "Rubik", "Lato", sans-serif; color: #333; overflow-wrap: anywhere; }
.ec-bg-word { margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); font: 800 min(34px, 7cqi)/1.1 "Poppins", "Lato", sans-serif; letter-spacing: 1px; color: #222; }
.ec-bg-card .ec-wsm-namedate { font-size: 14px; }
.ec-bg-grid { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); padding: 1px; }
.ec-bg-sq { aspect-ratio: 1; display: grid; place-items: center; gap: 2px; padding: 4px; outline: 2px solid #222; outline-offset: -1px; text-align: center; overflow: hidden;
	font: 600 calc(100cqi / var(--n) * var(--fs, .2)) / 1.15 "Lato", sans-serif; overflow-wrap: break-word; hyphens: manual; }
.ec-bg-sq.is-mid { font-size: calc(100cqi / var(--n) * .16); }
.ec-bg-sq.is-long { font-size: calc(100cqi / var(--n) * .135); } /* text sized from the card's width (cqi), so it fits on any screen and on paper */
.ec-bg-sq.is-longer { font-size: calc(100cqi / var(--n) * .11); font-weight: 400; }
.ec-bg-sq.is-free { background: #f1f2f5; font: 800 calc(100cqi / var(--n) * .15) "Poppins", sans-serif; letter-spacing: 1px; color: #555; }
/* a square with a picture: a column - the picture takes whatever height its clue leaves (it used to keep 62% and push a
   clue out of the bottom), the clue below it in smaller text */
.ec-bg-sq:has(.ec-bg-pic) { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.ec-bg-pic { flex: 1 1 0; min-height: 0; max-width: 92%; width: auto; object-fit: contain; border-radius: 4px; }
.ec-bg-sq .ec-bg-pic + span { flex: none; max-width: 100%; font-size: calc(100cqi / var(--n) * .1); font-weight: 600; line-height: 1.15; }
.ec-bg-num { margin: 0; text-align: center; font-size: 12px; color: #666; }

/* the printable page: two cards on screen, all of them on paper */
.ec-bgp-start { justify-self: start; }
.ec-bgp-out { display: grid; gap: 22px; }
@media screen { .ec-bgp-out .ec-bg-card:nth-child(n + 3) { display: none; } }
.ec-bgp-note { margin: 0; }
.ec-bgp-list ol { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 28px; font-size: 15px; }
.ec-bgp-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 10px; align-items: start; padding: 6px 0; break-inside: avoid; border-bottom: 1px solid #ddd; }
.ec-bgp-box { width: 16px; height: 16px; margin-top: 2px; border: 1.5px solid #333; border-radius: 3px; }
.ec-bgp-call { display: flex; gap: 8px; align-items: center; }
.ec-bgp-ans { grid-column: 2; font-size: 13px; color: #555; }
.ec-bgp-cpic { max-width: 64px; max-height: 44px; object-fit: contain; border-radius: 3px; }
.ec-bgp-cut { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ec-bgp-cc { display: grid; align-content: center; justify-items: center; gap: 4px; min-height: 1.4in; padding: 10px; border: 1.5px dashed #777; margin: 0 -1.5px -1.5px 0;
	text-align: center; font-size: 16px; break-inside: avoid; }
.ec-bgp-cc-call { display: grid; justify-items: center; gap: 4px; font-weight: 700; }
.ec-bgp-cc-call .ec-bgp-cpic { max-width: 1.4in; max-height: .8in; }
.ec-bgp-cc-ans { font-size: 12px; color: #666; }
@media (max-width: 575px) {
	.ec-bg-card { padding: 10px; }
	.ec-bgp-list ol { columns: 1; }
	.ec-bgp-cut { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
	.ec-bgp-note, .ec-bgp .ec-wsm-head .ec-btn { display: none !important; }
	.ec-bgp-out { display: block; }
	.ec-bg-cards { display: block; }
	.ec-bg-card { max-width: 7in; margin: 0 auto; break-after: page; }
	.ec-bg-cards.is-two .ec-bg-card { max-width: 4.4in; padding: 8px; gap: 4px; break-after: auto; margin-bottom: .25in; }
	.ec-bg-cards.is-two .ec-bg-card:nth-child(2n) { break-after: page; }
	.ec-bg-cards .ec-bg-card:last-child { break-after: auto; }
	.ec-bgp-list, .ec-bgp-callcards { break-before: page; }
}

/* on screen (index.php): how you're playing, the called clue above the card, and squares to tap - a marked square gets
   a colored dot under its text, the winning line turns gold */
.ec-bg-setup { display: grid; gap: 16px; max-width: 640px; padding: 20px; border: 1px solid var(--ec-line); border-radius: 14px; background: var(--ec-surface); box-shadow: var(--ec-shadow); }
.ec-bg-setup[hidden], .ec-bg-play[hidden], .ec-bg-play [hidden] { display: none !important; }
.ec-bg-setup fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ec-bg-setup legend { font: 600 18px "Rubik", "Lato", sans-serif; margin-bottom: 8px; }
.ec-bg-opts { display: grid; gap: 10px; }
.ec-bg-opt { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 12px 16px; border: 2px solid var(--ec-line); border-radius: 12px; cursor: pointer; }
.ec-bg-opt:has(input:checked) { border-color: var(--t-ink); background: var(--t-bg); }
.ec-bg-opt input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--t-ink); flex: none; }
.ec-bg-opt span { display: grid; gap: 2px; }
.ec-bg-opt b { font-size: 17px; }
.ec-bg-opt small { font-size: 14px; color: var(--ec-ink-2); }
.ec-bg-start { justify-self: start; min-height: 48px; font-size: 18px; }
.ec-bg-play { display: grid; gap: 14px; justify-items: center; }
.ec-bg-call { position: sticky; top: 0; z-index: 2; width: 100%; max-width: 560px; display: grid; justify-items: center; gap: 6px; padding: 12px 16px; border-radius: 14px;
	background: var(--t-bg); border: 1px solid #b9c7dc; text-align: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }
.ec-bg-call-label { margin: 0; font: 700 13px "Lato", sans-serif; letter-spacing: .5px; text-transform: uppercase; color: var(--t-ink); }
.ec-bg-call-text { display: grid; justify-items: center; gap: 6px; font: 600 22px/1.3 "Rubik", "Lato", sans-serif; color: var(--ec-ink); overflow-wrap: anywhere; }
.ec-bg-call-pic { max-height: 110px; max-width: 200px; object-fit: contain; border-radius: 8px; }
.ec-bg-call-note { margin: 0; min-height: 1.4em; font-weight: 700; }
.ec-bg-call-note.is-right { color: var(--ec-green-ink); }
.ec-bg-call-note.is-wrong { color: #a52723; }
.ec-bg-class-note { margin: 0; color: var(--ec-ink-2); text-align: center; }
#bgCard { width: 100%; max-width: 560px; } /* the card sizes its text from its width, so its box must have one */
.ec-bg-live { max-width: 560px; }
.ec-bg-live .ec-bg-sq { scroll-margin-top: 190px; /* clear of the clue pinned above the card */ position: relative; border: 0; background: #fff; color: #111; cursor: pointer; }
@media (hover: hover) { .ec-bg-live button.ec-bg-sq:hover { background: #f2f5fa; } }
.ec-bg-live .ec-bg-sq:focus-visible { outline: 3px solid var(--ec-focus); outline-offset: -3px; z-index: 1; }
.ec-bg-live .ec-bg-sq > * { position: relative; z-index: 1; }
.ec-bg-live .ec-bg-sq.is-marked::before { content: ""; position: absolute; inset: 14%; border-radius: 50%; background: var(--t-ink); opacity: .22; }
.ec-bg-live .ec-bg-sq.is-marked { font-weight: 800; }
.ec-bg-live .ec-bg-sq.is-free.is-marked::before { opacity: .12; }
.ec-bg-live .ec-bg-sq.is-win { background: #ffe58a; }
.ec-bg-live .ec-bg-sq.is-nope { animation: ec-bg-shake .3s; background: #fbeaea; }
@keyframes ec-bg-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .ec-bg-live .ec-bg-sq.is-nope { animation: none; } }
.ec-bg-under { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ec-ag-done { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 18px; padding: 16px; border-radius: 14px; background: var(--ec-green-soft); border: 1px solid #9fd3a3; width: 100%; max-width: 560px; }
.ec-ag-done p { margin: 0; font: 600 20px "Rubik", "Lato", sans-serif; color: var(--ec-green-ink); text-align: center; }
.ec-ag-done .fa-star { color: #d99a00; }
@media (max-width: 575px) {
	.ec-bg-setup { padding: 14px; }
	.ec-bg-call-text { font-size: 19px; }
	.ec-bg-call-pic { max-height: 80px; }
}

/* the caller (caller.php): the call big enough to read from the back of the room, then the tools and what's been called;
   in full screen it fills the screen */
.ec-bgc-stage { display: grid; gap: 16px; }
.ec-bgc-stage[hidden] { display: none; }
.ec-bgc-now { display: grid; justify-items: center; align-content: center; gap: 10px; min-height: 280px; padding: 24px; border-radius: 18px; background: var(--t-bg);
	border: 2px solid #b9c7dc; text-align: center; }
.ec-bgc-count { margin: 0; font: 700 16px "Lato", sans-serif; letter-spacing: .6px; text-transform: uppercase; color: var(--t-ink); }
.ec-bgc-text { display: grid; justify-items: center; gap: 12px; font: 600 clamp(28px, 4.5vw, 56px)/1.2 "Rubik", "Lato", sans-serif; color: var(--ec-ink); overflow-wrap: anywhere; max-width: 22ch; }
.ec-bgc-ready { font-size: .6em; color: var(--ec-ink-2); }
.ec-bgc-pic { max-height: 32vh; max-width: 60vw; object-fit: contain; border-radius: 10px; }
.ec-bgc-answer { margin: 0; font-size: 20px; color: var(--ec-ink-2); }
.ec-bgc-tools { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.ec-bgc-next { min-height: 52px; min-width: 140px; font-size: 20px; }
.ec-bgc-called h2 { font: 600 18px "Rubik", "Lato", sans-serif; margin: 0 0 8px; }
/* the called list across the whole width, as many columns as fit, newest first */
.ec-bgc-called ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; font-size: 16px; }
.ec-bgc-called li { display: flex; align-items: flex-start; gap: 8px; padding: 6px 10px; border: 1px solid var(--ec-line); border-radius: 8px; background: var(--ec-surface); min-width: 0; overflow-wrap: anywhere; }
.ec-bgc-called li > b { flex: none; min-width: 1.6em; color: var(--t-ink); }
.ec-bgc-called li:first-child { border-color: var(--t-ink); background: var(--t-bg); } /* the one just called */
.ec-bgc-called li small { color: var(--ec-ink-2); }
.ec-bgc-mini { max-height: 36px; max-width: 60px; object-fit: contain; vertical-align: middle; border-radius: 4px; margin-right: 6px; }
.ec-bgc:fullscreen { overflow: auto; padding: 24px 32px; background: var(--ec-bg, #fff); }
.ec-bgc:fullscreen .ec-bgc-now { min-height: 55vh; }
.ec-bgc:fullscreen .ec-play-foot { display: none; }
