/* Keep the Hub's main task in one compact, predictable purchase panel. */
body.hub-mode #hub-shell:not(.hub-draws-page-app) .hub-donation-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px !important;
}

#hub-shell .hub-purchase-heading {
  margin: 0;
  color: inherit;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}

#hub-shell .hub-donation-draw { margin: 0; }
#hub-shell .hub-donation-draw-trigger > span small { display: none; }
#hub-shell .hub-donation-draw-trigger > span { grid-column: 1; }
#hub-shell .hub-donation-draw-trigger > strong { grid-column: 1; }
#hub-shell .hub-donation-draw-trigger > small { grid-column: 1; }
#hub-shell .hub-donation-draw-trigger > .hub-next-draw-chevron { grid-column: 2; grid-row: 1 / span 3; }

#hub-shell .hub-ticket-sales {
  min-height: 0;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #31577f;
  border-radius: 9px;
  background: #102846;
  box-shadow: none;
}
#hub-shell .hub-ticket-sales-icon { width: 30px; height: 30px; border-radius: 8px; font-size: 16px; }
#hub-shell .hub-ticket-sales-copy { gap: 1px; }
#hub-shell .hub-ticket-sales-copy small { font-size: 10px; }
#hub-shell .hub-ticket-sales-copy strong { font-size: clamp(16px, 2vw, 21px); line-height: 1.2; }

/* Keep the match timer inside the purchase panel beside its match details. */
#hub-shell .hub-donation-card > .hub-purchase-countdown-card {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label timer" "hint timer";
  align-items: center;
  justify-items: start;
  gap: 2px 8px;
  width: 100%;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 8px 10px !important;
  border: 1px solid #31577f !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #17365a, #0b1c34) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05) !important;
}
#hub-shell .hub-purchase-countdown-card > .hub-live-label { grid-area: label; font-size: 11px; letter-spacing: .04em; }
#hub-shell .hub-purchase-countdown-card > .hub-countdown { grid-area: timer; gap: 5px; margin: 0; font-size: clamp(25px, 7vw, 34px) !important; letter-spacing: 0; }
#hub-shell .hub-purchase-countdown-card > .hub-countdown span { min-width: 1.1em; padding: 3px 6px !important; border-radius: 7px !important; }
#hub-shell .hub-purchase-countdown-card > small { grid-area: hint; font-size: 10px !important; line-height: 1.2; }
#hub-shell .hub-purchase-countdown-card:has(.hub-ball-animation) { grid-template-areas: "balls balls" "label timer" "hint timer"; }
#hub-shell .hub-purchase-countdown-card > .hub-ball-animation { grid-area: balls; min-height: 34px; margin: 0; gap: 7px; justify-content: flex-start; }
#hub-shell .hub-purchase-countdown-card .hub-ball-trail { gap: 4px; }
#hub-shell .hub-purchase-countdown-card .hub-ball-trail .bingo-sphere { width: 26px; height: 26px; }
#hub-shell .hub-purchase-countdown-card .hub-live-ball { width: 36px; height: 36px; }
#hub-shell .hub-purchase-countdown-card .hub-ball-count { font-size: 10px; }

#hub-shell .hub-series-choice-hint {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: inherit;
}
#hub-shell .hub-series-choice-hint strong { font-size: 13px; font-weight: 800; }
#hub-shell .hub-series-choice-hint small { flex: 0 0 auto; color: #9eb4ce; font-size: 12px; font-weight: 700; }

#hub-shell .hub-amounts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
#hub-shell .hub-amount-button {
  min-height: 40px;
  border: 1px solid #345d89;
  border-radius: 8px;
  background: #142d4c;
  color: #eaf3ff;
  font-size: 16px;
}
#hub-shell .hub-amount-button:hover,
#hub-shell .hub-amount-button.is-selected { border-color: #53a8ff; background: #1d64b7; color: #fff; }

#hub-shell .hub-donation-row:has(.hub-sequence-preview) {
  grid-template-columns: 48px minmax(0, 1fr) 48px !important;
  gap: 8px;
  margin: 0;
}
#hub-shell .hub-donation-row:has(.hub-sequence-preview) > button {
  min-height: 46px;
  border: 1px solid #357fd0;
  border-radius: 8px;
  background: #1f68c5;
  color: #fff;
  font-size: 23px;
  touch-action: manipulation;
}
#hub-shell .hub-sequence-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 46px;
  padding: 5px 11px;
  border: 1px solid #31577f;
  border-radius: 8px;
  background: #0d2039;
}
#hub-shell .hub-sequence-preview small { color: #a9c4e2; font-size: 12px; line-height: 1.2; }
#hub-shell .hub-sequence-preview output {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffe17b;
  font-size: clamp(18px, 2.4vw, 23px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 700px) {
  #hub-shell .hub-donation-card { gap: 8px; padding: 10px !important; }
  #hub-shell .hub-purchase-heading { font-size: 18px; }
  #hub-shell .hub-donation-draw { padding: 9px 10px; }
  #hub-shell .hub-series-choice-hint { align-items: flex-start; flex-direction: column; gap: 2px; }
  #hub-shell .hub-series-choice-hint strong { font-size: 14px; }
  #hub-shell .hub-series-choice-hint small { font-size: 12px; }
  #hub-shell .hub-amounts { gap: 6px; }
  #hub-shell .hub-amount-button { min-height: 42px !important; font-size: 17px !important; }
  #hub-shell .hub-donation-row:has(.hub-sequence-preview) { grid-template-columns: 46px minmax(0, 1fr) 46px !important; gap: 6px; }
  #hub-shell .hub-sequence-preview { padding: 5px 8px; }
  #hub-shell .hub-sequence-preview small { font-size: 11px; }
  #hub-shell .hub-sequence-preview output { font-size: 19px; }
  #hub-shell .hub-ticket-button { min-height: 54px; }
  #hub-shell .hub-donation-card > .hub-purchase-countdown-card { padding: 7px 9px !important; }
  #hub-shell .hub-purchase-countdown-card > .hub-countdown { font-size: clamp(26px, 8vw, 34px) !important; }
  #hub-shell:has(.hub-prize-dock) .hub-prizes { display: none !important; }
}

/* Mobile users should reach the purchase controls before secondary Hub content. */
@media (max-width: 720px) {
  html body.hub-mode #hub-shell .hub-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }
  html body.hub-mode #hub-shell .hub-layout > .hub-main-column,
  html body.hub-mode #hub-shell .hub-layout > .hub-side-column {
    display: contents !important;
  }
  html body.hub-mode #hub-shell .hub-layout .hub-donation-card { order: -100 !important; }
  html body.hub-mode #hub-shell .hub-layout .hub-live-round { order: -80 !important; }
  html body.hub-mode #hub-shell .hub-layout .hub-promo,
  html body.hub-mode #hub-shell .hub-layout .hub-history-card { display: none !important; }
  html body.hub-mode #hub-shell .hub-layout .hub-extra-draw { order: 10 !important; }
}
