/* Game-specific shared header palette. */

:root {
  --game-header-bg: linear-gradient(110deg,#53301b,#84502a 62%,#61391f);
  --game-header-border: #f3c85a;
  --game-header-shadow: #3f231840;
  --game-header-title: #fff;
  --game-header-button-bg: #fff5df;
  --game-header-button-border: #d1aa77;
  --game-header-button-color: #653a20;
  --game-header-button-hover-bg: #f8e2bf;
  --game-header-button-hover-border: #bd925c;
  --game-header-button-hover-color: #50301c;
  --game-header-button-active-bg: #e9c58e;
  --game-header-button-active-border: #bd925c;
  --game-header-button-active-color: #50301c;
  --game-header-focus: #ffe189;
  --game-header-logo-bg: #fff;
  --game-header-logo-border: #d1aa77;
  --game-header-brand-hover-shadow: #f3c85a44;
  --wood-surface: linear-gradient(180deg,#ffffff24,transparent 18%,#0000000d),
    repeating-linear-gradient(90deg,#c99a64 0 54px,#b78650 54px 108px,
      #c79a68 108px 162px,#b4824d 162px 216px,#c49360 216px 270px);
  --paper-surface: linear-gradient(180deg,#ffffff,#fcfcfc 55%, #f1f1f1);
  --ink: #432c20;
  --muted: #765941;
  --border: #d5bb98;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #b78650;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font: 16px/1.5 'Plus Jakarta Sans',system-ui,sans-serif;
  background: var(--wood-surface);
}

[hidden] {
  display: none !important;
}

button,input,select {
  font: inherit;
}

button,select {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

button:focus-visible,select:focus-visible,.unit-choice:focus-within {
  outline: 3px solid #98602e;
  outline-offset: 3px;
}

.page {
  width: min(1440px,100%);
  margin: auto;
  padding: 6px clamp(12px,2.2vw,32px);
}

.setup-screen {
  max-width: 1120px;
  margin: auto;
  background: linear-gradient(180deg,#f5d7a2,#d9a96f);
  border: 2px solid #78491f;
  border-radius: 18px;
  padding: 10px clamp(12px,2vw,24px);
  box-shadow: inset 0 0 0 3px #fff5d080, 0 4px 0 #78491f, 0 10px 24px #40200740;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-weight: 700;
  font-size: 14px;
}

.field select {
  width: 100%;
  border: 1px solid #b9915f;
  border-radius: 10px;
  background: #fff;
  padding: 11px 12px;
  color: var(--ink);
  font-weight: 600;
  min-height: 48px;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 16px 0;
  min-width: 0;
}

legend {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.units {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 0;
  padding: 7px;
  border: 1px solid #754521;
  border-radius: 12px;
  background: #d7a05a;
  box-shadow: inset 0 1px 0 #fff9,0 3px 6px #59371930;
}

.unit-choice {
  cursor: pointer;
  display: flex;
  position: relative;
  min-width: 0;
}

.unit-choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.unit-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 3px;
  min-height: clamp(60px,9vh,90px);
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #64422a;
  background: var(--paper-surface);
  overflow-wrap: anywhere;
}

.unit-label span {
  font-size: 13px;
  color: var(--muted);
}

.unit-label strong {
  font: 600 clamp(18px,2vw,26px)/1.15 Fredoka,Arial,sans-serif;
}

.unit-choice:hover .unit-label { background: #fff2d6; }
.unit-choice input:checked+.unit-label {
  background: linear-gradient(180deg,#ffe49b,#fdce03);
  color: #513814;
  box-shadow: inset 0 0 0 2px #8a5d13;
}

.setup-bottom-bar {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  align-items: end;
  gap: 12px;
}

.primary,.secondary {
  border: 1px solid transparent;
  border-radius: 10px;
  min-height: 44px;
  padding: 10px 17px;
  font-weight: 750;
  line-height: 1.2;
  transition: background .15s,transform .15s;
}

.primary {
  background: #895324;
  color: #fff;
  border-color: #895324;
  box-shadow: 0 3px 0 #593719;
}

.primary:hover:not(:disabled) {
  background: #6e421f;
  transform: translateY(-1px);
}

.secondary {
  background: #fff;
  color: #653b20;
  border-color: #d4b18a;
}

.secondary:hover:not(:disabled) {
  background: #f9e8cc;
}

.primary:disabled,.secondary:disabled {
  opacity: .5;
  box-shadow: none;
}

#startGame {
  grid-column: 1/-1;
  min-height: 53px;
  font-size: 19px;
  margin-top: 5px;
}

.notice {
  color: #a0292b;
  background: #fff1ef;
  border: 1px solid #f5c4bd;
  border-radius: 10px;
  padding: 12px;
  font-weight: 650;
  margin: 18px 0 0;
}

/* Game screen and caller */

body:has(.play-screen:not([hidden])) {
  display: flex;
  flex-direction: column;
}

.page:has(.play-screen:not([hidden])) {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  width: 100%;
  margin: 0 auto;
  padding: 4px 10px;
}

.play-screen:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "caller" "boards";
  align-items: stretch;
  gap: 18px;
  flex: 1 0 auto;
  min-width: 0;
}

.caller {
  grid-area: caller;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 6px 12px;
  align-items: center;
  min-width: 0;
  min-height: 78px;
  padding: 10px 18px;
  border-radius: 18px;
  border: 1px solid rgba(111,76,42,.24);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,245,239,.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 4px 12px rgba(61,33,8,.08);
}

.caller-count {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Floating controls: neither button nor timer can change the caller row size. */
.caller-word {
  --reveal-width: 146px;
  --timer-width: 68px;
  --control-gap: 12px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  align-items: center;
  grid-column: 1/-1;
  grid-row: 1;
  block-size: 64px;
  padding-right: calc(var(--reveal-width) + var(--timer-width) + 2 * var(--control-gap));
  text-align: center;
  min-width: 0;
}

.caller-word strong {
  display: block;
  min-width: 0;
  max-height: 100%;
  font: 600 clamp(26px,2.9vw,40px)/1.08 Fredoka,system-ui,sans-serif;
  color: #754521;
  overflow-wrap: anywhere;
}

#revealWord {
  position: absolute;
  top: 50%;
  right: calc(var(--timer-width) + var(--control-gap));
  transform: translateY(-50%);
  width: var(--reveal-width);
  min-height: 36px;
  padding: 7px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.round-timer {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: var(--timer-width);
  padding: 7px 8px;
  border: 1px solid #d6b58d;
  border-radius: 9px;
  background: #fff0d6;
  color: #754521;
  font-size: 16px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.round-timer.is-urgent {
  background: #ffe8e6;
  border-color: #e5a5a1;
  color: #a3242b;
}

.games-is-fullscreen .caller {
  padding-right: max(64px,calc(env(safe-area-inset-right, 0px) + 52px));
}

.caller-word.is-shuffling strong {
  font-family: Arial, "Segoe UI", sans-serif;
  animation: bingo-shuffle .11s linear infinite;
}

@keyframes bingo-shuffle {
  0% {
    transform: translateY(5px);
    opacity: .4;
  }
  50% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-5px);
    opacity: .4;
  }
}

/* Team status and cards share the palette of the assigned piece. */

.boards {
  grid-area: boards;
  --card-gap: 90px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: center;
  gap: var(--card-gap);
  width: 100%;
  min-height: 0;
  padding: 24px 8px 6px;
}

.team-panel {
  flex: 0 0 min(840px,calc((100% - var(--card-gap)) / 2));
  min-width: 0;
}

.boards[data-players='1'] .team-panel {
  flex-basis: min(860px,100%);
}

/* Three or four players: cards, full-width scoreboard, cards. */
.boards:is([data-players='3'],[data-players='4']) {
  row-gap: 16px;
  padding-block: 4px;
}

.boards > .team-stats {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: repeat(var(--stats-columns,3),minmax(0,1fr));
  gap: 12px;
}

.boards[data-players='4'] {
  --stats-columns: 4;
}

:is(.team-panel,.team-heading,.result-panel)[data-piece='a'] {
  --team: #fdce03;
  --team-dark: #755600;
  --team-light: #fff6cc;
}

:is(.team-panel,.team-heading,.result-panel)[data-piece='b'] {
  --team: #08dd81;
  --team-dark: #135f3c;
  --team-light: #e4fff0;
}

:is(.team-panel,.team-heading,.result-panel)[data-piece='c'] {
  --team: #fc5957;
  --team-dark: #942c2c;
  --team-light: #fff0f0;
}

:is(.team-panel,.team-heading,.result-panel)[data-piece='d'] {
  --team: #00c1fb;
  --team-dark: #075777;
  --team-light: #e5f8ff;
}

.team-stats {
  min-width: 0;
}

.caller > .team-stats {
  grid-column: 1/-1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* One or two teams flank the called word without overlapping it. */
@media (min-width:1001px) {
  .caller:has(.team-stats > .team-heading:last-child:nth-child(-n+2)) {
    grid-template-columns: minmax(0,1fr) minmax(0,2fr) minmax(0,1fr);
  }
  .caller:has(.team-stats > .team-heading:last-child:nth-child(-n+2)) .caller-word {
    grid-column: 2;
  }
  .caller > .team-stats:has(> .team-heading:last-child:nth-child(-n+2)) {
    display: contents;
  }
  .caller > .team-stats:has(> .team-heading:last-child:nth-child(-n+2)) > .team-heading {
    grid-row: 1;
    grid-column: 1;
    justify-self: start;
    width: min(100%,265px);
  }
  .caller > .team-stats:has(> .team-heading:last-child:nth-child(2)) > .team-heading:nth-child(2) {
    grid-column: 3;
    justify-self: end;
  }
}

.team-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  min-width: 0;
  flex: 0 1 265px;
  border: 1px solid color-mix(in srgb, var(--team-dark) 65%, #ffffff 35%);
  border-radius: 15px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--team-light) 90%, #ffffff 10%), color-mix(in srgb, var(--team-light) 97%, #f7f4ed 3%));
  color: var(--team-dark);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 2px 8px rgba(0,0,0,.05);
}

.team-piece {
  display: block;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  object-fit: contain;
}

.team-details {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

.team-heading h2 {
  margin: 0;
  font: 600 18px/1 Fredoka,system-ui,sans-serif;
  white-space: nowrap;
}

.team-progress {
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  text-align: left;
}

.team-score {
  flex: 0 0 auto;
  margin-left: auto;
  font: 600 25px/1 Fredoka,system-ui,sans-serif;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* The physical card contains only its frame and tiles. */

.team-card {
  position: relative;
  min-width: 0;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--team-dark) 78%, #ffffff 22%);
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--team) 88%, #ffffff 12%), var(--team));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -1px 0 rgba(0,0,0,.16),
    0 8px 20px rgba(0,0,0,.10),
    0 2px 0 rgba(0,0,0,.10);
}

.team-card::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,.45);
  pointer-events: none;
}

.bingo-grid {
  /* Equal rectangular tiles: height is 70% of their width. */
  box-sizing: content-box;
  aspect-ratio: 7 / 2.1;
  display: grid;
  grid-template-columns: repeat(7,minmax(0,1fr));
  grid-template-rows: repeat(3,minmax(0,1fr));
  gap: 0;
  border-top: 2px solid #3b3b3b;
  border-left: 2px solid #3b3b3b;
  outline: 1px solid rgba(255,255,255,.9);
  background: #fdfdfd;
}

/* One dark 2px line per shared edge, without doubled borders or gutters. */

.bingo-cell,.bingo-blank {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  border: 0;
  border-right: 2px solid #343434;
  border-bottom: 2px solid #343434;
  border-radius: 0;
  overflow: hidden;
}

.bingo-blank {
  background: var(--team);
}

.bingo-cell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  place-items: center;
  appearance: none;
  padding: 4px;
  background: var(--paper-surface);
  color: #202d36;
  text-align: center;
  font-weight: 600;
  line-height: 1.15;
}

.cell-label {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: 24px;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  line-height: 1.15;
}

.cell-label.allow-word-break {
  overflow-wrap: anywhere;
}

.bingo-cell:hover:not(:disabled) {
  background: var(--team-light);
}

.bingo-cell.winning {
  background: var(--team-light);
}

.bingo-cell.marked .cell-label {
  opacity: .12;
}

.bingo-cell.wrong {
  background: #ffe0df;
  color: #a0292b;
  animation: shake .25s ease-in-out;
}

@keyframes shake {
  25%,75% {
    transform: translateX(3px);
  }
  50% {
    transform: translateX(-3px);
  }
}

/* Circular marker: one centering rule, one size, and a raised rim. */

.cell-token {
  position: absolute;
  top: 50%;
  left: 50%;
  height: min(78%,72px);
  width: auto;
  max-width: 78%;
  aspect-ratio: 1;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  z-index: 2;
  isolation: isolate;
  pointer-events: none;
  background: #111;
  box-shadow: 0 2px 0 #0007,0 3px 4px #0005;
}

.cell-token-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.cell-token::before,.cell-token::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.cell-token::before {
  inset: 0;
  box-shadow: inset 0 2px 1px #fffb,inset 0 -2px 1px #0008;
}

.cell-token::after {
  inset: 7%;
  border: 2px solid #ffffff65;
  border-top-color: #0006;
  border-left-color: #0003;
  border-bottom-color: #ffffffa0;
  box-shadow: 0 -1px 1px #fff4,0 1px 1px #0005,inset 0 1px 1px #0003;
}

/* Per-card point feedback, never a blocking page-wide modal. */
.points-popup {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  min-width: min(150px,90%);
  max-width: 95%;
  padding: clamp(12px,2vw,18px) clamp(20px,3vw,34px);
  border: 2px solid var(--team-dark);
  border-radius: 18px;
  background: color-mix(in srgb, var(--team) 16%, #fff 84%);
  box-shadow: inset 0 1px 0 #fffc, 0 5px 24px #0005;
  font: 700 clamp(42px,6.5vw,76px)/1 Fredoka,system-ui,sans-serif;
  font-variant-numeric: tabular-nums;
  text-align: center;
  pointer-events: none;
  animation: points-popup var(--points-duration,2300ms) linear both;
}
.points-title {
  display: block;
  margin-bottom: 6px;
  font: 700 clamp(16px,2.5vw,26px)/1.2 'Plus Jakarta Sans',Arial,sans-serif;
  overflow-wrap: anywhere;
}
.points-value { display: block; }
.points-popup.positive { color: #08763e; }
.points-popup.negative { color: #b52631; }
@keyframes points-popup {
  0% { opacity: 0; transform: translate(-50%,-42%) scale(.9); animation-timing-function: ease-out; }
  7% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  65.2% { opacity: 1; transform: translate(-50%,-50%) scale(1); animation-timing-function: ease-in-out; }
  100% { opacity: 0; transform: translate(-50%,-60%) scale(1); }
}

/* Dialogs */

.bingo-dialog {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 25px;
  width: min(440px,calc(100% - 30px));
  color: var(--ink);
  box-shadow: 0 12px 60px #123b4b44;
}

.bingo-dialog::backdrop {
  background: #142d3a99;
  backdrop-filter: blur(3px);
}

.bingo-dialog h2 {
  margin: 0 0 10px;
  font: 600 27px/1.2 Fredoka,system-ui,sans-serif;
}

.bingo-dialog > p {
  margin: 0 0 22px;
  color: var(--muted);
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

/* Information dialog: local ownership; the shared header only opens it. */
.bingo-info-dialog {
  width: min(780px,calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: clamp(14px,2.3vw,24px);
  border: 2px solid #895324;
  background: #fff8e9;
  box-shadow: 0 18px 60px #40200766;
  overflow: auto;
}
.bingo-info-dialog[open] {
  display: flex;
  flex-direction: column;
}
.bingo-info-dialog::backdrop { background: #38231399; }
.info-content {
  display: grid;
  grid-template-columns: minmax(0,1.1fr) minmax(0,1fr);
  gap: 14px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 2px;
  font-size: 13px;
  line-height: 1.45;
}
.info-content > div {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}
.info-content section {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fffdf7;
}
.info-content h3 {
  margin: 0 0 7px;
  color: #754521;
  font: 600 19px/1.2 Fredoka,system-ui,sans-serif;
}
.info-content ol,.info-content ul { margin: 0; padding-inline-start: 19px; }
.info-content li + li { margin-top: 5px; }
.info-content p { margin: 0; color: var(--ink); }
.info-points { width: 100%; border-collapse: collapse; font-size: inherit; }
.info-points th,.info-points td { padding: 4px 3px; border-bottom: 1px solid #e9d6ba; }
.info-points tr:last-child > * { border-bottom: 0; }
.info-points th { text-align: left; font-weight: 600; }
.info-points td { text-align: right; color: #08763e; font-weight: 700; font-variant-numeric: tabular-nums; }
.info-points td.info-negative { color: #b52631; }
.info-content .info-note { margin-top: 8px; font-size: 12px; color: var(--muted); }
.info-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}
.info-footer a { color: #754521; font-size: 12px; text-underline-offset: 3px; }
.info-footer .primary { min-width: 104px; }
.result-dialog {
  width: min(820px,calc(100% - 30px));
  max-height: calc(100dvh - 30px);
  overflow: auto;
  text-align: center;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: var(--result-gap,12px);
  margin: 0 0 20px;
  text-align: left;
}
.result-panel {
  min-width: 0;
  padding: 14px 16px;
  border: 2px solid var(--team);
  border-radius: 14px;
  background: var(--team-light);
  color: var(--team-dark);
}
.result-stats[data-players='1'] .result-panel,
.result-stats[data-players='3'] .result-panel:last-child {
  grid-column: 1/-1;
  width: calc((100% - var(--result-gap,12px)) / 2);
  justify-self: center;
}
.result-panel h3 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 8px;
  font: 600 22px/1.15 Fredoka,system-ui,sans-serif;
}
.result-panel h3 img { width: 30px; height: 30px; object-fit: contain; }
.result-score {
  display: block;
  text-align: center;
  font: 700 34px/1.1 Fredoka,system-ui,sans-serif;
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}
.result-panel dl {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 6px 10px;
  margin: 0;
  font-size: 14px;
}
.result-panel dt { font-weight: 600; }
.result-panel dd { margin: 0; text-align: right; font-weight: 700; overflow-wrap: anywhere; }
@media (max-width:480px) {
  .result-stats { --result-gap: 8px; }
  .result-panel { padding: 10px 8px; }
  .result-panel h3 { font-size: 17px; }
  .result-score { font-size: 24px; }
  .result-panel dl { font-size: 12px; gap: 4px; }
}

.result-emblem {
  font: 700 52px/1 Fredoka,system-ui,sans-serif;
  letter-spacing: .04em;
  color: #895324;
  background: #f9e8ca;
  border: 2px dashed #e3b43f;
  border-radius: 14px;
  padding: 20px;
  margin: 0 0 20px;
}

.result-dialog .dialog-actions {
  justify-content: center;
}

/* Multiple bursts and falling confetti, confined to the modal. */
.result-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
  container-type: size;
}
.result-confetti span {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--size);
  height: calc(var(--size) * 1.5);
  border-radius: 2px;
  opacity: 0;
  will-change: transform, opacity;
  animation: bingo-confetti-fall var(--fall) var(--delay) linear both;
}
@keyframes bingo-confetti-fall {
  0% { opacity: 0; transform: translate(0,0) rotate(0); }
  8% { opacity: .95; }
  30% { transform: translate(var(--burst-x),var(--burst-y)) rotate(var(--half-spin)); }
  78% { opacity: .85; }
  100% { opacity: 0; transform: translate(var(--drift),calc(100cqh + 30px)) rotate(var(--spin)); }
}
@media (prefers-reduced-motion: reduce) {
  .result-confetti { display: none; }
}

/* Responsive layout */
@media (max-width:1000px) {
  .setup-bottom-bar {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .boards { --card-gap: 22px; }
}

@media (max-width:760px) {
  .caller { gap: 8px; padding: 8px var(--caller-side-padding,12px); }
  .team-heading { flex-basis: min(265px,100%); }
  .team-panel { flex-basis: min(680px,100%); }
  .boards { --card-gap: 14px; padding: 8px 0; }
  .boards > .team-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
}

@media (max-width:650px) {
  .info-content { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .page { padding: 6px 12px; }
  .page:has(.play-screen:not([hidden])) { padding: 3px 6px; }
  .caller { --caller-side-padding: 8px; }
  .caller-word { block-size: 56px; --reveal-width: 108px; --timer-width: 52px; --control-gap: 6px; }
  #revealWord { padding: 6px 7px; font-size: 11px; }
  .round-timer { padding: 6px 3px; font-size: 12px; }
  .units { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .setup-bottom-bar { gap: 8px; }
  .setup-bottom-bar .field:last-of-type { grid-column: 1/-1; }
  .field select { font-size: 13px; padding: 9px 6px; }
  .setup-screen { border-radius: 14px; }
  .team-heading { padding: 6px 8px; gap: 6px; }
  .team-piece { width: 24px; height: 24px; flex-basis: 24px; }
  .team-heading h2 { font-size: 15px; }
  .team-progress { font-size: 11px; }
  .team-score { font-size: 21px; }
  .team-card { padding: 6px; border-radius: 14px; }
  .team-card::before { inset: 4px; border-radius: 10px; }
  .bingo-cell { padding: 2px; }
}
