@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Kalam:wght@300;400;700&display=swap');

:root {
  color-scheme: dark;
  --board: #102b25;
  --board-deep: #0b221d;
  --panel: #17362e;
  --chalk: #f4f0db;
  --muted: #bac9b7;
  --yellow: #f1d77b;
  --peach: #e8a18d;
  --line: rgba(241, 239, 215, .45);
  --hand: 'Kalam', 'Segoe Print', 'Comic Sans MS', cursive;
  --sans: 'DM Sans', 'Trebuchet MS', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #142b24; color: var(--chalk); font-family: var(--sans); }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
.svg-defs { width: 0; height: 0; position: absolute; overflow: hidden; }
.chalk-svg { fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; filter: url(#chalk-roughen); }

.chalkboard {
  min-height: calc(100vh - 20px);
  margin: 10px;
  border: 10px solid #533622;
  border-image: linear-gradient(135deg, #7b5538, #382519 24%, #6b492f 52%, #322216 78%, #80593b) 1;
  box-shadow: 0 0 0 3px #1c1914, inset 0 0 0 3px rgba(225, 207, 152, .09), inset 0 0 100px rgba(2, 15, 12, .8);
  background:
    radial-gradient(ellipse at 16% 12%, rgba(66, 100, 78, .24), transparent 30%),
    radial-gradient(ellipse at 90% 30%, rgba(62, 111, 79, .13), transparent 35%),
    radial-gradient(ellipse at 52% 85%, rgba(60, 102, 71, .08), transparent 40%),
    repeating-linear-gradient(24deg, rgba(255,255,255,.012) 0 1px, transparent 1px 4px),
    var(--board);
}
.board-inner { width: min(100% - 64px, 1280px); margin: auto; }
.site-header { height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px dashed rgba(240,238,213,.22); }
.wordmark { display: inline-flex; gap: 12px; align-items: center; color: var(--chalk); text-decoration: none; font: 700 37px/1 var(--hand); letter-spacing: -2px; transform: rotate(-2deg); text-shadow: 1px 2px 0 rgba(255,255,255,.12); }
.wordmark-mark { width: 48px; height: 48px; display: grid; place-items: center; transform: rotate(-11deg); }
.wordmark svg { width: 45px; height: 45px; stroke-width: 2.6; }
.bang { color: var(--yellow); }
.refresh-button { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 0 19px; border: 1.5px solid var(--chalk); border-radius: 99px; color: var(--board-deep); background: var(--chalk); font: 800 13px/1 var(--sans); letter-spacing: .05em; text-transform: uppercase; cursor: pointer; box-shadow: 3px 4px 0 rgba(245, 241, 221, .2); transition: transform .2s, box-shadow .2s, background .2s; }
.refresh-button:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 4px 7px 0 rgba(245, 241, 221, .15); background: #fffbed; }
.refresh-button:active { transform: translateY(1px); box-shadow: none; }
.refresh-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.hero { display: flex; align-items: center; padding: 31px 8px 30px; }
.hero-copy { max-width: 690px; }
.section-kicker, .board-overline, .score-kicker { font-weight: 800; font-size: 11px; letter-spacing: .23em; color: var(--yellow); }
.hero h1 { margin: 0; font: 700 clamp(53px, 6.6vw, 92px)/.94 var(--hand); letter-spacing: -3px; transform: rotate(-1.1deg); text-shadow: 1px 1px 0 rgba(255,255,255,.12), -1px 1px 0 rgba(255,255,255,.1); }
.hero h1 em { color: var(--yellow); font-style: normal; white-space: nowrap; }

.game { padding-bottom: 36px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; border-top: 1px dashed rgba(240,238,213,.22); padding: 28px 4px 17px; }
.section-heading h2 { font: 700 clamp(25px, 3vw, 35px)/1.25 var(--hand); margin: 7px 0 0; transform: rotate(-1deg); }
.section-heading p { color: var(--muted); font-size: 13px; margin: 0 0 5px; }
.category-tabs { display: flex; gap: 9px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(245,241,221,.3) transparent; padding: 5px 3px 17px; }
.category-button { white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; padding: 10px 16px; border: 1px solid rgba(244,240,219,.42); border-radius: 50px; background: transparent; color: var(--chalk); font-size: 12px; font-weight: 700; cursor: pointer; transition: background .2s, color .2s, transform .2s, border-color .2s; }
.category-button:hover { border-color: var(--yellow); transform: translateY(-2px); }
.category-button[aria-pressed="true"] { color: var(--board-deep); background: var(--yellow); border-color: var(--yellow); box-shadow: 2px 3px 0 rgba(241, 215, 123, .25); }
.category-button .emoji { font-size: 15px; line-height: 1; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 294px; gap: 22px; align-items: start; }
.bingo-panel { border: 1.5px solid rgba(243,238,212,.44); border-radius: 7px; padding: 22px 23px 17px; background: rgba(12, 40, 32, .43); box-shadow: inset 0 0 55px rgba(3, 17, 12, .16), 5px 7px 0 rgba(1,16,12,.14); }
.board-topline { display: flex; align-items: end; justify-content: space-between; gap: 15px; padding-bottom: 13px; }
.board-overline { color: var(--peach); font-size: 10px; }
.board-topline h2 { font: 700 clamp(25px, 3vw, 34px)/1 var(--hand); margin: 5px 0 0; }
.chalk-dot { color: var(--peach); }
.card-number { color: #b7c8b7; font-size: 10px; font-weight: 700; letter-spacing: .14em; white-space: nowrap; padding-bottom: 5px; }
.card-number span { color: var(--chalk); }
.board-shell { border: 2px solid rgba(249,244,222,.76); border-radius: 3px; padding: 8px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15), 0 0 4px rgba(255,255,255,.08); transform: rotate(-.13deg); }
.letter-row { display: grid; grid-template-columns: repeat(5, 1fr); height: 52px; align-items: center; border-bottom: 2px solid rgba(249,244,222,.76); }
.letter-row span { text-align: center; font: 700 40px/.9 var(--hand); text-shadow: 1px 2px 0 rgba(255,255,255,.15); }
.letter-row span:nth-child(odd) { transform: rotate(-7deg); }.letter-row span:nth-child(even) { transform: rotate(6deg); }
.letter-row span:nth-child(3) { color: var(--yellow); }
.bingo-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bingo-cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; aspect-ratio: 1; min-height: 93px; padding: 9px 5px 8px; color: var(--chalk); background: transparent; border: 0; border-right: 1px solid rgba(249,244,222,.55); border-bottom: 1px solid rgba(249,244,222,.55); cursor: pointer; text-align: center; overflow: hidden; transition: background .16s; }
.bingo-cell:nth-child(5n) { border-right: 0; }.bingo-cell:nth-last-child(-n+5) { border-bottom: 0; }
.bingo-cell:hover { background: rgba(246,241,218,.08); }
.bingo-cell.is-marked { background: rgba(241,215,123,.055); }
.bingo-cell.is-winning { background: rgba(241,215,123,.105); }
.cell-icon { display: block; width: 25px; height: 25px; color: var(--yellow); opacity: .86; flex: none; }
.cell-icon svg { width: 100%; height: 100%; stroke-width: 2.2; }
.cell-label { position: relative; z-index: 1; font: 400 clamp(12px, 1.35vw, 15px)/1.2 var(--hand); text-wrap: balance; max-width: 116px; }
.bingo-cell.is-marked .cell-label { opacity: .67; }
.chalk-x { position: absolute; inset: 13% 14%; width: 72%; height: 74%; pointer-events: none; opacity: 0; transform: rotate(-10deg) scale(.72); transition: opacity .18s, transform .22s cubic-bezier(.2,1.8,.5,1); }
.chalk-x path { fill: none; stroke: var(--peach); stroke-linecap: round; stroke-width: 5.7; filter: url(#chalk-roughen); }
.chalk-x path:nth-child(2) { stroke-width: 3; opacity: .5; }
.bingo-cell.is-marked .chalk-x { opacity: .95; transform: rotate(-10deg) scale(1); }
.bingo-cell.is-free { cursor: default; background: rgba(241, 215, 123, .11); }
.bingo-cell.is-free:hover { background: rgba(241, 215, 123, .11); }
.bingo-cell.is-free .cell-icon { width: 34px; height: 34px; color: var(--yellow); }
.bingo-cell.is-free .cell-label { color: var(--yellow); font-weight: 700; font-size: clamp(14px, 1.5vw, 17px); }
.board-hint { display: flex; align-items: center; gap: 6px; margin: 15px 3px 0; color: #aec2b0; font: 400 14px/1.3 var(--hand); }
.board-hint svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.score-panel { position: relative; border: 1.5px dashed rgba(244,240,219,.52); border-radius: 7px; background: rgba(34, 73, 53, .32); padding: 26px 24px 23px; min-height: 470px; }
.score-icon { position: absolute; right: 23px; top: 19px; color: var(--yellow); transform: rotate(14deg); }.score-icon svg { width: 37px; height: 37px; }
.score-kicker { font-size: 10px; }
.score-panel h2 { font: 700 30px/1.03 var(--hand); margin: 18px 0 23px; transform: rotate(-2deg); }
.score-count { display: flex; align-items: center; gap: 8px; }
.score-count strong { font: 700 77px/.85 var(--hand); letter-spacing: -6px; color: var(--yellow); }
.score-count span { font-size: 13px; line-height: 1.3; color: #c2d0be; }
.progress-track { height: 9px; border: 1px solid rgba(242,239,216,.55); border-radius: 99px; overflow: hidden; margin: 21px 0 21px; padding: 2px; }
.progress-track span { display: block; width: 0%; height: 100%; background: var(--yellow); border-radius: inherit; transition: width .3s ease; }
.score-divider { border-top: 1px dashed rgba(244,240,219,.31); margin-bottom: 19px; }
.lines-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; color: #d0dccd; }
.lines-row strong { color: var(--yellow); font: 700 19px var(--hand); white-space: nowrap; }
.verdict { margin-top: 20px; font: 700 25px/1.13 var(--hand); color: var(--chalk); min-height: 60px; }
.verdict span { display: block; color: #b5c6b5; margin-top: 6px; font: 400 12px/1.4 var(--sans); }
.film-callout { margin-top: 18px; padding: 12px 10px 10px; border: 1.5px solid var(--yellow); border-radius: 3px; color: var(--yellow); text-align: center; transform: rotate(-2deg); background: rgba(241,215,123,.08); }
.film-callout[hidden] { display: none; }
.film-callout span { display: block; font: 700 29px/.9 var(--hand); }
.film-callout small { display: block; margin-top: 6px; font-size: 10px; letter-spacing: .02em; }
.clear-button { width: 100%; display: flex; justify-content: space-between; align-items: center; margin-top: 24px; padding: 10px 0 0; border: 0; border-top: 1px dashed rgba(244,240,219,.31); background: none; color: #c6d4c5; text-align: left; font-size: 11px; font-weight: 700; cursor: pointer; }
.clear-button:hover { color: var(--yellow); }
.clear-button span { font-size: 18px; line-height: 1; }

@media (max-width: 980px) {
  .game-layout { grid-template-columns: minmax(0, 1fr) 252px; gap: 14px; }
  .bingo-panel { padding: 17px 15px 14px; }.score-panel { padding: 23px 18px; }
  .bingo-cell { min-height: 78px; }.cell-icon { width: 21px; height: 21px; }
}
@media (max-width: 740px) {
  .board-inner { width: min(100% - 30px, 600px); }
  .site-header { height: 84px; }.wordmark { font-size: 30px; }.wordmark-mark, .wordmark svg { width: 36px; height: 36px; }
  .refresh-button { padding: 0 13px; min-height: 43px; font-size: 11px; gap: 7px; }
  .hero { padding: 30px 0 27px; }.hero h1 { font-size: clamp(54px, 11vw, 80px); }
  .section-heading { align-items: start; }.section-heading p { display: none; }
  .game-layout { grid-template-columns: 1fr; }.score-panel { min-height: 0; }
  .score-panel h2 { margin-bottom: 12px; }.score-count strong { font-size: 65px; }.verdict { min-height: 0; }
}
@media (max-width: 500px) {
  .chalkboard { margin: 5px; border-width: 6px; }.board-inner { width: calc(100% - 24px); }
  .site-header { height: 76px; }.wordmark { gap: 4px; font-size: 26px; }.wordmark-mark, .wordmark svg { width: 31px; height: 31px; }
  .refresh-button span { display: none; }.refresh-button { width: 44px; justify-content: center; padding: 0; }.refresh-button svg { width: 21px; height: 21px; }
  .hero { padding: 25px 1px 24px; }.hero h1 { font-size: clamp(50px, 13vw, 67px); }
  .section-heading { padding-top: 22px; }.section-heading h2 { font-size: 26px; }
  .category-button { padding: 9px 13px; font-size: 11px; }
  .bingo-panel { padding: 14px 9px 11px; }.board-topline { padding: 0 4px 12px; }.board-topline h2 { font-size: 23px; }.card-number { font-size: 8px; }
  .board-shell { padding: 4px; }.letter-row { height: 43px; }.letter-row span { font-size: 33px; }
  .bingo-cell { min-height: 0; gap: 2px; padding: 4px 2px; }.cell-icon { width: 18px; height: 18px; }.cell-label { font-size: clamp(9px, 2.7vw, 12px); line-height: 1.12; }.bingo-cell.is-free .cell-icon { width: 22px; height: 22px; }.bingo-cell.is-free .cell-label { font-size: 11px; }
  .chalk-x path { stroke-width: 4; }.board-hint { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }

