/* Referrals (quests/referrals.js, docs/REFERRALS.md) — the Invite view, the
   "Who invited you?" field, the ceremony. Built from the Tiger Squad pieces:
   the banner (.sqr-hero), the list's share card (.lv-public-card, .lv-social),
   the friend-code field, the full-set window (.qfs). */

/* Banner: the Deals frame and its layered scene (referrals.js INVITE_SCENE, a 3.6 : 1 box):
   envelopes, the giving tiger (behind the desk), the spool, the receiving tiger, the printed
   tiger, envelopes — assets/img/tigersquad/invite-hero/. */
.sqr-hero.rf-hero.rf-hero { --hero-scene: none; --hero-front: none; --hero-sink: 4px;
  --hero-art-w: 600px; --hero-art-ratio: 1; --hero-scene-w: 440px; --hl-ratio: 3.6; }
.rf-hero .hl--tiger-give { left: 12%; height: 88%; bottom: 6%; translate: 0 6px; }
.rf-hero .hl--tiger-take { left: 54%; height: 90%; bottom: 6%; translate: 0 6px; }
.rf-hero .hl--spool { left: 43%; height: 38%; }
.rf-hero .hl--figurine { left: 79%; height: 27%; }
/* Three envelopes in a small fan: a 2 : 1 box, each envelope a square at 0 / 25 / 50 %. */
.rf-hero .hl--envs { height: 26%; aspect-ratio: 2; }
.rf-hero .hl--envs img { position: absolute; bottom: 0; height: 100%; width: auto; aspect-ratio: 1; object-fit: contain; }
.rf-hero .hl--envs img:nth-child(1) { left: 0; rotate: -10deg; } .rf-hero .hl--envs img:nth-child(2) { left: 25%; } .rf-hero .hl--envs img:nth-child(3) { left: 50%; rotate: 10deg; }
.rf-hero .hl--envs-a { left: 0; } .rf-hero .hl--envs-b { left: 87%; }
/* Every envelope wiggles on click (one hides the inviteBanner easter egg): no pointer cursor, it stays a secret. */
.rf-hero .hl--envs img { pointer-events: auto; }
.rf-hero .hl--envs img.is-tapped { animation: tch-tap .35s ease; }
@media (prefers-reduced-motion: no-preference) { .rf-hero .hl--figurine { animation: hl-rock 4s ease-in-out infinite; } }
.sqr-card.rf-hero-card { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 170px; padding: 10px 14px; color: var(--on-dark); }
.rf-hero-lbl { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--on-dark); }
.rf-hero-lbl .ui-info .icon { background-color: var(--on-dark); opacity: .7; }
.rf-hero-card small { color: var(--on-dark); opacity: .75; }
.rf-hero-card .sqr-bar i { display: block; height: 100%; background: var(--tsq-orange); }

.rf-card { border: 1px solid var(--tsq-line); border-radius: 14px; background: var(--tsq-card); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.rf-card h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--tsq-text); }
.rf-card h3 .icon { background-color: var(--tsq-orange); }
.rf-card p { margin: 0; font-size: 13px; color: var(--tsq-muted); }


/* How it works: three steps in a row. */
/* How it works as a metro line: one line through three numbered stations, each
   step's title and detail under its stop. */
.rf-steps { position: relative; list-style: none; margin: 0; padding: 16px 16px 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  border: 1px solid var(--tsq-line); border-radius: 14px; background: var(--tsq-card); }
.rf-steps::before { content: ""; position: absolute; top: 30px; left: calc(16px + (100% - 32px) / 8); right: calc(16px + (100% - 32px) / 8); height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--tsq-orange), color-mix(in srgb, var(--tsq-orange) 45%, transparent)); }
.rf-stop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.rf-stop-dot { width: 30px; height: 30px; margin-bottom: 6px; border-radius: 50%; display: grid; place-items: center; background: var(--tsq-orange); color: var(--on-accent); font-size: 13px; font-weight: 800;
  box-shadow: 0 0 0 4px var(--tsq-card), 0 0 0 6px color-mix(in srgb, var(--tsq-orange) 35%, transparent); }
.rf-stop b { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--tsq-text); }
.rf-stop b .icon { background-color: var(--tsq-orange); }
.rf-stop small { font-size: 12px; color: var(--tsq-muted); }

/* Sharing: the code, the link, the networks by name, the message, the QR on the right. */
/* The share card: everything on one left edge, the QR in a narrow column on the right. */
/* The title on top, then the link column and the My code card side by side:
   the card starts level with the link bar, not with the title. */
.rf-share-body { display: flex; align-items: stretch; gap: 18px; }
.rf-share-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
/* The Friends card's orange "My code" card (20-friends.css .fp-hero), on the
   right of the link: QR (click = enlarge), the code, Share link | Download, and
   New code as the corner icon (confirmed in a window first). */
.rf-mycode.fp-hero { flex: 0 0 340px; margin: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }   /* from the link bar down to the message */

/* The share block: the link and "Copy my link" joined in one bar, every network
   five a row, the message as it will be sent with a copy icon. */
.rf-link-bar { align-self: stretch; display: flex; }
.rf-link-bar .rf-link.dns-input { flex: 1 1 auto; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.rf-link-copy.rf-link-copy { flex: 0 0 auto; height: auto; display: inline-flex; align-items: center; gap: 7px; padding: 0 16px; border: 0; border-radius: 0 10px 10px 0; background: var(--tsq-orange); color: var(--on-accent); font-size: 13.5px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.rf-link-copy .icon { background-color: var(--on-accent); }
.rf-copy-lbls { display: grid; }
.rf-copy-lbls > span { grid-area: 1 / 1; text-align: center; transition: opacity .15s; }
.rf-copy-lbls > span + span, .rf-link-copy.is-done .rf-copy-lbls > span:first-child { opacity: 0; }
.rf-link-copy.is-done .rf-copy-lbls > span + span { opacity: 1; }
.rf-link-copy:hover { filter: brightness(1.08); }
.rf-net-grid { align-self: stretch; display: flex; flex-wrap: wrap; gap: 10px; }
/* The same grid in the "Share this filament" window (inventory.js _openProductShare), centred. */
.product-share .ps-nets { justify-content: center; margin-top: 12px; }
/* The bare brand discs, no card around them. */
.rf-net.rf-net { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; cursor: pointer; transition: transform .1s; }
.rf-net:hover .lv-social { filter: brightness(1.1); transform: translateY(-1px); }
.rf-net:active { transform: scale(.94); }
.rf-net:focus-visible { outline: 2px solid var(--tsq-orange); outline-offset: 2px; }
.rf-net .lv-social { width: 40px; height: 40px; }
.rf-net .lv-social .icon { width: 20px; height: 20px; }
.rf-msg-row { align-self: stretch; display: flex; align-items: center; gap: 12px; }
.rf-msg-lbl { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--tsq-muted); }
.rf-msg-lbl .icon { background-color: var(--tsq-muted); }
.rf-msg.rf-msg { flex: 1 1 auto; min-width: 0; margin: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--tsq-line); background: var(--surface-2); font-size: 13px; line-height: 1.45; color: var(--tsq-text); }
.rf-msg-copy.rf-msg-copy { flex: 0 0 auto; width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--tsq-line); background: var(--surface-2); cursor: pointer; }
.rf-msg-copy .icon { background-color: var(--tsq-text); }
.rf-msg-copy:hover { border-color: var(--tsq-orange); }

/* "Your friend gets 3 envelopes too", above the steps. */
.rf-friend-gets { display: flex; align-items: center; gap: 8px; margin: 4px 2px -4px; font-size: 16px; font-weight: 800; color: var(--tsq-orange); }
.rf-friend-gets .icon { background-color: var(--tsq-orange); }

/* Your invitations: one row per friend, a column per stage. */
.rf-table-wrap { overflow-x: auto; }
.rf-table { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--tsq-text); }
.rf-table th { padding: 8px 10px; text-align: left; font-size: 12px; font-weight: 700; color: var(--tsq-muted); background: var(--surface-2); }
.rf-table th:first-child { border-radius: 8px 0 0 8px; }
.rf-table th:last-child { border-radius: 0 8px 8px 0; }
.rf-table td { padding: 8px 10px; border-top: 1px solid var(--tsq-line); white-space: nowrap; }
.rf-table tr:first-child td { border-top: 0; }
.rf-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rf-who b { overflow: hidden; text-overflow: ellipsis; }
.rf-who-txt { display: flex; flex-direction: column; min-width: 0; }
.rf-who-hint { font-size: 11.5px; color: var(--tsq-muted); white-space: normal; max-width: 260px; }
.rf-date { color: var(--tsq-muted); }
.rf-table th:not(:first-child), .rf-table td:not(:first-child) { text-align: center; }
.rf-st .icon { vertical-align: middle; }
.rf-st--yes .icon { background-color: var(--tsq-orange); }
.rf-st--wait { color: var(--tsq-muted); }
.rf-st--expired .icon { background-color: var(--danger-text); }

/* The networks added for the share grid (brand colours) and their logos. */
.lv-social--wechat { background: #07c160; }
.lv-social--messenger { background: #0866ff; }
.lv-social--line { background: #06c755; }
.lv-social--kakao { background: #fee500; }
.lv-social--kakao .icon { background-color: #191919; }
.lv-social--vk { background: #0077ff; }
.lv-social--sms { background: #34c759; }
.icon-wechat    { -webkit-mask-image: url('../../assets/svg/logos/logo_wechat.svg');    mask-image: url('../../assets/svg/logos/logo_wechat.svg'); }
.icon-messenger { -webkit-mask-image: url('../../assets/svg/logos/logo_messenger.svg'); mask-image: url('../../assets/svg/logos/logo_messenger.svg'); }
.icon-line-app  { -webkit-mask-image: url('../../assets/svg/logos/logo_line.svg');      mask-image: url('../../assets/svg/logos/logo_line.svg'); }
.icon-kakaotalk { -webkit-mask-image: url('../../assets/svg/logos/logo_kakaotalk.svg'); mask-image: url('../../assets/svg/logos/logo_kakaotalk.svg'); }
.icon-vk        { -webkit-mask-image: url('../../assets/svg/logos/logo_vk.svg');        mask-image: url('../../assets/svg/logos/logo_vk.svg'); }
/* The enlarged QR in the My code card's look: a dark frame, round corners. */
.rf-qr-xl.rf-qr-xl { width: min(340px, 70vw); height: auto; aspect-ratio: 1; margin: 12px auto 4px; display: block;
  padding: 12px; box-sizing: border-box; background: var(--qr-frame); border-radius: 22px; box-shadow: 0 10px 28px rgba(0,0,0,.28); }
.rf-qr-dl.rf-qr-dl { height: auto; display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: var(--tsq-orange); font-size: 12px; font-weight: 600; cursor: pointer; }
.rf-qr-dl .icon { background-color: var(--tsq-orange); }
.lv-social--reddit { background: #ff4500; }
.lv-social--telegram { background: #26a5e4; }
.lv-social--bluesky { background: #1185fe; }
.lv-social--discord { background: #5865f2; }
.lv-social--ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.icon-reddit   { -webkit-mask-image: url('../../assets/svg/logos/logo_reddit.svg');   mask-image: url('../../assets/svg/logos/logo_reddit.svg'); }
.icon-telegram { -webkit-mask-image: url('../../assets/svg/logos/logo_telegram.svg'); mask-image: url('../../assets/svg/logos/logo_telegram.svg'); }
.icon-bluesky  { -webkit-mask-image: url('../../assets/svg/logos/logo_bluesky.svg');  mask-image: url('../../assets/svg/logos/logo_bluesky.svg'); }

/* The code field: one dark input with Paste inside it, then the owner's preview. */
.rf-code-lbl { font-size: 12px; font-weight: 700; color: var(--tsq-muted); }
.rf-code { position: relative; display: flex; align-items: center; }
.rf-code .rf-code-in.dns-input { flex: 1 1 auto; min-width: 0; padding-right: 96px; font: 700 15px var(--qw-mono, monospace); letter-spacing: 2px; text-transform: uppercase; }
.rf-code .rf-code-in::placeholder { font-weight: 500; letter-spacing: 1px; text-transform: none; }
.rf-paste.rf-paste { position: absolute; right: 5px; top: 50%; translate: 0 -50%; height: auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 0; border-left: 1px solid var(--tsq-line); border-radius: 0 8px 8px 0; background: none; color: var(--tsq-text); font-size: 13px; font-weight: 600; cursor: pointer; }
.rf-paste .icon { background-color: currentColor; }
.rf-paste:hover { color: var(--tsq-orange); }
.rf-preview { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--tsq-text, var(--text)); }
.rf-preview[hidden] { display: none; }
.rf-err { margin: 0; min-height: 1em; font-size: 12px; color: var(--danger); }
/* "A friend invited you?": icon, title + rule, the days left as a pill; then field, Validate, "I have no code". */
.rf-claim-head { display: flex; align-items: center; gap: 12px; }
.rf-claim-ic { flex: 0 0 auto; width: 34px; aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--tsq-orange) 18%, transparent); }
.rf-claim-ic .icon { background-color: var(--tsq-orange); }
.rf-claim-title { font-size: 15px; }
.rf-days { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; margin-left: auto; padding: 3px 10px; border: 1px solid var(--tsq-line); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--tsq-muted); white-space: nowrap; }
.rf-days .icon { background-color: currentColor; }
.rf-claim-row { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.rf-claim-field { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rf-claim-go.sqd-open { height: auto; margin-top: 23px; padding: 9px 18px; font-size: 13.5px; white-space: nowrap; }
.rf-claim-go.sqd-open:disabled { opacity: .45; cursor: default; filter: grayscale(.6); }
.rf-nocode.rf-nocode { height: auto; margin-top: 32px; padding: 0; border: 0; background: none; color: var(--tsq-muted); font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.rf-nocode:hover { color: var(--tsq-text); }
/* Folded: one line that opens it again. */
.rf-card.rf-claim-fold { flex-direction: row; align-items: center; gap: 8px; width: 100%; font: inherit; font-size: 14px; font-weight: 700; color: var(--tsq-text); text-align: left; cursor: pointer; }
.rf-claim-fold > .icon { background-color: var(--tsq-orange); }
.rf-claim-fold:hover { border-color: var(--tsq-orange); }

/* Invitees: avatar, name + date, state pill. */
.rf-mine.rf-card { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.rf-row-txt { flex: 1 1 auto; min-width: 0; display: grid; }
.rf-row-txt b { font-size: 14px; color: var(--tsq-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-row-txt small { font-size: 12px; color: var(--tsq-muted); }
.rf-pill { flex: 0 0 auto; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.rf-pill--validated { background: var(--success); color: var(--on-accent); }
.rf-pill--pending { background: color-mix(in srgb, var(--tsq-orange) 22%, transparent); color: var(--tsq-orange); }
.rf-empty { margin: 0; font-size: 13px; color: var(--tsq-muted); }
.rf-empty b { color: var(--tsq-text); }

/* Onboarding step 2: the optional field under the name. */
.dns-ref { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }

/* Ceremony: the two avatars and the envelopes, on the full-set window. */
.rf-win-pair { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0 6px; }
.rf-win-pair .sb-friend-avatar { width: 64px; height: 64px; font-size: 22px; }
.rf-win-pair .icon { background-color: var(--tier-legendary); }
.rf-win-envs { display: flex; justify-content: center; gap: 8px; }
.rf-win-envs img { width: 64px; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .4)); }
@media (prefers-reduced-motion: no-preference) {
  .rf-win.is-open .rf-win-envs img { animation: qfs-pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
  .rf-win.is-open .rf-win-envs img:nth-child(2) { animation-delay: .12s; }
  .rf-win.is-open .rf-win-envs img:nth-child(3) { animation-delay: .24s; }
}
@media (max-width: 760px) { .rf-steps { grid-template-columns: 1fr; } .rf-steps::before { display: none; } .rf-share-body { flex-direction: column; } .rf-mycode.fp-hero { flex-basis: auto; align-self: stretch; } }

/* Entry points elsewhere: the sidebar friends list's last chip, the empty friends list. */
.sb-friend-invite-ic.sb-friend-invite-ic { display: grid; place-items: center; background: transparent; border: 1.5px dashed var(--border); }
.sb-friend-invite-ic .icon { background-color: var(--muted); }
.sb-friend-invite:hover .sb-friend-invite-ic { border-color: var(--primary); }
.sb-friend-invite:hover .sb-friend-invite-ic .icon { background-color: var(--primary); }
.fp-empty-invite.fp-empty-invite { margin-top: 10px; }
