/* Friends drawer, invite cards, auth + profile pages. Palette tokens come from templates/base.html. */
#friends-drawer { position: fixed; z-index: 45; top: 4rem; right: 0; bottom: 0; width: min(24rem, 100%); background: var(--panel); border-left: 2px solid var(--border);
  box-shadow: -8px 0 24px rgba(0,0,0,.18); display: flex; flex-direction: column; }
#friends-drawer[hidden] { display: none; }
.fd-head { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; border-bottom: 2px solid var(--border); }
.fd-add { display: flex; gap: .5rem; padding: .75rem 1rem 0; }
.fd-add .input { flex: 1; min-width: 0; }
.fd-msg { margin: .5rem 1rem 0; font-weight: 700; font-size: .95rem; color: var(--accent); }
.fd-body { overflow-y: auto; padding: .5rem 1rem 1rem; flex: 1; }
.fd-body h4 { font-family: var(--display); font-weight: 700; font-size: .92rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.1rem 0 .4rem; }
.fd-row { display: flex; align-items: center; gap: .55rem; padding: .45rem 0; border-bottom: 2px dotted var(--border); }
.fd-row .dot { flex: none; width: .7rem; height: .7rem; border-radius: 50%; background: var(--muted); opacity: .5; }
.fd-row .dot.on { background: var(--ok); opacity: 1; }
.fd-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-name:hover b { color: var(--accent); }
.fd-name small { color: var(--muted); font-weight: 700; }
.fd-x { flex: none; color: var(--muted); padding: .2rem .4rem; border-radius: .5rem; }
.fd-x:hover { color: var(--danger); background: var(--bg); }
.fd-empty { padding: .6rem 0; font-weight: 700; }
#invite-stack { position: fixed; z-index: 70; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .6rem; max-width: calc(100vw - 2rem); }
.inv-card { width: 19rem; max-width: 100%; background: var(--panel); border: 3px solid var(--accent); border-radius: 1.1rem; padding: .8rem 1rem; box-shadow: 0 12px 30px rgba(0,0,0,.3); animation: invin .25s ease-out; }
.inv-t { font-size: 1.05rem; line-height: 1.3; }
.inv-s { font-weight: 700; margin-top: .15rem; }
.inv-b { display: flex; gap: .5rem; margin-top: .6rem; }
@keyframes invin { from { transform: translateY(12px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- profile page ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .7rem; }
.stat { background: var(--bg); border: 2px solid var(--border); border-radius: 1rem; padding: .7rem .9rem; }
.stat b { display: block; font-family: var(--display); font-weight: 900; font-size: 1.9rem; line-height: 1.1; color: var(--accent); }
.stat span { display: block; font-weight: 700; font-size: .85rem; color: var(--muted); margin-top: .15rem; }
.tbl { width: 100%; border-collapse: collapse; font-weight: 700; }
.tbl th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .3rem .5rem; }
.tbl td { padding: .45rem .5rem; border-top: 2px dotted var(--border); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: .05rem .6rem; border-radius: 999px; border: 2px solid var(--border); font-size: .85rem; font-weight: 700; }
.pill.win { background: var(--gold-bg); color: var(--gold-text); border-color: var(--gold-edge); }
.sect { font-family: var(--display); font-weight: 700; font-size: 1.3rem; margin: 1.6rem 0 .6rem; }
