/* Bingo card generator. Page chrome follows the site theme; the cards always
   use their own colour theme (--card-*), on screen and on paper. */

:root {
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.06);
  --good: #1f7a4d;
  --warn: #9a5b00;
}
@media (prefers-color-scheme: dark) {
  :root { --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35); --good: #6fd3a0; --warn: #f2b45c; }
}

main { max-width: 1120px; }
.topbar { max-width: 1120px; display: flex; align-items: center; gap: 16px; }
.topnav { display: flex; gap: 16px; margin-left: auto; font-size: 15px; }
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--fg); }
@media (max-width: 560px) { .topnav { display: none; } .badge { margin-left: auto; } }

/* ---------- hero ---------- */
.hero { padding: 24px 0 8px; max-width: 760px; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-weight: 600; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; }
.hero h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.08; margin: 0 0 12px; letter-spacing: -0.02em; }
.lede { font-size: 19px; color: var(--muted); margin: 0 0 16px; }
.ticks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.ticks li { position: relative; padding-left: 22px; font-size: 15px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.35em; width: 12px; height: 7px; border-left: 2.5px solid var(--good); border-bottom: 2.5px solid var(--good); transform: rotate(-45deg); }

.notice { margin: 16px 0 0; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); }
.notice.good { border-color: var(--good); }
.notice.warn { border-color: var(--warn); }

/* ---------- studio ---------- */
.studio { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 28px; margin-top: 24px; align-items: start; }
@media (max-width: 860px) { .studio { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.panel label, .segmented label, .swatch { display: block; color: var(--fg); }
.field > label, .label { font-size: 14px; font-weight: 600; color: var(--fg); }
.hint { font-weight: 400; color: var(--muted); font-size: 13px; margin: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.panel input[type="text"], .panel input[type="number"], .panel select, .panel textarea {
  font: inherit; font-size: 15px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg); color: var(--fg); width: 100%;
}
.panel textarea { font-family: inherit; line-height: 1.45; resize: vertical; }
.panel input[type="file"] { font-size: 14px; }
.panel :focus-visible, .btn:focus-visible, .swatch input:focus-visible + .chip { outline: 2px solid var(--accent); outline-offset: 2px; }
.panel .check { display: flex; align-items: center; gap: 8px; font-size: 15px; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--bg); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.segmented span { display: block; text-align: center; padding: 7px 0; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--muted); }
.segmented input:checked + span { background: var(--panel); color: var(--fg); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.chip { display: block; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); }
.swatch input:checked + .chip { border-color: var(--fg); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); }

.preview-col { position: sticky; top: 16px; display: grid; gap: 14px; }
@media (max-width: 860px) { .preview-col { position: static; } }
.preview-meta { margin: 0; color: var(--muted); font-size: 14px; text-align: center; }
.preview-empty { margin: auto; padding: 24px; text-align: center; color: #555; font-size: 16px; }

/* A sheet of paper at A4 proportions. */
.paper {
  background: #fff; aspect-ratio: 210 / 297; width: min(100%, 560px); justify-self: center;
  border-radius: 6px; box-shadow: var(--shadow), 0 0 0 1px rgb(0 0 0 / 0.06);
  padding: 5%; display: flex; container-type: inline-size; overflow: hidden;
}
.paper .page { width: 100%; }

.cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.btn {
  font: inherit; font-size: 15px; font-weight: 600; padding: 11px 18px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--fg); text-decoration: none; display: inline-block;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:not(:disabled):hover { filter: brightness(0.96); }

.upsell { border: 2px solid var(--accent); border-radius: var(--radius); padding: 18px; background: var(--panel); text-align: center; }
.upsell-title { margin: 0 0 6px; font-weight: 700; font-size: 17px; }
.upsell-text { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.restore { border: 1px solid var(--good); border-radius: var(--radius); padding: 14px 16px; background: var(--panel); font-size: 15px; }
.restore p { margin: 0 0 8px; }
.restore-row { display: flex; gap: 8px; }
.restore-row input { flex: 1; min-width: 0; font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }

/* ---------- cards (shared by preview and print) ---------- */
.page { display: grid; gap: 4cqw; align-content: center; justify-items: center; }
.page[data-per-page="1"] .card { width: 90%; }
.page[data-per-page="2"] .card { width: 55%; }
.page[data-per-page="4"] { grid-template-columns: 1fr 1fr; gap: 6cqw 5cqw; }
.page[data-per-page="4"] .card { width: 100%; }

.card { color: var(--card-ink); background: var(--card-paper); container-type: inline-size; margin-inline: auto; }
.card-title { margin: 0 0 2.5cqw; text-align: center; font-size: 8cqw; line-height: 1.05; letter-spacing: 0.06em; color: var(--card-head); overflow-wrap: anywhere; font-weight: 800; }
.grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); border: 0.6cqw solid var(--card-ink); border-radius: 1.6cqw; overflow: hidden; background: var(--card-paper); }
.cell {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  border: 0.25cqw solid var(--card-ink); padding: 4%; line-height: 1.1; font-weight: 650;
  font-size: calc(var(--f) * 1cqw); overflow-wrap: break-word; word-break: normal; hyphens: auto; overflow: hidden; color: var(--card-ink);
}
.cell.head { aspect-ratio: 2 / 1; background: var(--card-head); color: var(--card-head-ink); font-size: 10cqw; font-weight: 800; }
.cell.free { background: var(--card-free); font-weight: 800; letter-spacing: 0.05em; font-size: calc(100cqw / var(--n) * 0.2); }
.cell.pic { padding: 3%; gap: 2%; }
.cell.pic img { width: 100%; flex: 1; min-height: 0; object-fit: contain; }
.cell.pic .caption { font-size: calc(100cqw / var(--n) * 0.1); font-weight: 600; line-height: 1.1; }
.made-with { margin: 1.6cqw 0 0; text-align: center; font-size: 2.6cqw; color: #666; }

.call-sheet { display: block; color: #111; }
.call-hint { margin: 0 0 12px; text-align: center; color: #555; }
.calls { columns: 4 120px; margin: 0; padding-left: 28px; line-height: 1.7; }

/* ---------- sections ---------- */
.section { margin-top: 72px; }
.section h2 { font-size: clamp(24px, 3.4vw, 32px); margin: 0 0 12px; letter-spacing: -0.01em; }
.section-lede { color: var(--muted); font-size: 17px; max-width: 680px; margin: 0 0 20px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 0; margin: 0; list-style: none; counter-reset: step; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.steps li { counter-increment: step; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; font-size: 15px; color: var(--muted); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); font-weight: 700; margin-bottom: 10px; }
.steps strong { display: block; color: var(--fg); margin-bottom: 4px; font-size: 16px; }

.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); gap: 16px; }
@media (max-width: 640px) { .plans { grid-template-columns: 1fr; } }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.plan.featured { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.plan h3 { margin: 0; font-size: 18px; }
.price { font-size: 34px; font-weight: 800; margin: 6px 0 12px; }
.price span { font-size: 16px; font-weight: 500; color: var(--muted); }
.plan ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }

.set-links { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.set-links a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--fg); text-decoration: none; font-weight: 600; }
.set-links a:hover { border-color: var(--accent); }
.set-links a[aria-current="page"] { border-color: var(--accent); color: var(--accent); }

.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; max-width: 760px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; }
.faq p { color: var(--muted); margin: 8px 0 0; }

footer { max-width: 1120px; margin-top: 64px; padding-bottom: 32px; color: var(--muted); font-size: 14px; }

/* ---------- caller ---------- */
.caller { width: min(1000px, 96vw); max-height: 94vh; border: none; border-radius: 18px; padding: 20px 24px; background: var(--panel); color: var(--fg); box-shadow: var(--shadow); }
.caller::backdrop { background: rgb(0 0 0 / 0.6); }
.caller-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 600; }
.caller-current { min-height: 28vh; display: grid; place-items: center; text-align: center; margin: 8px 0; gap: 8px; }
.caller-word { font-size: clamp(48px, 10vw, 120px); font-weight: 800; line-height: 1.05; color: var(--card-head); letter-spacing: -0.01em; }
.caller-wait { font-size: 24px; color: var(--muted); }
.caller-current img { max-height: 30vh; max-width: 80%; object-fit: contain; border-radius: 10px; }
.caller-caption { font-size: 28px; font-weight: 700; }
.caller-buttons { display: flex; gap: 12px; justify-content: center; }
.caller-buttons .btn { font-size: 18px; padding: 12px 26px; }
.caller-hint { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 14px; }
.caller-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.caller-board.numbers { grid-template-columns: 34px repeat(15, 1fr); }
.tile.row-label { background: var(--card-head); color: var(--card-head-ink); font-weight: 800; border-color: transparent; }
@media (max-width: 700px) { .caller-board.numbers { grid-template-columns: 26px repeat(15, 1fr); } .tile { font-size: 11px; padding: 4px 1px; } }
.tile { padding: 6px 4px; border-radius: 6px; text-align: center; font-size: 13px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); overflow-wrap: anywhere; }
.tile.called { background: var(--card-free); color: var(--card-ink); border-color: transparent; font-weight: 700; }
.tile.latest { background: var(--card-head); color: var(--card-head-ink); }

/* ---------- print ---------- */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .no-print, .caller { display: none !important; }
  .print-only { display: block; }
  .sheet { container-type: inline-size; }
  .sheet .page { break-after: page; break-inside: avoid; min-height: 270mm; align-content: center; }
  .sheet .page:last-child { break-after: auto; }
  .sheet .call-sheet { min-height: 0; }
  .card, .cell, .grid { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
