.bbHubPage {
  min-height: 100vh;
  height: auto;
  margin: 0;
  padding: clamp(16px, 3vw, 28px);
  overflow-y: auto;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Segoe UI", Inter, Roboto, Arial, sans-serif;
  box-sizing: border-box;
}

html {
  height: auto;
  min-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.bbTopbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.bbHomeLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  backdrop-filter: blur(5px);
  color: var(--ink);
  text-decoration: none;
}

.bbHomeLink:hover {
  background: rgba(35, 62, 109, 0.42);
}

.bbChevron {
  opacity: 0.92;
}

.bbPlaqueWrap {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 120px;
}

.bbPlaqueSvg {
  display: block;
  width: min(360px, 58vw);
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}

.bbIconBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  backdrop-filter: blur(5px);
  color: var(--ink);
  cursor: pointer;
}

.bbIconBtn:hover {
  background: rgba(35, 62, 109, 0.42);
}

.bbMain {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
}

.bbPane {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: var(--panel-bg);
  backdrop-filter: blur(6px);
  padding: 14px 14px 16px;
  min-width: 0;
}

.bbPaneHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.bbPaneTitle {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

.bbPaneMeta {
  color: var(--muted);
  font-size: 12px;
}

.bbActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.bbActionsBottom {
  margin-top: 14px;
  margin-bottom: 0;
}

.bbCard {
  border: 1px solid rgba(129, 156, 206, 0.16);
  background: rgba(19, 32, 64, 0.22);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.bbCardTitle {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.bbBtn {
  display: inline-block;
  border: 1px solid rgba(132, 165, 219, 0.35);
  background: rgba(35, 62, 109, 0.45);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

.bbBtn:hover {
  background: rgba(45, 78, 128, 0.55);
}

.bbBtn:disabled,
.bbBtn.isDisabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.bbBtnPrimary {
  border-color: rgba(232, 168, 32, 0.45);
  background: rgba(232, 168, 32, 0.18);
}

.bbBtnPrimary:hover {
  background: rgba(232, 168, 32, 0.24);
}

.bbBtnGhost {
  background: transparent;
}

.bbBtnGhost:hover {
  background: rgba(35, 62, 109, 0.34);
}

.bbUserUiSection {
  margin-bottom: 8px;
}

.bbUserUiSubTitle {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.bbUserUiBlurb {
  margin: 0 0 12px;
  line-height: 1.45;
}

.bbUserUiGrid {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.bbUserUiLabel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

.bbSelect {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(132, 165, 219, 0.35);
  background: rgba(35, 62, 109, 0.35);
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
}

.bbDraftInviteLinkWrap {
  margin: 0 0 10px;
}

.bbDraftInviteLink {
  display: inline;
  color: #b8d4ff;
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
  font-size: 13px;
  line-height: 1.45;
  user-select: text;
  cursor: pointer;
}

.bbDraftInviteLink:hover {
  color: #dbeaff;
}

.bbUserColorPreviewWrap {
  border-radius: 12px;
  border: 1px solid rgba(132, 165, 219, 0.28);
  background: #f4f6fa;
  padding: 10px 12px;
  margin-bottom: 10px;
  overflow-x: auto;
}

.bbUserColorPreviewSvg {
  display: block;
  width: 100%;
  min-width: 280px;
  height: 72px;
  max-height: 22vw;
}

.bbDivider {
  border: none;
  border-top: 1px solid rgba(132, 165, 219, 0.22);
  margin: 16px 0;
}

.bbRoomRow {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(129, 156, 206, 0.22);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(19, 32, 64, 0.18);
}

.bbRoomRowMeta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.bbRoomBadges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bbRoomBadge {
  border: 1px solid rgba(132, 165, 219, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--muted);
}

.bbRoomBadgeMe {
  border-color: rgba(232, 168, 32, 0.45);
  color: var(--ink);
}

.bbRoomSelectedPreview {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bbRoomColorSwatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(132, 165, 219, 0.45);
  display: inline-block;
}

.bbRoomList {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.bbRoomList li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(129, 156, 206, 0.15);
  margin: 0;
}

.bbRoomList li:last-child {
  border-bottom: none;
}

.bbRoomTitle {
  font-weight: 600;
}

.bbMuted {
  color: var(--muted);
  font-size: 12px;
}

.bbPager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.bbPagerLabel {
  color: var(--muted);
  font-size: 12px;
  min-width: 96px;
  text-align: center;
}

.bbListMeta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.bbPaneBody {
  min-height: 120px;
}

.bbHidden {
  display: none !important;
}

.bbError {
  color: var(--bad);
  font-size: 12px;
}

.bbOverlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 18, 0.72);
  backdrop-filter: blur(6px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: clamp(10px, 2vw, 20px) clamp(8px, 1.4vw, 16px);
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
}

.bbOverlayTop {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  backdrop-filter: blur(6px);
}

.bbOverlayTitle {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

.bbOverlayBody {
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
  align-self: stretch;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: rgba(19, 32, 64, 0.22);
  padding: clamp(14px, 2.2vw, 22px) clamp(12px, 2vw, 20px);
  overflow: visible;
}

.bbRulesBlock {
  max-width: min(72rem, 100%);
  margin: 0 auto;
}

/* Rules overlay: use full panel width — no narrow centered column with empty side margins */
.bbOverlay .bbRulesBlock {
  max-width: 100%;
  width: 100%;
  margin-inline: 0;
}

.bbRulesLayout {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.bbRulesChapter {
  min-width: 0;
}

.bbRulesChapter--introSplit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.46fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: start;
}

.bbRulesColAnim {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding-inline-start: clamp(0.75rem, 2.5vw, 2rem);
  border-inline-start: 1px solid rgba(135, 170, 235, 0.22);
  /* Same cap for HUD bar and board so widths match */
  --bbChapterAnimMaxW: min(86.4vmin, 432px);
}

.bbRulesChapterAnimHud,
.bbRulesChapterAnimMount {
  width: min(100%, var(--bbChapterAnimMaxW));
  margin-inline: auto;
  box-sizing: border-box;
}

.bbRulesChapterAnimHud {
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  line-height: 1.3;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: #f0f6ff;
  text-align: center;
  padding: 0.55em 0.75em;
  border-radius: 10px;
  border: 1px solid rgba(232, 168, 32, 0.45);
  background: linear-gradient(180deg, rgba(32, 48, 88, 0.95) 0%, rgba(14, 22, 44, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 4px 14px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.bbRulesChapterAnimMount {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f4f6fa;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.bbRulesChapterAnimSvgWrap {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.bbRulesChapterAnimSvg {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

@media (max-width: 900px) {
  .bbRulesChapter--introSplit {
    grid-template-columns: 1fr;
  }

  .bbRulesColAnim {
    padding-inline-start: 0;
    border-inline-start: none;
    padding-block-start: clamp(0.5rem, 2vw, 1rem);
    border-block-start: 1px solid rgba(135, 170, 235, 0.22);
    --bbChapterAnimMaxW: min(105.6vmin, 480px);
  }
}

.bbRulesToy {
  margin-top: clamp(0.25rem, 1.5vw, 0.75rem);
  padding-top: clamp(1rem, 2.5vw, 1.75rem);
  border-top: 1px solid var(--panel-border);
}

.bbRulesToyHint {
  margin: 0 0 0.65rem;
  font-size: clamp(0.9rem, 1.8vw, 1rem);
  line-height: 1.42;
  max-width: 42rem;
}

.bbRulesToyMount {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: min(92vmin, 560px);
  margin-inline: auto;
}

.bbRulesToyToolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
}

.bbRulesToyBtn {
  font-size: clamp(0.75rem, 1.5vw, 0.875rem);
  padding: 0.35rem 0.65rem;
}

.bbRulesToyCoords {
  font-size: clamp(0.8rem, 1.55vw, 0.9rem);
  min-width: min(100%, 14rem);
  flex: 1 1 auto;
}

.bbRulesToySvgWrap {
  aspect-ratio: 1 / 1;
  width: 100%;
  overflow: hidden;
  background: #f4f6fa;
}

.bbRulesToySvg {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.bbRulesToySvg.isPanning {
  cursor: grabbing;
}

.bbRulesDocRest {
  margin-top: 0;
}

.bbRulesDoc {
  color: var(--ink);
  font-size: clamp(1.125rem, 2.4vw, 1.5rem);
  line-height: 1.52;
}

.bbRulesDoc .bbMuted {
  font-size: inherit;
  line-height: inherit;
}

.bbRulesDoc h2 {
  font-size: clamp(1.35rem, 3.1vw, 1.95rem);
  font-weight: 650;
  margin: 1.35em 0 0.45em;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.bbRulesDocRest h2:first-of-type {
  margin-top: 0.15em;
}

.bbRulesDoc h2:first-of-type {
  margin-top: 0.35em;
}

.bbRulesDoc p {
  margin: 0.55em 0;
}

.bbRulesDoc ul {
  margin: 0.4em 0 0.55em 1.25em;
  padding: 0;
}

.bbRulesDoc li {
  margin: 0.35em 0;
}

.bbRulesLead {
  margin-top: 0;
}

.bbToast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 60;
  border: 1px solid rgba(232, 168, 32, 0.35);
  background: rgba(19, 32, 64, 0.74);
  backdrop-filter: blur(6px);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  max-width: min(520px, calc(100vw - 24px));
}

@media (orientation: landscape) and (min-width: 1200px) {
  .bbMain {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .bbPane {
    min-height: 520px;
  }
}
