/* Friend invites (js/referrals.js): field-journal red, black and white. */
.ref-chip { border-color: #e0242d99; }
.ref-badge { position: absolute; right: -6px; bottom: -7px; padding: 0 3px; font: 400 11px/14px var(--display); font-style: normal; color: #fff; background: #e0242d; border: 1px solid #0e0d0c; white-space: nowrap; pointer-events: none; }
/* Home: the invite button shares the update ribbon's row under the switch, so it is on screen above the sticky PLAY bar on
   every phone and on both sides of Home. The ribbon gives up its decorative flag (and its dots on a narrow phone). */
.home-rib { display: flex; align-items: stretch; gap: 6px; margin: 4px 0 6px; }
.home-rib > .tl-ribbon { flex: 1; min-width: 0; margin: 0; grid-template-columns: 12px minmax(0, 1fr) auto; }
.home-rib .tl-rib-go { display: none; }
.ref-home { position: relative; flex: none; display: grid; justify-items: center; align-content: center; gap: 2px; width: 64px; min-height: 48px; padding: 4px 2px 3px;
  color: #f3ede2; background: linear-gradient(180deg, #2a1211, #0e0d0c); border: 1px solid #e0242d; box-shadow: 0 3px 0 #070807, inset 0 0 0 2px #0b0a07, inset 0 1px #ff8a8040; }
.ref-home:active { transform: translateY(1px); filter: brightness(1.1); }
.ref-home .wi { width: 30px; height: 30px; margin: -4px 0 -3px; color: #f3ede2; }
.ref-home b { font: 400 13px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: #fff; white-space: nowrap; }
.ref-home .ref-badge { top: -6px; right: -4px; bottom: auto; }
@media (max-width: 379px) { .home-rib .tl-dots { display: none; } .home-rib .tl-rib-txt b { font-size: 16px; } .ref-home { width: 56px; } }
.ref-chip .wi { color: #f3ede2; }
@media (max-width: 379px) { .ref-chip span { display: none; } .td-chip { padding: 2px 6px; } }

.ref-sheet { max-width: 460px; }
.ref-sheet .setup-head h2 { display: flex; align-items: center; gap: 8px; }
.ref-sheet .setup-head h2 .wi { width: 22px; height: 22px; }
.ref-how { margin: 4px 0 0; padding: 6px 9px 5px; border-left: 4px solid #e0242d; background: #e0242d18; color: #f3ede2; font-size: 14px; }
.ref-track { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; }
.ref-track > b { font: 400 30px var(--display); color: #f2c14e; min-width: 1.4ch; text-align: center; }
.ref-bar { position: relative; flex: 1; height: 8px; margin: 0 8px 14px 4px; background: #0e0d0c; border: 1px solid #4a4035; }
.ref-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #a5171d, #e0242d); }
.ref-bar em { position: absolute; top: 10px; transform: translateX(-50%); font: 400 12px var(--display); font-style: normal; color: var(--muted); }
.ref-bar em::before { content: ''; position: absolute; left: 50%; top: -14px; width: 2px; height: 12px; background: #4a4035; }
.ref-bar em.on { color: #f2c14e; }
.ref-bar em.on::before { background: #f2c14e; }
.ref-ladder { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.ref-tier { display: grid; grid-template-columns: 52px minmax(0, 1fr) 22px; align-items: center; gap: 10px; padding: 6px 8px; background: #0e0d0c; border: 1px dashed #4a4035; }
.ref-tier.next { border: 1px solid #e0242d; box-shadow: inset 4px 0 0 #e0242d; }
.ref-tier.done { border-style: solid; border-color: #f2c14e66; }
.ref-pic { display: grid; place-items: center; width: 52px; height: 44px; }
.ref-pic img, .ref-pic svg, .ref-pic .pass-mark { max-width: 100%; max-height: 100%; width: auto; height: 44px; object-fit: contain; }
.ref-pic .wi { width: 34px; height: 34px; color: #f2c14e; }
.ref-tt { display: grid; min-width: 0; }
.ref-tt small { font: 400 12px var(--display); letter-spacing: .06em; text-transform: uppercase; color: #e0242d; }
.ref-tier.done .ref-tt small { color: #f2c14e; }
.ref-tt b { font-weight: 600; font-size: 14px; color: #f3ede2; }
.ref-tt em { font-style: normal; font-size: 12px; color: var(--muted); }
.ref-state .wi { width: 20px; height: 20px; color: #f2c14e; }
.ref-friends { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; }
.ref-friend { display: grid; grid-template-columns: minmax(0, 1fr) auto 92px; align-items: center; gap: 8px; padding: 5px 8px; border-bottom: 1px dashed #4a4035; font-size: 14px; }
.ref-friend b { font-weight: 600; text-align: right; color: #cfc3ad; }
.ref-friend.counted b { color: #f2c14e; }
.ref-friend.expired, .ref-friend.capped { opacity: .7; }
.ref-pips { display: flex; gap: 3px; }
.ref-pips i { width: 12px; height: 12px; border: 1px solid #4a4035; transform: rotate(45deg); }
.ref-pips i.on { background: #e0242d; border-color: #e0242d; }
.ref-friend.counted .ref-pips i.on { background: #f2c14e; border-color: #f2c14e; }
.ref-empty { padding: 8px; font-size: 14px; color: var(--muted); border: 1px dashed #4a4035; }
.ref-mine { margin: 0 0 10px; font-size: 14px; color: #f2c14e; }
.ref-enter { display: grid; gap: 4px; margin-bottom: 6px; }
.ref-enter label { font: 400 13px var(--display); letter-spacing: .05em; text-transform: uppercase; color: #cfc3ad; }
.ref-enter span { display: flex; gap: 6px; }
.ref-enter input { flex: 1; min-width: 0; min-height: 44px; padding: 0 10px; background: #0e0d0c; border: 1px solid #4a4035; color: #f3ede2; font: 400 18px var(--display); letter-spacing: .14em; text-transform: uppercase; }
.ref-enter small { font-size: 12px; color: var(--muted); }
.ref-status { min-height: 1.2em; margin: 4px 0 0; font-size: 13px; color: #f2c14e; }
.ref-foot { display: flex; align-items: stretch; gap: 8px; }
.ref-code { flex: none; display: grid; align-content: center; padding: 2px 10px; border: 1px dashed #f3ede2aa; background: #0e0d0c; }
.ref-code small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ref-code b { font: 400 20px var(--display); letter-spacing: .12em; color: #f3ede2; user-select: all; -webkit-user-select: all; }
.ps-code { display: grid; gap: 2px; margin: 8px 0; padding: 8px 10px; background: #0e0d0c; border: 1px dashed #f3ede2aa; text-align: center; }
.ps-code small { font: 400 12px var(--display); letter-spacing: .08em; text-transform: uppercase; color: #c9bc98; }
.ps-code b { font: 400 28px/1.1 var(--display); letter-spacing: .16em; color: #f3ede2; user-select: all; -webkit-user-select: all; }
.ref-foot .btn.ref-share { flex: 1; min-width: 0; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; font-size: clamp(17px, 5vw, 22px); }
.ref-share .wi { width: 20px; height: 20px; }

.fin-invite { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 10px; text-align: left; color: var(--fg); background: #0e0d0c; border: 1px solid #e0242d; box-shadow: inset 4px 0 0 #e0242d; }
.fin-invite .wi { width: 22px; height: 22px; flex: none; color: #f2c14e; }
.fin-invite span { display: grid; min-width: 0; }
.fin-invite b { font: 400 15px var(--display); letter-spacing: .05em; text-transform: uppercase; }
.fin-invite small { font-size: 12.5px; color: #cfc3ad; }

.ref-plates { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ref-plates.n1 { grid-template-columns: minmax(0, 1fr); }
.ref-plates .spin-prize.feature { grid-column: 1 / -1; }
.ref-plates .spin-prize-picture .wi, .ref-plates .spin-prize-picture .pass-mark { width: 84px; height: 84px; color: #f2c14e; }
@media (prefers-reduced-motion: reduce) { .ref-plates .spin-prize { animation: none !important; } }
@media (max-width: 379px) {
  .ref-foot { gap: 6px; }
  .ref-code { padding: 2px 6px; }
  .ref-code b { font-size: 16px; letter-spacing: .06em; }
  .ref-foot .btn.ref-share { font-size: 16px; padding-inline: 6px; letter-spacing: .02em; }
  .ref-foot .btn.ref-share .wi { display: none; }
}
