/* Friends: one small header dock, a slide-in side panel, toasts under the header, and
   one-icon "add friend" actions on leaderboard and result rows. Same palette as dialogs. */

/* Dock: the only new top-level control. Icon, online count, request badge. */
.friends-dock{position:relative;display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 10px;border:1px solid currentColor;border-radius:3px;background:transparent;color:inherit;font:700 11px 'Courier New',monospace;letter-spacing:.06em;cursor:pointer}
.friends-dock[hidden]{display:none}
.is-home .friends-dock{color:#dbdfcd;border-color:#dbdfcd66}
.friends-dock svg{width:18px;height:18px;fill:currentColor}
.friends-dock:hover,.friends-dock[aria-expanded=true]{background:#f5b076;color:#152b31;border-color:#f5b076}
.friends-dock-online:empty{display:none}
.friends-dock-badge{position:absolute;top:-7px;right:-8px;min-width:17px;height:17px;padding:0 4px;border-radius:9px;background:#ff754f;color:#1b242c;font:700 10px/17px Arial,sans-serif;text-align:center;box-shadow:0 0 0 2px #10252e}
.friends-dock-badge[hidden]{display:none}

/* The header (and so the dock) stays above dialog backdrops, so friends are reachable from
   the lobby and results screens too. */
.header{z-index:35}
/* Panel: non-modal, below the header, above dialogs; renders only while open. */
.friends-panel{position:fixed;z-index:36;top:84px;right:0;bottom:0;width:380px;max-width:100vw;display:flex;flex-direction:column;gap:10px;padding:18px 20px 16px;background:#132e38;color:#ecebd7;border-left:1px solid #789482;border-top:3px solid #ec9b68;box-shadow:-10px 0 60px #0009;animation:friends-in .18s ease-out}
.is-home .friends-panel{top:64px}
.friends-panel[hidden]{display:none}
@keyframes friends-in{from{transform:translateX(24px);opacity:0}}
@media(prefers-reduced-motion:reduce){.friends-panel{animation:none}}
.friends-head{display:flex;align-items:flex-start;justify-content:space-between}
.friends-head h2{margin:2px 0 0;font:400 30px Impact,'Arial Narrow',sans-serif;letter-spacing:.04em;color:#f1e8ce}
.friends-head .eyebrow{font:700 9px 'Courier New',monospace;letter-spacing:.14em;color:#edaa76}
.friends-panel .dialog-close{position:static;color:#d4d7bd}
.friends-add label{display:block;margin-bottom:6px;font:8px 'Courier New',monospace;letter-spacing:.12em;color:#abc3af}
.friends-add div{display:flex;gap:8px}
.friends-add input{flex:1;min-width:0;padding:9px 10px;background:#0a222d;color:#f1edd6;border:1px solid #718b766e;border-radius:2px;font:14px Arial,sans-serif}
.friends-add-status,.friends-status{min-height:14px;margin:6px 0 0;font:11px 'Courier New',monospace;color:#c7d5bd}
.friends-status:empty{display:none}
[data-kind=error].friends-add-status,[data-kind=error].friends-status{color:#ffb39c}
[data-kind=ok].friends-add-status{color:#a5dfa4}
.friends-retry{align-self:flex-start}
.friends-retry[hidden]{display:none}
.friends-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;margin:0 -6px;padding:0 6px}
.friends-section[hidden]{display:none}
.friends-section h3,.friends-blocked summary{margin:14px 0 4px;font:700 9px 'Courier New',monospace;letter-spacing:.14em;color:#9fb3a5}
.friends-blocked summary{cursor:pointer}
.friends-rows{list-style:none;margin:0;padding:0}
.friends-rows[aria-busy=true]{opacity:.6}
.friends-empty,.friends-note{margin:10px 0;font:12px Arial,sans-serif;color:#b0c0b3}
.friends-empty[hidden]{display:none}

/* Rows: badge, name + presence (dot AND text), one primary action, overflow menu. */
.friend-row{display:grid;grid-template-columns:30px minmax(0,1fr) auto 26px;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid #718d7426}
.friend-row .rank-badge{width:28px;height:32px;display:block}
.friends-unranked{display:grid;place-items:center;width:28px;height:32px;color:#6f887e;font:14px 'Courier New',monospace}
.friend-name{display:flex;flex-direction:column;min-width:0}
.friend-name strong{font:700 13px Arial,sans-serif;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.friend-name small{display:flex;align-items:center;gap:6px;margin-top:2px;font:10px 'Courier New',monospace;color:#b5c7b8}
.presence-dot{width:8px;height:8px;border-radius:50%;flex:none;background:#6f887e;box-shadow:inset 0 0 0 2px #6f887e}
.friend-row[data-state=offline] .presence-dot{background:transparent}
.friend-row[data-state=offline] strong{color:#b5c2b6}
[data-state=online] .presence-dot{background:#7fd18b;box-shadow:none}
[data-state=training] .presence-dot,[data-state=room] .presence-dot{background:#83cafa;box-shadow:none}
[data-state=queue] .presence-dot,[data-state=match] .presence-dot{background:#f2cd68;box-shadow:none}
.friend-action{display:flex;gap:6px;justify-content:flex-end}
.friend-reason{max-width:110px;font:9px 'Courier New',monospace;color:#9fb3a5;text-align:right}
.friend-reason.pending{color:#f0b782}
.friend-primary,.friend-secondary,.friend-danger{padding:6px 10px;border-radius:2px;font:700 10px 'Courier New',monospace;letter-spacing:.06em;cursor:pointer}
.friend-primary{background:#f18d59;color:#193039;border:1px solid #f6b67f}
.friend-primary:hover{background:#ffb87c}
.friend-secondary{background:transparent;color:#e1e8ca;border:1px solid #739782}
.friend-secondary:hover{background:#23443f}
.friend-danger{background:#c9583f;color:#fff5ea;border:1px solid #f08b6f}
.friend-confirm{display:flex;align-items:center;gap:6px;font:10px 'Courier New',monospace}
.friend-row.confirming .friend-name,.friend-row.confirming .friend-more{display:none}
.friend-row.confirming .friend-action{grid-column:2/5}
.friend-row.confirming .friend-confirm span{margin-right:auto}
.friend-more{position:relative}
.friend-menu-button{width:26px;height:26px;background:transparent;border:1px solid transparent;color:#dbdfcd;font:700 14px Arial,sans-serif;cursor:pointer;border-radius:2px}
.friend-menu-button:hover,.friend-menu-button[aria-expanded=true]{border-color:#739782}
.friend-menu{position:absolute;z-index:2;right:0;top:30px;display:flex;flex-direction:column;min-width:150px;background:#0d2630;border:1px solid #789482;box-shadow:4px 6px 0 #061b2880}
.friend-menu[hidden]{display:none}
.friend-menu button{padding:9px 12px;background:transparent;border:0;color:#e6ead6;text-align:left;font:700 10px 'Courier New',monospace;letter-spacing:.06em;cursor:pointer}
.friend-menu button:hover,.friend-menu button:focus-visible{background:#294a4b;color:#ffe2b0}
.friends-panel button:focus-visible,.friends-panel input:focus-visible,.friends-panel summary:focus-visible{outline:2px solid #f8deab;outline-offset:2px}
.friends-offline{display:flex;gap:10px;align-items:flex-start;padding-top:10px;border-top:1px solid #718d7433;font:700 10px 'Courier New',monospace;letter-spacing:.08em;color:#dce6cf;cursor:pointer}
.friends-offline small{display:block;margin-top:3px;font:400 10px Arial,sans-serif;letter-spacing:0;color:#a9bcae}
.friends-offline input{flex:none;width:16px;height:16px;margin:1px 0 0;padding:0;accent-color:#f18d59}

/* Toasts: under the header on the right, never over the HUD's bottom controls. */
.friends-toasts{position:fixed;z-index:40;top:96px;right:24px;display:flex;flex-direction:column;gap:8px;width:320px;max-width:calc(100vw - 32px);pointer-events:none}
.is-home .friends-toasts{top:72px}
.friends-panel:not([hidden])~.friends-toasts{right:404px}
.friends-toast{pointer-events:auto;padding:12px 14px;background:#132e38;color:#ecebd7;border:1px solid #789482;border-left:3px solid #ec9b68;box-shadow:4px 6px 0 #061b2880;font:12px Arial,sans-serif;animation:friends-in .18s ease-out}
.friends-toast p{margin:0}
.friends-countdown{font:10px 'Courier New',monospace;color:#f0b782}
.friends-toast-actions{display:flex;gap:8px;margin-top:10px}

/* "Add friend": one small icon cell per row on the leaderboard and the results screen. */
.leaderboard-row{grid-template-columns:86px 40px minmax(0,1fr) auto auto}
.row-add-cell,.result-add{display:inline-flex;width:26px;justify-content:center}
.row-add{width:24px;height:24px;padding:0;border:1px solid #739782;border-radius:2px;background:transparent;color:#f0b782;font:700 15px/1 Arial,sans-serif;cursor:pointer}
.row-add:hover,.row-add:focus-visible{background:#f5b076;color:#152b31;outline:none}
.row-add-done{color:#a5dfa4;font:700 12px Arial,sans-serif}
.result-line{display:flex;align-items:center;border-bottom:1px solid #718d7433}
.result-line .result-row{flex:1;border-bottom:0}
.leaderboard-scope{display:inline-flex;border:1px solid #789482}
.leaderboard-scope[hidden]{display:none}
.leaderboard-scope button{padding:6px 10px;background:transparent;border:0;color:#dce8cb;font:700 10px 'Courier New',monospace;letter-spacing:.08em;cursor:pointer}
.leaderboard-scope button[aria-pressed=true]{background:#edaa76;color:#132e38}

/* Statistics moved from the main menu into the profile panel. */
.loadout-link{display:grid;grid-template-columns:1fr auto;align-items:center;width:100%;margin-top:12px;padding:10px 0 0;background:transparent;border:0;border-top:1px solid #92a78e33;color:#eff0d8;text-align:left;cursor:pointer}
.loadout-link span{font:700 10px 'Courier New',monospace;letter-spacing:.12em}
.loadout-link small{grid-column:1;font:10px Arial,sans-serif;color:#9bb6a5;margin-top:2px}
.loadout-link b{grid-row:1/3;grid-column:2;color:#f0b782;font-size:14px}
.loadout-link:hover span{color:#f5b076}
@media(max-width:760px){.friends-panel{width:100vw}}
