.bingo-main { display: grid; gap: 14px; }
.bingo-stage { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(215px, 1fr); gap: 14px; }
.cage-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  align-items: end;
  padding: 0 10px 14px;
  background: radial-gradient(ellipse at 43% 66%, #87533047, transparent 74%), var(--glass);
}

#cage {
  width: min(100%, 640px, max(360px, 94vh));
  height: auto;
  max-height: min(41vh, 385px);
  aspect-ratio: 640 / 390;
  object-fit: contain;
}

.bingo-actions { width: 100%; justify-content: center; }
.bingo-actions .primary { min-width: min(190px, 100%); }

.last-draw {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(8px, 1.6vh, 16px);
  padding: 13px;
  text-align: center;
}

.result-orb {
  display: grid;
  place-items: center;
  width: clamp(115px, 23vh, 227px);
  aspect-ratio: 1;
  border: 2px solid #b78551;
  border-radius: 50%;
  color: #27150d;
  background: radial-gradient(circle at 32% 21%, #fff5d6 4%, #efc282 48%, #a96c39 84%, #784523 100%);
  box-shadow: inset 0 0 9px #fff1b482, 0 8px 25px #160c0890, 0 0 32px #d19f6040;
}

.result-orb strong {
  font-size: clamp(3.5rem, 13vh, 8rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -.075em;
  margin-right: .075em;
}
.result-orb strong.long-number { font-size: clamp(2.25rem, 7.4vh, 4.8rem); }
.result-orb.empty { opacity: .64; }
.result-orb.empty strong { font-size: clamp(2.4rem, 8vh, 4.2rem); }
.result-orb.reveal { animation: reveal-ball .45s cubic-bezier(.2, .78, .38, 1.18); }
@keyframes reveal-ball { from { transform: scale(.84); opacity: .55; } to { transform: scale(1); opacity: 1; } }

.draw-status { color: var(--muted); font-size: .9rem; }
.recent-balls { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0; margin: 0; list-style: none; }
.recent-balls:empty { display: none; }
.recent-balls li {
  display: grid;
  place-items: center;
  min-width: 30px;
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid #785435;
  border-radius: 20px;
  font-size: .78rem;
  color: var(--gold-light);
  background: #302015;
}

.board-panel { padding: clamp(10px, 1.6vw, 18px); }
.board-bar, .board-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; }
.board-bar { justify-content: space-between; margin-bottom: 12px; }
.board-bar h2 { font: 700 1.5rem / 1.12 var(--display); letter-spacing: .045em; color: var(--gold-light); }
.board-heading p { font-size: .9rem; }

.number-board {
  display: grid;
  --columns: 10;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  grid-template-columns: repeat(min(var(--columns), var(--board-count, 90)), minmax(0, 1fr));
  gap: 5px;
  max-height: clamp(180px, 34vh, 330px);
  margin: 0;
  padding: 2px 3px 4px 2px;
  overflow: auto;
  list-style: none;
  font-variant-numeric: tabular-nums;
  scrollbar-color: #8c633d #211611;
}
.number-board li {
  display: grid;
  place-items: center;
  min-height: 31px;
  padding: 2px;
  border: 1px solid #51382a;
  border-radius: 7px;
  background: #211713;
  font-weight: 700;
}
.number-board li.called { border-color: #be955f; color: #25170c; background: #d7ad78; }
.number-board li.latest { border-color: #ffefbe; background: #ffdc9e; box-shadow: inset 0 0 0 1px #fff3cf; }

#setup-note { margin-top: 12px; }
.announced-year { display: block; margin-block: 2px 10px; font: 700 clamp(4rem, 16vw, 7.3rem) / 1 var(--display); color: var(--gold-light); }

@media (min-width: 1000px) {
  .number-board { --columns: 15; }
}

@media (min-width: 780px) and (max-height: 800px) {
  .bingo-main, .bingo-stage { gap: 9px; }
  .board-panel { padding: 10px; }
  .board-bar { margin-bottom: 8px; }
  .number-board li { min-height: 25px; }
}

@media (max-width: 660px) {
  .bingo-stage { grid-template-columns: minmax(0, 1fr) minmax(100px, 34%); gap: 8px; }
  .bingo-main { gap: 9px; }
  .cage-panel { padding: 0 5px 8px; align-items: center; }
  #cage { width: 100%; height: auto; max-height: none; }
  .bingo-actions { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: stretch; gap: 5px; }
  .bingo-actions:has(#auto-button[hidden]) { grid-template-columns: minmax(0, 1fr); }
  .bingo-actions .button { min-width: 0; min-height: 38px; gap: 5px; padding: 6px 7px; font-size: .71rem; letter-spacing: .04em; }
  .bingo-actions img { width: 16px; height: 16px; }
  .last-draw { gap: 6px; padding: 8px 4px; }
  .result-orb { width: clamp(68px, 20vw, 125px); }
  .result-orb strong { font-size: clamp(2.6rem, 11vw, 4.8rem); }
  .result-orb strong.long-number { font-size: clamp(1.58rem, 6vw, 3rem); }
  .draw-status { font-size: .73rem; }
  .recent-balls li { min-width: 23px; min-height: 23px; padding: 2px 4px; font-size: .68rem; }
  .board-bar .game-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 5px; }
  .board-bar .button { min-width: 0; gap: 4px; padding-inline: 4px; font-size: .68rem; letter-spacing: .035em; }
  .board-bar .button img { width: 14px; }
  .number-board { --columns: 6; }
}
