/* Social window (Guild / Friends), guild line in Inspect, chat tabs + guild chat colours (guild.js).
   Same dark-wood look as social.css (party frames, inspect). */
.gwin { --wood:var(--ui-wood); border-radius:var(--ui-r-panel); --rim:var(--ui-rim), 0 6px 16px rgba(0,0,0,.5);
  position:fixed; left:50%; top:50%; transform:translate(-50%,-50%); z-index:23; width:min(440px, calc(100vw - 24px));
  height:min(560px, calc(100dvh - 24px)); display:flex; flex-direction:column; background:var(--wood); box-shadow:var(--rim);
  font:13px/1.35 var(--ui-font); color:#ecdfc2; }
.ghead { display:flex; gap:2px; align-items:center; padding:3px; background:#2a1d12; }
.gtab { position:relative; background:#1a110a; color:#bda97f; border-radius:var(--ui-r); padding:4px 14px; font-weight:700; font-size:12px; box-shadow:var(--ui-box); }
.gtab.on { background:#3d2a17; color:#f6d488; box-shadow:inset 0 0 0 1px #8a6a3a; }
.gbadge { position:absolute; top:-4px; right:-4px; min-width:14px; height:14px; padding:0 3px; border-radius:7px; background:#d8452c; color:#fff; font-size:10px; line-height:14px; }
.gsp { flex:1; }
.gbody { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; touch-action:pan-y; padding:6px 8px 8px; scrollbar-width:thin;
  display:flex; flex-direction:column; gap:6px; }
.gtitle { display:flex; gap:8px; align-items:center; }
.gembig { width:33px; height:33px; image-rendering:pixelated; flex:none; }
.gem { width:22px; height:22px; image-rendering:pixelated; vertical-align:middle; }
.gname { font-size:15px; font-weight:700; } .gsub { color:#bda97f; font-size:11px; }
.gmotd { position:relative; padding:5px 7px; background:#120c08; box-shadow:inset 0 0 0 1px #3c2a1a; }
.gmotdt { white-space:pre-wrap; word-wrap:break-word; color:#f3e7c8; margin-top:2px; } .gmotdt.empty { color:#7a705e; font-style:italic; }
.gedit { position:absolute; right:4px; top:4px; }
.glbl { color:#f6d488; font-weight:700; font-size:11px; }
.grow { display:flex; gap:4px; align-items:center; flex-wrap:wrap; }
.ginp { flex:1 1 120px; min-width:0; background:var(--ui-slot-bg); color:#f3e7c8; border:0; box-shadow:var(--ui-slot); border-radius:var(--ui-r); padding:4px 6px; font:inherit; font-size:13px; }
.gmotdin { width:100%; resize:vertical; margin-bottom:4px; }
.gchk { display:flex; gap:3px; align-items:center; color:#bda97f; cursor:pointer; }
.gnav { display:flex; gap:2px; border-bottom:1px solid rgba(107,74,42,.6); }
.gsub2 { background:none; color:#bda97f; border-radius:var(--ui-r); padding:3px 9px; font-size:12px; font-weight:600; }
.gsub2.on { color:#f6d488; box-shadow:inset 0 -2px 0 #e8b44a; }
.glist { display:flex; flex-direction:column; gap:2px; }
.grow2 { display:grid; grid-template-columns:8px minmax(60px,1fr) 22px 58px auto minmax(60px,auto); gap:5px; align-items:center;
  padding:3px 5px 3px 6px; background:#120c08; box-shadow:inset 3px 0 0 var(--cc); cursor:pointer; }
.grow2:hover { background:#24180e; }
.grow2.off { opacity:.55; }
.gdot { width:7px; height:7px; border-radius:50%; background:#5a5248; } .gdot.on { background:#6ee05a; box-shadow:0 0 4px #6ee05a; }
.gn { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.glv { color:#f6d488; text-align:right; font-variant-numeric:tabular-nums; }
.gcl { color:var(--cc); font-size:11px; }
.grk { color:#d8ccb0; font-size:11px; }
.gz { color:#9a8e74; font-size:11px; text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gnote { color:#bda97f; padding:2px; }
.glog { display:flex; flex-direction:column; gap:2px; }
.glogr { display:flex; gap:8px; padding:2px 4px; border-bottom:1px solid rgba(107,74,42,.25); }
.glogr .gz { flex:0 0 72px; text-align:left; }
.gpane { display:flex; flex-direction:column; gap:6px; padding:6px; background:rgba(0,0,0,.2); box-shadow:inset 0 0 0 1px #3c2a1a; }
.granks { border-collapse:collapse; width:100%; } .granks th { color:#bda97f; font-weight:400; font-size:11px; }
.granks td, .granks th { padding:3px; text-align:center; border-bottom:1px solid rgba(107,74,42,.3); } .granks td:first-child { text-align:left; font-weight:600; }
.gpick { display:flex; flex-direction:column; gap:3px; }
.gpems, .gpcols { display:flex; flex-wrap:wrap; gap:3px; }
.gpem { padding:2px; background:#120c08; border-radius:var(--ui-r); box-shadow:inset 0 0 0 1px #3c2a1a; min-height:0; }
.gpem.on { box-shadow:inset 0 0 0 2px #f6d488; background:#3d2a17; }
.gpcol { width:24px; height:24px; min-height:0; padding:0; border-radius:var(--ui-r); box-shadow:inset 0 0 0 2px #120a05; }
.gpcol.on { outline:2px solid #fff0c8; outline-offset:1px; }
.gprev { display:flex; align-items:center; gap:4px; padding:4px 6px; background:#120c08; font-weight:700; }
.gprev .gz { font-weight:400; }
.ginvite { padding:6px; background:#1e3a1a; box-shadow:inset 0 0 0 1px #4a8a3a; display:flex; flex-direction:column; gap:4px; }
.greq { padding:3px 5px; background:#120c08; }
.pbtn.gok { background:#3a5a22; } .pbtn.gok:hover { background:#4a7a2a; }
.pbtn.gdanger { background:#5a1e14; } .pbtn.gdanger:hover { background:#7a2a1a; }
.gfoot { justify-content:flex-end; margin-top:auto; padding-top:4px; }
.iguild { display:flex; align-items:center; gap:3px; color:#d8ccb0; font-size:12px; margin-top:1px; }
.iguild .gem { width:16px; height:16px; }

/* chat tabs + guild / officer / friend lines */
.ctabs { display:flex; gap:1px; }
.ctab { position:relative; background:rgba(8,8,14,.6); color:#a89c84; border-radius:6px 6px 0 0; padding:2px 9px; min-height:0; font-size:11px; font-weight:700; }
.ctab.on { background:var(--panel, rgba(10,10,16,.72)); color:#f6d488; }
.ctab.new::after { content:''; position:absolute; right:2px; top:2px; width:5px; height:5px; border-radius:50%; background:#ffb347; }
#chat:not(.typing):not(:hover) .ctabs { opacity:.6; }
#chatLog .ch-g, #chatLog .ch-g .name { color:#7fe0a8; } #chatLog .ch-o, #chatLog .ch-o .name { color:#62d0c8; }
#chatLog .sys.ch-g { color:#6fc08f; } #chatLog .sys.ch-f { color:#e8c890; }
#chatLog.f-g > div:not(.ch-g):not(.ch-o) { display:none; }
#chatLog.f-p > div:not(.ch-p):not(.ch-r) { display:none; }
#chatLog.f-w > div:not(.ch-w) { display:none; }
#socialBtn { pointer-events:auto; }

/* phones: full width, bigger touch targets */
body.touch .gwin { width:calc(100vw - 16px); height:calc(100dvh - 16px - env(safe-area-inset-top,0px)); }
body.touch .gtab { padding:7px 16px; font-size:14px; }
body.touch .grow2 { padding:7px 6px; grid-template-columns:8px minmax(50px,1fr) 22px auto minmax(40px,auto); }
body.touch .grow2 .gcl { display:none; }
body.touch .ginp { font-size:16px; padding:6px; }
body.touch .ctab { padding:5px 10px; font-size:12px; }
@media (max-width: 480px) { .grow2 { grid-template-columns:8px minmax(50px,1fr) 22px auto minmax(40px,auto); } .grow2 .gcl { display:none; } }
