*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bb-red: #c62828;
  --bb-red-dark: #8b0000;
  --bb-gold: #ffd54f;
  --bb-green: #2e7d32;
  --bb-green-dark: #1b5e20;
  --bb-panel-blue: #0d1b4a;
  --bb-panel-border: #ffd54f;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bingoBucksBody {
  min-height: 100dvh;
  min-height: 100svh;
  background: var(--bb-red-dark);
  color: #fff;
  font-family: "Luckiest Guy", Impact, Haettenschweiler, sans-serif;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  padding: var(--safe-top) 0 var(--safe-bottom);
  display: flex;
  flex-direction: column;
}

.bingoBucksShell {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem 1rem;
  flex: 1;
  min-height: 0;
}

/* Playfield visible: footer is shown — avoid `flex: 1` on the shell stretching below the
   playfield and leaving a large empty band before the footer (common on tall mobile Safari). */
body.bingoBucksBody:has(#pullTabGameFooter:not([hidden])) .bingoBucksShell {
  flex: 0 1 auto;
  min-height: 0;
}

/* ── Header sunburst ─────────────────────────────────────────────────── */

.bingoBucksHeader {
  text-align: center;
  padding: 0.75rem;
  border-radius: 12px;
  background:
    conic-gradient(
      from 0deg,
      #ff6f00 0deg,
      #ffca28 40deg,
      #ff6f00 80deg,
      #ffca28 120deg,
      #ff6f00 160deg,
      #ffca28 200deg,
      #ff6f00 240deg,
      #ffca28 280deg,
      #ff6f00 320deg,
      #ffca28 360deg
    );
  box-shadow:
    inset 0 0 40px rgba(255, 255, 255, 0.15),
    0 6px 20px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

.bingoBucksHeader--logoOnly {
  background: none;
  box-shadow: none;
  padding-inline: 0;
  padding-block: 0.35rem;
  overflow: visible;
  border-radius: 0;
}

.gameLogoSlot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.gameLogoSlot:empty {
  display: none;
}

.gameLogoSlot img {
  display: block;
  max-width: min(100%, 280px);
  height: auto;
}

.pullTabHomeGameLogoSlot {
  width: 100%;
  justify-content: center;
}

/* Join-home hero: logo spans shell content width (matches Game ID panel), not capped at 280px */
.bingoBucksHeader--logoOnly .pullTabHomeGameLogoSlot img {
  max-width: 100%;
  width: 100%;
  height: auto;
}

/* In-game lobby: bingo-balls art (pull-tab.html #lobbyHeader) — smooth gold fill, not conic sunburst */
.pullTabLobbyHeader.bingoBucksHeader {
  /* Extra air below the bar; shell gap (.65rem) adds on top of this */
  margin-bottom: clamp(1rem, 4vw, 1.55rem);
  padding-block: 0.65rem;
  /* Light hotspot kept small; corners/circumference read richer gold */
  background: radial-gradient(
    ellipse 68% 54% at 50% 42%,
    #fffde7 0%,
    #fff59d 8%,
    #ffee58 18%,
    #ffeb3b 34%,
    #fdd835 52%,
    #ffc107 72%,
    #ffb300 88%,
    #ffa000 100%
  );
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    inset 0 2px 24px rgba(255, 255, 255, 0.12),
    inset 0 -18px 36px rgba(255, 179, 0, 0.22),
    0 5px 18px rgba(0, 0, 0, 0.38);
}

.pullTabLobbyLogoSlot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.pullTabLobbyLogoSlot img {
  display: block;
  max-width: min(100%, 420px);
  width: 100%;
  height: auto;
}

.bingoBalls {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.ball {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.ball--b {
  background: radial-gradient(circle at 30% 30%, #64b5f6, #1565c0);
}
.ball--i {
  background: radial-gradient(circle at 30% 30%, #ef5350, #b71c1c);
}
.ball--n {
  background: radial-gradient(circle at 30% 30%, #fafafa, #bdbdbd);
  color: #333;
}
.ball--g {
  background: radial-gradient(circle at 30% 30%, #81c784, #2e7d32);
}
.ball--o {
  background: radial-gradient(circle at 30% 30%, #ba68c8, #6a1b9a);
}

.bingoBucksTitle {
  line-height: 1;
  margin-bottom: 0.35rem;
}

.bingoWord {
  display: block;
  font-size: clamp(1.85rem, 8vw, 2.5rem);
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff59d, #ffb300, #ff6f00);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(2px 3px 0 #5d4037);
}

.bucksWord {
  display: block;
  font-size: clamp(1.5rem, 7vw, 2.1rem);
  color: #fff;
  -webkit-text-stroke: 2px #1b5e20;
  paint-order: stroke fill;
  text-shadow:
    0 0 12px rgba(76, 175, 80, 0.8),
    2px 3px 0 #1b5e20;
}

.gameStatusLine {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: #fff8e1;
  text-transform: uppercase;
  opacity: 0.95;
}

.activeDisplayName {
  font-size: clamp(1.1rem, 4.5vw, 1.45rem);
  color: #fffde7;
  margin-top: 0.25rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* ── Lobby panel ─────────────────────────────────────────────────────── */

.lobbyPanel {
  width: 100%;
  flex-shrink: 0;
  align-self: stretch;
}

.lobbyEditSection {
  width: 100%;
  padding: 0.65rem 0.75rem 0.7rem;
  border-radius: 12px;
  background: rgba(13, 27, 74, 0.92);
  border: 2px solid var(--bb-panel-border);
}

.lobbyWaitingNicknameCard {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lobbyNicknameDock {
  width: 100%;
}

.lobbyEyebrow,
.pullTabJoinLabel {
  display: block;
  font-size: clamp(0.72rem, 3.2vw, 0.88rem);
  font-weight: 400;
  font-family: inherit;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bb-gold);
}

.lobbyEyebrow {
  margin-bottom: 0.4rem;
}

.pullTabJoinLabel {
  margin-bottom: 0.4rem;
}

.lobbyNicknameAndAvatarRow {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.38rem;
  width: 100%;
}

.lobbyNicknameInputWrap {
  flex: 1 1 50%;
  min-width: 0;
}

/* Match .lobbySaveBtn / .lobbyRandomBtn (min-height: 48px) */
.lobbyAvatarPickerBtn {
  flex: 1 1 50%;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0 0.65rem;
  min-height: 48px;
  height: 48px;
  max-height: 48px;
  border-radius: 8px;
  border: 2px solid #3a4a8a;
  background: rgba(0, 0, 0, 0.4);
  color: var(--bb-gold);
  font-family: inherit;
  font-size: clamp(1rem, 4.5vw, 1.25rem);
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;
}

.lobbyAvatarPickerBtn:active {
  transform: translateY(1px);
}

.lobbyAvatarPickerThumbWrap {
  flex: 0 0 auto;
  width: 2.625rem;
  height: 2.625rem;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lobbyAvatarPickerThumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Luckiest Guy sits high vs cap-height; mirror lobbyNicknameBtn optical centering */
.lobbyAvatarPickerBtnLabel {
  flex: 0 0 auto;
  line-height: 1;
  display: inline-block;
  transform: translateY(0.1em);
}

.lobbyAvatarPicker {
  margin: auto;
  padding: 0;
  border: none;
  width: min(96vw, 36rem);
  max-width: min(96vw, 36rem);
  background: transparent;
}

.lobbyAvatarPicker::backdrop {
  background: rgba(8, 12, 32, 0.72);
}

.lobbyAvatarPickerPanel {
  padding: 1.05rem 1.05rem 0.95rem;
  border-radius: 14px;
  background: rgba(13, 27, 74, 0.98);
  border: 3px solid var(--bb-panel-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.lobbyAvatarPickerTitle {
  font-family: inherit;
  font-size: clamp(1.05rem, 5vw, 1.35rem);
  letter-spacing: 0.06em;
  text-align: center;
  margin-bottom: 0.62rem;
  color: var(--bb-gold);
  text-transform: uppercase;
}

/* 5 × 3 grid of square tiles (aspect-ratio fixes row height to column width) */
.lobbyAvatarPickerGrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(3, auto);
  gap: clamp(0.45rem, 2.5vw, 0.72rem);
  margin-bottom: 0.85rem;
  align-items: start;
}

.lobbyAvatarPickTile {
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0;
  border-radius: 12px;
  border: 2px solid rgba(255, 213, 79, 0.55);
  background: rgba(0, 0, 0, 0.38);
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lobbyAvatarPickTile img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center;
}
.lobbyAvatarPickTile:is(:hover, :focus-visible) {
  border-color: var(--bb-gold);
  box-shadow: 0 0 0 1px var(--bb-gold);
  outline: none;
}

.lobbyAvatarPickTile--selected {
  border-color: #fff176;
  box-shadow: 0 0 0 2px #fff176;
}

.lobbyAvatarPickerFooter {
  display: flex;
  justify-content: center;
}

.lobbyAvatarPickerCloseBtn {
  min-height: 48px;
  padding: 0.45rem 1.85rem;
  border-radius: 999px;
  border: 2px solid var(--bb-gold);
  background: var(--bb-gold);
  color: #3e2723;
  font-family: inherit;
  font-size: clamp(1rem, 4.5vw, 1.2rem);
  letter-spacing: 0.06em;
  cursor: pointer;
  touch-action: manipulation;
}

.pullTabJoinInput,
.lobbyNameInput {
  width: 100%;
  border-radius: 8px;
  border: 2px solid #3a4a8a;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  padding: 0.65rem 0.75rem;
  font-size: 16px;
  font-family: ui-monospace, monospace;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  min-height: 44px;
  touch-action: manipulation;
}

.pullTabJoinInput {
  margin-bottom: 0.5rem;
}

.lobbyEditActions {
  display: flex;
  gap: 0.35rem;
}
.lobbySaveBtn,
.lobbyRandomBtn {
  flex: 1;
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
  font-family: inherit;
  font-size: clamp(1rem, 4.5vw, 1.25rem);
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 2px solid var(--bb-gold);
  background: var(--bb-gold);
  color: #3e2723;
  min-height: 48px;
  touch-action: manipulation;
}



.lobbyNicknameBtn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 0.52rem 0.95rem;
  min-height: 48px;
  background: var(--bb-gold);
  color: #3e2723;
  font-family: inherit;
  font-size: clamp(1rem, 4.5vw, 1.25rem);
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 3px 0 #b8860b;
  line-height: 1;
  text-align: center;
}

.lobbyNicknameBtnThumbWrap {
  flex-shrink: 0;
  width: 2.375rem;
  height: 2.375rem;
  aspect-ratio: 1;
  border-radius: 999px;
  overflow: hidden;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lobbyNicknameBtnThumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Luckiest Guy sits high in the em-box; nudge glyphs for optical vertical center */
.lobbyNicknameBtnLabel {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateY(0.1em);
}

.lobbyNicknameBtn:focus-visible {
  outline: 2px solid #fff176;
  outline-offset: 3px;
}

.lobbyWaitingNicknameCard .lobbyNicknameBtn {
  width: auto;
  max-width: 100%;
}

.lobbyNicknameBtn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 #b8860b;
}

.lobbyNicknameBtn:active .lobbyNicknameBtnLabel {
  transform: translateY(calc(0.1em + 1px));
}

.lobbyWaitingLabel {
  margin: 0;
  margin-top: 1rem;
  padding: 0 0.25rem;
  text-align: center;
  font-family: inherit;
  font-size: clamp(0.82rem, 3.8vw, 1.06rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
  color: #ffe082;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.lobbyRoster {
  margin-top: 0.65rem;
  max-height: min(38vh, 280px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.lobbyRosterGrid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.55rem 0.4rem;
  padding: 2px;
}

.lobbyRosterTile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0.05rem 0.12rem 0.35rem;
  min-height: 0;
}

.lobbyRosterTileAvatar {
  width: clamp(2.85rem, 15vw, 3.35rem);
  height: clamp(2.85rem, 15vw, 3.35rem);
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lobbyRosterTileAvatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.lobbyRosterTileLabel {
  width: 100%;
  margin: 0.12rem 0 0;
  padding: 0 2px 3px;
  font-size: 0.62rem;
  line-height: 1.35;
  text-align: center;
  font-family: system-ui, sans-serif;
  font-weight: 600;
  color: #fff8e7;
  overflow-x: hidden;
  overflow-y: visible;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobbyRosterTile--self .lobbyRosterTileLabel {
  color: var(--bb-gold);
  font-weight: 800;
}

.playerNameError {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: #ff8a80;
  font-family: system-ui, sans-serif;
}

/* ── Pixi playfield ──────────────────────────────────────────────────── */

.bingoBucksPlayfield {
  width: 100%;
  flex: 0 0 auto;
  height: auto;
  /* Match PNG aspect so `contain` fills the box — avoids extra letterboxing on mobile */
  aspect-ratio: 1008 / 392;
  border-radius: 10px;
  background: var(--bb-panel-blue);
  border: 5px solid var(--bb-gold);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  position: relative;
}

.bingoBucksPlayfield--tabs4 {
  aspect-ratio: 1358 / 392;
}

.pullTabPlayfieldArt {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("/assets/pull-tab/three-empty-tabs.png");
}

.bingoBucksPlayfield--tabs4 .pullTabPlayfieldArt {
  background-image: url("/assets/pull-tab/four-empty-tabs.png");
}

.bingoBucksPlayfield canvas {
  display: block;
  position: relative;
  z-index: 1;
  width: 100% !important;
  height: 100% !important;
}

.pullTabErrorFlash {
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: #ff8a80;
  font-family: system-ui, sans-serif;
  line-height: 1.35;
  padding: 0 0.25rem 0.35rem;
  flex-shrink: 0;
}

.pullTabErrorFlash[hidden] {
  display: none !important;
}

/* ── Full-bleed game footer (under playfield) ───────────────────────── */

.pullTabGameFooter {
  width: 100%;
  margin: 0;
  padding: 0.4rem 0 max(0.4rem, var(--safe-bottom));
  border: none;
  background: transparent;
  box-shadow: none;
  flex-shrink: 0;
}

.pullTabGameFooterInner {
  width: 100%;
}

.pullTabGameFooterVisual {
  position: relative;
  width: 100%;
}

.pullTabGameFooterImg {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0 auto;
}

/* Overlay: “N TABS PER GAME” on green band of footer art */
.pullTabGameFooterTabLine {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translateX(-50%);
  margin: 0;
  font-family: "Luckiest Guy", Impact, Haettenschweiler, sans-serif;
  /* Mobile: readable on Safari; still capped so the line usually fits */
  font-size: clamp(0.88rem, 5vw, 1.3rem);
  letter-spacing: 0.05em;
  color: var(--bb-gold);
  text-shadow:
    0 1px 0 #000,
    0 3px 8px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  text-align: center;
  line-height: 1.2;
  pointer-events: none;
  max-width: min(96%, 22rem);
  padding-inline: 0.2rem;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .pullTabGameFooterTabLine {
    font-size: clamp(1rem, 5.5vw, 2.1rem);
    letter-spacing: 0.08em;
    max-width: none;
    /* Nudge right to sit better over the green band on wide layouts */
    left: 57%;
  }
}

.pullTabFooterTabCount {
  margin-right: 0.28em;
}

/* ── Active play HUD (nickname + avatar) ───────────────────────────── */

.pullTabGameHud {
  width: 100%;
  box-sizing: border-box;
  padding: 0 max(0.75rem, env(safe-area-inset-left)) 0
    max(0.75rem, env(safe-area-inset-right));
  margin-top: -0.2rem;
  margin-bottom: -0.2rem;
  flex-shrink: 0;
  border: none;
  background: transparent;
}

.pullTabGameHudInner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5em;
  width: 100%;
  font-size: clamp(1.2rem, 5.5vw, 1.65rem);
  line-height: 1;
  --pullTabHudRow: 1.42em;
  --pullTabHudAvatarSize: calc(var(--pullTabHudRow) * 0.78);
}

.pullTabDauberPicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.22em;
  flex: 0 0 auto;
  margin-left: auto;
  max-width: min(5.8em, 38vw);
  padding: 0.14em 0.16em;
  border-radius: 8px;
  background: #fff;
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.pullTabDauberSwatch {
  width: 0.72em;
  height: 0.72em;
  min-width: 14px;
  min-height: 14px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.18);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.pullTabDauberSwatch[aria-pressed="true"] {
  border-color: #1a1a40;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.9),
    0 0 0 2px rgba(0, 0, 0, 0.35);
  transform: scale(1.08);
}

.pullTabDauberSwatch:focus-visible {
  outline: 2px solid var(--bb-gold);
  outline-offset: 2px;
}

.pullTabHudIdentity {
  display: flex;
  align-items: center;
  gap: 0.28em;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  min-height: var(--pullTabHudRow);
  font-size: inherit;
  line-height: 1;
}

.pullTabHudNickname {
  flex: 0 1 auto;
  min-width: 0;
  display: inline-block;
  max-width: 100%;
  line-height: 1;
  /* Luckiest Guy sits high in the em-box; padding avoids transform + overflow:hidden clipping */
  padding-top: 0.14em;
  font-family: "Luckiest Guy", Impact, Haettenschweiler, sans-serif;
  font-size: 1em;
  text-align: left;
  color: var(--bb-gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pullTabHudAvatar {
  flex-shrink: 0;
  display: block;
  width: var(--pullTabHudAvatarSize);
  height: var(--pullTabHudAvatarSize);
  object-fit: contain;
  object-position: center center;
  image-rendering: auto;
}

/* Hide HUD while lobby is visible — belt-and-suspenders with JS */
#lobbyPanel:not([hidden]) ~ #pullTabGameHud {
  display: none !important;
}

/* ── Overlay ─────────────────────────────────────────────────────────── */

#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.4s ease;
  padding: var(--safe-top) 1rem var(--safe-bottom);
  overflow: hidden;
}

.overlayConfetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.overlayConfetti[hidden] {
  display: none !important;
}

.overlayFireworks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.overlayFireworks[hidden] {
  display: none !important;
}

.overlayConfetti__piece {
  position: absolute;
  top: -14px;
  left: var(--x, 50%);
  width: 9px;
  height: 13px;
  border-radius: 1px;
  opacity: 0.92;
  animation: overlayConfettiFall var(--dur, 3s) var(--delay, 0s) ease-in forwards;
}

@keyframes overlayConfettiFall {
  to {
    transform: translateY(115vh) rotate(calc(var(--rot, 0deg) + 720deg));
    opacity: 0.65;
  }
}

#overlay:not([hidden]) {
  opacity: 1;
}

#overlay[hidden] {
  display: none !important;
}

.overlayInner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-width: min(100%, 24rem);
}

#overlayMessage {
  font-size: clamp(2rem, 12vw, 3.5rem);
  text-align: center;
  line-height: 1.15;
}

#overlay.win #overlayMessage {
  color: var(--bb-gold);
  text-shadow: 0 0 24px rgba(255, 213, 79, 0.8);
}

.overlayWinBlock {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.overlayWinBlock[hidden],
#overlay.invalidGame .overlayWinBlock,
#overlay.lose .overlayWinBlock,
#overlay.ended .overlayWinBlock {
  display: none !important;
}

.overlayWinCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: min(92vw, 20rem);
  padding: 0.35rem 1.15rem 1rem;
  border-radius: 20px;
  border: 5px solid rgba(255, 213, 79, 0.72);
  background:
    radial-gradient(circle at 50% -8%, rgba(255, 213, 79, 0.14), transparent 52%),
    linear-gradient(
      165deg,
      rgba(255, 255, 255, 0.07) 0%,
      rgba(13, 27, 74, 0.98) 38%,
      rgba(8, 18, 52, 0.99) 100%
    );
  box-shadow:
    0 18px 48px rgb(0 0 0 / 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: center;
}

.overlayWinHero {
  display: block;
  margin: -2.75rem 0 0.15rem;
  line-height: 0;
}

.overlayWinHeroImg {
  display: block;
  width: min(240px, 62vw);
  height: auto;
  filter: drop-shadow(0 8px 18px rgb(0 0 0 / 0.5));
}

#overlay.win .overlayWinHeroImg {
  animation: overlayWinHeroPop 0.55s cubic-bezier(0.22, 1.12, 0.36, 1) 0.05s both;
}

@keyframes overlayWinHeroPop {
  from {
    opacity: 0;
    transform: scale(0.82) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.overlayWinCardBody {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.15rem 0 0.65rem;
}

.overlayWinTitle {
  margin: 0;
  font-family: "Luckiest Guy", Impact, sans-serif;
  font-size: clamp(2rem, 11vw, 3.25rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--bb-gold);
  text-shadow:
    0 0 20px rgba(255, 213, 79, 0.75),
    0 2px 6px rgba(0, 0, 0, 0.85);
}

.overlayWinParty {
  display: inline-block;
  margin-right: 0.12em;
  vertical-align: middle;
  line-height: 1;
}

#overlay.win .overlayWinParty {
  animation: overlayWinPartyPop 0.65s ease-out;
}

@keyframes overlayWinPartyPop {
  0% {
    transform: scale(0.2) rotate(-18deg);
    opacity: 0;
  }
  65% {
    transform: scale(1.2) rotate(6deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .overlayConfetti__piece {
    animation: none;
    display: none;
  }

  .overlayFireworks {
    display: none !important;
  }

  #overlay.win .overlayWinParty {
    animation: none;
  }

  #overlay.win .overlayWinHeroImg {
    animation: none;
  }
}

.overlayWinNumbers {
  display: grid;
  place-items: center;
  margin: 0;
  width: 100%;
  min-height: 3.75rem;
  padding: 0.5rem 0.85rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
}

.overlayWinNumbersText {
  display: block;
  font-family: "Luckiest Guy", Impact, sans-serif;
  font-size: clamp(1.75rem, 9.5vw, 2.55rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  color: #fffef5;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  /* Luckiest Guy sits high in the line box — nudge down for optical center */
  transform: translateY(0.16em);
}

#overlay.win .overlayWinNumbers:empty {
  display: none;
}

.overlayWinAction {
  display: inline-block;
  margin-top: 0.15rem;
  padding-top: 0.65rem;
  width: 100%;
  border-top: 1px solid rgba(255, 213, 79, 0.22);
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #90caf9;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.overlayWinAction:focus-visible {
  outline: 2px solid rgba(144, 202, 249, 0.85);
  outline-offset: 3px;
  border-radius: 6px;
}

#overlay.lose #overlayMessage {
  color: #ef9a9a;
}

#overlay.invalidGame #overlayMessage {
  color: #ef9a9a;
  font-size: clamp(1.35rem, 7vw, 2.25rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.overlayStartOver {
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  color: #90caf9;
}

/* ── Pull-tab joyride tooltip (single step) ──────────────────────────── */

.pullTabTour {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  width: 100vw;
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  overflow: visible;
  border: none;
  background: transparent;
  z-index: 150;
}

.pullTabTour:not([open]) {
  display: none;
}

.pullTabTour::backdrop {
  background: transparent;
}

.pullTabTour__dimSpot {
  position: fixed;
  inset: 0;
  background: rgb(13 27 74 / 0.92);
  opacity: 0;
  transition: opacity 0.45s cubic-bezier(0.33, 1, 0.36, 1);
  pointer-events: auto;
}

.pullTabTour.pullTabTour--visible .pullTabTour__dimSpot {
  opacity: 1;
}

.pullTabTour__hotspotRing {
  position: fixed;
  left: var(--pullTabTourRingLeft, 10vw);
  top: var(--pullTabTourRingTop, 40vh);
  width: var(--pullTabTourRingW, 180px);
  height: var(--pullTabTourRingH, 96px);
  z-index: 2;
  pointer-events: none;
  border-radius: 18px;
  border: 3px solid var(--bb-panel-border);
  opacity: 0;
  box-shadow:
    0 0 0 1px rgba(198, 40, 40, 0.45),
    0 0 24px rgba(255, 213, 79, 0.65),
    inset 0 0 20px rgba(255, 213, 79, 0.12);
}

.pullTabTour.pullTabTour--visible .pullTabTour__hotspotRing {
  opacity: 1;
  animation:
    pullTabTourRingPop 0.72s cubic-bezier(0.22, 1.08, 0.36, 1) 0.08s both,
    pullTabTourRingGlow 1.65s ease-in-out 0.45s infinite alternate;
}

.pullTabTour__fingerWrap {
  position: fixed;
  left: var(--pullTabTourFingerX, 50%);
  /** Top edge = just under “PULL” baseline (JS sets `--pullTabTourPullY`). */
  top: var(--pullTabTourPullY, 50vh);
  z-index: 3;
  pointer-events: none;
  /** Bbox-centered img places the graphic fingertip slightly right of “PULL” — nudge left so the tip aligns. */
  --pullTabTourFingerXNudge: clamp(22px, 6vw, 40px);
  transform: translateX(calc(-50% - var(--pullTabTourFingerXNudge)));
  opacity: 0;
}

.pullTabTour.pullTabTour--visible .pullTabTour__fingerWrap {
  animation: pullTabTourFingerWrapEnter 0.38s cubic-bezier(0.22, 1.12, 0.36, 1) 0.08s both;
}

.pullTabTour__main {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.pullTabTour__panel {
  pointer-events: auto;
  position: fixed;
  left: 50%;
  bottom: var(--pullTabTourPanelBottom, 240px);
  max-width: min(94vw, 23rem);
  width: calc(100vw - 2rem);
  transform: translate(-50%, 18px);
  padding: 1.05rem 1.25rem 1.15rem;
  border-radius: 16px;
  background:
    radial-gradient(circle at 88% -5%, rgba(255, 213, 79, 0.16), transparent 48%),
    linear-gradient(
      165deg,
      rgba(255, 255, 255, 0.09) 0%,
      rgba(13, 27, 74, 0.99) 42%,
      rgba(13, 27, 74, 0.99) 100%
    );
  border: 3px solid var(--bb-panel-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 14px 40px rgb(0 0 0 / 0.52),
    0 0 0 1px rgba(198, 40, 40, 0.32);
  opacity: 0;
}

.pullTabTour.pullTabTour--visible .pullTabTour__panel {
  animation: pullTabTourCardDockIn 0.52s cubic-bezier(0.33, 1, 0.36, 1) 0.14s forwards;
}

.pullTabTour__instructions {
  font-family: "Luckiest Guy", Impact, sans-serif;
  font-size: clamp(1.22rem, 5.75vw, 1.72rem);
  letter-spacing: 0.038em;
  line-height: 1.32;
  text-align: center;
  text-transform: uppercase;
  color: var(--bb-gold);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.38), 0 4px 8px rgb(0 0 0 / 0.36);
  margin-bottom: 0.85rem;
}

.pullTabTour__finger {
  display: block;
  width: min(280px, 72vw);
  height: auto;
  margin: 0;
  filter: drop-shadow(0 6px 14px rgb(0 0 0 / 0.55));
  /** Pivot at fingertip belt so scaling reads as tapping “into” PULL above. */
  transform-origin: 48% 6%;
}

.pullTabTour.pullTabTour--visible .pullTabTour__finger {
  animation: pullTabTourFingerPulse 0.34s cubic-bezier(0.5, 0, 0.45, 1) 0.35s infinite
    alternate;
}

.pullTabTour__gotIt {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  margin-top: 0;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  font-family: "Luckiest Guy", Impact, sans-serif;
  font-size: clamp(1rem, 4vw, 1.35rem);
  letter-spacing: 0.06em;
  color: var(--bb-panel-blue);
  background: linear-gradient(180deg, #ffe082 0%, var(--bb-gold) 45%, #ff8f00 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 4px 14px rgb(0 0 0 / 0.4);
}

.pullTabTour__gotIt:focus-visible {
  outline: 3px solid rgba(255, 213, 79, 0.85);
  outline-offset: 2px;
}

.pullTabTour__gotIt:active {
  transform: translateY(1px);
}

@keyframes pullTabTourCardDockIn {
  from {
    opacity: 0;
    transform: translate(-50%, 22px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes pullTabTourRingPop {
  from {
    opacity: 0;
    transform: scale(0.72);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pullTabTourRingGlow {
  from {
    box-shadow:
      0 0 0 1px rgba(198, 40, 40, 0.45),
      0 0 18px rgba(255, 213, 79, 0.45),
      inset 0 0 16px rgba(255, 213, 79, 0.1);
  }

  to {
    box-shadow:
      0 0 0 1px rgba(198, 40, 40, 0.35),
      0 0 34px rgba(255, 213, 79, 0.85),
      inset 0 0 22px rgba(255, 213, 79, 0.18);
  }
}

@keyframes pullTabTourFingerWrapEnter {
  from {
    opacity: 0;
    transform: translateX(calc(-50% - var(--pullTabTourFingerXNudge))) translateY(44px) scale(0.78);
  }

  to {
    opacity: 1;
    transform: translateX(calc(-50% - var(--pullTabTourFingerXNudge))) translateY(0) scale(1);
  }
}

@keyframes pullTabTourFingerPulse {
  from {
    transform: scale(0.93) translateY(3px);
  }

  to {
    transform: scale(1.1) translateY(-9px);
  }
}

/* ── Callable number full-screen spotlight + dauber coach ───────────── */

.pullTabCallable {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

.pullTabCallable[hidden] {
  display: none !important;
}

.pullTabCallable__dim {
  position: fixed;
  inset: 0;
  background: rgb(13 27 74 / 0.92);
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.33, 1, 0.36, 1);
}

.pullTabCallable.pullTabCallable--visible .pullTabCallable__dim {
  opacity: 1;
}

.pullTabCallable__hotspots {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.pullTabCallable__hotspot {
  position: fixed;
  border-radius: 18px;
  border: 7px solid rgba(255, 213, 79, 0.96);
  opacity: 0;
  box-shadow:
    0 0 0 2px rgba(255, 248, 200, 0.35),
    0 0 28px rgba(255, 213, 79, 0.72),
    0 0 52px rgba(255, 193, 7, 0.58),
    inset 0 0 22px rgba(255, 213, 79, 0.18);
  transition: opacity 0.35s cubic-bezier(0.33, 1, 0.36, 1);
}

.pullTabCallable.pullTabCallable--visible .pullTabCallable__hotspot {
  opacity: 1;
  animation: pullTabCallableHotspotPulse 0.46s ease-in-out infinite alternate;
}

.pullTabCallable.pullTabCallable--emphasis .pullTabCallable__hotspot {
  animation:
    pullTabTourRingPop 0.72s cubic-bezier(0.22, 1.08, 0.36, 1) 0.08s both,
    pullTabCallableHotspotPulse 0.46s ease-in-out 0.22s infinite alternate;
}

@keyframes pullTabCallableHotspotPulse {
  from {
    border-color: rgba(255, 193, 7, 0.88);
    box-shadow:
      0 0 0 1px rgba(255, 236, 160, 0.4),
      0 0 22px rgba(255, 213, 79, 0.55),
      0 0 40px rgba(255, 193, 7, 0.45),
      inset 0 0 16px rgba(255, 213, 79, 0.12);
    transform: scale(1);
  }

  to {
    border-color: rgba(255, 248, 220, 1);
    box-shadow:
      0 0 0 4px rgba(255, 248, 200, 0.55),
      0 0 44px rgba(255, 213, 79, 1),
      0 0 78px rgba(255, 193, 7, 0.92),
      inset 0 0 30px rgba(255, 248, 200, 0.28);
    transform: scale(1.035);
  }
}

.pullTabCallable__daubers {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.pullTabCallable__dauberCoach {
  position: fixed;
  transform: translate(-50%, -100%);
  margin-top: -0.35rem;
  pointer-events: none;
}

.pullTabCallable__dauber {
  display: block;
  width: var(--pullTabCallableDauberSize, min(208px, 52vw));
  height: auto;
  margin: 0;
  filter: drop-shadow(0 6px 14px rgb(0 0 0 / 0.55));
  transform-origin: 50% 94%;
}

.pullTabCallable.pullTabCallable--visible .pullTabCallable__dauber {
  animation: pullTabCallableDauberPulse 0.52s cubic-bezier(0.5, 0, 0.45, 1)
    var(--pullTabCallableDauberDelay, 0.35s) infinite alternate;
}

.pullTabCallable__panel {
  pointer-events: none;
  position: fixed;
  z-index: 6;
  transform: translate(-50%, 1.2rem);
  max-width: min(94vw, 18rem);
  width: max-content;
  min-width: min(10.5rem, 82vw);
  padding: 0.65rem 0.95rem 0.72rem;
  border-radius: 16px;
  background:
    radial-gradient(circle at 88% -5%, rgba(255, 213, 79, 0.16), transparent 48%),
    linear-gradient(
      165deg,
      rgba(255, 255, 255, 0.09) 0%,
      rgba(13, 27, 74, 0.99) 42%,
      rgba(13, 27, 74, 0.99) 100%
    );
  border: none;
  box-shadow: 0 10px 32px rgb(0 0 0 / 0.45);
  opacity: 0;
}

.pullTabCallable.pullTabCallable--visible .pullTabCallable__panel,
.pullTabCallable.pullTabCallable--emphasis .pullTabCallable__panel {
  opacity: 1;
}

.pullTabCallable__instructions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.06rem;
  font-family: "Luckiest Guy", Impact, sans-serif;
  font-size: clamp(1.05rem, 4.8vw, 1.5rem);
  letter-spacing: 0.038em;
  line-height: 1.08;
  text-align: center;
  text-transform: uppercase;
  color: var(--bb-gold);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.38), 0 4px 8px rgb(0 0 0 / 0.36);
  margin: 0;
}

.pullTabCallable__instructionsLine {
  display: block;
}

.pullTabCallable.pullTabCallable--visible .pullTabCallable__panel,
.pullTabCallable.pullTabCallable--emphasis .pullTabCallable__panel {
  animation: pullTabCallablePanelEnter 0.38s cubic-bezier(0.22, 1.12, 0.36, 1) 0.08s both;
}

@keyframes pullTabCallablePanelEnter {
  from {
    opacity: 0;
    transform: translate(-50%, calc(1.2rem + 14px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, 1.2rem);
  }
}

@keyframes pullTabCallableDauberPulse {
  from {
    transform: scale(1) translateY(0);
  }
  to {
    transform: scale(1.1) translateY(-9px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pullTabCallable__dim {
    transition: none;
  }

  .pullTabCallable.pullTabCallable--visible .pullTabCallable__hotspot,
  .pullTabCallable.pullTabCallable--emphasis .pullTabCallable__hotspot {
    animation: none;
    opacity: 1;
    border-color: rgba(255, 213, 79, 0.95);
    box-shadow:
      0 0 0 3px rgba(255, 248, 200, 0.45),
      0 0 36px rgba(255, 213, 79, 0.85),
      0 0 60px rgba(255, 193, 7, 0.7),
      inset 0 0 22px rgba(255, 213, 79, 0.2);
    transform: scale(1);
  }

  .pullTabCallable.pullTabCallable--visible .pullTabCallable__dauber {
    animation: none;
  }

  .pullTabCallable.pullTabCallable--visible .pullTabCallable__panel,
  .pullTabCallable.pullTabCallable--emphasis .pullTabCallable__panel {
    animation: none;
    opacity: 1;
    transform: translate(-50%, 1.2rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pullTabTour__dimSpot,
  .pullTabTour__fingerWrap {
    transition: none;
  }

  .pullTabTour.pullTabTour--visible .pullTabTour__panel {
    animation: none !important;
    opacity: 1;
    transform: translate(-50%, 0);
  }

  .pullTabTour.pullTabTour--visible .pullTabTour__hotspotRing {
    animation: none;
    opacity: 1;
    transform: none;
    box-shadow:
      0 0 0 1px rgba(198, 40, 40, 0.45),
      0 0 24px rgba(255, 213, 79, 0.6),
      inset 0 0 20px rgba(255, 213, 79, 0.12);
  }

  .pullTabTour.pullTabTour--visible .pullTabTour__fingerWrap {
    animation: none !important;
    opacity: 1;
    transform: translateX(calc(-50% - var(--pullTabTourFingerXNudge)));
  }

  .pullTabTour.pullTabTour--visible .pullTabTour__finger {
    animation: none !important;
    transform: scale(1);
  }

  .pullTabTour__gotIt:active {
    transform: none;
  }
}

/* ── Home (join) page ────────────────────────────────────────────────── */

.pullTabHomeBody.bingoBucksBody {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pullTabHomeShell {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-bottom: max(0.75rem, var(--safe-bottom));
}

/* Lives at body root so it spans the full viewport above the capped join shell */
.pullTabHomeBody > .pullTabHomeErrorGutter {
  align-self: stretch;
  flex-shrink: 0;
}

.pullTabHomeErrorGutter {
  width: 100%;
  margin: calc(-1 * var(--safe-top)) 0 0;
  padding-top: max(0.55rem, var(--safe-top));
  padding-bottom: 0.55rem;
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  text-align: center;
  font-family: system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: #b71c1c;
  border-bottom: 2px solid #ff8a80;
}

.pullTabHomeErrorGutter[hidden] {
  display: none;
}

.pullTabHomeJoinPanel {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(13, 27, 74, 0.92);
  border: 2px solid var(--bb-panel-border);
}

.pullTabJoinInput:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pullTabJoinError {
  font-size: 0.8rem;
  color: #ff8a80;
  margin-bottom: 0.65rem;
  font-family: system-ui, sans-serif;
}

.pullTabHomeSubmit {
  width: 100%;
  margin-top: 0.25rem;
}

.pullTabJoinSubmit {
  width: 100%;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  min-height: 48px;
  font-family: inherit;
  font-size: clamp(1rem, 4.5vw, 1.25rem);
  letter-spacing: 0.04em;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  background: var(--bb-gold);
  color: #3e2723;
  border: 2px solid var(--bb-gold);
}

.pullTabJoinSubmit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
