/* V99 — Invitation Bonus overlay (#/main/InvitationBonus*) — page-scoped */

html.co-ib-open,
html.co-ib-open body {
  overflow: hidden;
  background: #1a201e !important;
  min-height: 100%;
  min-height: 100dvh;
}

/* Only reserve tabbar space when the bar is actually mounted. */
html.co-ib-open:has(.tabbar__container) .co-ib {
  height: calc(100% - 1.72rem);
  height: calc(100dvh - 1.72rem - env(safe-area-inset-bottom, 0px));
  bottom: auto;
}

html.co-ib-open #app {
  visibility: hidden !important;
  z-index: 120 !important;
  pointer-events: none !important;
}
html.co-ib-open .tabbar__container,
html.co-ib-open #app .tabbar__container {
  visibility: visible !important;
  z-index: 121 !important;
  overflow: visible !important;
  pointer-events: auto !important;
}
html.co-ib-open .tabbar__container-item,
html.co-ib-open .tabbar__container .turntableBg,
html.co-ib-open .tabbar__container .v83-spin-wrap,
html.co-ib-open .tabbar__container .v83-spin-disc {
  overflow: visible !important;
}
html.co-ib-open .tabbar__container-item:nth-of-type(3),
html.co-ib-open .tabbar__container [data-v83-key="turntable"] {
  z-index: 122 !important;
}

.co-ib {
  --co-bg: #1a201e;
  --co-header: #27312f;
  --co-card: #303936;
  --co-card-dark: #252d2a;
  --co-card-inner: #3e4845;
  --co-primary: #f1f4f2;
  --co-secondary: #c0cac5;
  --co-muted: #919d98;
  --co-emerald: #27e68b;
  --co-emerald-soft: rgba(39, 230, 139, 0.18);
  --co-gold: #d9bc59;
  --co-border: rgba(235, 244, 239, 0.08);
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 10rem;
  /* Full viewport by default — InvitationBonus route has no tabbar in DOM. */
  height: 100%;
  height: 100dvh;
  bottom: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: var(--co-bg);
  color: var(--co-primary);
  font-family: inherit;
  overflow: hidden;
}

.co-ib *,
.co-ib *:before,
.co-ib *:after { box-sizing: border-box; }

.co-ib__header {
  position: relative;
  flex: none;
  display: grid;
  grid-template-columns: 0.85333rem 1fr 0.85333rem;
  align-items: center;
  height: 1.17333rem;
  padding: 0 0.32rem;
  background: var(--co-header);
}

.co-ib__title {
  text-align: center;
  font-size: 0.48rem;
  font-weight: 800;
  color: var(--co-primary);
}

.co-claim-hub-tabs {
  flex: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.12rem;
  margin: 0;
  padding: 0.16rem 0.32rem 0.2rem;
  border: 0;
  border-radius: 0;
  background: var(--co-header);
}

.co-claim-hub-tab {
  height: 0.88rem;
  border: 0;
  border-radius: 0.16rem;
  background: #343d3a;
  color: var(--co-secondary);
  font-size: 0.34667rem;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: none;
}

.co-claim-hub-tab.is-on {
  color: var(--co-primary);
  background: #202724;
  box-shadow: none;
}

.co-ib__scroll {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 0.56rem;
}

.co-ib__banner {
  position: relative;
  display: block;
  height: 3.84rem;
  margin: 0.32rem 0.32rem 0;
  overflow: hidden;
  border-radius: 0.42667rem;
  border: 1px solid var(--co-border);
  background: var(--co-card-dark);
}

.co-ib__banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 78% 48%;
  display: block;
}

/* Banner art already has title/copy — no HTML overlay. */
.co-ib__banner-copy {
  display: none !important;
}

.co-ib__card {
  margin: 0.32rem 0.32rem 0;
  padding: 0.4rem;
  border-radius: 0.42667rem;
  border: 1px solid var(--co-border);
  background: var(--co-card);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.co-ib__card h3 {
  margin: 0 0 0.24rem;
  font-size: 0.37333rem;
  font-weight: 800;
  color: #ffffff;
}

.co-ib__stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.16rem;
}

.co-ib__stat {
  padding: 0.24rem 0.16rem;
  border-radius: 0.26667rem;
  background: var(--co-card-inner);
  text-align: center;
}

.co-ib__stat b {
  display: block;
  font-size: 0.4rem;
  font-weight: 800;
  color: #ffffff;
}

.co-ib__stat span {
  display: block;
  margin-top: 0.06rem;
  font-size: 0.24rem;
  color: #ffffff;
}

.co-ib__share {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 1.12rem;
  margin-top: 0.28rem;
  padding: 0.1rem 2.05rem 0.1rem 0.22rem;
  border: 0.02667rem solid #24ee89;
  border-radius: 0.56rem;
  background: #1c2623;
  box-sizing: border-box;
}

.co-ib__share svg {
  width: 0.44rem;
  height: 0.44rem;
  flex: none;
  margin-right: 0.12rem;
  color: #24ee89;
}

.co-ib__share code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.36rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #c8f6dc;
  font-family: inherit;
}

.co-ib__copy {
  position: absolute;
  right: 0.08rem;
  top: 50%;
  transform: translateY(-50%);
  flex: none;
  height: 0.88rem;
  min-width: 1.7rem;
  padding: 0 0.3rem;
  border: 0;
  border-radius: 0.44rem;
  background: #24ee89;
  color: #000;
  font-size: 0.32rem;
  font-weight: 800;
  line-height: 0.88rem;
  cursor: pointer;
}

/* Match Affiliate .co-inv__actions exactly (How It Works + Withdraw row). */
.co-ib__actions {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.24rem;
  width: calc(100% - 0.64rem);
  margin: 0.36rem 0.32rem 0;
  padding: 0;
  box-sizing: border-box;
}

.co-ib__action {
  min-width: 0;
  height: 0.96rem;
  margin: 0;
  border: 0;
  border-radius: 0.18rem;
  font-size: 0.32rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.08rem;
  padding: 0 0.16rem;
  box-sizing: border-box;
  color: inherit;
  text-align: center;
}

.co-ib__action svg {
  width: 0.4rem;
  height: 0.4rem;
  flex: none;
}

.co-ib__action--rules {
  flex: 2 1 0;
  background: #3f4a47;
  color: var(--co-primary);
}

.co-ib__action--rules svg {
  color: var(--co-emerald);
}

.co-ib__action--recs {
  flex: 3 1 0;
  background: var(--co-gold);
  color: #1a1408;
}

.co-ib__action--recs svg {
  color: #1a1408;
}

.co-ib__tier {
  margin: 0.24rem 0.32rem 0;
  padding: 0.36rem;
  border-radius: 0.42667rem;
  border: 1px solid var(--co-border);
  background: var(--co-card);
  color: #ffffff;
}

.co-ib__tier-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.2rem;
  margin-bottom: 0.2rem;
}

.co-ib__tier-h span {
  font-size: 0.32rem;
  color: #ffffff;
  font-weight: 700;
}

.co-ib__tier-h b {
  color: #ffffff;
  font-size: 0.4rem;
}

.co-claim-prog {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.08rem;
  min-width: 0;
  margin-top: 0.18rem;
  margin-bottom: 0.08rem;
}

.co-claim-prog__bar {
  position: relative;
  height: 0.44rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #252d2a 0%, #151a18 100%);
  box-shadow: inset 0 0.03rem 0.08rem rgba(0, 0, 0, 0.55);
  overflow: hidden;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.co-claim-prog__bar > i {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  height: 100%;
  border-radius: inherit;
  max-width: 100%;
  z-index: 0;
  transition: width 0.55s ease;
}

.co-claim-prog.is-gold .co-claim-prog__bar > i {
  background-image: linear-gradient(90deg, #0f9f45 0%, #26e58a 55%, #86e671 100%);
  box-shadow: 0 0 0.12rem rgba(38, 229, 138, 0.35);
}

.co-claim-prog.is-blue .co-claim-prog__bar > i {
  background-image: linear-gradient(90deg, #2f7fd4 0%, #5eb6ff 55%, #9fd0ff 100%);
  box-shadow: 0 0 0.12rem rgba(94, 182, 255, 0.35);
}

.co-claim-prog__pip {
  position: absolute;
  top: 50%;
  width: 0.3rem;
  height: 0.3rem;
  margin: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: none;
  transition: left 0.55s ease;
  animation: co-claim-pip-blink-gold 1.2s ease-in-out infinite;
}

.co-claim-prog__pip::after {
  content: "";
  position: absolute;
  left: 18%;
  top: 16%;
  width: 38%;
  height: 38%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.co-claim-prog.is-gold .co-claim-prog__pip {
  background: radial-gradient(circle at 35% 30%, #fff59a 0%, #ffe14a 38%, #e0b400 72%, #9a7400 100%);
  animation-name: co-claim-pip-blink-gold;
}

.co-claim-prog.is-blue .co-claim-prog__pip {
  background: radial-gradient(circle at 35% 30%, #d8f0ff 0%, #7ec8ff 40%, #3a9adf 72%, #1a5f9a 100%);
  animation-name: co-claim-pip-blink-blue;
}

@keyframes co-claim-pip-blink-gold {
  0%, 100% {
    opacity: 1;
    box-shadow:
      0 0 0 0.03rem rgba(255, 245, 170, 0.35) inset,
      0 0 0.12rem rgba(255, 214, 40, 0.55),
      0 0.04rem 0.1rem rgba(0, 0, 0, 0.45);
  }
  50% {
    opacity: 0.85;
    box-shadow:
      0 0 0 0.03rem rgba(255, 245, 170, 0.5) inset,
      0 0 0.28rem rgba(255, 230, 80, 0.95),
      0 0.04rem 0.1rem rgba(0, 0, 0, 0.45);
  }
}

@keyframes co-claim-pip-blink-blue {
  0%, 100% {
    opacity: 1;
    box-shadow:
      0 0 0 0.03rem rgba(200, 230, 255, 0.35) inset,
      0 0 0.12rem rgba(90, 180, 255, 0.55),
      0 0.04rem 0.1rem rgba(0, 0, 0, 0.45);
  }
  50% {
    opacity: 0.85;
    box-shadow:
      0 0 0 0.03rem rgba(200, 230, 255, 0.5) inset,
      0 0 0.28rem rgba(130, 200, 255, 0.95),
      0 0.04rem 0.1rem rgba(0, 0, 0, 0.45);
  }
}

.co-claim-prog__val {
  position: relative;
  z-index: 4;
  font-size: 0.22rem;
  font-weight: 800;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  white-space: nowrap;
  pointer-events: none;
  padding: 0.04rem 0.16rem;
  border-radius: 999px;
  background: #101614;
  box-shadow: 0 0 0 0.015rem rgba(255, 255, 255, 0.18);
}

.co-claim-prog__lab {
  font-size: 0.29333rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.co-ib__claim {
  width: 100%;
  margin-top: 0.28rem;
  height: 0.88rem;
  border: 0;
  border-radius: 0.16rem;
  background: var(--co-card-inner);
  color: #ffffff;
  font-size: 0.34667rem;
  font-weight: 800;
  cursor: default;
}

.co-ib__claim.is-on {
  background: var(--co-gold);
  color: #1a1408;
  cursor: pointer;
}

.co-ib__claim.is-done {
  background: #252c2a;
  color: rgba(255, 255, 255, 0.72);
  cursor: default;
}

.co-ib__intro,
.co-ib__note {
  margin: 0.32rem 0.32rem 0;
  padding: 0.36rem;
  border-radius: 0.42667rem;
  background: var(--co-card);
  border: 1px solid var(--co-border);
  color: var(--co-secondary);
  font-size: 0.32rem;
  line-height: 1.45;
}

.co-ib__note li {
  margin: 0 0 0.16rem 0.28rem;
}

.co-ib__table {
  width: calc(100% - 0.64rem);
  margin: 0.32rem 0.32rem 0;
  border-collapse: collapse;
  font-size: 0.29333rem;
}

.co-ib__table th,
.co-ib__table td {
  padding: 0.2rem 0.16rem;
  text-align: left;
  border-bottom: 1px solid var(--co-border);
}

.co-ib__table th {
  color: var(--co-muted);
  font-weight: 700;
}

.co-ib__table td {
  color: var(--co-primary);
}

.co-ib__table td:last-child {
  color: var(--co-gold);
  font-weight: 800;
  text-align: right;
}

.co-ib__rec {
  margin: 0.24rem 0.32rem 0;
  padding: 0.32rem;
  border-radius: 0.42667rem;
  background: var(--co-card);
  border: 1px solid var(--co-border);
}

.co-ib__rec-h {
  display: flex;
  justify-content: space-between;
  gap: 0.2rem;
  font-weight: 800;
}

.co-ib__rec-h span {
  color: var(--co-muted);
  font-weight: 600;
  font-size: 0.29333rem;
}

.co-ib__rec p {
  display: flex;
  justify-content: space-between;
  margin: 0.12rem 0 0;
  font-size: 0.29333rem;
  color: var(--co-muted);
}

.co-ib__rec p b {
  color: var(--co-emerald);
  font-weight: 800;
}

.co-ib__state {
  padding: 1.2rem 0.4rem;
  text-align: center;
  color: var(--co-secondary);
  font-size: 0.34667rem;
}

.co-ib__retry,
.co-ib__more {
  margin: 0.32rem auto 0;
  display: block;
  height: 0.88rem;
  padding: 0 0.48rem;
  border: 0;
  border-radius: 0.16rem;
  background: var(--co-card);
  color: var(--co-primary);
  font-size: 0.34667rem;
  font-weight: 800;
  cursor: pointer;
}

.co-ib__toast {
  position: absolute;
  left: 50%;
  bottom: 0.4rem;
  transform: translateX(-50%);
  z-index: 5;
  max-width: 80%;
  padding: 0.2rem 0.36rem;
  border-radius: 0.16rem;
  background: #323b39;
  color: var(--co-primary);
  font-size: 0.32rem;
  font-weight: 700;
}

.co-ib__toast.is-err { color: #ffb4b0; }
