/* Panel de amigos (js/amigos.js, docs/Amigos e invitaciones.md). Se copia TAL
   CUAL en juegos y Goodverso: colores propios (los de la barra común), sin
   variables del tema de cada web. Todo con el prefijo am-. */
.am-raiz { position: relative; display: inline-flex; align-items: center; font: 500 14px/1.3 system-ui, sans-serif; color: #f5f0ff; }
.am-raiz[hidden] { display: none; }
.am-boton {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 999px;
  background: #241e36; color: #fff; font: inherit; font-size: 20px; cursor: pointer;
}
.am-boton:hover, .am-boton[aria-expanded="true"] { background: #3b3259; }
.am-boton:focus-visible, .am-b:focus-visible, .am-x:focus-visible, .am-form input:focus-visible { outline: 2px solid #ffd98a; outline-offset: 2px; }
.am-insignia {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #ff4f7b; color: #fff; font: 700 11px/18px system-ui, sans-serif; text-align: center;
}
.am-insignia[hidden] { display: none; }

.am-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  width: min(380px, calc(100vw - 16px)); max-height: min(72vh, 600px); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 12px 12px; border-radius: 16px; background: #1d182b; border: 1px solid #2f2847;
  box-shadow: 0 16px 40px rgb(0 0 0 / .5); text-align: left;
}
.am-panel[hidden] { display: none; }
.am-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.am-titulo { font-size: 16px; }
.am-x { min-width: 44px; min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: #c9c0e6; font-size: 18px; cursor: pointer; }
.am-x:hover { background: #2f2847; color: #fff; }
.am-panel h3 { margin: 12px 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #a99fcc; }
.am-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.am-persona { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 12px; min-height: 48px; }
.am-persona:hover { background: #241e36; }
.am-avatar {
  position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; color: #fff;
}
.am-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.am-punto { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #6b6385; border: 2px solid #1d182b; }
.am-punto.si { background: #4ade80; }
.am-quien { flex: 1; min-width: 0; display: grid; }
.am-nombre { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-donde { font-size: 12.5px; color: #c9c0e6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-acciones { display: flex; gap: 6px; flex: none; align-items: center; }
.am-b {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 12px;
  border: 0; border-radius: 999px; background: #2f2847; color: #fff !important; font: 600 13px/1 system-ui, sans-serif;
  text-decoration: none !important; cursor: pointer; white-space: nowrap;
}
.am-b:hover { background: #3b3259; }
.am-b:disabled { opacity: .55; cursor: default; }
.am-primario { background: #ffd98a; color: #1b1530 !important; }
.am-primario:hover { background: #ffe7b0; }
.am-sutil { background: transparent; color: #a99fcc !important; padding: 0 8px; }
.am-hecho { font-size: 12.5px; color: #4ade80; white-space: nowrap; }
.am-nota { margin: 6px 4px; font-size: 13px; color: #c9c0e6; }
.am-form { margin-top: 12px; padding-top: 10px; border-top: 1px solid #2f2847; }
.am-etiqueta { display: block; margin: 0 4px 6px; font-weight: 700; }
.am-fila { display: flex; gap: 8px; }
.am-form input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid #3b3259; border-radius: 12px;
  background: #15121f; color: #fff; font: inherit; font-size: 16px; /* 16px: el iPhone no hace zoom */
}
.am-mensaje { margin: 6px 4px 0; min-height: 1em; font-size: 13px; color: #4ade80; }
.am-mensaje.malo { color: #ff8fa6; }
.am-tu { font-size: 12.5px; }

/* Invitaciones: arriba, centradas; en el móvil a todo el ancho. */
.am-tostadas {
  position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 1000;
  width: min(460px, calc(100vw - 16px)); display: grid; gap: 8px; pointer-events: none;
  font: 500 14px/1.3 system-ui, sans-serif; color: #f5f0ff;
}
.am-invitacion {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px;
  background: #241e36; border: 1px solid #ffd98a; box-shadow: 0 12px 30px rgb(0 0 0 / .5);
  animation: am-entra .25s ease-out;
}
.am-invitacion .am-quien { font-weight: 600; }
@keyframes am-entra { from { transform: translateY(-12px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .am-invitacion { animation: none; } }

@media (max-width: 520px) {
  .am-panel { position: fixed; left: 8px; right: 8px; width: auto; top: var(--am-top, 64px); max-height: calc(100dvh - var(--am-top, 64px) - 8px); }
  .am-invitacion { flex-wrap: wrap; }
  .am-invitacion .am-quien { flex-basis: calc(100% - 46px); }
  .am-invitacion .am-acciones { width: 100%; justify-content: flex-end; }
  .am-persona { flex-wrap: wrap; }
  .am-persona .am-quien { flex-basis: 140px; } /* si no cabe con los botones, estos bajan */
  .am-persona .am-acciones { margin-left: auto; }
}
