/* Amis + notifications — brique « social ».
   Repose sur les variables de style.css (thème bois/or de l'app). */

/* ── Onglet Amis ─────────────────────────────────────────────────────────── */
.friends { display: grid; gap: 16px; max-width: 820px; margin: 0 auto; }

.friends__box {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(224, 185, 111, .18);
  border-radius: 14px;
  padding: 14px 16px;
}
.friends__box h3 {
  margin: 0 0 10px;
  font-family: 'Cinzel', serif;
  font-size: 1.02rem;
  letter-spacing: .02em;
  color: #e0b96f;
}

.friends__add { display: flex; gap: 8px; flex-wrap: wrap; }
.friends__add input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(224, 185, 111, .28);
  background: rgba(0, 0, 0, .28);
  color: inherit;
  font: inherit;
}
.friends__add input:focus { outline: 2px solid rgba(224, 185, 111, .55); outline-offset: 1px; }

.friends__code { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; font-size: .88rem; opacity: .85; }
.friends__code code {
  background: rgba(0, 0, 0, .32);
  border: 1px solid rgba(224, 185, 111, .2);
  border-radius: 7px;
  padding: 3px 8px;
  font-size: .82rem;
  /* Un uid est long : on le laisse se couper plutôt que déborder du cadre. */
  word-break: break-all;
  max-width: 100%;
}

.friends__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.friend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .18);
}
.friend__dot {
  width: 9px; height: 9px; flex: none;
  border-radius: 50%;
  background: #6b6257;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .25);
}
.friend__dot.is-online { background: #7cc59a; box-shadow: 0 0 6px rgba(124, 197, 154, .75); }
/* Le nom vient d'un AUTRE joueur : il ne doit jamais casser la mise en page. */
.friend__name { flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.friend__acts { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.friend__acts .btn { padding: 5px 10px; font-size: .82rem; }

/* ── Cloche + panneau de notifications ───────────────────────────────────── */
.topbar__bellwrap { position: relative; display: inline-flex; }

.topbar__bell { position: relative; }
.topbar__bell b {
  position: absolute; top: -6px; right: -6px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: #d9534f;
  color: #fff;
  font-size: .68rem;
  line-height: 17px;
  text-align: center;
  font-weight: 700;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: min(340px, calc(100vw - 24px));
  max-height: min(60vh, 460px);
  overflow-y: auto;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(224, 185, 111, .28);
  background: #17110b;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
}
.notif__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.notif__head strong { font-family: 'Cinzel', serif; color: #e0b96f; margin-right: auto; }
.notif__head .btn { padding: 4px 9px; font-size: .76rem; }

.notif__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.notif {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  border-left: 3px solid transparent;
}
.notif.is-unread { border-left-color: #e0b96f; background: rgba(224, 185, 111, .09); }
.notif__title { font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
.notif__body { font-size: .82rem; opacity: .8; overflow-wrap: anywhere; }
.notif .btn { justify-self: start; margin-top: 4px; padding: 4px 10px; font-size: .78rem; }

@media (max-width: 560px) {
  .notif-panel { position: fixed; top: 62px; right: 12px; left: 12px; width: auto; }
  .friend__acts { margin-left: 0; width: 100%; }
}
