/* Football Bingo — premium streamed-card game.
   Same visual language as TTT + Box2Box: white cards on green pitch,
   hairline separators, brand-green accents, spring animations. */

.bg-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-3) var(--sp-7);
}

/* ---------- Top header card ---------- */
.bg-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--sp-4);
  background: linear-gradient(135deg, #16a34a 0%, #0d6b0b 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
  position: relative;
  overflow: hidden;
}
.bg-card-head::before {
  /* Subtle football field stripes inside the header. */
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.04) 0 12px,
    transparent 12px 24px
  );
  pointer-events: none;
}
.bg-head__count {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #ffffff;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.bg-head__count-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 24px;
  color: #0a0a0a;
  letter-spacing: -0.02em;
  line-height: 1;
}
.bg-head__player {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.bg-head__player-first {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.9);
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bg-head__player-last {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 5vw, 38px);
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bg-head__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-1);
  position: relative;
  z-index: 1;
}
.bg-skip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.30);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .12s ease, transform .15s cubic-bezier(.34,1.56,.64,1);
}
.bg-skip:hover { background: rgba(255,255,255,0.25); transform: translateY(-1px); }
.bg-skip:active { transform: translateY(1px); }
.bg-skip:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.bg-head__remaining {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.85);
  text-transform: uppercase;
}

/* Player swap-in animation. */
.bg-head__player.is-changing { animation: bgPlayerIn .35s cubic-bezier(.34,1.56,.64,1); }
@keyframes bgPlayerIn {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 3x4 grid of category cells ---------- */
.bg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: #ffffff;
  padding: 8px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0,0,0,0.08);
}
.bg-cell {
  background: #f5f6f4;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--sp-2);
  cursor: pointer;
  position: relative;
  transition: background .15s ease, border-color .15s ease, transform .15s cubic-bezier(.34,1.56,.64,1);
  min-height: 110px;
}
.bg-cell:hover {
  background: #ffffff;
  border-color: #16a34a;
  transform: translateY(-1px);
}
.bg-cell:disabled,
.bg-cell.is-locked {
  cursor: not-allowed;
  pointer-events: none;
}
.bg-cell__art {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bg-cell__art img {
  max-width: 100%; max-height: 100%; object-fit: contain;
}
.bg-cell__art .bg-cell__badge {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  color: #0a0a0a;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
}
.bg-cell__label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0a0a0a;
  line-height: 1.15;
  word-break: break-word;
  max-height: 3em;
  overflow: hidden;
}

/* Filled state — claimed by a player. */
.bg-cell.is-filled {
  background: #ffffff;
  border-color: #16a34a;
  animation: bgCellFill .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes bgCellFill {
  0%   { transform: scale(.9); }
  60%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.bg-cell__claim {
  margin-top: var(--sp-1);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  color: #16a34a;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Wrong-claim flash — brief red tint. */
.bg-cell.is-wrong {
  animation: bgCellWrong .5s ease;
}
@keyframes bgCellWrong {
  0%, 100% { background: #f5f6f4; }
  20%, 60% { background: rgba(220,38,38,0.18); border-color: #dc2626; }
}

/* ---------- Result panel ---------- */
.bg-result {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  margin-top: var(--sp-4);
  animation: resultIn .35s cubic-bezier(.34,1.56,.64,1);
}
.bg-result__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.875rem;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-2);
  color: #0a0a0a;
}
.bg-result.win .bg-result__title  { color: #16a34a; }
.bg-result.lose .bg-result__title { color: #dc2626; }
.bg-result__sub {
  color: #4b5563;
  margin-bottom: var(--sp-4);
  font-size: 14px;
}
.bg-result__row {
  display: flex; gap: var(--sp-3); justify-content: center;
  flex-wrap: wrap;
}

/* ---------- How to play ---------- */
.bg-how {
  margin-top: var(--sp-5);
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius);
  overflow: hidden;
  color: #0a0a0a;
}
.bg-how > summary {
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  list-style: none;
}
.bg-how > summary::-webkit-details-marker { display: none; }
.bg-how > summary::after { content: "▾"; float: right; color: #6b7280; }
.bg-how[open] > summary::after { content: "▴"; }
.bg-how__body { padding: 0 var(--sp-4) var(--sp-4); font-size: 13px; color: #4b5563; line-height: 1.6; }
.bg-how__body ul { padding-left: 18px; margin: var(--sp-2) 0; }
.bg-how__body li { margin-bottom: 4px; }
.bg-how__multi { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid rgba(0,0,0,0.06); }

/* Mobile tweaks */
@media (max-width: 520px) {
  .bg-card-head { grid-template-columns: auto 1fr auto; gap: var(--sp-3); padding: var(--sp-3); }
  .bg-head__count { width: 48px; height: 48px; }
  .bg-head__count-num { font-size: 18px; }
  .bg-head__player-last { font-size: 22px; }
  .bg-cell { min-height: 96px; padding: var(--sp-2) 6px; }
  .bg-cell__art { width: 36px; height: 36px; }
  .bg-cell__label { font-size: 10px; }
  .bg-cell__claim { font-size: 10px; }
}
