/* club-hub.html — a club's home. Only this page loads it. */

:root {
  --hq-bg: #0B0E14;
  --hq-line: rgba(255, 255, 255, 0.075);
  --hq-line-hi: rgba(58, 190, 255, 0.22);
  --hq-purple: #a68af9;
  --hq-blue: #3ABEFF;
  --hq-gold: #FBBF24;
  --hq-teal: #2DD4BF;
  --hq-orange: #fb923c;
  --hq-text: #E5E7EB;
  --hq-text-hi: #F7F9FF;
  --hq-muted: #9CA3AF;
  --hq-dim: #8B93A1;
  --hq-grad: linear-gradient(135deg, #a68af9, #3ABEFF);
  --hq-radius: 20px;
}

.hub {
  position: relative;
  min-height: 100vh;
  padding: 124px 22px 90px;
  background:
    radial-gradient(1000px 560px at 50% -14%, rgba(166, 138, 249, 0.13), transparent 70%),
    radial-gradient(760px 480px at 100% 30%, rgba(58, 190, 255, 0.07), transparent 70%),
    var(--hq-bg);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--hq-text);
}

.hub-shell {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}

.hub-loading {
  padding: 100px 0;
  text-align: center;
  color: var(--hq-muted);
  font-size: 13.5px;
}

.hub-loading i {
  color: var(--hq-blue);
  margin-right: 8px;
}

.club-crest-svg {
  display: block;
  height: auto;
}

/* ── Buttons ── */

.hub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--hq-text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.hub-btn:hover:not(:disabled) {
  border-color: var(--hq-line-hi);
  background: rgba(58, 190, 255, 0.07);
  color: var(--hq-text-hi);
  transform: translateY(-1px);
}

.hub-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.hub-btn[hidden] {
  display: none;
}

.hub-btn--primary {
  border-color: transparent;
  background: var(--hq-grad);
  color: #0B0E14;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(166, 138, 249, 0.24);
}

.hub-btn--primary:hover:not(:disabled) {
  color: #0B0E14;
  filter: brightness(1.06);
}

.hub-btn--danger {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.06);
  color: #f87171;
}

.hub-btn--danger:hover:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
}

.hub-btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--hq-muted);
  font-weight: 500;
}

.hub-btn--ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--hq-text);
}

/* ── Gate / empty ── */

.hub-gate,
.hub-empty {
  max-width: 620px;
  margin: 30px auto 0;
  text-align: center;
}

.hub-empty-crest {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.5));
}

.hub-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(166, 138, 249, 0.28);
  background: rgba(166, 138, 249, 0.09);
  color: var(--hq-purple);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hub-empty h1,
.hub-gate h1 {
  margin: 20px 0 12px;
  font-family: "Unbounded", "Montserrat", sans-serif;
  font-size: clamp(1.8rem, 4.6vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--hq-text-hi);
}

.hub-empty > p,
.hub-gate > p {
  margin: 0 auto 26px;
  max-width: 480px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--hq-muted);
}

.hub-empty-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 26px;
  text-align: left;
}

.hub-fact {
  padding: 16px 14px;
  border-radius: 14px;
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.022);
}

.hub-fact i {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--hq-purple);
}

.hub-fact b {
  display: block;
  margin-bottom: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--hq-text-hi);
}

.hub-fact span {
  display: block;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--hq-dim);
}

.hub-empty-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 340px;
  margin: 0 auto;
}

.hub-empty-actions .hub-btn {
  width: 100%;
  padding: 13px 18px;
}

/* The join row is a form, not a stacked button — the submit must not eat the
   input's width. */
.hub-empty-actions .hub-join-form .hub-btn {
  width: auto;
  flex: 0 0 auto;
  padding: 0 18px;
}

.hub-join-form {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.hub-join-form[hidden] {
  display: none;
}

.hub-join-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--hq-text-hi);
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  outline: none;
}

.hub-join-form input:focus {
  border-color: var(--hq-line-hi);
}

.hub-error {
  min-height: 18px;
  margin: 10px 0 0;
  font-size: 12px;
  color: #f87171;
}

.hub-error:empty {
  display: none;
}

/* ── Hero ── */

.hub-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 32px 34px;
  border-radius: 24px;
  border: 1px solid rgba(166, 138, 249, 0.16);
  background:
    radial-gradient(560px 300px at 8% 0%, rgba(166, 138, 249, 0.16), transparent 68%),
    radial-gradient(520px 320px at 96% 100%, rgba(58, 190, 255, 0.10), transparent 70%),
    linear-gradient(150deg, rgba(24, 30, 42, 0.96), rgba(12, 16, 23, 0.97));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.hub-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #a68af9, #3ABEFF, transparent);
  opacity: 0.7;
}

.hub-crest {
  flex-shrink: 0;
  filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.55));
}

.hub-hero-body {
  flex: 1;
  min-width: 0;
}

.hub-hero h1 {
  margin: 14px 0 10px;
  font-family: "Unbounded", "Montserrat", sans-serif;
  font-size: clamp(1.55rem, 3.6vw, 2.25rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--hq-text-hi);
  overflow-wrap: anywhere;
}

.hub-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 12.5px;
  color: var(--hq-muted);
}

.hub-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hub-meta i {
  font-size: 11px;
  color: var(--hq-dim);
}

.hub-meta b {
  color: var(--hq-text);
  font-weight: 600;
}

.hub-role-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hub-role-chip i {
  font-size: 9px;
}

.hub-role-chip--founder {
  border: 1px solid rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
  color: var(--hq-gold);
}

.hub-role-chip--officer {
  border: 1px solid rgba(166, 138, 249, 0.32);
  background: rgba(166, 138, 249, 0.1);
  color: var(--hq-purple);
}

.hub-role-chip--member {
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--hq-muted);
}

.hub-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Prestige ── */

.hub-prestige {
  margin-top: 18px;
  padding: 22px 26px;
  border-radius: var(--hq-radius);
  border: 1px solid var(--hq-line);
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.055), rgba(166, 138, 249, 0.03)),
    rgba(255, 255, 255, 0.02);
}

.hub-prestige-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.hub-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hq-dim);
  margin-bottom: 6px;
}

.hub-prestige-tier {
  font-family: "Unbounded", "Montserrat", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hq-gold);
}

.hub-prestige-total {
  font-size: 12.5px;
  color: var(--hq-muted);
}

.hub-prestige-total b {
  font-family: "Unbounded", "Montserrat", sans-serif;
  font-size: 1.15rem;
  color: var(--hq-text-hi);
  font-weight: 700;
  margin-right: 4px;
}

.hub-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.hub-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #FBBF24, #fb923c, #a68af9);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.35);
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hub-prestige-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--hq-dim);
}

.hub-prestige-foot b {
  color: var(--hq-muted);
  font-weight: 600;
}

/* ── Prestige tier track ── */

.hub-tier-track {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  width: 100%;
}

.hub-tier-seg {
  flex: 1;
  min-width: 0;
  padding-top: 5px;
  border-top: 2px solid rgba(255, 255, 255, 0.09);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  /* Dimmest tier label still has to be readable at 9.5px. */
  color: #6B7280;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.hub-tier-seg.is-passed {
  border-top-color: rgba(251, 191, 36, 0.35);
  color: var(--hq-dim);
}

.hub-tier-seg.is-current {
  border-top-color: var(--hq-gold);
  color: var(--hq-gold);
}

/* ── Sections ── */

.hub-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.hub-section-head h2 {
  margin: 0;
  font-family: "Unbounded", "Montserrat", sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--hq-text-hi);
}

.hub-section-head span {
  font-size: 11.5px;
  color: var(--hq-dim);
  white-space: nowrap;
}

.hub-milestones {
  margin-top: 18px;
  padding: 24px 26px;
  border-radius: var(--hq-radius);
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.02);
  /* The challenges card is usually taller; centring the rail keeps the spare
     height balanced instead of pooling at the bottom of the card. */
  display: flex;
  flex-direction: column;
}

/* Milestones and challenges sit side by side above the fold; they stay two
   distinct cards (clearer separation than one merged panel). */
.hub-progress-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  /* Stretch, not start: if the two cards differ in height the shorter one
     would leave a dead gap above the next section. Matching heights keep the
     row flush and the leftover space reads as padding inside the card. */
  align-items: stretch;
}

.hub-progress-grid > .hub-milestones,
.hub-progress-grid > .hub-challenges {
  margin-top: 0;
}

.hub-rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  list-style: none;
  /* auto top/bottom centres the rail inside a stretched milestones card. */
  margin: auto 0;
  padding: 0;
}

.hub-rail::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 17px;
  height: 1px;
  background: rgba(255, 255, 255, 0.09);
}

.hub-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-align: center;
}

.hub-node-dot {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--hq-line);
  background: #0F141D;
  color: var(--hq-dim);
  font-size: 11px;
  font-weight: 700;
  transition: border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.hub-node-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--hq-dim);
  white-space: nowrap;
}

.hub-node-count {
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: #6B7280;
}

.hub-node.is-unlocked .hub-node-dot {
  border-color: rgba(251, 191, 36, 0.55);
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.22), rgba(251, 146, 60, 0.1));
  color: var(--hq-gold);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.18);
}

.hub-node.is-unlocked .hub-node-label {
  color: var(--hq-text);
}

.hub-node.is-unlocked .hub-node-count {
  color: rgba(251, 191, 36, 0.55);
}

.hub-node.is-next .hub-node-dot {
  border-color: rgba(166, 138, 249, 0.55);
  background: rgba(166, 138, 249, 0.12);
  color: var(--hq-purple);
  box-shadow: 0 0 0 4px rgba(166, 138, 249, 0.08);
}

/* ── Challenges ── */

.hub-challenges {
  margin-top: 18px;
  padding: 24px 26px;
  border-radius: var(--hq-radius);
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.02);
}

.hub-challenges-grid {
  display: grid;
  /* Two-up: four full-width cards made this panel ~3x the height of the
     milestone card and left a dead band above the feed. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.hub-challenge-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.hub-challenge-card.is-completed {
  border-color: rgba(45, 212, 191, 0.4);
  background: rgba(45, 212, 191, 0.08);
}

.hub-challenge-card.is-completed .hub-challenge-icon {
  color: var(--hq-teal);
}

.hub-challenge-card.is-completed .hub-challenge-label {
  color: var(--hq-text);
}

.hub-challenge-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(166, 138, 249, 0.1);
  color: var(--hq-purple);
  font-size: 12px;
  flex-shrink: 0;
}

.hub-challenge-body {
  flex: 1;
  min-width: 0;
}

.hub-challenge-label {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--hq-muted);
}

.hub-challenge-meter {
  height: 4px;
  margin: 7px 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.hub-challenge-meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #a68af9, #3ABEFF);
  transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hub-challenge-card.is-completed .hub-challenge-meter span {
  background: linear-gradient(90deg, #2DD4BF, #34D399);
}

.hub-challenge-meta {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--hq-dim);
  font-variant-numeric: tabular-nums;
}

.hub-challenge-card.is-completed .hub-challenge-meta {
  color: var(--hq-teal);
}

/* ── Officer Controls ── */

.hub-role-select {
  flex: 0 0 92px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--hq-text);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.hub-role-select:hover {
  border-color: var(--hq-line-hi);
  background: rgba(255, 255, 255, 0.08);
}

.hub-role-select:focus {
  outline: none;
  border-color: var(--hq-blue);
  box-shadow: 0 0 0 2px rgba(58, 190, 255, 0.2);
}

.hub-remove-btn {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--hq-muted);
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-remove-btn:hover {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
  color: #EF4444;
}

.hub-remove-btn:active {
  transform: scale(0.95);
}

.hub-btn:focus-visible,
.hub-role-select:focus-visible,
.hub-remove-btn:focus-visible {
  outline: 2px solid rgba(58, 190, 255, 0.6);
  outline-offset: 2px;
}

/* ── Onboarding nudge ── */

.hub-nudge {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(166, 138, 249, 0.24);
  background: linear-gradient(135deg, rgba(166, 138, 249, 0.09), rgba(58, 190, 255, 0.05));
}

.hub-nudge[hidden] {
  display: none;
}

.hub-nudge > i {
  font-size: 15px;
  color: var(--hq-purple);
  flex-shrink: 0;
}

.hub-nudge-body {
  flex: 1;
  min-width: 0;
}

.hub-nudge-body b {
  display: block;
  font-size: 13px;
  color: var(--hq-text-hi);
}

.hub-nudge-body span {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--hq-muted);
}

.hub-nudge .hub-btn {
  flex: 0 0 auto;
}

/* ── Columns ── */

.hub-columns {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.hub-panel {
  padding: 24px 24px 22px;
  border-radius: var(--hq-radius);
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.02);
}

.hub-panel > p {
  margin: 0 0 16px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--hq-muted);
}

.hub-link {
  display: flex;
  align-items: center;
  border-radius: 11px;
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.hub-link input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border: none;
  background: transparent;
  color: var(--hq-blue);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  outline: none;
}

.hub-link button {
  flex-shrink: 0;
  padding: 11px 14px;
  border: none;
  border-left: 1px solid var(--hq-line);
  background: rgba(58, 190, 255, 0.07);
  color: var(--hq-blue);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.hub-link button:hover {
  background: rgba(58, 190, 255, 0.14);
  color: var(--hq-text-hi);
}

.hub-recruit-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.hub-recruit-actions .hub-btn {
  flex: 1;
  padding: 10px 12px;
  font-size: 12px;
}

.hub-code-note {
  margin: 10px 0 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hq-dim);
}

.hub-code-note b {
  margin-left: 6px;
  font-family: "Unbounded", "Montserrat", sans-serif;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--hq-blue);
}

.hub-qr {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.hub-qr:empty {
  display: none;
}

.hub-qr .qr-frame {
  padding: 9px;
  border-radius: 12px;
  background: #F7F9FF;
  line-height: 0;
}

.hub-qr svg {
  width: 118px;
  height: 118px;
  display: block;
}

.hub-qr-note {
  margin: 8px 0 0;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hq-dim);
}

.hub-paused {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.24);
  background: rgba(251, 191, 36, 0.06);
  color: var(--hq-gold);
  font-size: 11.5px;
  line-height: 1.5;
}

.hub-paused:empty,
.hub-paused[hidden] {
  display: none;
}

/* ── Member wall ── */

.hub-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 10px;
}

.member-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.022);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  animation: member-in 0.4s ease both;
}

@keyframes member-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.member-card:hover {
  border-color: rgba(58, 190, 255, 0.24);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.member-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--hq-grad);
  color: #0B0E14;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.member-avatar.is-founder {
  background: linear-gradient(135deg, #FBBF24, #fb923c);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.18), 0 6px 18px rgba(251, 191, 36, 0.22);
}

.member-crown {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #0B0E14;
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: var(--hq-gold);
  font-size: 8px;
}

.member-body {
  flex: 1;
  min-width: 0;
}

.member-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hq-text-hi);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.member-tag {
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--hq-line);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hq-dim);
  white-space: nowrap;
}

.member-tag--founder {
  border-color: rgba(251, 191, 36, 0.32);
  background: rgba(251, 191, 36, 0.08);
  color: var(--hq-gold);
}

.member-tag--founding {
  border-color: rgba(166, 138, 249, 0.32);
  background: rgba(166, 138, 249, 0.08);
  color: var(--hq-purple);
}

.member-tag--new {
  border-color: rgba(45, 212, 191, 0.32);
  background: rgba(45, 212, 191, 0.08);
  color: var(--hq-teal);
}

.member-level {
  flex-shrink: 0;
  text-align: right;
}

.member-level b {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--hq-text);
  font-variant-numeric: tabular-nums;
}

.member-level span {
  display: block;
  margin-top: 2px;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hq-dim);
}

.hub-roster-empty {
  padding: 26px 0;
  text-align: center;
  color: var(--hq-muted);
  font-size: 12.5px;
}

/* ── Settings drawer ── */

.hub-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 2400;
  background: rgba(5, 8, 12, 0.72);
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.hub-drawer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.hub-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2401;
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  background: #0D1118;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5);
  transform: translateX(102%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
}

.hub-drawer.is-open {
  transform: translateX(0);
}

.hub-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--hq-line);
}

.hub-drawer-head h2 {
  margin: 0;
  font-family: "Unbounded", "Montserrat", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--hq-text-hi);
}

.hub-drawer-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--hq-muted);
  cursor: pointer;
}

.hub-drawer-close:hover {
  color: var(--hq-text-hi);
  border-color: var(--hq-line-hi);
}

.hub-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 40px;
}

.hub-set {
  padding: 18px 0;
  border-top: 1px solid var(--hq-line);
}

.hub-set:first-child {
  border-top: none;
  padding-top: 0;
}

.hub-set-label {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--hq-dim);
}

.hub-set input[type="text"] {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--hq-text-hi);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.hub-set input[type="text"]:focus {
  border-color: var(--hq-line-hi);
}

.hub-set-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.hub-set-row .hub-btn {
  padding: 9px 13px;
  font-size: 11.5px;
}

.hub-set .hub-link {
  margin-bottom: 4px;
}

.hub-set-msg {
  min-height: 16px;
  margin: 8px 0 0;
  font-size: 11.5px;
  color: #f87171;
}

.hub-set-msg:empty {
  display: none;
}

.hub-emblem-row {
  display: flex;
  gap: 9px;
  margin-top: 4px;
}

.hub-emblem {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.hub-emblem:hover {
  transform: scale(1.06);
}

.hub-emblem.is-selected {
  border-color: #F7F9FF;
  box-shadow: 0 0 0 3px rgba(166, 138, 249, 0.25);
}

.hub-set-roster {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 4px;
}

.hub-set-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.02);
}

.hub-set-member .member-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 10.5px;
}

.hub-set-member span {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--hq-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-set-member button {
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.26);
  background: rgba(248, 113, 113, 0.06);
  color: #f87171;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.hub-set-member button:hover {
  background: rgba(248, 113, 113, 0.12);
}

.hub-danger {
  border: 1px solid rgba(248, 113, 113, 0.14);
  background: rgba(248, 113, 113, 0.03);
  border-radius: 14px;
  padding: 16px;
  margin-top: 20px;
}

.hub-danger .hub-set-label {
  color: #b45b5b;
}

/* ── Toast ── */

.hub-toasts {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 2600;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.hub-toast {
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid rgba(58, 190, 255, 0.28);
  background: rgba(13, 17, 24, 0.96);
  color: var(--hq-text-hi);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.28s ease both;
}

.hub-toast.is-error {
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.hub-toast.is-out {
  animation: toast-out 0.25s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

/* ── Founding banner ── */

.hub-founding {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid rgba(251, 191, 36, 0.24);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.09), rgba(166, 138, 249, 0.05));
  animation: rite-in 0.5s ease both;
}

.hub-founding[hidden] {
  display: none;
}

.hub-founding i {
  font-size: 18px;
  color: var(--hq-gold);
}

.hub-founding b {
  display: block;
  font-size: 13px;
  color: var(--hq-text-hi);
}

.hub-founding span {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--hq-muted);
}

@keyframes rite-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */

@media (max-width: 900px) {
  .hub-hero {
    flex-wrap: wrap;
    gap: 22px;
  }

  .hub-hero-actions {
    flex-direction: row;
    width: 100%;
    flex-wrap: wrap;
  }

  .hub-hero-actions .hub-btn {
    flex: 1;
  }

  .hub-progress-grid {
    grid-template-columns: 1fr;
  }

  .hub-columns {
    grid-template-columns: 1fr;
  }
}

/* Between 901 and 1100px the two progress cards are half-width, so the
   six-node rail no longer fits on one row. */
@media (max-width: 1100px) and (min-width: 901px) {
  .hub-rail {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px 6px;
  }

  .hub-rail::before {
    display: none;
  }
}

@media (max-width: 640px) {
  .hub {
    padding: 112px 16px 70px;
  }

  .hub-hero {
    padding: 24px 20px;
  }

  .hub-crest svg {
    width: 104px !important;
    height: auto !important;
  }

  .hub-prestige,
  .hub-milestones,
  .hub-challenges,
  .hub-panel {
    padding: 20px 18px;
  }

  .hub-rail {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px 6px;
  }

  .hub-challenges-grid {
    grid-template-columns: 1fr;
  }

  .hub-nudge {
    flex-wrap: wrap;
  }

  .hub-nudge .hub-btn {
    width: 100%;
  }

  .hub-rail::before {
    display: none;
  }

  .hub-empty-facts {
    grid-template-columns: 1fr;
  }

  .hub-drawer {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .member-card,
  .hub-founding,
  .hub-toast {
    animation: none !important;
  }

  .hub-bar span,
  .hub-drawer,
  .member-card,
  .hub-btn,
  .hub-challenge-meter span {
    transition: none !important;
  }
}

/* ── Share chips ── */

.hub-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.hub-share-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--hq-muted);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.hub-share-chip:hover:not(:disabled) {
  border-color: var(--hq-line-hi);
  background: rgba(58, 190, 255, 0.08);
  color: var(--hq-text-hi);
}

.hub-share-chip:disabled {
  opacity: 0.55;
  cursor: default;
}

.hub-share-chip i {
  font-size: 10.5px;
}

/* ── Club feed ── */

.hub-feed-panel {
  margin-top: 18px;
  padding: 24px 26px;
  border-radius: var(--hq-radius);
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.02);
}

.hub-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hub-feed-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.hub-feed-item:first-child {
  border-top: none;
  padding-top: 2px;
}

.hub-feed-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--hq-line);
  background: rgba(58, 190, 255, 0.07);
  color: var(--hq-blue);
  font-size: 9.5px;
}

.hub-feed-item--founded .hub-feed-icon {
  color: var(--hq-gold);
  background: rgba(251, 191, 36, 0.09);
}

.hub-feed-item--milestone .hub-feed-icon {
  color: var(--hq-purple);
  background: rgba(166, 138, 249, 0.11);
}

.hub-feed-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.hub-feed-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--hq-muted);
}

.hub-feed-text b {
  color: var(--hq-text-hi);
  font-weight: 600;
}

.hub-feed-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.11);
  color: var(--hq-gold);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.hub-feed-time {
  flex-shrink: 0;
  font-size: 10.5px;
  color: var(--hq-dim);
  white-space: nowrap;
}

.hub-feed-empty {
  padding: 10px 0 2px;
  font-size: 12px;
  color: var(--hq-dim);
}

/* ── Contribution board ── */

.hub-contrib {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 16px;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.022);
}

.hub-contrib-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hq-dim);
}

.hub-contrib-total {
  font-family: "Unbounded", "Montserrat", sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--hq-blue);
}

.hub-contrib-row {
  display: grid;
  grid-template-columns: minmax(74px, 30%) 1fr 38px;
  align-items: center;
  gap: 10px;
}

.hub-contrib-name {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--hq-text);
}

.hub-contrib-row.is-me .hub-contrib-name {
  color: var(--hq-text-hi);
  font-weight: 600;
}

.hub-contrib-crown {
  flex-shrink: 0;
  font-size: 9px;
  color: var(--hq-gold);
}

.hub-contrib-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.hub-contrib-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--hq-grad);
}

.hub-contrib-value {
  text-align: right;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--hq-dim);
}

/* ── Public toggle ── */

.hub-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--hq-muted);
  cursor: pointer;
}

.hub-toggle input {
  appearance: none;
  flex-shrink: 0;
  width: 34px;
  height: 19px;
  margin: 1px 0 0;
  border-radius: 999px;
  border: 1px solid var(--hq-line);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  position: relative;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.hub-toggle input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--hq-muted);
  transition: transform 0.18s ease, background 0.18s ease;
}

.hub-toggle input:checked {
  background: rgba(58, 190, 255, 0.22);
  border-color: var(--hq-line-hi);
}

.hub-toggle input:checked::after {
  transform: translateX(15px);
  background: var(--hq-blue);
}

.hub-toggle input:disabled {
  opacity: 0.5;
  cursor: default;
}

.hub-set.is-readonly .hub-toggle {
  cursor: default;
}

@media (max-width: 640px) {
  .hub-hero h1 {
    font-size: 1.25rem;
    overflow-wrap: break-word;
  }

  .hub-feed-panel {
    padding: 20px 18px;
  }

  .hub-feed-body {
    display: block;
  }

  .hub-feed-time {
    display: block;
    margin-top: 2px;
  }

  .hub-contrib-row {
    grid-template-columns: minmax(64px, 34%) 1fr 34px;
    gap: 8px;
  }
}
