/* "Play with friends" (multiplayer.js). Dialogs reuse .ez-dialog from collectibles/collectibles.css. */
#mapTools #playFriendsBtn { grid-column:1 / -1; min-height:62px; border-radius:16px; border:2px solid #1f2a36; background:linear-gradient(#8fd3c6,#4fa89a); color:#13232a; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; padding:6px; }
#mapTools #playFriendsBtn:hover { filter:brightness(1.06); }
#playFriendsBtn .badge { font-size:9px; font-weight:700; letter-spacing:.16em; background:#13232a; color:#bff1e6; padding:2px 8px; border-radius:99px; }
#playFriendsBtn .label { font-size:15px; font-weight:800; }
#playFriendsBtn .sub { font-size:10.5px; font-weight:600; }
body.compact #playFriendsBtn { display:none !important; }

.mp-dialog { width:min(560px, calc(100vw - 32px)); }
.mp-dialog p { margin:10px 0; }
.mp-error { padding:8px 12px; border-radius:10px; background:#f8e5df; color:#7a2f22; font-weight:600; }
.mp-wide { width:100%; min-height:46px !important; font-size:16px !important; }
.mp-or { margin-top:16px !important; font-weight:650; }
.mp-join { display:flex; gap:8px; }
.mp-code-input { flex:1; min-width:0; font:700 22px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; letter-spacing:.3em; text-transform:uppercase; padding:8px 12px; border-radius:9px; border:1px solid rgba(73,59,39,.35); background:#fff; color:#201d17; }
.mp-code-input:focus-visible { outline:3px solid #d6ad58; outline-offset:1px; }
.mp-connecting { font-weight:650; color:#2f5f8a; }
.mp-code { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:10px; padding:10px 14px; border-radius:12px; background:#f3ead3; }
.mp-code-text { font:800 34px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; letter-spacing:.22em; color:#201d17; }
.mp-hint { font-size:13px; color:#6b604d; margin-top:6px !important; }
.mp-field { margin-top:12px; }
.mp-label { display:block; font-size:12px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:#8a6a2a; margin-bottom:6px; }
.mp-name-row { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.mp-name-row b { font-size:18px; }
.mp-character { display:flex; gap:14px; align-items:flex-start; margin-top:4px; }
.mp-stage { flex:none; width:150px; height:190px; border-radius:12px; background:#f3ead3; margin-top:12px; overflow:hidden; }
.mp-preview { display:block; width:150px; height:190px; }
.mp-options { flex:1; min-width:0; }
.mp-swatches { display:flex; flex-wrap:wrap; gap:6px; }
.mp-dialog .mp-swatch { width:26px; height:26px; min-height:0; padding:0; border-radius:50%; border:2px solid rgba(0,0,0,.18); }
.mp-dialog .mp-swatch[aria-checked="true"] { outline:3px solid #201d17; outline-offset:2px; }
.mp-chips { display:flex; flex-wrap:wrap; gap:5px; }
.mp-dialog .mp-chip { min-height:30px; padding:3px 10px; font-size:13px; border-radius:99px; }
.mp-dialog .mp-chip[aria-checked="true"] { background:#201d17; border-color:#201d17; color:#fff; }
.mp-players { list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:6px; }
.mp-players li { display:flex; align-items:center; gap:6px; padding:4px 10px; border-radius:99px; background:#f3ead3; font-size:13px; }
.mp-players li.me { font-weight:700; }
.mp-dot { flex:none; display:inline-block; width:12px; height:12px; border-radius:50%; border:3px solid transparent; box-sizing:content-box; }
.mp-standings { list-style:none; margin:10px 0 0; padding:0; display:grid; gap:4px; max-height:min(46dvh, 360px); overflow:auto; }
.mp-standings li { display:flex; align-items:center; gap:8px; padding:6px 12px; border-radius:9px; background:#f3ead3; }
.mp-standings li.me { background:#fff1c9; font-weight:700; }
.mp-medal { width:26px; text-align:center; }
.mp-who { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media (max-width:520px) { .mp-character { flex-direction:column; align-items:center; } }

#mpBoard { position:fixed; top:140px; right:14px; z-index:8; width:230px; box-sizing:border-box; padding:8px; border-radius:14px; background:rgba(248,244,234,.94); color:#201d17; border:1px solid rgba(73,59,39,.25); box-shadow:0 6px 18px rgba(0,0,0,.12); font-size:13px; }
#mpBoard[hidden], body.compact #mpBoard { display:none; }
body:not(.walking) #mpBoard { top:98px; }
.mp-board-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; font-weight:650; color:#6b604d; }
.mp-board-head button { font:inherit; font-weight:700; color:#201d17; border:1px solid rgba(73,59,39,.25); background:#fff; border-radius:99px; padding:4px 10px; cursor:pointer; }
#mpBoard ol { list-style:none; margin:0; padding:0; display:grid; gap:2px; }
#mpBoard li { display:flex; align-items:center; gap:7px; padding:3px 6px; border-radius:8px; }
#mpBoard li.me { background:#fff1c9; font-weight:700; }
#mpBoard li.away { opacity:.55; }

#mpToasts { position:fixed; top:14px; left:50%; transform:translateX(-50%); z-index:20; display:grid; gap:6px; justify-items:center; pointer-events:none; width:min(460px, calc(100vw - 32px)); }
.mp-toast { background:rgba(30,27,22,.88); color:#f8f3e9; border-radius:999px; padding:7px 14px; font-size:13px; font-weight:600; box-shadow:0 6px 18px rgba(0,0,0,.18); text-align:center; }
@media (prefers-reduced-motion: no-preference) { .mp-toast { animation:mp-toast 4.2s ease forwards; } }
@keyframes mp-toast { 0% { opacity:0; transform:translateY(-6px); } 6%, 85% { opacity:1; transform:none; } 100% { opacity:0; } }
#mpBoard .mp-next { background:#2f5f8a; border-color:#2f5f8a; color:#fff; }
