/* BLACKOUT app: the Invite page (invite.js). The app's own cards, type and purple; nothing new but the tier
   ladder, the three numbers and the ring badge. Motion is transform and opacity only, and off with
   prefers-reduced-motion. No cross-like shape anywhere: the badge is rings (the power-button "O"). */

.iv h1 { text-wrap: balance; }
.iv .card + .card, .iv .card + div, .iv div + .card, .iv .iv-nums + .card, .iv .two + .card { margin-top: 14px; }
.iv .card h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* the invite link */
.iv-link .label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font: 600 11.5px/1.2 var(--sans); letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.iv-link .label .mono { font: 700 13px/1 var(--mono); letter-spacing: .16em; color: var(--red); }
.iv-link__row { display: flex; align-items: stretch; gap: 10px; margin-top: 10px; }
.iv-link__row .btn { flex: none; }
.iv-link .status { display: block; margin-top: 8px; min-height: 0; }
.iv-link .status:empty { display: none; }
.iv-link__box { flex: 1; min-width: 0; display: flex; align-items: center; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2); font: 500 14.5px/1.45 var(--mono); color: var(--text); overflow-wrap: anywhere; user-select: all; }

/* the three numbers */
.iv-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.iv .iv-nums .card, .iv .two > .card { margin-top: 0; }
.iv-num { display: grid; gap: 4px; align-content: start; padding-block: 16px; }
.iv-num__k { font: 600 11.5px/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.iv-num__v { font: 900 clamp(30px, 4.4vw, 46px)/1 var(--display); letter-spacing: -.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.iv-num__s { font: 500 12.5px/1.35 var(--sans); color: var(--dim); }
.iv-num--tier { position: relative; }
.iv-num__art { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); }
.iv-num__art .iv-badge { width: 64px; height: 64px; }
.iv-num__art:empty { display: none; }
/* Room for the badge beside the tier's name. */
.iv-num--tier.has-art > :not(.iv-num__art) { padding-right: 62px; }
.iv-num--tier.has-art .iv-num__v { font-size: clamp(19px, 1.75vw, 23px); }
.iv-num--tier .iv-num__v { font-size: clamp(22px, 3vw, 30px); line-height: 1.25; letter-spacing: -.02em; }
.iv-num--tier .iv-num__v:not([data-tier='none']) { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* the ladder */
.iv-tiers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--iv-n, 4), minmax(0, 1fr)); gap: 10px; }
.iv-tier { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); transition: border-color .3s, background-color .3s, transform .4s cubic-bezier(.2, .8, .2, 1); }
.iv-tier__t { display: grid; gap: 3px; min-width: 0; }
.iv-tier__t b { font: 700 15px/1.15 var(--display); letter-spacing: -.015em; color: var(--text); }
.iv-tier__t span { font: 500 12.5px/1.35 var(--sans); color: var(--muted); }
.iv-tier .chip { position: absolute; top: -9px; right: 10px; }
.iv-tier.is-reached { border-color: rgba(var(--accent-rgb), .45); }
.iv-tier.is-mine { border-color: var(--red); background: var(--card-s); box-shadow: 0 14px 34px -18px rgba(var(--accent-rgb), .7); transform: translateY(-2px); }
.iv-tier:not(.is-reached) .iv-badge { filter: grayscale(.85); opacity: .55; }
.iv-tier.is-next .iv-badge { filter: grayscale(.4); opacity: .8; }

/* the badge: rings, one more per tier. Replaced by artwork when a tier has a file (invite.js TIER_ART). */
.iv-badge { position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 38%, rgba(var(--accent-rgb), .22), rgba(var(--accent-rgb), .06) 70%); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .3); transition: filter .4s, opacity .4s; }
.iv-badge img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* With artwork the medallion is the badge: no disc of our own behind it, and a little larger. */
.iv-badge--art { width: 58px; height: 58px; background: none; box-shadow: none; border-radius: 0; filter: drop-shadow(0 8px 12px rgba(40, 10, 90, .32)); }
/* With artwork each tier is a small showcase: the crest on top, large, on a soft pool of light once it is reached. */
.iv-tiers--art .iv-tier { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 6px; padding: 14px 12px; }
.iv-tiers--art .iv-tier::before { content: ''; position: absolute; left: 50%; top: 6px; width: 160px; max-width: 92%; height: 124px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(var(--accent-rgb), .2), transparent); opacity: 0; transition: opacity .5s; pointer-events: none; }
.iv-tiers--art .iv-tier.is-reached::before { opacity: 1; }
.iv-tiers--art .iv-tier .iv-badge--art { width: 104px; height: 104px; }
.iv-tiers--art .iv-tier:not(.is-reached) .iv-badge { filter: grayscale(.7); opacity: .6; }
.iv-tiers--art .iv-tier.is-next .iv-badge { filter: saturate(.8); opacity: .92; }
.iv-tier.is-mine .iv-badge.iv-badge--art { animation: iv-float 3.2s ease-in-out infinite; }
@keyframes iv-float { 50% { transform: translateY(-2px) scale(1.04); } }
.iv-badge i { position: absolute; border-radius: 50%; border: 2px solid var(--red); opacity: 0; }
.iv-badge i:nth-child(1) { inset: 16px; opacity: 1; background: var(--red); }
.iv-badge i:nth-child(2) { inset: 10px; }
.iv-badge i:nth-child(3) { inset: 4px; }
.iv-badge--boosted i:nth-child(2), .iv-badge--pro i:nth-child(2), .iv-badge--pro i:nth-child(3) { opacity: 1; }
.iv-tier.is-mine .iv-badge { animation: iv-pulse 2.8s ease-in-out infinite; }
@keyframes iv-pulse { 50% { box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .5), 0 0 0 7px rgba(var(--accent-rgb), .1); } }

.iv-bar { margin-top: 16px; height: 8px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.iv-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); transform: scaleX(0); transform-origin: 0 50%; transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.iv-next { margin: 12px 0 0 !important; font: 600 14.5px/1.45 var(--sans); color: var(--text); }

/* a friend's link was opened */
.iv-came { border-color: rgba(var(--accent-rgb), .5); }
.iv-came__t { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.iv-came__t b { font: 700 16px/1.2 var(--display); letter-spacing: -.015em; }

/* friends */
.iv-friends li { align-items: center; }
.iv-friends .s { font: 500 12.5px/1.4 var(--sans); }
.iv-friends li:not(.empty) { animation: iv-in .45s cubic-bezier(.2, .8, .2, 1) both; }
.iv-friends li:nth-child(2) { animation-delay: 40ms; }
.iv-friends li:nth-child(3) { animation-delay: 80ms; }
.iv-friends li:nth-child(4) { animation-delay: 120ms; }
.iv-friends li:nth-child(n + 5) { animation-delay: 160ms; }
.iv-friends { max-height: 300px; overflow: auto; }
@keyframes iv-in { from { opacity: 0; transform: translateY(6px); } }

/* how it works */
.iv-steps { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: iv; display: grid; gap: 10px; }
.iv-steps li { counter-increment: iv; position: relative; padding-left: 38px; font: 500 14.5px/1.5 var(--sans); color: var(--text); }
.iv-steps li::before { content: counter(iv); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 12.5px/1 var(--display); color: var(--chip-ink); background: var(--chip-bg); }
.iv-notes { margin: 16px 0 0; padding: 14px 0 0; list-style: none; display: grid; gap: 8px; border-top: 1px solid var(--line); }
.iv-notes li { position: relative; padding-left: 16px; font: 400 13.5px/1.5 var(--sans); color: var(--muted); }
.iv-notes li::before { content: ''; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: rgba(var(--accent-rgb), .55); }

.iv #iv-wallet-now { overflow-wrap: anywhere; }

/* The earnings calculator, the link name and the leaderboard (built by invite.js, only where the server has them). */
.iv-calc__q { margin: 6px 0 12px; color: var(--muted); }
.iv-calc__in { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 16px; align-items: end; }
.iv-calc__in input[type='range'] { width: 100%; accent-color: var(--red); margin-bottom: 14px; }
.iv-calc__out { list-style: none; margin: 14px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.iv-calc__row { position: relative; display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); min-width: 0; }
.iv-calc__row.is-mine { border-color: var(--red); background: var(--card-s); }
.iv-calc__row .chip { position: absolute; top: -9px; right: 10px; }
.iv-calc__t { font: 600 12.5px/1.3 var(--sans); color: var(--muted); }
.iv-calc__row b { font: 700 clamp(15px, 1.5vw, 19px)/1.2 var(--display); letter-spacing: -.015em; color: var(--text); overflow-wrap: anywhere; }
.iv-name #iv-name-now { overflow-wrap: anywhere; margin: 6px 0 10px; }
.iv-board__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.iv-board__tabs { display: flex; gap: 6px; }
.iv-board__tabs .btn.is-on { border-color: var(--red); color: var(--text); background: var(--card-s); }
.iv-board__wrap { overflow-x: auto; margin: 12px 0 10px; }
.iv-board__table { width: 100%; border-collapse: collapse; font: 500 13.5px/1.35 var(--sans); }
.iv-board__table th { text-align: left; font: 600 11px/1.3 var(--sans); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 6px 8px 8px; white-space: nowrap; }
.iv-board__table td { padding: 9px 8px; border-top: 1px solid var(--line); white-space: nowrap; }
.iv-board__table td:nth-child(2) { font-weight: 700; color: var(--text); white-space: normal; overflow-wrap: anywhere; min-width: 96px; }
.iv-board__table th:first-child, .iv-board__table td:first-child { width: 28px; color: var(--muted); }
.iv-board__table th:nth-child(n + 4), .iv-board__table td:nth-child(n + 4) { text-align: right; }
.iv-board__table tr.is-mine td { background: var(--card-s); }
.iv-board__table td.empty { text-align: center; color: var(--muted); white-space: normal; }
.iv-board__you { margin: 0 0 10px; color: var(--text); }
/* Payouts: the line that says why nothing is paid right now stands out a little from the small print. */
.iv-pay__why { color: var(--text); }
.iv-earn .kv dd { overflow-wrap: anywhere; }
.iv-board__show { flex-wrap: wrap; }
.iv-board__show .btn:disabled { opacity: .5; cursor: not-allowed; }
.iv-board #iv-board-sees { margin: 8px 0 10px; }
.iv-board__x { display: grid; gap: 4px; margin: 0 0 10px; }
.iv-board__x .row { flex-wrap: wrap; align-items: center; gap: 10px; }
.iv-board__x a, .iv-board__table a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.iv-board__table td .chip { margin-left: 6px; font-size: 10px; padding: 1px 6px; }

@media (max-width: 820px) {
  .iv-calc__in { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .iv-calc__out { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .iv-board__table { font-size: 13px; }
  .iv-board__table th, .iv-board__table td { padding-left: 5px; padding-right: 5px; }
  /* A phone has no room for six columns: the tier is on each person's own page, so it is the one left out. */
  .iv-board__table th:nth-child(3), .iv-board__table td:nth-child(3) { display: none; }
  .iv-board__table td:nth-child(2) { min-width: 0; }
  .iv-tiers { grid-template-columns: minmax(0, 1fr); }
  .iv-nums { gap: 8px; }
  .iv-num { padding: 12px; }
  .iv-num__s { font-size: 11.5px; }
  .iv-two { grid-template-columns: minmax(0, 1fr); }
  .iv-link__box { font-size: 13px; flex-basis: 100%; }
  .iv-link__row { flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .iv-num__k { letter-spacing: .04em; font-size: 10.5px; }
  .iv-num--tier .iv-num__v { font-size: 19px; }
}
/* A narrow tile has no room for the badge beside the tier's name: the ladder right below shows it. */
@media (max-width: 820px) {
  .iv-tiers--art .iv-tier { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; gap: 14px; padding: 10px 14px; }
  .iv-tiers--art .iv-tier::before { left: 52px; top: 50%; width: 110px; height: 110px; transform: translate(-50%, -50%); }
  .iv-tiers--art .iv-tier .iv-badge--art { width: 78px; height: 78px; }
  .iv-num__art { display: none; }
  .iv-num--tier.has-art > :not(.iv-num__art) { padding-right: 0; }
  .iv-num--tier.has-art .iv-num__v { font-size: clamp(18px, 5vw, 26px); }
}
@media (prefers-reduced-motion: reduce) {
  .iv-tier, .iv-bar i, .iv-badge { transition: none; }
  .iv-tier.is-mine .iv-badge, .iv-tier.is-mine .iv-badge.iv-badge--art, .iv-friends li { animation: none; }
}
