/* lane F: friends. Social > Friends tab, Home Friends button, the invite card, lobby invites, quick deck pick.
   Stage units: 1600-2100 x 900 landscape, 900 wide portrait. body.mobile = the stage is scaled below .62, so tap targets
   are doubled there to stay 44px+ on the device. */
.fr-wrap { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(360px, 1fr); gap: 18px; align-items: start; }
.fr-main, .fr-add, .fr-reqs { padding: 18px 20px; }
.fr-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.fr-list { display: flex; flex-direction: column; gap: 10px; }
.fr-btn { min-height: 52px; min-width: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; font-size: 15px; border-radius: 12px; white-space: nowrap; }
.fr-btn .ico { width: 20px; height: 20px; flex: none; }
.fr-btn:disabled { opacity: .45; cursor: default; }
.fr-danger { color: #ffb2a6; border-color: rgba(255, 120, 100, .45); }
.fr-muted { color: var(--muted); margin: 6px 0 0; font-size: 15px; }
.fr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fr-tabn { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 6px; border-radius: 99px; font: 900 12px/1 var(--font-ui); font-style: normal; color: #fff2e8; box-sizing: border-box;
  background: radial-gradient(circle at 35% 30%, #ff9b7a, #c3281c 55%, #6e0f08); vertical-align: middle; }

/* a friend */
.fr-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, .035); border: 1px solid rgba(232, 186, 90, .14); }
.fr-row.offline .fr-t b { color: #cfc4b6; }
.fr-avw { position: relative; width: 58px; height: 58px; flex: none; }
.fr-av { display: block; width: 100%; height: 100%; border-radius: 50%; background: #20143a center / cover no-repeat; box-shadow: 0 0 0 2px rgba(232, 186, 90, .5); }
.fr-dot { position: absolute; right: -1px; bottom: -1px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid #140b26; background: #6f6680; }
.fr-dot.online { background: #4fe08a; box-shadow: 0 0 10px rgba(79, 224, 138, .8); }
.fr-dot.match { background: #f2c14e; box-shadow: 0 0 10px rgba(242, 193, 78, .7); }
.fr-t { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.fr-t b { font: 800 18px/1.2 var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff6e0; }
.fr-t em { font: 600 13px/1.3 var(--font-ui); font-style: normal; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-row.online .fr-t em { color: #8ff0b4; } .fr-row.match .fr-t em { color: #f6d680; }
.fr-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.fr-menu { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; }
.fr-menu[hidden] { display: none; }
.fr-note { grid-column: 2 / -1; font-size: 13px; color: var(--muted); }
.fr-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 36px 18px; color: var(--muted); }
.fr-empty .ico { width: 44px; height: 44px; } .fr-empty b { color: #fff6e0; font-size: 20px; }

/* waiting invites (also on the card) */
.fr-pend { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.fr-prow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: linear-gradient(90deg, rgba(242, 193, 78, .16), rgba(242, 193, 78, .04)); border: 1px solid rgba(242, 193, 78, .45); }
.fr-prow > span { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.fr-prow .ico { width: 20px; height: 20px; color: var(--gold-1); flex: none; }

/* add + requests */
.fr-add { display: flex; flex-direction: column; gap: 10px; }
.fr-add .m-h { margin-bottom: 2px; }
.fr-fld input { width: 100%; box-sizing: border-box; min-height: 52px; padding: 0 16px; border-radius: 12px; font: 600 17px var(--font-ui); color: #fff6e0;
  background: rgba(8, 4, 18, .7); border: 1px solid rgba(232, 186, 90, .35); }
.fr-fld input:focus { outline: none; border-color: var(--gold-1); box-shadow: 0 0 0 3px rgba(242, 193, 78, .25); }
.fr-fld input.bad { border-color: #ff7a66; }
.fr-add .ferr { min-height: 18px; font-size: 14px; color: #ffcf9a; }
.fr-reqs { display: flex; flex-direction: column; gap: 8px; }
.fr-rrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid rgba(232, 186, 90, .1); }
.fr-rrow .fr-av { width: 46px; height: 46px; }
.fr-rrow.out .fr-t em { color: #bdb3c9; }
.fr-blocked summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--muted); font-size: 14px; }
.fr-blocked .fr-rrow { grid-template-columns: minmax(0, 1fr) auto; }
.fr-guest .fr-big { min-height: 60px; padding: 0 28px; font-size: 18px; display: inline-flex; gap: 10px; align-items: center; margin-top: 10px; }

/* Home top bar button */
.hubtop .fr-hbtn { position: relative; }
.hubtop .fr-hbtn::after { content: ""; position: absolute; inset: -10px; } /* a bigger tap area than the icon, same look as its neighbours */
.fr-hbadge { position: absolute; right: -4px; top: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; font: 900 12px/1 var(--font-ui); color: #fff2e8; box-sizing: border-box;
  background: radial-gradient(circle at 35% 30%, #ff9b7a, #c3281c 55%, #6e0f08); box-shadow: 0 0 0 2px rgba(10, 5, 20, .9), 0 0 10px rgba(255, 90, 60, .6); pointer-events: none; }

/* the invite card: top centre, over everything (sheets 990, toast 1200) */
.fr-inv { position: absolute; left: 50%; top: 22px; z-index: 1150; width: 720px; max-width: calc(100% - 40px); box-sizing: border-box; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px;
  padding: 18px 22px 22px; border-radius: 20px; overflow: hidden; text-align: left;
  background: linear-gradient(180deg, rgba(40, 24, 74, .98), rgba(16, 9, 32, .98)); border: 1px solid rgba(242, 193, 78, .7);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 24px 60px rgba(0, 0, 0, .7), 0 0 40px rgba(242, 193, 78, .22);
  transform: translate(-50%, -140%); opacity: 0; transition: transform .45s var(--ease-back, cubic-bezier(.3, 1.4, .5, 1)), opacity .25s; }
.fr-inv.on { transform: translate(-50%, 0); opacity: 1; }
.fr-inv-av { width: 84px; height: 84px; border-radius: 50%; background: #20143a center / cover no-repeat; box-shadow: 0 0 0 3px rgba(242, 193, 78, .8), 0 0 24px rgba(242, 193, 78, .4); }
.fr-inv-t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fr-inv-t em { display: flex; align-items: center; gap: 8px; font: 800 13px var(--font-ui); font-style: normal; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-1); }
.fr-inv-t em .ico { width: 18px; height: 18px; }
.fr-inv-t b { font: 800 26px/1.15 var(--font-title); color: #fff6e0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-inv-t > span { font-size: 16px; color: #e9dfcf; }
.fr-inv-deck { appearance: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 4px; padding: 0 12px; align-self: flex-start; max-width: 100%;
  border-radius: 10px; border: 1px solid rgba(232, 186, 90, .3); background: rgba(255, 255, 255, .05); color: #d8cdbd; font: 600 14px var(--font-ui); cursor: pointer; }
.fr-inv-deck span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .fr-inv-deck u { color: var(--gold-1); text-underline-offset: 3px; }
.fr-inv-deck .ico { width: 18px; height: 18px; flex: none; }
.fr-inv-b { display: flex; flex-direction: column; gap: 10px; }
.fr-inv-b .btn { min-height: 56px; min-width: 150px; font-size: 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.fr-inv-b .btn .ico { width: 20px; height: 20px; }
.fr-inv-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255, 255, 255, .08); }
.fr-inv-bar i { position: absolute; inset: 0; transform-origin: left; background: linear-gradient(90deg, #f6d06a, #ff9b5a); animation: frDrain linear forwards; }
@keyframes frDrain { to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .fr-inv { transition: opacity .2s; } }

/* queued while you play: a small badge, top centre under the battle bar */
.fr-qbadge { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); z-index: 1100; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 99px; border: 1px solid rgba(242, 193, 78, .7); background: rgba(20, 11, 40, .92); color: #fff6e0; font: 800 14px var(--font-ui); cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .5); animation: frPulse 2.4s ease-in-out infinite; }
.fr-qbadge .ico { width: 20px; height: 20px; }
@keyframes frPulse { 50% { box-shadow: 0 8px 20px rgba(0, 0, 0, .5), 0 0 18px rgba(242, 193, 78, .55); } }

/* Free-for-All lobby: invite friends from inside the table */
.fr-lbpick { display: flex; flex-direction: column; gap: 8px; max-height: 250px; overflow-y: auto; margin: 6px 0 14px; padding: 10px; border-radius: 14px; background: rgba(0, 0, 0, .25); border: 1px solid rgba(232, 186, 90, .2); text-align: left; }
.fr-lbpick[hidden] { display: none; }
.fr-lbrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.fr-lbrow .fr-avw { width: 46px; height: 46px; }

/* quick deck pick */
.fr-dks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; max-height: 480px; overflow-y: auto; margin: 10px 0 18px; text-align: left; }
.fr-dk { appearance: none; display: flex; flex-direction: column; gap: 4px; min-height: 64px; padding: 10px 14px; border-radius: 12px; cursor: pointer; text-align: left;
  border: 1px solid rgba(232, 186, 90, .3); background: rgba(255, 255, 255, .05); color: #fff6e0; font: 800 16px var(--font-ui); }
.fr-dk span { font: 600 13px var(--font-ui); color: var(--muted); }
.fr-dk.on { border-color: var(--gold-1); box-shadow: 0 0 0 2px rgba(242, 193, 78, .35); }
#sheet .box.fr-dksheet { width: 820px; max-width: 94%; }

/* phones (stage scaled down): double the sizes so taps stay 44px+ on the device */
body.mobile .fr-btn { min-height: 104px; min-width: 104px; font-size: 22px; padding: 0 22px; border-radius: 16px; }
body.mobile .fr-btn .ico { width: 28px; height: 28px; }
body.mobile .fr-avw { width: 84px; height: 84px; } body.mobile .fr-dot { width: 24px; height: 24px; }
body.mobile .fr-t b { font-size: 26px; } body.mobile .fr-t em, body.mobile .fr-note, body.mobile .fr-muted { font-size: 19px; }
body.mobile .fr-fld input { min-height: 104px; font-size: 24px; }
body.mobile .fr-add .ferr { font-size: 19px; }
body.mobile .fr-prow > span { font-size: 20px; }
body.mobile .fr-rrow .fr-av { width: 70px; height: 70px; }
body.mobile .fr-blocked summary { min-height: 104px; font-size: 20px; }
body.mobile .fr-tabn { min-width: 32px; height: 32px; font-size: 17px; }
body.mobile .fr-hbadge { min-width: 34px; height: 34px; font-size: 18px; }
body.mobile .fr-inv { width: 1100px; top: 26px; gap: 24px; padding: 24px 28px 30px; }
body.mobile .fr-inv-av { width: 120px; height: 120px; }
body.mobile .fr-inv-t em { font-size: 19px; } body.mobile .fr-inv-t b { font-size: 38px; } body.mobile .fr-inv-t > span { font-size: 24px; }
body.mobile .fr-inv-deck { min-height: 104px; font-size: 21px; padding: 0 18px; }
body.mobile .fr-inv-b .btn { min-height: 104px; min-width: 220px; font-size: 26px; }
body.mobile .fr-qbadge { min-height: 104px; font-size: 22px; padding: 0 26px; top: 90px; }
body.mobile .fr-dk { min-height: 108px; font-size: 22px; } body.mobile .fr-dk span { font-size: 18px; }
body.mobile .fr-lbpick { max-height: 360px; }

/* portrait: one column, the friends list first, then add + requests */
body.portrait .fr-wrap { grid-template-columns: minmax(0, 1fr); gap: 16px; }
body.portrait .fr-main, body.portrait .fr-add, body.portrait .fr-reqs { padding: 22px; border-radius: 24px; }
body.portrait .fr-row { grid-template-columns: auto minmax(0, 1fr); padding: 14px; }
body.portrait .fr-row .fr-acts { grid-column: 1 / -1; justify-content: stretch; }
body.portrait .fr-row .fr-acts .fr-btn { flex: 1 1 0; }
body.portrait .fr-row .fr-acts .fr-more { flex: 0 0 auto; }
body.portrait .fr-note { grid-column: 1 / -1; }
body.portrait .fr-btn { min-height: 104px; font-size: 24px; border-radius: 18px; }
body.portrait .fr-btn .ico { width: 30px; height: 30px; }
body.portrait .fr-avw { width: 92px; height: 92px; } body.portrait .fr-dot { width: 26px; height: 26px; }
body.portrait .fr-t b { font-size: 30px; } body.portrait .fr-t em, body.portrait .fr-note, body.portrait .fr-muted { font-size: 22px; }
body.portrait .fr-fld input { min-height: 104px; font-size: 28px; }
body.portrait .fr-add .ferr { font-size: 21px; }
body.portrait .fr-prow { flex-wrap: wrap; } body.portrait .fr-prow > span { flex: 1 1 100%; font-size: 24px; } body.portrait .fr-prow .fr-btn { flex: 1 1 0; }
body.portrait .fr-rrow .fr-av { width: 76px; height: 76px; }
body.portrait .fr-blocked summary { min-height: 104px; font-size: 22px; }
body.portrait .fr-tabn { min-width: 34px; height: 34px; font-size: 19px; }
body.portrait #hub .hubtop #hFriends { right: 0; top: 354px; } /* under Settings (126) and Feedback (240) */
body.portrait .fr-hbadge { top: -6px; right: -6px; min-width: 36px; height: 36px; font-size: 19px; }
body.portrait .fr-inv { width: 860px; max-width: calc(100% - 24px); top: 24px; grid-template-columns: auto minmax(0, 1fr); gap: 20px; padding: 24px 24px 30px; }
body.portrait .fr-inv-av { width: 120px; height: 120px; }
body.portrait .fr-inv-t em { font-size: 20px; } body.portrait .fr-inv-t b { font-size: 40px; } body.portrait .fr-inv-t > span { font-size: 26px; }
body.portrait .fr-inv-deck { min-height: 104px; font-size: 22px; padding: 0 18px; }
body.portrait .fr-inv-b { grid-column: 1 / -1; flex-direction: row; }
body.portrait .fr-inv-b .btn { flex: 1 1 0; min-height: 108px; font-size: 28px; }
body.portrait .fr-qbadge { min-height: 104px; font-size: 24px; padding: 0 28px; top: 120px; }
body.portrait .fr-dks { grid-template-columns: minmax(0, 1fr); max-height: 900px; }
body.portrait .fr-dk { min-height: 100px; font-size: 26px; } body.portrait .fr-dk span { font-size: 20px; }
body.portrait #sheet .box.fr-dksheet { width: 860px; }
body.portrait .fr-lbpick { max-height: 520px; }
body.portrait .fr-lbrow .fr-avw { width: 76px; height: 76px; }
body.portrait .fr-none .fr-side { order: -1; } /* no friends yet: the add form comes first */
body.portrait .fr-fld input { font-size: 34px; }
body.portrait .fr-empty { padding: 44px 24px; gap: 12px; } body.portrait .fr-empty .ico { width: 64px; height: 64px; }
body.portrait .fr-empty b { font-size: 32px; } body.portrait .fr-empty span { font-size: 24px; line-height: 1.4; }
body.mobile .fr-empty b { font-size: 28px; } body.mobile .fr-empty span { font-size: 21px; }
body.portrait .fr-add .m-h, body.portrait .fr-reqs .m-h { justify-content: flex-start; }
