/* The board beside the game (Online, Chat, Teman): parchment in a wooden
   frame, orange tabs and green buttons, like the game's own panels. */

.social {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--parchment) 0%, var(--parchment-deep) 100%);
  box-shadow: 0 0 0 5px var(--wood) inset, 0 0 0 7px var(--gold) inset, 0 18px 50px rgba(0, 0, 0, 0.6);
  outline: 1px solid rgba(242, 196, 107, 0.4);
  outline-offset: 3px;
  color: var(--ink);
  font-size: 14px;
}

.side-tabs {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.side-tabs button {
  position: relative;
  min-width: 0;
  height: 36px;
  border: 2px solid var(--ink);
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, #e9d4a8 0%, #c9a970 100%);
  color: var(--wood-dark);
  font: 800 13px system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}

.side-tabs button:hover { filter: brightness(1.05); }

.side-tabs button[aria-selected="true"] {
  background: linear-gradient(180deg, #ffcf6a 0%, #f39a1f 100%);
  color: var(--ink);
}

.tab-count { font-size: 11px; font-weight: 700; }

.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: #d62828;
  color: #fff;
  font: 800 10px system-ui, sans-serif;
}

.side-tabs .tab-badge { position: absolute; top: -8px; right: -6px; }
.tab-badge[hidden] { display: none; }

.side-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.side-panel[hidden] { display: none; }
.side-hint { flex: none; margin: 0 0 8px; color: var(--wood); font-size: 12px; font-weight: 600; text-align: center; }
.chat-form + .side-hint { margin: 6px 0 0; }
.side-note { margin: 10px 0; color: var(--wood); font-size: 13px; font-weight: 600; text-align: center; }
.side-note:empty { display: none; }

.people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
}

.people:empty { display: none; }
#friend-requests { flex: none; margin-bottom: 8px; }

.person {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 2px solid rgba(94, 49, 16, 0.35);
  border-radius: 10px;
  background: #fff7e3;
}

.person--offline { background: rgba(255, 247, 227, 0.55); }
.person--offline .avatar { filter: grayscale(1); opacity: 0.55; }
.person--waiting .avatar { filter: grayscale(1); opacity: 0.4; }
.person__text { min-width: 0; display: flex; flex-direction: column; }
.person__name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person__state { color: var(--wood); font-size: 11px; font-weight: 600; }
.person__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }

.avatar {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(160deg, #ffcf6a, #e05a1e);
  color: var(--ink);
  font-weight: 900;
}

.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar--small { width: 30px; height: 30px; font-size: 13px; }

.mini-btn {
  height: 28px;
  padding: 0 9px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff7e3;
  color: var(--ink);
  font: 800 12px system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--ink);
}

.mini-btn:hover { background: #ffe9b8; }
.mini-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--ink); }
.mini-btn--primary { background: linear-gradient(180deg, #6fd35f 0%, var(--leaf) 55%, var(--leaf-dark) 100%); color: #fff; text-shadow: 0 1px 0 var(--ink); }
.mini-btn--primary:hover { background: linear-gradient(180deg, #82e070 0%, #47bf41 55%, var(--leaf-dark) 100%); }
.mini-btn--quiet { border-color: rgba(30, 15, 5, 0.35); background: transparent; box-shadow: none; color: var(--wood-dark); }

.chat-rooms { flex: none; display: flex; gap: 5px; overflow-x: auto; padding: 2px 2px 8px; }
.chat-room { flex: none; height: 28px; display: inline-flex; align-items: center; gap: 4px; }
.chat-room[aria-selected="true"] { background: linear-gradient(180deg, #ffcf6a 0%, #f39a1f 100%); }

.chat-log {
  list-style: none;
  flex: 1;
  min-height: 120px;
  margin: 0 0 8px;
  padding: 10px;
  overflow-y: auto;
  border: 2px solid rgba(94, 49, 16, 0.45);
  border-radius: 10px;
  background: #fffaf0;
  box-shadow: inset 0 2px 6px rgba(94, 49, 16, 0.18);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-line {
  max-width: 88%;
  align-self: flex-start;
  padding: 5px 9px;
  border: 1px solid rgba(94, 49, 16, 0.25);
  border-radius: 10px 10px 10px 3px;
  background: #f1e1bd;
}

.chat-line--mine {
  align-self: flex-end;
  border-color: var(--ink);
  border-radius: 10px 10px 3px 10px;
  background: linear-gradient(180deg, #ffd27a 0%, #f7a733 100%);
}

.chat-line__head { display: flex; gap: 6px; color: var(--wood-dark); font-size: 11px; font-weight: 700; opacity: 0.85; }
.chat-line__text { display: block; font-size: 13px; overflow-wrap: anywhere; }
.chat-empty { margin: auto; color: var(--wood); font-size: 12px; font-weight: 600; }

.social form.chat-form,
.social form.friend-search { flex: none; display: flex; gap: 6px; }
.friend-search { margin-bottom: 8px; }

.social input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 2px solid rgba(94, 49, 16, 0.55);
  border-radius: 9px;
  background: #fffaf0;
  color: var(--ink);
  font: 14px system-ui, sans-serif;
}

.social input::placeholder { color: rgba(94, 49, 16, 0.6); }
.social input:focus { outline: none; border-color: #f39a1f; box-shadow: 0 0 0 3px rgba(243, 154, 31, 0.3); }

.chat-form button,
.friend-search button {
  height: 38px;
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: linear-gradient(180deg, #6fd35f 0%, var(--leaf) 55%, var(--leaf-dark) 100%);
  color: #fff;
  font: 800 14px system-ui, sans-serif;
  text-shadow: 0 1px 0 var(--ink);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}

.chat-form button:active,
.friend-search button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

.friends-source { flex: none; margin: 0 0 8px; color: var(--wood); font-size: 12px; line-height: 1.4; }
.friends-source a { color: #c24a10; font-weight: 800; }

.blocked-list { flex: none; margin-top: 10px; color: var(--wood); font-size: 12px; }
.blocked-list summary { font-weight: 800; cursor: pointer; }
.blocked-list .people { margin-top: 6px; }

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(320px, calc(100vw - 32px));
}

.toast {
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--parchment);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--ink), 0 10px 30px rgba(0, 0, 0, 0.5);
  font: 700 13px system-ui, sans-serif;
}

.toast__text { margin: 0; }
