/* Friends (js/friends.js): the Friends tab's pip, its panel (add by username, challenges, requests, the list, sent,
   blocked), "Add friend" on someone's Agent File, and the challenge row on the menu. The Ops look: hairlines and corner
   brackets, no fills or glows, Chakra Petch for the HUD labels, Barlow Condensed for names, square edges. fr-* only. */

/* the tab's pip: what's waiting for you (requests and challenges), steady, no pulse */
.pl .ops-tabs i.fr-pip { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; margin-left: 0.5em; padding: 0 0.3em; box-shadow: none; font: 800 0.72em / 1 var(--hud); font-style: normal; letter-spacing: 0; color: #fff; background: var(--red); }
.pl .ops-tabs i.fr-pip[hidden] { display: none; }

/* the panel: one column that scrolls inside the screen, like the Agent File */
.pl .df-lboard.fr { align-self: stretch; align-content: start; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; max-height: 100%; padding-bottom: 4cqh;
  grid-template-columns: minmax(0, 1fr); justify-items: stretch; grid-auto-rows: max-content; gap: 2cqh; }
.pl .df-draft.ops > .df-lboard.fr { height: 100%; box-sizing: border-box; }
.pl .df-draft.ops:has(> .df-lboard.fr) > .ops-tabs { background: #0b0b0d; }
.pl .df-lboard.fr > * { min-width: 0; max-width: min(100%, 112cqh); }
.pl .df-lboard.fr > .df-lbtitle, .pl .df-lboard.fr > .df-lbhead { justify-self: start; }
.pl .fr .df-lbtitle { line-height: 0.98; }
.pl .fr .df-lbtitle span { color: var(--red); }
/* the panels' paragraphs are short and fade in late (.df-ready p): these change in place, so they stay put */
.pl .df-ready.fr p { max-width: 72ch; animation: none; }
.pl .fr-live { display: inline-flex; align-items: center; gap: 0.9cqh; font: 600 min(1.5cqh, 2.4cqw) / 1 var(--hud); letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute-2); }
.pl .fr-live[hidden] { display: none; }
.pl .fr-live b { color: var(--bone); font-weight: 700; }
.pl .fr-live i, .pl .fr-status i { width: 0.7em; height: 0.7em; flex: none; background: #3fdc8a; }

/* add by username: one field, one button, one line of answer */
.pl .fr-add { display: grid; gap: 1cqh; width: 100%; }
.pl .fr-add .df-label { justify-self: start; }
.pl .fr-addrow { display: flex; gap: 1.2cqh; min-width: 0; }
.pl .fr-addrow input { flex: 1 1 auto; min-width: 0; max-width: 46cqh; height: max(40px, 5.4cqh); padding: 0 1.6cqh; border: 0; border-radius: 0; box-shadow: inset 0 0 0 1px var(--rule); background: rgba(10, 10, 11, 0.7);
  font: 600 max(16px, min(2.2cqh, 3.6cqw)) / 1 var(--body); color: var(--bone); outline: none; }
.pl .fr-addrow input::placeholder { color: var(--mute-2); }
.pl .fr-addrow input:focus-visible { box-shadow: inset 0 0 0 2px var(--bone); }
.pl .fr-addrow .fr-b { height: max(40px, 5.4cqh); }
.pl .fr-note { min-height: 1.3em; margin: 0; font: 500 min(1.8cqh, 3cqw) / 1.3 var(--body); color: var(--bone); }
.pl .fr-note.bad { color: var(--red); }
.pl .fr-guest { display: grid; gap: 1.2cqh; max-width: 70ch; }
.pl .fr-guest b { font: 800 min(2.8cqh, 4.4cqw) / 1.05 var(--display); text-transform: uppercase; }
.pl .fr-guest span { color: var(--muted); font-size: min(2cqh, 3.3cqw); }
.pl .fr-guest button { justify-self: start; }

/* sections: a label on a hairline, then rows */
.pl .fr-body { display: grid; gap: 2.6cqh; }
.pl .fr-sec { display: grid; gap: 0.8cqh; }
.pl .fr-sech { display: flex; align-items: center; justify-content: space-between; gap: 2cqh; padding-bottom: 0.8cqh; border-bottom: 1px solid var(--rule); }
.pl .fr-count { font: 600 min(1.5cqh, 2.4cqw) / 1 var(--hud); letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute-2); }
.pl .fr-count b { color: var(--bone); }
.pl .fr-empty, .pl .fr-hint { margin: 0.6cqh 0 0; font: 500 min(1.9cqh, 3.2cqw) / 1.4 var(--body); color: var(--muted); max-width: 70ch; }
.pl .fr-hint { font-size: min(1.7cqh, 2.9cqw); }
.pl .fr-list { display: grid; margin: 0; padding: 0; list-style: none; }

/* a row: crest, name and rank, status, actions */
.pl .fr-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 0.6cqh 1.8cqh; min-height: 6.4cqh; padding: 1cqh 0.6cqh; border-bottom: 1px solid rgba(244, 241, 234, 0.08); }
.pl .fr-row:not(:has(.fr-crest)) { grid-template-columns: minmax(0, 1fr) auto auto; }
.pl .fr-crest { width: max(30px, 4.6cqh); height: max(30px, 4.6cqh); object-fit: contain; }
.pl .fr-who { display: grid; gap: 0.4cqh; min-width: 0; }
.pl .fr-name { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 min(2.8cqh, 4.6cqw) / 1 var(--display); letter-spacing: 0.02em; text-transform: uppercase; color: var(--bone); }
.pl .fr-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 min(1.45cqh, 2.4cqw) / 1.2 var(--hud); letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute-2); }
.pl .fr-status { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.4cqh 0.9cqh; font: 600 min(1.5cqh, 2.4cqw) / 1 var(--hud); letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute-2); white-space: nowrap; text-align: right; }
.pl .fr-status.s-offline i { background: none; box-shadow: inset 0 0 0 1px var(--mute-2); }
.pl .fr-status.s-online, .pl .fr-status.s-match, .pl .fr-status.s-duel { color: var(--bone); }
.pl .fr-status.s-match i, .pl .fr-status.s-duel i { background: #f2c14e; }
.pl .fr-status em { flex-basis: 100%; font-style: normal; color: var(--red); text-align: right; }
.pl .fr-friend:not(.on) .fr-name { color: rgba(244, 241, 234, 0.72); }
.pl .fr-friend:not(.on) .fr-crest { opacity: 0.6; }
.pl .fr-acts { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.9cqh; }

/* buttons: hairline boxes; the one that moves you forward is red */
.pl .fr-b { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; min-height: max(34px, 4.4cqh); padding: 0 1.8cqh; border: 0; border-radius: 0; background: none; box-shadow: inset 0 0 0 1px rgba(244, 241, 234, 0.4);
  font: 700 min(1.5cqh, 2.5cqw) / 1 var(--hud); letter-spacing: 0.12em; text-transform: uppercase; color: var(--bone); cursor: pointer; white-space: nowrap; transition: background 0.12s, color 0.12s, box-shadow 0.12s; }
.pl .fr-b:hover, .pl .fr-b:focus-visible { box-shadow: inset 0 0 0 1px var(--bone); background: rgba(244, 241, 234, 0.08); outline: none; }
.pl .fr-b.go { background: var(--red); box-shadow: none; color: #fff; }
.pl .fr-b.go:hover, .pl .fr-b.go:focus-visible { background: #ff2a5e; }
.pl .fr-b.quiet { box-shadow: none; color: var(--mute-2); padding: 0 1cqh; }
.pl .fr-b.quiet:hover, .pl .fr-b.quiet:focus-visible { color: var(--bone); background: none; }
.pl .fr-b.armed { box-shadow: inset 0 0 0 1px var(--red); color: var(--red); background: none; }
.pl .fr-b:disabled { opacity: 0.45; cursor: default; }
.pl .fr-dots { gap: 3px; padding: 0 1.2cqh; }
.pl .fr-dots i { width: 3px; height: 3px; background: currentColor; }

/* a challenge: the row that matters most, with the corner brackets */
.pl .fr-inv { position: relative; padding-inline: 1.6cqh; box-shadow: inset 0 0 0 1px var(--rule); border: 0; background: rgba(10, 10, 11, 0.6); }
.pl .fr-inv::before, .pl .fr-inv::after, .pl .fr-menuinv::before, .pl .fr-menuinv::after { content: ""; position: absolute; width: 1.6cqh; height: 1.6cqh; border: 2px solid var(--red); pointer-events: none; }
.pl .fr-inv::before, .pl .fr-menuinv::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.pl .fr-inv::after, .pl .fr-menuinv::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }
.pl .fr-inv small { color: var(--bone); }

/* the panel's bar: the safety line on the left */
.pl .fr .df-lbbar { justify-content: space-between; }
.pl .fr-safe { font: 600 min(1.45cqh, 2.4cqw) / 1.3 var(--hud); letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute-2); }

/* "Add friend" on someone's Agent File */
.pl .fr-filebar { display: inline-flex; align-items: center; }
.pl .fr-filetag { display: inline-flex; align-items: center; gap: 0.8cqh; font: 700 min(1.6cqh, 2.6cqw) / 1 var(--hud); letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone); }
.pl .fr-filetag::before { content: ""; width: 0.6em; height: 0.6em; background: var(--red); }
.pl .af .df-lbbtn.fr-filebtn::before { content: none; }

/* the challenge on the menu: one row above your ID card, the same box the Today list uses */
.pl .fr-menuinv { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 2cqh; row-gap: 0.7cqh; align-items: center;
  padding: 1.5cqh 2.2cqh; background: rgba(10, 10, 11, 0.82); box-shadow: inset 0 0 0 1px var(--rule); }
.pl .fr-menuinv.fr-new { animation: frIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.pl .fr-mik { grid-column: 1; font: 600 min(1.3cqh, 2cqw) / 1 var(--hud); letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }
.pl .fr-mik b { color: var(--bone); font-weight: 700; }
.pl .fr-mit { grid-column: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 min(2.6cqh, 4.2cqw) / 1 var(--display); letter-spacing: 0.02em; text-transform: uppercase; color: var(--mute-2); }
.pl .fr-mit b { color: var(--bone); }
.pl .fr-menuinv .fr-acts { grid-column: 2; grid-row: 1 / span 2; flex-wrap: nowrap; }
.pl .fr-menureq::before, .pl .fr-menureq::after { border-color: var(--bone); }
.pl .fr-menureq .fr-mik { color: var(--mute-2); }
.pl .fr-menureq .fr-mit { color: var(--bone); }
@keyframes frIn { from { opacity: 0; transform: translateY(-6px); } }

/* phones and tall screens */
@container (max-aspect-ratio: 6 / 5) {
  .pl .df-draft.ops > .df-lboard.fr { height: auto; }
  .pl .fr-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .pl .fr-row .fr-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .pl .fr-row:has(.fr-crest) .fr-acts { grid-column: 2 / -1; }
  .pl .fr-row:not(:has(.fr-crest)) { grid-template-columns: minmax(0, 1fr) auto; }
  .pl .fr-addrow input { max-width: none; }
  .pl .fr-name { font-size: min(3cqh, 5.4cqw); }
  .pl .fr-who small, .pl .fr-status, .pl .fr-b, .pl .fr-safe, .pl .fr-count, .pl .fr-live { font-size: max(11px, min(1.5cqh, 3cqw)); }
  .pl .fr-note, .pl .fr-empty { font-size: max(13px, min(1.9cqh, 3.6cqw)); }
  .pl .fr-mik { font-size: max(10px, 2.6cqw); }
  .pl .fr-menuinv { grid-template-columns: minmax(0, 1fr); }
  .pl .fr-menuinv .fr-acts { grid-column: 1; grid-row: auto; justify-content: flex-start; margin-top: 0.6cqh; }
  .pl .fr-menureq { grid-template-columns: minmax(0, 1fr) auto; }
  .pl .fr-menureq .fr-acts { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
  .pl .fr-mit { font-size: max(16px, 4.6cqw); }
}
@media (prefers-reduced-motion: reduce) { .pl .fr-menuinv.fr-new { animation: none; } }

/* online 1v1 isn't open yet: a clear, quiet notice at the top of the panel */
.pl .fr-soon { display: grid; gap: 0.4cqh; margin: 0.4cqh 0 0.6cqh; padding: 1cqh 1.4cqh; max-width: 70ch; background: color-mix(in srgb, var(--red) 8%, #0d0d0f); box-shadow: inset 3px 0 0 var(--red), inset 0 0 0 1px var(--rule); }
.pl .fr-soon b { font: 700 min(1.5cqh, 2.6cqw) / 1.2 var(--hud); letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }
.pl .fr-soon span { font: 500 min(1.7cqh, 2.9cqw) / 1.4 var(--body); color: var(--bone); opacity: 0.85; }
@container (max-aspect-ratio: 6/5) { .pl .fr-soon b { font-size: max(11px, 3cqw); } .pl .fr-soon span { font-size: max(12px, 3.2cqw); } }
