/* Alliance Wars - social panels: clan, cities, reports, notes, profile, chat, settings. Portrait first. */
.so { display: block; }
.so .grow, .so-city .grow { flex: 1; min-width: 0; }
.so .small, .so-rep-sub.small { font-size: 12px; }
.so-gap { margin-top: 10px; }
.so h3 { font-size: 19px; }
.so label { display: block; margin-top: 10px; font-weight: 800; }
.so label input, .so label textarea { margin-top: 4px; }
.so-tag { color: var(--gold); font-family: var(--pix); }
.so-desc { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.25); color: var(--ink2); font-weight: 600; white-space: pre-wrap; word-break: break-word; }
.so-rep-sub { display: block; font-size: 12.5px; color: var(--ink2); margin-top: 2px; font-weight: 700; }
.so-lvl { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 5px; border-radius: 7px 7px 12px 12px; background: linear-gradient(#ffd75f, #e09a1f); color: #3b2a1a; font: 700 13px/1 var(--pix); border: 2px solid #3b2a1a; vertical-align: middle; }
.so-lvl.big { min-width: 40px; height: 40px; font-size: 18px; flex: none; }
.so-kv { min-height: 30px; padding: 3px 0; border-bottom: 1px dashed rgba(255,255,255,.08); gap: 8px; }
.so-kv:last-child { border-bottom: 0; }
.so-total { border-top: 2px solid var(--line); border-bottom: 0; margin-top: 4px; padding-top: 6px; }
.so-tot { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; background: rgba(0,0,0,.28); border: 2px solid #11161f; }
.so-tot b { font: 700 18px/1 var(--pix); color: var(--ink); }
.so-tot span { font-size: 12px; color: var(--mute); font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.so-btns { display: flex; gap: 6px; flex: none; }
.so-btns .btn.small { min-height: 40px; }

/* reports */
.so-revive { background: linear-gradient(#3a2f52, #2a2240); border-color: #6b55a0; }
.so-rep, .so-city, .so-mem { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; min-height: 60px; padding: 8px 10px; border-radius: 12px; background: var(--card); border: 2px solid #11161f; box-shadow: inset 0 2px 0 rgba(255,255,255,.05); }
.so-rep { border-left: 6px solid var(--mute); }
.so-rep.win { border-left-color: var(--green); } .so-rep.loss { border-left-color: var(--red); } .so-rep.scout { border-left-color: var(--sapph); }
.so-rep-kind { display: flex; flex-direction: column; align-items: center; width: 58px; flex: none; font: 700 12px var(--pix); }
.so-rep.win .so-rep-kind b { color: var(--green); } .so-rep.loss .so-rep-kind b { color: var(--red); } .so-rep.scout .so-rep-kind b { color: var(--sapph); }
.so-rep-mid, .so-city-mid { flex: 1; min-width: 0; }
.so-rep-mid > b, .so-city-mid > b { font-size: 15px; }
.so-rep-foe { flex: none; }
.so-outcome { display: flex; align-items: center; gap: 12px; margin: 10px 0; padding: 12px 14px; border-radius: 14px; border: 3px solid #0d111a; font-family: var(--pix); }
.so-outcome > div > b { font-size: 24px; }
.so-outcome.win { background: linear-gradient(#3f9a52, #23683a); } .so-outcome.loss { background: linear-gradient(#b34a40, #7a2a24); } .so-outcome.scout { background: linear-gradient(#3b78c4, #234f8a); }
.so-vs { display: flex; align-items: stretch; gap: 4px; }
.so-vs-mid { align-self: center; font: 700 16px var(--pix); color: var(--gold); flex: none; }
.so-side { flex: 1; min-width: 0; padding: 8px; font-size: 13px; }
.so .so-side + .card, .so-vs .card + .card { margin-top: 0; }
.so-side-top { display: flex; align-items: flex-end; gap: 6px; margin: 4px 0 6px; }
.so-side-name { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so .grid2 .card + .card { margin-top: 0; }
.so .sec-title:first-child { margin-top: 0; }
.so-gear { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; }
.so-g { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; background: rgba(0,0,0,.35); border: 2px solid var(--rc, #333); box-shadow: inset 0 0 8px color-mix(in srgb, var(--rc, #000) 45%, transparent); }
.so-g .ic { width: 70%; height: 70%; }
.so-g i { position: absolute; bottom: -4px; left: 0; right: 0; text-align: center; font-size: 8px; color: var(--gold); font-style: normal; letter-spacing: -1px; }
.so-g.empty-g { border-color: #2a3346; opacity: .45; }
.so-note { align-items: flex-start; }
.so-note.war { border-left: 5px solid var(--red); } .so-note.alert { border-left: 5px solid var(--orange); } .so-note.clan { border-left: 5px solid var(--sapph); }

/* cities */
.so-city { cursor: pointer; }
.so-city.cap { border-color: #8b6a3e; background: linear-gradient(#2f3a55, #262f45); }
.so-up { flex: none; min-height: 40px !important; gap: 3px; }
.so-up[aria-disabled] { opacity: .55; }

/* clan */
.so-clan { padding: 10px; }
.so-create p { margin: 6px 0; } .so-create input { background: #fff8e6; color: var(--parch-ink); border-color: #8b6a3e; }
.so-chead h3 { font-size: 20px; }
.so-role { display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; vertical-align: middle; }
.so-role.leader { background: var(--gold); color: #3b2a1a; } .so-role.officer { background: var(--sapph); color: #0d1a2a; }
.so-mem.me { border-color: var(--gold2); }
.so-mem-av { position: relative; flex: none; }
.so-online { position: absolute; top: -3px; left: -3px; width: 12px; height: 12px; border-radius: 50%; background: #59607a; border: 2px solid #0d111a; }
.so-online.on { background: var(--green); }
.so-val { display: flex; align-items: center; gap: 3px; font: 700 15px var(--pix); color: var(--gold); flex: none; }
.so-sheet { display: flex; gap: 14px; align-items: center; justify-content: center; margin-bottom: 8px; }
.so-sheet-acts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.so-sw { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.so-sw button { width: 32px; height: 32px; border-radius: 8px; border: 3px solid #0d111a; }
.so-sw button.on { outline: 3px solid var(--gold); outline-offset: 1px; }
.so-ban-prev { gap: 14px; margin-bottom: 8px; } .so-ban-prev .btn.small { min-width: 40px; min-height: 40px; }
.so-num { width: 90px; flex: none; }
.so-set .seg { width: 210px; }

/* profile */
.so-phead h3 { font-size: 22px; }
.so-rec { gap: 0 14px; }
.so-stat { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.so-stat-n { width: 74px; flex: none; }
.so-stat .bar { flex: 1; }
.so-stat b { width: 46px; text-align: right; flex: none; }

/* chat */
#panel[data-panel="chat"] .pn-body { display: flex; flex-direction: column; overflow: hidden; padding-bottom: calc(8px + var(--safe-b)); }
.so-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.so-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 10px; touch-action: pan-y; min-height: 0; }
.so-msg { display: flex; gap: 8px; align-items: flex-start; max-width: 88%; }
.so-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.so-msg-av { flex: none; }
.so-bubble { background: var(--card); border: 2px solid #11161f; border-radius: 4px 14px 14px 14px; padding: 6px 10px 8px; min-width: 0; }
.so-msg.mine .so-bubble { background: #2c4a3a; border-color: #183024; border-radius: 14px 4px 14px 14px; }
.so-msg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 12px; }
.so-msg-name { font: 700 14px var(--pix); min-height: 24px; }
.so-msg-lg { color: var(--ink2); } .so-msg-t { color: var(--mute); margin-left: auto; }
.so-msg-txt { margin-top: 2px; font-size: 14.5px; color: var(--ink); word-break: break-word; user-select: text; -webkit-user-select: text; }
.so-say { display: flex; gap: 8px; padding-top: 8px; border-top: 2px solid var(--line); }
.so-say input { flex: 1; min-height: 44px; font-size: 15px; }
.so-say .btn { min-width: 52px; min-height: 44px; }
.so-rules h3 { text-align: center; margin-bottom: 6px; }
.so-rules ol { padding-left: 22px; margin: 8px 0 14px; } .so-rules li { margin: 6px 0; font-weight: 700; }

/* settings */
.so-toggle { min-height: 48px; }
.so-switch { position: relative; width: 62px; height: 40px; border-radius: 20px; background: #3a4258; border: 2px solid #0d111a; flex: none; }
.so-switch i { position: absolute; top: 2px; left: 2px; width: 32px; height: 32px; border-radius: 50%; background: #c8cbd6; transition: left .15s; }
.so-switch.on { background: #23803a; } .so-switch.on i { left: 24px; background: #fff; }
.so-help { align-items: flex-start; } .so-help b { font-family: var(--pix); font-size: 15px; }
.so-credits { text-align: center; }

@media (max-width: 380px) { .so-gear { grid-template-columns: repeat(5, 1fr); } .so-side { font-size: 12px; } }

/* ---- premium pass ---- */
.so-rep, .so-city, .so-mem { background: linear-gradient(175deg, #283450, #1f283d); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 0 rgba(0,0,0,.3); }
.so-rep-kind .ic { width: 40px; height: 40px; filter: drop-shadow(0 2px 1px rgba(0,0,0,.5)); }
.so-rep-sub .ic, .so-city-mid .ic { width: 18px; height: 18px; }
.so-tot { background: linear-gradient(175deg, #283450, #1c2437); box-shadow: inset 0 0 0 1px rgba(233,199,106,.22), 0 2px 0 rgba(0,0,0,.3); padding: 10px 4px 8px; gap: 4px; }
.so-tot .ic { width: 34px; height: 34px; filter: drop-shadow(0 2px 1px rgba(0,0,0,.5)); }
.so-tot b { font-size: 20px; color: #ffe7a8; }
.so-kv .ic { width: 20px; height: 20px; }
.so-up .ic { width: 18px; height: 18px; }
.so-up { font-size: 14px !important; }
.so-outcome { box-shadow: inset 0 0 0 2px rgba(255,255,255,.18), 0 4px 0 rgba(0,0,0,.35); text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.so-outcome .ic { width: 48px; height: 48px; filter: drop-shadow(0 2px 1px rgba(0,0,0,.5)); }
.so-city .so-lvl.big { box-shadow: 0 2px 0 rgba(0,0,0,.4); }
.so-g .ic { width: 78%; height: 78%; }
.so-gear { gap: 5px; }
.so-phead .avatar { border-width: 4px; }
.so-msg-av .avatar { border-width: 2px; }
.so-bubble { box-shadow: 0 2px 0 rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.06); }
.so-switch.on { box-shadow: 0 0 10px rgba(79,207,110,.4); }
.so-phead .so-rep-sub .ic { width: 26px; height: 26px; }
.so-phead { background: linear-gradient(160deg, #34466c, #1d2538); box-shadow: inset 0 0 0 1px rgba(233,199,106,.3), 0 3px 0 rgba(0,0,0,.35); }
.so-stat .ic.sm { width: 24px; height: 24px; }
.so-help .ic.lg { width: 42px; height: 42px; filter: drop-shadow(0 2px 1px rgba(0,0,0,.5)); }
.so-toggle .ic { width: 26px; height: 26px; }
.so-val .ic { width: 22px; height: 22px; }

/* parity lane: locate chip on report rows */
.so-rep-foe { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.so-loc { display: inline-flex; align-items: center; gap: 3px; min-height: 30px; padding: 2px 8px; border-radius: 10px; background: rgba(0,0,0,.35); border: 1.5px solid #3a4867; font: 700 11px var(--pix); }
.so-clancard { width: 100%; text-align: left; color: inherit; gap: 10px; }
/* ---- polish B: compact clan header totals, readable parchment notes, settings rows, map chip tap size ---- */
.so-chead .so-tot { flex-direction: row; justify-content: center; gap: 6px; padding: 6px 4px; min-height: 48px; }
.so-chead .so-tot .ic { width: 28px; height: 28px; flex: none; }
.so-chead .so-tot b { font-size: 17px; }
.so-chead .so-tot span { font-size: 10.5px; letter-spacing: .2px; }
.so-chead .so-tot > div { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.parch .muted, .parch .small.muted { color: #6e5733; }
.so-set label.row { display: flex; }
.so-set label.row > span, .so-set > .row.sp > span { font-weight: 800; }
.so-loc { min-height: 40px; padding: 2px 10px; }
.so-rules { margin: 10px 12px; }
/* city details (Info on a lord's city): art + owner card, estimated defence, stats */
.ci-md { max-width: 640px; }
.ci { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .ci { grid-template-columns: 0.8fr 1.2fr; } }
.ci-left { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ci-art { width: 150px; height: 130px; object-fit: contain; image-rendering: auto; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
.ci-noart { display: grid; place-items: center; }
.ci-owner { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1.5px solid #e9c76a55; color: inherit; text-align: left; }
.ci-owner .avatar { flex: none; }
.ci-owner > span:not(.avatar) { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ci-owner b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-owner small { color: #c9d3e3; }
.ci-card { padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.05); display: flex; flex-direction: column; gap: 8px; }
.ci-h { color: #8fc3ff; font-size: 15px; }
.ci-big { font-size: 20px; color: #fff; }
.ci-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ci-stat { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(0,0,0,.18); }
.ci-stat span { display: flex; flex-direction: column; min-width: 0; }
.ci-stat small { color: #8fc3ff; font-size: 12px; }
.ci-stat b { font-size: 14px; }

/* ---- clan Members: summary card, rank groups, big framed rows, open places ---- */
.hm-top { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 12px; }
.hm-ban { flex: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.hm-stats { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hm-stats > div { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 10px; background: rgba(0,0,0,.3); }
.hm-stats b { font-size: 19px; line-height: 1.1; color: var(--gold); } .hm-stats b small { font-size: 12px; color: var(--mute); }
.hm-stats > div > small { font-size: 11px; color: var(--mute); text-align: center; }
.hm-stats .on b { color: #6ee37f; }
.hm-rank { display: flex; align-items: center; gap: 8px; margin: 14px 2px 6px; }
.hm-rank b { font-size: 15px; color: var(--ink2); } .hm-rank small { margin-left: auto; color: var(--mute); font-weight: 800; }
.hm-rank::after { content: ''; flex: 0 0 30%; height: 1px; background: linear-gradient(90deg, #88643c, transparent); order: 3; }
.hm-rb { min-width: 34px; padding: 2px 6px; border-radius: 7px; text-align: center; font: 900 12px var(--txt); color: #1a1205; border: 1px solid #0d111a; box-shadow: inset 0 1px 0 rgba(255,255,255,.45); }
.hm-rb.r5 { background: linear-gradient(#ffe08a, #d79c22); } .hm-rb.r4 { background: linear-gradient(#e7c8ff, #9a5ee0); } .hm-rb.r3 { background: linear-gradient(#bfe3ff, #4a8fd8); }
.hm-rb.r2 { background: linear-gradient(#c9f0c0, #4fa457); } .hm-rb.r1 { background: linear-gradient(#e4e0d6, #8e8a80); }
.hm-list { display: flex; flex-direction: column; gap: 8px; }
.hm-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-align: left; border-radius: 14px; background: linear-gradient(170deg, #2b3550, #1c2337); border: 2px solid #0d111a; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 3px 0 rgba(0,0,0,.35); }
.hm-row.me { border-color: var(--gold2); box-shadow: inset 0 0 0 1px rgba(245,198,60,.35), 0 0 14px rgba(245,198,60,.18), 0 3px 0 rgba(0,0,0,.35); }
.hm-row:active { transform: translateY(2px); }
.hm-av { position: relative; flex: none; }
.hm-dot { position: absolute; top: -3px; left: -3px; width: 15px; height: 15px; border-radius: 50%; background: #59607a; border: 2.5px solid #0d111a; }
.hm-row.on .hm-dot { background: #4fcf6e; box-shadow: 0 0 8px #4fcf6e; }
.hm-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hm-name { display: flex; align-items: center; gap: 6px; min-width: 0; } .hm-name b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-sub { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink2); } .hm-sub i { font-style: normal; color: var(--mute); margin: 0 2px; } .hm-sub .ic { width: 20px; height: 20px; }
.hm-seen { font-size: 12px; color: var(--mute); } .hm-seen.on { color: #6ee37f; font-weight: 800; }
.hm-val { flex: none; display: flex; flex-direction: column; align-items: center; min-width: 64px; } .hm-val .ic { width: 30px; height: 30px; }
.hm-val b { font-size: 16px; color: var(--gold); line-height: 1.1; } .hm-val small { font-size: 10.5px; color: var(--mute); }
.hm-open { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; }
.hm-slots { flex: none; display: grid; grid-template-columns: repeat(3, 18px); gap: 4px; }
.hm-slots i { width: 18px; height: 18px; border-radius: 6px; border: 2px dashed #6a7a9c; background: rgba(0,0,0,.25); }
.hm-otx { flex: 1; min-width: 0; display: flex; flex-direction: column; } .hm-otx b { font-size: 15px; } .hm-otx small { font-size: 12px; color: var(--mute); line-height: 1.3; }
body.land .hm-list { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 370px) { .hm-row { gap: 8px; padding: 8px; } .hm-val { min-width: 52px; } .hm-name b { font-size: 15px; } }
