/* Social: the player menu (social/playermenu.js), the Amigos panel (social/friends.js) and the
   game-wide notice (ui.js toast). */

/* the player menu */
.player-menu {
  position: fixed; z-index: 70; min-width: 210px; display: grid; gap: 2px; padding: 6px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); box-shadow: 0 12px 30px #000c;
}
.pm-head { padding: 6px 10px 8px; font-family: var(--pixel); font-size: 1rem; color: var(--accent); border-bottom: 1px solid #ffffff12; margin-bottom: 4px; }
.pm-item { text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 0.9rem; cursor: pointer; }
.pm-item:hover { background: #1f3460; }
.pm-item.ranked { color: #ffd23f; }
.pm-row { padding: 8px 10px; }

/* clickable names */
.chat-name.clickable { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.chat-name.clickable:hover { text-decoration: underline; color: var(--accent); }
.player-chip.clickable { cursor: pointer; color: var(--text); font: inherit; font-size: 0.78rem; }
.player-chip.clickable:hover { border-color: var(--accent); }
.pvp-name { border: 0; background: none; padding: 0; color: var(--text); font-family: var(--pixel); font-size: 1rem; cursor: pointer; text-align: left; }
.pvp-name:hover { color: var(--accent); text-decoration: underline; }

/* the Amigos panel */
.fr-add { display: flex; gap: 6px; }
.fr-add .input { min-width: 0; width: 200px; }
.fr-card { display: grid; gap: 6px; margin-bottom: 12px; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.fr-card h3 { font-family: var(--pixel); font-size: 1.05rem; }
.fr-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 8px; border-radius: 8px; background: #0b1424; }
.fr-row.on { background: #12233d; }
.fr-dot { width: 9px; height: 9px; border-radius: 50%; background: #4a5570; flex: none; }
.fr-row.on .fr-dot { background: #4cc96a; box-shadow: 0 0 6px #4cc96a; }
.fr-name { border: 0; background: none; padding: 0; color: var(--text); font-family: var(--pixel); font-size: 1rem; cursor: pointer; }
.fr-name:hover { color: var(--accent); }
.fr-actions { margin-left: auto; display: flex; gap: 6px; }

/* the game-wide notice */
.game-toasts {
  position: fixed; z-index: 61; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(calc(100vw / var(--ui-zoom, 1)) - 32px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.game-toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 10px;
  background: #2a3550; border: 1px solid var(--line); font-size: 0.9rem; box-shadow: 0 8px 24px #000a;
}
.game-toast-actions { display: flex; gap: 6px; }

/* private messages (social/dm.js): the chat box in the corner, the unread count on Amigos */
.dm-box {
  position: fixed; z-index: 62; right: 18px; bottom: 18px; width: min(340px, calc(calc(100vw / var(--ui-zoom, 1)) - 24px)); height: min(420px, calc(60vh / var(--ui-zoom, 1)));
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); box-shadow: 0 16px 40px #000d;
}
.dm-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #ffffff12; }
.dm-head b { font-family: var(--pixel); color: var(--accent); }
.dm-status { font-size: 0.72rem; color: var(--muted); }
.dm-status.on { color: #4cc96a; }
.dm-close { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; }
.dm-close:hover { color: #fff; }
.dm-list { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.dm-line { align-self: flex-start; max-width: 82%; display: grid; gap: 2px; padding: 6px 10px; border-radius: 12px 12px 12px 4px; background: #1f3460; font-size: 0.88rem; overflow-wrap: anywhere; }
.dm-line.mine { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: #3a2340; }
.dm-time { font-size: 0.65rem; color: var(--muted); justify-self: end; }
.dm-send { display: flex; gap: 6px; padding: 8px; border-top: 1px solid #ffffff12; }
.dm-input { flex: 1; min-width: 0 !important; padding: 6px 10px; }
.nav-btn { position: relative; }
.nav-badge {
  position: absolute; top: 4px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: grid; place-items: center; background: var(--red); color: #fff; font-family: var(--pixel); font-size: 0.7rem;
}
.nav-badge.static { position: static; margin-left: auto; }
.fr-dm { width: 100%; border: 0; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.fr-dm:hover { background: #1f3460; }
.fr-dm.unread .fr-name { color: var(--accent); }
.fr-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
@media (max-width: 720px) { .dm-box { right: 12px; left: 12px; width: auto; bottom: 76px; } }
