/* ==================================================================
   social.css — gaya untuk modul Builder 3 (wallet + aliansi + chat).
   File ini juga memuat gaya modal wallet (wallet.js) & tombol bersama,
   karena wallet.js tidak punya file CSS sendiri.
   Palet mengikuti tema game: cokelat hangat + emas (#78350f / #f5b727).
   Semua kelas memakai prefix gl404- / soc- agar tidak bentrok dengan
   CSS worker lain.
   ================================================================== */

/* ---------- Tombol bersama ---------- */
.gl404-btn {
  display: inline-block;
  padding: 9px 14px;
  margin: 6px 0;
  border: 1px solid #d6a419;
  border-radius: 8px;
  background: #fef3c7;
  color: #78350f;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}
.gl404-btn:hover { background: #fde68a; }
.gl404-btn:active { transform: translateY(1px); }
.gl404-btn-block { display: block; width: 100%; }
.gl404-btn-primary {
  background: #f5b727;
  border-color: #b45309;
  color: #451a03;
}
.gl404-btn-primary:hover { background: #fbbf24; }
.gl404-btn-ghost {
  background: transparent;
  border-color: #d1d5db;
  color: #6b7280;
  font-weight: 500;
}
.gl404-btn-ghost:hover { background: #f3f4f6; }
.gl404-btn-danger {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}
.gl404-btn-danger:hover { background: #fecaca; }

/* ---------- Modal wallet (wallet.js) ---------- */
.gl404-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.gl404-modal {
  background: #fffbeb;
  color: #1a1a1a;
  border-radius: 12px;
  border: 1px solid #f5b727;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  box-sizing: border-box;
}
.gl404-modal-wide { max-width: 560px; }
.gl404-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
  border-bottom: 1px solid #fde68a;
}
.gl404-modal-title {
  margin: 0;
  font-size: 17px;
  color: #92400e;
}
.gl404-modal-close {
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  color: #6b7280;
  padding: 4px 8px;
}
.gl404-modal-body { padding: 12px 16px 16px; }
.gl404-modal-text { font-size: 14px; line-height: 1.5; margin: 8px 0; }
.gl404-modal-note {
  font-size: 12.5px;
  line-height: 1.5;
  color: #6b7280;
  background: #fef9ec;
  border-left: 3px solid #f59e0b;
  padding: 8px 10px;
  margin: 10px 0;
}
.gl404-demo-badge {
  display: inline-block;
  background: #f59e0b;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}
.gl404-pay-detail {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0;
  font-size: 14px;
}
.gl404-pay-row { padding: 3px 0; line-height: 1.45; }
.gl404-mono {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  word-break: break-all;
}
.gl404-qr-wrap { text-align: center; margin: 10px 0; }
.gl404-qr-img {
  width: 200px;
  height: 200px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}
.gl404-wallet-option {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  background: #fff;
}
.gl404-wallet-option-name { font-weight: 700; font-size: 14px; color: #78350f; }
.gl404-wallet-option-desc { font-size: 12.5px; color: #6b7280; margin: 2px 0 6px; }

/* ---------- Tombol wallet di HUD / menu ---------- */
.gl404-wallet-btn {
  padding: 8px 12px;
  border: 1px solid #d6a419;
  border-radius: 8px;
  background: #fef3c7;
  color: #78350f;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.gl404-wallet-btn:hover { background: #fde68a; }
.gl404-wallet-connected {
  background: #dcfce7;
  border-color: #22c55e;
  color: #166534;
}
.gl404-wallet-btn-floating {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* ---------- Toast fallback (bila Game.toast belum ada) ---------- */
.gl404-toast-fallback {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 9999;
  background: #451a03;
  color: #fef3c7;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  max-width: 90vw;
  text-align: center;
}

/* ---------- Panel sosial (social.js) ---------- */
.gl404-social-panel .panel-body,
.gl404-social-body {
  padding: 12px 14px 16px;
  overflow-y: auto;
}
.gl404-demo-banner {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-left: 4px solid #f59e0b;
  border-radius: 6px;
  padding: 9px 11px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #92400e;
  margin-bottom: 12px;
}
.soc-text { font-size: 14px; line-height: 1.55; margin: 8px 0; }
.soc-note { font-size: 12.5px; line-height: 1.5; color: #6b7280; margin: 8px 0; }
.soc-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  margin: 10px 0;
}
.soc-box-title { margin: 0 0 8px; font-size: 15px; color: #92400e; }
.soc-row { font-size: 14px; padding: 3px 0; }
.soc-input {
  display: block;
  width: 100%;
  padding: 9px 10px;
  margin: 6px 0;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  background: #fff;
}
.soc-input:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}
.soc-war {
  text-align: center;
  font-size: 13.5px;
  color: #6b7280;
  font-style: italic;
  margin: 14px 0 8px;
}

/* Daftar anggota aliansi */
.soc-member-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.soc-member {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}
.soc-member:last-child { border-bottom: none; }
.soc-member-name { font-weight: 600; }
.soc-member-role {
  margin-left: auto;
  font-size: 12.5px;
  color: #6b7280;
}
.soc-badge-demo {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}
.soc-badge-me {
  background: #dcfce7;
  border: 1px solid #22c55e;
  color: #166534;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

/* Log aliansi */
.soc-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
}
.soc-log-item { padding: 4px 0; border-bottom: 1px solid #f3f4f6; }
.soc-log-item:last-child { border-bottom: none; }

/* ---------- Chat ---------- */
.soc-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.soc-tab {
  flex: 1;
  padding: 9px 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.soc-tab-active {
  background: #f5b727;
  border-color: #b45309;
  color: #451a03;
}
.soc-chat-list {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  min-height: 220px;
  max-height: 46vh;
  overflow-y: auto;
  margin-bottom: 10px;
}
.soc-chat-msg {
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
}
.soc-chat-mine { background: #fef3c7; }
.soc-chat-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}
.soc-chat-author { font-weight: 700; font-size: 13px; color: #78350f; }
.soc-chat-time { font-size: 11.5px; color: #9ca3af; }
.soc-chat-text { word-break: break-word; }
.soc-report-btn {
  border: none;
  background: none;
  color: #9ca3af;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0 0;
  text-decoration: underline;
}
.soc-report-btn:hover { color: #ef4444; }
.soc-chat-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.soc-chat-input { flex: 1; margin: 0; }
.soc-chat-send { margin: 0; white-space: nowrap; }

/* Tombol menu fallback (bila Game.emit menu:add tidak tersedia) */
.gl404-menu-btn {
  padding: 8px 12px;
  border: 1px solid #d6a419;
  border-radius: 8px;
  background: #fef3c7;
  color: #78350f;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.gl404-menu-btn:hover { background: #fde68a; }
