/* One quiet entry point; secondary actions stay inside the dialog. */
.profile-buttons{display:flex;flex-wrap:wrap;justify-content:center;gap:12px}
#open-social{min-height:48px;min-width:200px;background:#fff7e9;color:#42352e;border:2px solid #42352e}
#social-dialog{width:min(560px,calc(100vw - 28px));max-height:90dvh;overflow:auto;padding:32px 24px;text-align:center;background:#fff7e9;color:#42352e;border:2px solid #42352e;border-radius:20px}
#social-dialog h2{font-family:GardenDisplay,Georgia,serif;margin:8px 0 16px}#social-dialog h3{margin:24px 0 12px}
.social-tabs{display:flex;gap:8px;margin:20px 0}.social-tabs button{flex:1;min-width:0;padding:12px 8px;font-weight:700;background:#f1dfc9}.social-tabs button[aria-pressed=true]{background:#e8a59d}
#social-dialog button,#social-dialog a.primary{min-height:44px;font-weight:700}#social-dialog .primary{background:#e8a59d;color:#42352e;border:2px solid #42352e;text-decoration:none;padding:10px 14px;border-radius:10px}
#social-dialog ul,#social-dialog ol{list-style:none;padding:0;margin:12px 0}.social-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:16px 0;border-bottom:1px solid #c4b29f;text-align:left}.social-row>strong{overflow-wrap:anywhere}.social-actions{display:flex;gap:8px;flex-wrap:wrap}.social-row details{width:100%;font-size:14px;font-weight:700}.social-row details button{margin:8px 8px 0 0}.social-empty{padding:16px 0;font-size:14px;font-weight:700;line-height:1.6}
#friend-request-form{display:grid;gap:12px;margin:24px 0}#friend-request-form label{font-weight:700}#friend-code-input{width:100%;text-align:center;text-transform:uppercase;box-sizing:border-box;letter-spacing:2px}#friend-code{font:700 20px monospace;letter-spacing:2px;display:block;margin:12px 0}.social-code{padding:18px;background:#efd7b7;border:1px solid #bca68e;border-radius:14px}
.social-rank{display:grid;grid-template-columns:30px 1fr auto;gap:12px;text-align:left;padding:14px 0;border-bottom:1px solid #c4b29f;font-weight:700}.social-rank strong{overflow-wrap:anywhere}.ranking-choice{display:flex;justify-content:center;align-items:center;gap:10px;font-weight:700;padding:16px 0}.ranking-choice input{width:20px;height:20px}.social-small,#social-message{font-size:14px;font-weight:700;line-height:1.6}#social-message{min-height:22px;margin-top:20px}
@media(max-width:420px){#social-dialog{padding:28px 18px}.social-tabs button{font-size:14px}.profile-buttons{width:100%}.profile-buttons button{flex:1}.social-rank{gap:8px;font-size:14px}}
.public-room-option{padding:20px 0;margin-bottom:20px;border-bottom:1px solid currentColor;text-align:center}.public-room-option p{font-weight:650;line-height:1.5}.public-game{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px 0;border-bottom:1px solid #d9c8cb}.public-game p{font-size:15px;font-weight:650;margin:6px 0}.public-game .primary{white-space:nowrap;text-decoration:none}.public-game strong{font-size:19px}#discovery-dialog{max-width:520px;width:calc(100% - 40px);box-sizing:border-box;text-align:center}#public-games{text-align:left}#refresh-games{margin-top:16px}#discovery-message{font-weight:650;line-height:1.5}@media(max-width:380px){.public-game{flex-direction:column;text-align:center}.public-game .primary{width:100%;box-sizing:border-box}}

/* Always-visible confirmation; no new banner shifts the game board. */
#social-message{position:sticky;top:0;z-index:5;margin:0 0 16px;padding:12px 14px;border:2px solid #635447;border-radius:10px;background:#fff1cf;box-shadow:0 2px 0 #635447;color:#42352e;overflow-wrap:anywhere}
#social-message:empty{display:none}
.friend-presence{display:block;font-size:14px;font-weight:700;margin-top:6px;color:#706659}.friend-presence::before{content:"";display:inline-block;width:8px;height:8px;margin-right:7px;border-radius:50%;background:#9d968b}.friend-presence.online::before{background:#527347}
.player-name{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.add-player-friend{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:8px;background:#fffaf0;color:#42352e;border:1.5px solid #635447;border-radius:10px;box-shadow:0 2px 0 #635447;flex:none}.add-player-friend:hover:not(:disabled){background:#f0ce83}.add-player-friend svg{pointer-events:none}
.social-row>.social-actions{gap:10px}.social-row .social-actions button{border:2px solid #635447;border-radius:10px;background:#f0ce83;color:#42352e;font-size:14px}.social-row .social-actions .primary{background:#e8a59d}.social-row>strong{flex:1;min-width:120px}

.add-by-code{margin:20px 0;background:#fff1dc;border:1px solid #bca68e;border-radius:12px;padding:16px}.add-by-code summary{font-weight:800}.add-by-code .social-code{margin-top:16px}

#social-dialog .social-row details{border:0;margin:0;padding:4px 0}#social-dialog>div>section>details:not(.add-by-code){border:0;padding:12px 0}
