.hbg { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.hbg-card {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  padding: 16px;
  max-width: 920px;
  margin: 14px auto;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.hbg h2 { margin: 0 0 12px; font-size: 22px; }
.hbg-row { margin: 10px 0 14px; }
.hbg-label { display:block; font-weight: 600; margin-bottom: 6px; }

.hbg-team-picker { display:flex; gap:10px; flex-wrap:wrap; }
.hbg-select, .hbg-input, .hbg-textarea {
  width: min(520px, 100%);
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
}
.hbg-select { width: min(260px, 100%); }
.hbg-input { width: min(260px, 100%); }

.hbg-actions { display:flex; gap:10px; flex-wrap: wrap; margin-top: 12px; }
.hbg-btn {
  border: 1px solid #d0d0d0;
  background: #f6f6f6;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}
.hbg-btn:hover { filter: brightness(0.98); }
.hbg-primary {
  background: #111;
  color: #fff;
  border-color: #111;
}

.hbg-hint { opacity: 0.75; margin-top: 12px; font-size: 13px; }

.hbg-roulette { display:grid; gap: 12px; }
.hbg-roulette-window {
  border: 2px dashed #ddd;
  border-radius: 14px;
  padding: 18px;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height: 86px;
}
.hbg-roulette-item{
  border: 3px solid #ddd;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 18px;
  background: #fff;
}
.hbg-pill{
  display:inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
  color: #111;
}

.hbg-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.hbg-teamname { font-weight: 800; font-size: 16px; }

.hbg-grid-wrap { position: relative; }
.hbg-board{
  display:grid;
  gap: 8px;
}
.hbg-cell{
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  min-height: 64px;
  cursor:pointer;
  position: relative;
  display:flex;
  align-items:center;
  justify-content:center;
  user-select:none;
  appearance: none;
  -webkit-appearance: none;
  border-color: rgba(0,0,0,0.12) !important;
  outline: none;
}
.hbg-mark{
  z-index: 1;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  color: rgba(0,0,0,0.70);
  text-shadow: 0 1px 0 rgba(255,255,255,0.35);
}
.hbg-cell.is-checked { outline: 3px solid rgba(0,0,0,0.25); }
.hbg-cell.is-bingo{
  background: #000 !important;
}
.hbg-cell.is-bingo .hbg-mark{
  z-index: 1; color:#fff; text-shadow:none; }

.hbg-bongo{
  position:absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:none;
  font-size: clamp(34px, 6vw, 80px);
  font-weight: 1000;
  letter-spacing: 2px;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity .18s ease, transform .18s ease;
  color:#fff;
  text-shadow: 0 10px 30px rgba(0,0,0,0.45);
}
.hbg-bongo.show{
  opacity: 1;
  transform: scale(1);
  background: rgba(0,0,0,0.22);
  border-radius: 16px;
}

.hbg-answer{ margin-top: 14px; }
.hbg-answer-title{ font-weight:800; margin-bottom: 6px; }
.hbg-textarea{
  min-height: 100px;
  resize: vertical;
}
.hbg-textarea.is-locked{
  border-color: #20c997;
  box-shadow: 0 0 0 3px rgba(32,201,151,0.18);
}



/* ===== Grid rewrite overrides (v1.2.0) ===== */
.hbg-board.is-disabled { opacity: 0.45; pointer-events: none; }

.hbg-team-select-wrap{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap: wrap;
}
.hbg-team-select-label{ font-weight: 800; }

.hbg-board{
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

/* Square responsive cells */
.hbg-cell{
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  min-height: 0;
  padding: 0;
  border-radius: 12px;

  /* Ensure themes don't override */
  appearance: none;
  -webkit-appearance: none;
  background-image: none;
  box-shadow: none;
  outline: none;

  display:flex;
  align-items:center;
  justify-content:center;

  overflow: hidden;
}

/* Cross */
.hbg-mark{
  position:absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:none;
  font-weight: 1000;
  line-height: 1;
  font-size: clamp(26px, 7vw, 64px);
  color: rgba(0,0,0,0.78);
  text-shadow: 0 1px 0 rgba(255,255,255,0.35);
  opacity: 0;
  transform: scale(0.98);
  transition: opacity .08s ease, transform .08s ease;
  z-index: 2;
}
.hbg-cell.is-checked .hbg-mark{
  opacity: 1;
  transform: scale(1);
}

/* Category label overlay */
.hbg-cat{
  position:absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:none;
  font-weight: 900;
  font-size: clamp(11px, 3.2vw, 15px);
  text-align:center;
  padding: 6px;
  color: rgba(0,0,0,0.92);
  opacity: 0;
  transition: opacity .12s ease;
  background: rgba(255,255,255,0.38);
  z-index: 1;
}

@media (hover:hover) and (pointer:fine){
  .hbg-cell:hover .hbg-cat{ opacity: 1; }
}
.hbg-cell.is-preview .hbg-cat{ opacity: 1; }

.hbg-cell:hover, .hbg-cell:active, .hbg-cell:focus{
  filter: none;
  outline: none;
}

/* Bingo blackout */
.hbg-cell.is-bingo{
  background-color: #000 !important;
}
.hbg-cell.is-bingo .hbg-mark{
  color:#fff;
  text-shadow:none;
}
.hbg-cell.is-bingo:not(.is-checked) .hbg-mark{ opacity: 0; }

/* Overlay title */
.hbg-bongo{
  font-size: clamp(34px, 8vw, 84px);
}

/* Mobile density */
@media (max-width: 420px){
  .hbg-board{ gap: 6px !important; }
  .hbg-card{ padding: 12px; }
}
