/* Header & Navigation: Desktop 3-Pill Shell + Mobile H5 Fixed Bottom Bar */
.site-header-wrap {
  position: sticky;
  top: 0;
  z-index: 400;
  padding: 12px 18px 6px;
}

.site-header {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Pill 1: Brand */
.brand-pill {
  height: 50px;
  padding: 0 16px 0 8px;
  border-radius: 999px;
  background: var(--g-solid);
  backdrop-filter: var(--g-blur);
  -webkit-backdrop-filter: var(--g-blur);
  border: 1px solid var(--g-edge);
  box-shadow: var(--g-lift);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* Pill 2: Center Nav */
.nav {
  height: 50px;
  padding: 5px 6px;
  border-radius: 999px;
  background: var(--g-solid);
  backdrop-filter: var(--g-blur);
  -webkit-backdrop-filter: var(--g-blur);
  border: 1px solid var(--g-edge);
  box-shadow: var(--g-lift);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.nav-item {
  position: relative;
}

.nav-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-btn:hover,
.nav-item.is-open .nav-btn,
.nav-item.is-active .nav-btn {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(20, 24, 55, 0.08);
}

.nav-micon {
  display: none;
}

.nav-caret {
  width: 11px;
  height: 11px;
  opacity: 0.55;
  transition: transform 0.18s ease;
}

.nav-item.is-open .nav-caret {
  transform: rotate(180deg);
}

.nav-earn-badge {
  background: #e8337f;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.4;
}

/* Inline ticker (>=1360px) */
.feed2 {
  display: none;
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: var(--g-blur);
  border: 1px solid var(--g-edge);
  box-shadow: var(--g-lift);
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 12.5px;
}

/* Pill 3: Right Utility */
.util-pill {
  margin-left: auto;
  height: 50px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--g-solid);
  backdrop-filter: var(--g-blur);
  -webkit-backdrop-filter: var(--g-blur);
  border: 1px solid var(--g-edge);
  box-shadow: var(--g-lift);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.coin-btn {
  height: 36px;
  padding: 0 10px 0 6px;
  border-radius: 999px;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
}
.coin-btn:hover {
  background: rgba(255, 255, 255, 0.85);
}
.coin-btn img {
  width: 24px;
  height: 24px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.9);
}

.acct-btn {
  position: relative;
  height: 36px;
  min-width: 36px;
  padding: 0 8px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.acct-btn:hover {
  background: rgba(255, 255, 255, 0.9);
}
.acct-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10a36b;
}

/* Mega Dropdown (Desktop) */
.nav-mega {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  width: 340px;
  background: rgba(252, 252, 255, 0.95);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 22px 60px rgba(20, 26, 55, 0.18);
  z-index: 450;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.2s var(--g-spring);
}

.nav-mega.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.mega-head {
  font-size: 12px;
  color: var(--faint);
  font-weight: 600;
  padding: 2px 8px 8px;
}

.mega-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  transition: background 0.15s ease;
}
.mega-link:hover {
  background: rgba(109, 91, 255, 0.08);
}

.mega-ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.mega-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.mega-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.35;
}

/* Account Popover */
.acct-pop {
  position: fixed;
  top: 70px;
  right: 22px;
  width: 280px;
  background: rgba(252, 252, 255, 0.97);
  backdrop-filter: blur(26px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 22px 54px rgba(15, 22, 48, 0.18);
  z-index: 460;
  display: none;
}
.acct-pop.is-open {
  display: block;
}

/* Full-width Feed Strip (<=1359px) */
.feed-strip-wrap {
  max-width: 1180px;
  margin: 6px auto 0;
}

.feed-strip {
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 16px rgba(30, 38, 70, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  overflow: hidden;
  white-space: nowrap;
}

.feed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(232, 51, 127, 0.16);
}
.feed-dot[data-t="steal"] { background: #e8337f; box-shadow: 0 0 0 3px rgba(232, 51, 127, 0.18); }
.feed-dot[data-t="harvest"] { background: #10a36b; box-shadow: 0 0 0 3px rgba(16, 163, 107, 0.18); }
.feed-dot[data-t="claim"] { background: #f08a00; box-shadow: 0 0 0 3px rgba(240, 138, 0, 0.18); }
.feed-dot[data-t="recharge"] { background: #10a36b; box-shadow: 0 0 0 3px rgba(16, 163, 107, 0.18); }
.feed-dot[data-t="envcheck"] { background: #1d8fe0; box-shadow: 0 0 0 3px rgba(29, 143, 224, 0.18); }
.feed-dot[data-t="coin"] { background: #e0a100; box-shadow: 0 0 0 3px rgba(224, 161, 0, 0.18); }
.feed-dot[data-t="lottery"] { background: #6d5bff; box-shadow: 0 0 0 3px rgba(109, 91, 255, 0.18); }
.feed-dot[data-t="invite"] { background: #a24cf0; box-shadow: 0 0 0 3px rgba(162, 76, 240, 0.18); }
.feed-dot[data-t="download"] { background: #0ea59a; box-shadow: 0 0 0 3px rgba(14, 165, 154, 0.18); }
.feed-dot[data-t="api"] { background: #f0532b; box-shadow: 0 0 0 3px rgba(240, 83, 43, 0.18); }

.feed-actor {
  font-weight: 700;
  color: var(--ink);
}
.feed-action {
  color: #e8337f;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-dot[data-t="harvest"] ~ .feed-action,
.feed-dot[data-t="recharge"] ~ .feed-action { color: #0c8a59; }
.feed-dot[data-t="claim"] ~ .feed-action { color: #c76d00; }
.feed-dot[data-t="lottery"] ~ .feed-action { color: #5b48e8; }
.feed-time {
  color: var(--faint);
  font-size: 11.5px;
  flex-shrink: 0;
}

.sheet-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 42, 0.25);
  z-index: 440;
}
.sheet-scrim.is-open {
  display: block;
}

/* >=1360px wide header */
@media (min-width: 1360px) {
  .site-header,
  .page-wrap {
    max-width: 1320px;
  }
  .feed2 {
    display: flex;
  }
  .feed-strip-wrap {
    display: none;
  }
}

/* <=860px Mobile H5 Shell */
@media (max-width: 860px) {
  .site-header-wrap {
    padding: 10px 12px 4px;
  }
  .brand-pill {
    width: 46px;
    height: 46px;
    padding: 0;
    justify-content: center;
  }
  .brand-copy {
    display: none;
  }
  .util-pill {
    height: 46px;
    padding: 4px 6px;
  }

  /* Detach .nav to fixed bottom bar */
  .nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    height: 58px;
    padding: 4px 6px;
    background: rgba(250, 250, 253, 0.95);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 22px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    z-index: 480;
    box-shadow: 0 10px 34px rgba(15, 20, 45, 0.16), inset 0 1px 0 #fff;
  }

  .nav-btn {
    width: 100%;
    height: 50px;
    padding: 4px 2px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    font-size: 10.5px;
    font-weight: 600;
    border-radius: 16px;
  }
  .nav-micon {
    display: inline-flex;
    width: 21px;
    height: 21px;
    align-items: center;
    justify-content: center;
  }
  .nav-caret,
  .nav-earn-badge {
    display: none;
  }

  /* Bottom Sheet .nav-mega */
  .nav-mega {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: auto;
    transform: translateY(14px);
    max-height: 68vh;
    overflow-y: auto;
    border-radius: 24px;
    z-index: 490;
  }
  .nav-mega.is-open {
    transform: translateY(0);
  }

  .feed-strip {
    justify-content: flex-start;
    padding: 0 12px;
    font-size: 12px;
  }
}

/* Legacy flat 2-row header for /env-check/ */
.legacy-header {
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(20, 20, 40, 0.08);
  padding: 10px 18px;
}
.legacy-top {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.legacy-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.legacy-link {
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
}
.legacy-link.is-active {
  background: rgba(109, 91, 255, 0.12);
  color: var(--c-home);
}

/* Minimal 3-link header for /skills/featured/* */
.min-header {
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 18px 14px;
  border-bottom: 1px solid rgba(20, 20, 40, 0.1);
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  font-weight: 600;
  color: #3452c7;
}
.min-header a:hover {
  text-decoration: underline;
}
