/* Globofootball help bot — floating bubble + chat panel.
   Sits below Bootstrap modals (1040+) so terms/onboarding stay on top. */
.gf-hb {
  --hb-green: #58BA52;
  --hb-green-dark: #1a7f2e;
  --hb-green-soft: #e7f8ec;
  --hb-navy: #0b2a4a;
  --hb-text: #16181d;
  --hb-muted: #66788a;
  --hb-border: #e3e8ee;
  --hb-bg: #ffffff;
  --hb-bg-alt: #f5f7f9;
  font-family: "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--hb-text);
}

.gf-hb-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1035;
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  background: var(--hb-green);
  color: #fff;
  box-shadow: 0 8px 24px rgba(11, 42, 74, .28);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.gf-hb-fab:hover { background: #4a9944; transform: translateY(-2px); }
.gf-hb-fab:focus-visible { outline: 3px solid var(--hb-navy); outline-offset: 3px; }
.gf-hb-fab svg { width: 28px; height: 28px; }
.gf-hb-fab .gf-hb-fab-close { display: none; width: 22px; height: 22px; }
/* Only the button of the view on screen turns into the close (X) */
.gf-hb.is-open[data-tab="msgs"] .gf-hb-fab-msgs .gf-hb-fab-open,
.gf-hb.is-open[data-tab="help"] .gf-hb-fab-help .gf-hb-fab-open { display: none; }
.gf-hb.is-open[data-tab="msgs"] .gf-hb-fab-msgs .gf-hb-fab-close,
.gf-hb.is-open[data-tab="help"] .gf-hb-fab-help .gf-hb-fab-close { display: block; }

/* Messages sits left of the assistant, so the open panel covers neither */
.gf-hb-fab-msgs {
  right: 90px;
  bottom: 25px;
  width: 48px;
  height: 48px;
  background: var(--hb-navy);
}
.gf-hb-fab-msgs:hover { background: #12406f; }
.gf-hb-fab-msgs:focus-visible { outline-color: var(--hb-green); }
.gf-hb-fab-msgs svg { width: 24px; height: 24px; }
.gf-hb-fab-msgs .gf-hb-fab-close { width: 18px; height: 18px; }

.gf-hb-panel {
  position: fixed;
  right: 20px;
  bottom: 90px;
  z-index: 1035;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: min(600px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: var(--hb-bg);
  border: 1px solid var(--hb-border);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(11, 42, 74, .22);
  overflow: hidden;
  animation: gf-hb-in .18s ease-out;
}
.gf-hb-panel[hidden] { display: none; }
@keyframes gf-hb-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.gf-hb-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 14px 16px;
  background: var(--hb-navy);
  color: #fff;
}
.gf-hb-avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--hb-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.gf-hb-heading { flex: 1; min-width: 0; }
.gf-hb-title { margin: 0; font-size: 1rem; font-weight: 800; color: #fff; line-height: 1.2; }
.gf-hb-subtitle { margin: 2px 0 0; font-size: .78rem; opacity: .75; }
.gf-hb-icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  opacity: .75;
  cursor: pointer;
}
.gf-hb-icon-btn:hover, .gf-hb-icon-btn:focus-visible { opacity: 1; background: rgba(255, 255, 255, .12); }

.gf-hb-log {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  background: var(--hb-bg-alt);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overscroll-behavior: contain;
}
.gf-hb-msg {
  max-width: 88%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: .9rem;
  line-height: 1.45;
  white-space: pre-line;
  word-wrap: break-word;
}
.gf-hb-msg-bot {
  align-self: flex-start;
  background: var(--hb-bg);
  border: 1px solid var(--hb-border);
  border-bottom-left-radius: 4px;
}
.gf-hb-msg-user {
  align-self: flex-end;
  background: var(--hb-green);
  color: #fff;
  font-weight: 600;
  border-bottom-right-radius: 4px;
}
.gf-hb-msg-note {
  align-self: center;
  font-size: .76rem;
  color: var(--hb-muted);
  padding: 2px 8px;
}
.gf-hb-links {
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 92%;
}
.gf-hb-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--hb-navy);
  color: #fff !important;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none !important;
}
.gf-hb-link:hover { background: #12406f; }
.gf-hb-link::after { content: "\2197"; font-weight: 400; }

.gf-hb-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background: var(--hb-bg);
  border: 1px solid var(--hb-border);
  border-radius: 14px;
}
.gf-hb-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hb-muted);
  animation: gf-hb-dot 1s infinite ease-in-out;
}
.gf-hb-typing span:nth-child(2) { animation-delay: .15s; }
.gf-hb-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes gf-hb-dot { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

.gf-hb-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  max-height: 34%;
  overflow-y: auto;
  border-top: 1px solid var(--hb-border);
  background: var(--hb-bg);
}
.gf-hb-options:empty { display: none; }
.gf-hb-opt {
  font-family: inherit;
  border: 1.5px solid var(--hb-green);
  background: var(--hb-bg);
  color: var(--hb-green-dark);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .82rem;
  font-weight: 700;
  text-align: left;
  line-height: 1.25;
  cursor: pointer;
}
.gf-hb-opt:hover, .gf-hb-opt:focus-visible { background: var(--hb-green-soft); outline: none; }
.gf-hb-opt-nav { border-color: var(--hb-border); color: var(--hb-muted); }
.gf-hb-opt-contact { border-color: var(--hb-navy); color: var(--hb-navy); }

.gf-hb-search {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--hb-border);
  background: var(--hb-bg);
  margin: 0;
}
.gf-hb-search-input {
  font-family: inherit;
  flex: 1;
  min-width: 0;
  border: 1px solid var(--hb-border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: .88rem;
  color: var(--hb-text);
  background: var(--hb-bg-alt);
}
.gf-hb-search-input:focus { outline: none; border-color: var(--hb-green); background: #fff; }
.gf-hb-search-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--hb-green);
  color: #fff;
  cursor: pointer;
}

@media (max-width: 575.98px) {
  .gf-hb-fab { right: 14px; bottom: 14px; width: 52px; height: 52px; }
  .gf-hb-fab-msgs { right: 76px; bottom: 18px; width: 44px; height: 44px; }
  .gf-hb-panel {
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
  }
  .gf-hb.is-open .gf-hb-fab { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gf-hb-panel, .gf-hb-typing span { animation: none; }
  .gf-hb-fab { transition: none; }
}

@media print { .gf-hb { display: none; } }

/* ---------- Messages view (signed-in users) ---------- */
.gf-hb-fab { overflow: visible; }
.gf-hb-fab-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #e5484d;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
.gf-hb-fab-badge[hidden], .gf-hb-icon-btn[hidden] { display: none; }
.gf-hb-fab-msgs .gf-hb-fab-badge {
  top: -6px;
  right: -6px;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  font-size: .66rem;
  line-height: 15px;
}
/* The open Messages button shows its X: the count is already in the list */
.gf-hb.is-open[data-tab="msgs"] .gf-hb-fab-msgs .gf-hb-fab-badge { display: none; }

.gf-hb-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.gf-hb-view[hidden], .gf-hb-convs[hidden], .gf-hb-chat[hidden] { display: none; }
.gf-hb-convs, .gf-hb-chat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.gf-hb-av {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--hb-border);
  background: #fff;
  display: block;
}
.gf-hb-av img { display: block; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.gf-hb-chat-avatar { display: flex; flex-shrink: 0; }

.gf-hb-conv-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--hb-bg);
  padding: 6px 0;
}
.gf-hb-conv-list > .gf-hb-msg-note { display: block; text-align: center; padding: 28px 16px; }
.gf-hb-conv {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  font-family: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.gf-hb-conv:hover, .gf-hb-conv:focus-visible { background: var(--hb-bg-alt); outline: none; }
.gf-hb-conv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gf-hb-conv-top, .gf-hb-conv-bottom { display: flex; align-items: center; gap: 8px; }
.gf-hb-conv-name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gf-hb-conv-time { flex-shrink: 0; font-size: .72rem; color: var(--hb-muted); }
.gf-hb-conv-preview {
  flex: 1;
  min-width: 0;
  font-size: .82rem;
  color: var(--hb-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gf-hb-conv.is-unread .gf-hb-conv-preview { color: var(--hb-text); font-weight: 600; }
.gf-hb-conv.is-unread .gf-hb-conv-time { color: var(--hb-green-dark); font-weight: 700; }
.gf-hb-conv-unread {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--hb-green);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}

.gf-hb-msgs-foot {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--hb-border);
  background: var(--hb-bg);
}
.gf-hb-foot-link {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--hb-navy);
  color: var(--hb-navy) !important;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none !important;
}
.gf-hb-foot-link:hover { background: var(--hb-navy); color: #fff !important; }

.gf-hb-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--hb-border);
  background: var(--hb-bg);
}
.gf-hb-chat-head .gf-hb-av { width: 32px; height: 32px; }
.gf-hb-chat-name {
  flex: 1;
  min-width: 0;
  font-weight: 800;
  font-size: .92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gf-hb-chat-back, .gf-hb-chat-inbox {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--hb-muted) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none !important;
}
.gf-hb-chat-back:hover, .gf-hb-chat-inbox:hover { background: var(--hb-bg-alt); color: var(--hb-navy) !important; }

.gf-hb-chat-log {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px 8px;
  background: var(--hb-bg-alt);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gf-hb-day { margin-top: 6px; }
.gf-hb-pm { display: flex; flex-direction: column; gap: 4px; }
.gf-hb-msg-user.gf-hb-pm { font-weight: 400; }
.gf-hb-pm-subject { font-size: .82rem; }
.gf-hb-pm-time { align-self: flex-end; font-size: .68rem; opacity: .7; }
.gf-hb-pm-players { display: flex; flex-wrap: wrap; gap: 4px; }
.gf-hb-pm-player {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(11, 42, 74, .08);
  font-size: .74rem;
  font-weight: 700;
}
.gf-hb-msg-user .gf-hb-pm-player { background: rgba(255, 255, 255, .22); }
.gf-hb-pm-card { align-self: flex-start; }
.gf-hb-pm-error { color: #c62828; }

.gf-hb-reply {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--hb-border);
  background: var(--hb-bg);
  margin: 0;
}
.gf-hb-reply-input {
  font-family: inherit;
  flex: 1;
  min-width: 0;
  resize: none;
  max-height: 120px;
  border: 1px solid var(--hb-border);
  border-radius: 18px;
  padding: 8px 14px;
  font-size: .88rem;
  line-height: 1.35;
  color: var(--hb-text);
  background: var(--hb-bg-alt);
}
.gf-hb-reply-input:focus { outline: none; border-color: var(--hb-green); background: #fff; }
.gf-hb-reply.is-sending .gf-hb-search-btn { opacity: .6; pointer-events: none; }
