/* ── Final Week Bingo ───────────────────────────────────────── */

main { max-width: 760px; margin: 0 auto; padding: 16px; }

/* Controls / player picker */
.bingo-controls { position: relative; margin-bottom: 20px; }
#player-search {
  width: 100%; box-sizing: border-box;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; color: var(--text); font-size: 15px; outline: none;
}
#player-search:focus { border-color: var(--gold-dim); }
.player-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  max-height: 280px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.player-dropdown.open { display: block; }
.player-option {
  padding: 8px 14px; cursor: pointer; font-size: 14px; display: flex;
  justify-content: space-between; align-items: center; gap: 8px;
}
.player-option:hover, .player-option.active { background: var(--bg3); }
.player-option .po-dead { color: var(--text2); font-size: 11px; }

/* Header for the chosen player */
.bingo-head { text-align: center; margin-bottom: 16px; }
.bingo-head .bh-name { font-size: 22px; font-weight: 700; }
.bingo-head .bh-stats { margin-top: 6px; font-size: 13px; color: var(--text2); }
.bingo-head .bh-bingos { color: var(--gold); font-weight: 700; }

/* The board */
.bingo-board {
  display: grid;
  grid-template-columns: repeat(var(--size), 1fr);
  gap: 6px;
  margin: 0 auto;
}
.bingo-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.bingo-cell .bc-name {
  font-size: 14px; font-weight: 600; line-height: 1.2; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.bingo-cell .bc-desc {
  margin-top: 4px; font-size: 12px; line-height: 1.25; color: var(--text2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.bingo-cell .bc-pts { margin-top: 5px; font-size: 12px; color: var(--text2); font-weight: 700; }
.bingo-cell.empty-square { opacity: .35; }

/* Earned squares */
.bingo-cell.earned {
  background: linear-gradient(160deg, var(--bg3), var(--bg2));
  border-color: var(--gold-dim);
}
.bingo-cell.earned .bc-name { color: var(--gold); font-weight: 600; }
.bingo-cell.earned::after {
  content: "✓"; position: absolute; top: 3px; right: 5px;
  font-size: 11px; color: var(--gold); font-weight: 700;
}

/* Mandatory squares — must be completed. Legendary orange. */
.bingo-cell.mandatory {
  border-color: #ff8000;
  box-shadow: inset 0 0 0 1px rgba(255,128,0,.4);
}
.bingo-cell.mandatory .bc-name { color: #ff8000; }
.bingo-cell.mandatory .bc-mandatory {
  font-size: 9px; font-weight: 800; letter-spacing: 1px; color: #ff8000;
  margin-bottom: 2px;
}
.bingo-cell.mandatory.earned {
  background: linear-gradient(160deg, rgba(255,128,0,.28), rgba(255,128,0,.08));
  border-color: #ff8000;
}
.bingo-cell.mandatory.earned::after { color: #ff8000; }

/* Center free space */
.bingo-cell.free {
  background: radial-gradient(circle at center, var(--bg3), var(--bg2));
  border-color: var(--gold-dim);
}
.bingo-cell.free .bc-free { font-size: 12px; font-weight: 800; color: var(--gold); letter-spacing: 1px; }
.bingo-cell.free img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

/* Winning-line glow */
.bingo-cell.bingo-line {
  background: linear-gradient(160deg, rgba(200,169,81,.35), rgba(200,169,81,.12));
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(200,169,81,.55);
  animation: bingoPulse 1.6s ease-in-out infinite;
}
.bingo-cell.bingo-line .bc-name { color: var(--text); }
@keyframes bingoPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(200,169,81,.4); }
  50%      { box-shadow: 0 0 18px rgba(200,169,81,.75); }
}

.bingo-banner {
  text-align: center; margin: 14px 0 0;
  font-size: 18px; font-weight: 800; letter-spacing: 2px; color: var(--gold);
}

.bingo-empty { text-align: center; color: var(--text2); padding: 60px 20px; font-size: 15px; line-height: 1.6; }

.bingo-preview-note {
  text-align: center; margin-bottom: 14px; padding: 8px 12px; font-size: 13px; font-weight: 600;
  color: var(--gold); background: rgba(200,169,81,.1);
  border: 1px dashed var(--gold-dim); border-radius: 8px;
}

@media (max-width: 520px) {
  .bingo-cell .bc-name { font-size: 11px; -webkit-line-clamp: 3; }
  .bingo-cell .bc-desc { font-size: 9px; -webkit-line-clamp: 2; }
  .bingo-cell .bc-pts { font-size: 10px; }
  .bingo-board { gap: 4px; }
}
