/* ═══ SOCIAL (29.9) — friends, clans, the online arena — in the game's own hand ═══ */
#view-social { --sg: #ffd75e; --sg2: #f4b93f; --sb: #7fdcff; --ink: #0a0e1a; }
#view-social > h2 { position: relative; z-index: 2; margin-bottom: 10px !important; }
#view-social .soc { padding-top: 0 !important; }
#view-social .soc { position: relative; z-index: 2; padding: 0 12px 26px; display: flex; flex-direction: column; gap: 14px; }

/* the player's own plate */
.socMe { position: relative; border-radius: 20px; overflow: hidden; border: 2px solid rgba(255,215,94,.55);
  box-shadow: 0 14px 34px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.25); min-height: 108px; }
.socMe .pb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.socMe .pshade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,8,16,.9) 0%, rgba(5,8,16,.6) 50%, rgba(5,8,16,.3) 100%); }
.socMe .prow { position: relative; display: flex; align-items: center; gap: 12px; padding: 13px 14px; }
.socMe .pportrait { width: 66px; height: 66px; border-radius: 50%; flex: none; background-size: cover; background-position: center 20%;
  border: 3px solid var(--sg); box-shadow: 0 4px 14px rgba(0,0,0,.55), 0 0 0 3px rgba(0,0,0,.35); }
.socMe .pname { font-family: 'Lilita One', sans-serif; font-size: 22px; letter-spacing: 1px; color: #fff; line-height: 1.05;
  text-shadow: 0 2px 0 rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.7); display: flex; align-items: center; gap: 8px; }
.socMe .pname i { font-style: normal; font-size: 11px; opacity: .7; }
.socMe .pbadges { display: flex; gap: 6px; margin-top: 6px; align-items: center; flex-wrap: wrap; }
.socMe .pbadges span { display: inline-flex; align-items: center; gap: 4px; font-family: 'Russo One', sans-serif; font-size: 10.5px; letter-spacing: .5px;
  color: #ffe9b0; background: rgba(0,0,0,.5); border: 1px solid rgba(255,215,94,.4); border-radius: 999px; padding: 3px 9px; }
.socMe .pbadges img { width: 13px; height: 13px; }
.socMe .pbadges .lv { color: #cfe3ff; border-color: rgba(127,220,255,.45); }
.socMe .code { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px;
  background: rgba(0,0,0,.42); border-top: 1px solid rgba(255,215,94,.25); }
.socMe .code small { font-family: 'Russo One', sans-serif; font-size: 9px; letter-spacing: 2.5px; color: #9fdcff; }
.socMe .code b { font-family: 'Lilita One', sans-serif; font-size: 20px; letter-spacing: 4px; color: #fff; }
.socMe .code button { flex: none; }

/* buttons — the game's physical buttons */
.sbtn { -webkit-appearance: none; appearance: none; border: 0; cursor: pointer; border-radius: 12px; min-height: 40px; padding: 8px 14px;
  font-family: 'Lilita One', sans-serif; font-size: 15px; letter-spacing: .8px; color: #fff; text-transform: uppercase; white-space: nowrap;
  background: linear-gradient(#3c7fb6, #1a4a78); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 3px 0 #0b2a48, 0 6px 14px rgba(0,0,0,.45); }
.sbtn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 0 #0b2a48; }
.sbtn:disabled { opacity: .5; filter: saturate(.4); }
.sbtn.gold { background: linear-gradient(#fff3ae, #ffd767 34%, #efad27); color: #2c1c00; box-shadow: inset 0 1px 0 #fff, 0 3px 0 #a36312, 0 6px 14px rgba(0,0,0,.45); }
.sbtn.gold:active { box-shadow: inset 0 1px 0 #fff, 0 1px 0 #a36312; }
.sbtn.ghost { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22); box-shadow: none; }
.sbtn.red { background: linear-gradient(#e0574f, #8d1d1d); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 3px 0 #4a0d0d; }
.sbtn.sm { min-height: 32px; padding: 5px 11px; font-size: 12.5px; border-radius: 10px; }
.sbtn.big { width: 100%; min-height: 58px; font-size: 21px; letter-spacing: 1.4px; border-radius: 16px; }

/* the online arena door */
.socArena { position: relative; border-radius: 20px; padding: 16px 16px 14px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #2a4a80 0%, #101c36 55%, #0b1426 100%); border: 1px solid rgba(127,220,255,.4);
  box-shadow: 0 12px 30px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.15); text-align: center; }
.socArena::before { content: ''; position: absolute; inset: -40% -20% auto; height: 120%; background: radial-gradient(circle at 50% 30%, rgba(127,220,255,.22), transparent 60%); pointer-events: none; }
.socArena .k { font-family: 'Russo One', sans-serif; font-size: 9px; letter-spacing: 3.5px; color: var(--sb); }
.socArena h3 { font-family: 'Lilita One', sans-serif; font-size: 26px; letter-spacing: 1px; color: #fff; margin: 4px 0 6px; text-shadow: 0 3px 0 rgba(0,0,0,.35); }
.socArena p { font-size: 12.5px; color: #c7d1e6; line-height: 1.45; margin: 0 auto 14px; max-width: 30ch; }
.socArena .live { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-family: 'Russo One', sans-serif; font-size: 9px; letter-spacing: 2px; color: #9be7b1; }
.socArena .live i { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 10px #34d399; animation: socPulse 1.6s ease-in-out infinite; }
@keyframes socPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(.7); } }

/* sections */
.socSec { border-radius: 18px; border: 1px solid rgba(213,181,104,.55); background: linear-gradient(135deg, rgba(36,52,77,.94), rgba(16,26,47,.93));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 18px rgba(0,0,0,.35); overflow: hidden; }
.socSec .sh { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.socSec .sh h3 { margin: 0; font-family: 'Lilita One', sans-serif; font-size: 18px; letter-spacing: 1.2px; color: #ffe294; display: flex; align-items: center; gap: 8px; }
.socSec .sh h3 small { font-family: 'Russo One', sans-serif; font-size: 9px; letter-spacing: 2px; color: #9fdcff; }
.socSec .sh .acts { display: flex; gap: 6px; }
.socSec .body { padding: 8px 10px 12px; }
.socEmpty { text-align: center; padding: 18px 10px 20px; color: #c3cee0; font-size: 12.5px; line-height: 1.5; }
.socEmpty b { display: block; font-family: 'Lilita One', sans-serif; font-size: 17px; color: #ffe9b0; letter-spacing: 1px; margin-bottom: 4px; }

/* rows: friends, members, board */
.socRow2 { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 8px 8px; border-radius: 12px; min-height: 56px;
  background: linear-gradient(110deg, rgba(32,50,76,.9), rgba(16,26,45,.9)); border: 1px solid rgba(114,131,151,.45); margin-top: 6px; }
.socRow2.me { border-color: #ffdc7c; background: linear-gradient(105deg, rgba(107,80,29,.9), rgba(20,34,58,.95) 45%); box-shadow: inset 0 0 10px rgba(255,200,71,.13), 0 0 8px rgba(255,205,72,.2); }
.socRow2.pending { border-style: dashed; }
.socRow2 .face { width: 44px; height: 44px; border-radius: 50%; background-size: cover; background-position: center 20%; border: 2px solid rgba(255,215,94,.7); position: relative; }
.socRow2 .face i { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: #4b5563; border: 2px solid #0e1626; }
.socRow2 .face i.on { background: #34d399; box-shadow: 0 0 8px #34d399; }
.socRow2 .face i.fight { background: #fb7185; box-shadow: 0 0 8px #fb7185; }
.socRow2 .who { min-width: 0; }
.socRow2 .nm { font-family: 'Lilita One', sans-serif; font-size: 15px; letter-spacing: .6px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.socRow2 .nm em { font-style: normal; font-family: 'Russo One', sans-serif; font-size: 8.5px; letter-spacing: 1.5px; color: #9fdcff; margin-left: 6px; vertical-align: 2px; }
.socRow2 .sub { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-family: 'Russo One', sans-serif; font-size: 9.5px; letter-spacing: .6px; color: #c7d1e6; margin-top: 3px; white-space: nowrap; }
.socRow2 .sub img { width: 12px; height: 12px; vertical-align: -2px; margin-right: 3px; }
.socRow2 .sub .st { color: #9be7b1; }
.socRow2 .sub .st.off { color: #8a93a8; }
.socRow2 .acts { display: flex; gap: 6px; align-items: center; }
.socRow2 .rk { font-family: 'Lilita One', sans-serif; color: #ffe18f; font-size: 18px; width: 44px; text-align: center; }
.socRow2 .rk.top { color: #fff; text-shadow: 0 0 12px var(--sg); }
.socRow2 .tr { font-family: 'Lilita One', sans-serif; font-size: 15px; color: #ffe9b0; white-space: nowrap; }
.socRow2 .tr img { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.socRow2 .role { font-family: 'Russo One', sans-serif; font-size: 8px; letter-spacing: 1.5px; padding: 2px 6px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); color: #cfe3ff; }
.socRow2 .role.leader { color: #ffd75e; border-color: rgba(255,215,94,.6); }
.socRow2 .role.elder { color: #c4b5fd; border-color: rgba(196,181,253,.6); }

/* the clan card */
.clanCard { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 12px 12px 10px; }
.clanBadge { width: 64px; height: 64px; border-radius: 16px; position: relative; overflow: hidden; flex: none; padding: 3px; box-sizing: border-box;
  background: linear-gradient(145deg, #fff0b8, #ffc93c 45%, #b8700c); box-shadow: 0 6px 14px rgba(0,0,0,.5), inset 0 1px 0 #fff; }
.clanBadge img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 13px; }
.clanBadge.sm { width: 44px; height: 44px; border-radius: 12px; padding: 2px; }
.clanBadge.sm img { border-radius: 10px; }
.clanBadge.big { width: 76px; height: 76px; border-radius: 18px; }
.clanBadge.big img { border-radius: 15px; }
.clanCard .nm { font-family: 'Lilita One', sans-serif; font-size: 19px; letter-spacing: 1px; color: #fff; line-height: 1.05; }
.clanCard .nm em { font-style: normal; color: var(--sg); margin-left: 6px; font-size: 14px; }
.clanCard .meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 5px; font-family: 'Russo One', sans-serif; font-size: 9.5px; letter-spacing: .8px; color: #c7d1e6; }
.clanCard .meta img { width: 12px; height: 12px; vertical-align: -2px; margin-right: 3px; }
.clanCard .desc { grid-column: 1 / -1; font-size: 12px; color: #c3cee0; line-height: 1.45; }
.clanCard .btns { grid-column: 1 / -1; display: flex; gap: 8px; }
.clanCard .btns .sbtn { flex: 1; }
/* (29.9 night) the badge class is OURS: the game's global .noti rule (absolute, pointer-events:none) made ADD FRIEND untappable */
.sbtn.socNoti { position: relative; }
.sbtn.socNoti[data-n]:not([data-n="0"])::after { content: attr(data-n); position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #ef4444; color: #fff; font: 700 10px/18px 'Russo One', sans-serif; text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.5); }

/* the board */
.socBoardNote { text-align: center; font-family: 'Russo One', sans-serif; font-size: 8.5px; letter-spacing: 2px; color: #9fdcff; padding: 6px 0 2px; }

/* ── sheets ── */
.socSheet { position: fixed; inset: 0; z-index: 720; display: flex; align-items: flex-end; justify-content: center; background: rgba(4,8,18,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: socFade .2s ease-out; }
.socSheet.center { align-items: center; padding: 20px; }
@keyframes socFade { from { opacity: 0; } to { opacity: 1; } }
.socPanel { width: min(100%, 520px); max-height: min(92vh, 92svh); display: flex; flex-direction: column; border-radius: 22px 22px 0 0; overflow: hidden;
  background: linear-gradient(180deg, #1e2d4a, #0d1629 60%, #0a1120); border: 2px solid rgba(255,215,94,.5); border-bottom: 0; box-shadow: 0 -18px 50px rgba(0,0,0,.7);
  animation: socUp .28s cubic-bezier(.2,.9,.3,1); padding-bottom: env(safe-area-inset-bottom); }
.socSheet.center .socPanel { border-radius: 22px; border-bottom: 2px solid rgba(255,215,94,.5); max-height: 86vh; animation: socPop .3s cubic-bezier(.2,1.3,.3,1); }
@keyframes socUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes socPop { from { transform: scale(.86); opacity: 0; } to { transform: none; opacity: 1; } }
.socPanel .ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid rgba(255,215,94,.25); }
.socPanel .ph h3 { margin: 0; font-family: 'Lilita One', sans-serif; font-size: 21px; letter-spacing: 1.2px; color: #ffe294; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.socPanel .ph small { display: block; font-family: 'Russo One', sans-serif; font-size: 8.5px; letter-spacing: 2px; color: #9fdcff; margin-top: 3px; }
.socPanel .x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: #fff; font: 18px/34px 'Lilita One', sans-serif; text-align: center; cursor: pointer; }
.socPanel .pb2 { padding: 12px 14px 16px; overflow: auto; -webkit-overflow-scrolling: touch; flex: 1; min-height: 0; }
.socPanel .pf { padding: 10px 14px 14px; border-top: 1px solid rgba(255,255,255,.08); display: flex; gap: 8px; }
.socPanel .pf .sbtn { flex: 1; }
.socField { display: block; margin: 10px 0 0; }
.socField span { display: block; font-family: 'Russo One', sans-serif; font-size: 9px; letter-spacing: 2px; color: #9fdcff; margin-bottom: 6px; }
.socField input, .socField textarea, .socField select { box-sizing: border-box; width: 100%; min-height: 44px; border: 1px solid rgba(139,170,196,.7); border-radius: 12px; background: #0b1b30; color: #fff; padding: 10px 12px;
  font: 15px 'Russo One', sans-serif; letter-spacing: .5px; -webkit-appearance: none; appearance: none; }
.socField input.code { text-transform: uppercase; letter-spacing: 5px; font-family: 'Lilita One', sans-serif; font-size: 22px; text-align: center; }
.socField textarea { min-height: 70px; resize: none; font-family: inherit; font-size: 14px; letter-spacing: 0; }
.socField input:focus, .socField textarea:focus, .socField select:focus { outline: 2px solid #f4cf75; }
.socHint { font-size: 12px; color: #c3cee0; line-height: 1.5; margin: 8px 0 0; }
.socErr { margin: 10px 0 0; padding: 9px 12px; border-radius: 10px; background: rgba(239,68,68,.16); border: 1px solid rgba(239,68,68,.5); color: #ffd1d1; font-size: 12.5px; }
.socOk { margin: 10px 0 0; padding: 9px 12px; border-radius: 10px; background: rgba(52,211,153,.14); border: 1px solid rgba(52,211,153,.5); color: #c8ffe6; font-size: 12.5px; }
/* ═══ the clan badge book (29.9) — five across on any phone, nothing wider than the sheet ═══ */
.socClanForm .pb2 { overflow-x: hidden; }
.badgeBook { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bpGroup > span { display: block; font-family: 'Russo One', sans-serif; font-size: 8.5px; letter-spacing: 2.5px; color: #ffe294; margin: 2px 2px 6px; }
.badgePick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.badgePick button { position: relative; display: block; min-width: 0; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden; cursor: pointer;
  border-radius: 12px; border: 2px solid rgba(255,255,255,.14); background: #0b1b30; box-shadow: 0 3px 8px rgba(0,0,0,.4);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; -webkit-tap-highlight-color: transparent; }
.badgePick button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.badgePick button:active { transform: scale(.94); }
.badgePick button.on { border-color: var(--sg); box-shadow: 0 0 0 2px rgba(255,215,94,.35), 0 0 16px rgba(255,215,94,.45); }
.badgePick button.on::after { content: '✓'; position: absolute; right: 3px; bottom: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--sg); color: #2c1c00; font: 12px/18px 'Lilita One', sans-serif; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,.5); }
.ccPreview { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px; border-radius: 16px;
  background: radial-gradient(120% 120% at 0% 0%, rgba(255,215,94,.16), rgba(11,27,48,.6) 60%); border: 1px solid rgba(255,215,94,.4); }
.ccPrevTxt { min-width: 0; }
.ccPrevTxt .nm { font-family: 'Lilita One', sans-serif; font-size: 20px; line-height: 1.12; letter-spacing: .8px; color: #fff; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.ccPrevTxt .nm em { white-space: nowrap; }
.ccPrevTxt .nm em { font-style: normal; color: var(--sg); margin-left: 6px; font-size: 15px; }
.ccPrevTxt .sub { font-family: 'Russo One', sans-serif; font-size: 9px; letter-spacing: 1.8px; color: #9fdcff; margin-top: 4px; }
.segs { display: flex; gap: 6px; margin-top: 6px; }
.segs button { flex: 1; min-height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); color: #cfe3ff; font: 12px 'Russo One', sans-serif; letter-spacing: 1px; cursor: pointer; }
.segs button.on { background: rgba(255,215,94,.2); border-color: var(--sg); color: #fff; }

/* chat */
.chatWrap { display: flex; flex-direction: column; gap: 6px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 92%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg .face { width: 30px; height: 30px; border-radius: 50%; background-size: cover; background-position: center 20%; border: 2px solid rgba(255,215,94,.6); flex: none; }
.msg .bub { border-radius: 14px; padding: 8px 11px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #eef3ff; font-size: 13.5px; line-height: 1.4; word-break: break-word; }
.msg.me .bub { background: rgba(59,130,246,.28); border-color: rgba(127,220,255,.4); }
.msg .bub .nm { display: block; font-family: 'Russo One', sans-serif; font-size: 8.5px; letter-spacing: 1.5px; color: #9fdcff; margin-bottom: 3px; }
.msg .bub .tm { display: block; font-size: 9px; color: #8a93a8; margin-top: 3px; text-align: right; }
.msg.sys { align-self: center; max-width: 100%; }
.msg.sys .bub { background: transparent; border: 0; color: #9aa6c0; font-family: 'Russo One', sans-serif; font-size: 9.5px; letter-spacing: 1px; text-align: center; }
.msg .req { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; min-width: 230px; }
.msg .req img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; border: 2px solid rgba(255,215,94,.6); }
.msg .req .t { font-family: 'Lilita One', sans-serif; font-size: 14px; letter-spacing: .6px; color: #ffe9b0; }
.msg .req .p { font-family: 'Russo One', sans-serif; font-size: 9px; letter-spacing: 1px; color: #c7d1e6; margin-top: 3px; }
.msg .req .bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); margin-top: 6px; overflow: hidden; }
.msg .req .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd75e, #f4b93f); }
.chatInput { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid rgba(255,255,255,.1); }
.chatInput input { flex: 1; min-width: 0; min-height: 44px; border-radius: 22px; border: 1px solid rgba(139,170,196,.7); background: #0b1b30; color: #fff; padding: 0 16px; font-size: 15px; }
.chatInput input:focus { outline: 2px solid #f4cf75; }
.cardPick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.cardPick button { position: relative; display: block; min-width: 0; width: 100%; border: 2px solid rgba(255,255,255,.14); border-radius: 12px; overflow: hidden; background: #0b1b30; padding: 0; aspect-ratio: 1; cursor: pointer; }
.cardPick button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cardPick button span { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 4px; background: rgba(0,0,0,.65); font: 9px 'Russo One', sans-serif; letter-spacing: .6px; color: #fff; text-align: center; }
.cardPick button.on { border-color: var(--sg); box-shadow: 0 0 0 2px rgba(255,215,94,.35); }

/* ── invites + the search ── */
.socToast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 14px); transform: translateX(-50%); z-index: 760; width: min(94vw, 420px);
  border-radius: 18px; border: 2px solid rgba(255,215,94,.7); background: linear-gradient(180deg, #23365a, #0e1a30); box-shadow: 0 16px 40px rgba(0,0,0,.65), 0 0 24px rgba(255,215,94,.25);
  padding: 12px 14px; display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; animation: socDrop .35s cubic-bezier(.2,1.3,.3,1); }
@keyframes socDrop { from { transform: translate(-50%, -30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.socToast .face { width: 52px; height: 52px; border-radius: 50%; background-size: cover; background-position: center 20%; border: 3px solid var(--sg); }
.socToast .t { font-family: 'Lilita One', sans-serif; font-size: 17px; letter-spacing: .8px; color: #fff; }
.socToast .s { font-size: 12px; color: #c7d1e6; margin-top: 2px; }
.socToast .btns { grid-column: 1 / -1; display: flex; gap: 8px; }
.socToast .btns .sbtn { flex: 1; }
.socToast.mini { grid-template-columns: 1fr; text-align: center; padding: 10px 14px; }

#socSearch { position: fixed; inset: 0; z-index: 740; background: radial-gradient(120% 80% at 50% 0%, #1b2f55 0%, #070c18 70%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 24px; animation: socFade .25s ease-out; overflow: hidden; }
#socSearch .ring { width: 96px; height: 96px; border-radius: 50%; border: 4px solid rgba(255,215,94,.25); border-top-color: var(--sg); animation: socSpin 1s linear infinite; }
@keyframes socSpin { to { transform: rotate(360deg); } }
#socSearch h2 { margin: 0; font-family: 'Lilita One', sans-serif; font-size: 24px; letter-spacing: 2px; color: #fff; text-align: center; text-shadow: 0 3px 0 rgba(0,0,0,.4); }
#socSearch .sub { font-family: 'Russo One', sans-serif; font-size: 10px; letter-spacing: 2.5px; color: #9fdcff; text-align: center; }
#socSearch .plates { position: relative; width: min(92vw, 420px); height: 200px; }
#socSearch .mp { position: absolute; left: 0; right: 0; border-radius: 18px; overflow: hidden; border: 2px solid rgba(255,215,94,.55); box-shadow: 0 18px 44px rgba(0,0,0,.65); height: 92px;
  transition: transform .5s cubic-bezier(.2,1.25,.35,1), opacity .3s; }
#socSearch .mp.you { bottom: 0; transform: translateX(-4%) rotate(-1.5deg); }
#socSearch .mp.foe { top: 0; transform: translateX(112%) rotate(1.5deg); opacity: 0; }
#socSearch.found .mp.foe { transform: translateX(4%) rotate(1.5deg); opacity: 1; }
#socSearch .mp .pb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#socSearch .mp .pshade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,8,16,.88), rgba(5,8,16,.55) 45%, rgba(5,8,16,.28)); }
#socSearch .mp.foe .pshade { background: linear-gradient(270deg, rgba(5,8,16,.88), rgba(5,8,16,.55) 45%, rgba(5,8,16,.28)); }
#socSearch .mp .prow { position: relative; display: flex; align-items: center; gap: 12px; padding: 13px 14px; }
#socSearch .mp.foe .prow { flex-direction: row-reverse; text-align: right; }
#socSearch .mp .pportrait { width: 60px; height: 60px; border-radius: 50%; flex: none; background-size: cover; background-position: center 20%; border: 3px solid var(--sg); box-shadow: 0 4px 14px rgba(0,0,0,.55); }
#socSearch .mp.foe .pportrait { border-color: #fb7185; }
#socSearch .mp.you .pportrait { border-color: #38bdf8; }
#socSearch .mp .pname { font-family: 'Lilita One', sans-serif; font-size: 21px; letter-spacing: 1px; color: #fff; line-height: 1.05; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
#socSearch .mp .pbadges { display: flex; gap: 6px; margin-top: 5px; align-items: center; }
#socSearch .mp.foe .pbadges { justify-content: flex-end; }
#socSearch .mp .pbadges span { display: inline-flex; align-items: center; gap: 4px; font-family: 'Russo One', sans-serif; font-size: 10px; color: #ffe9b0; background: rgba(0,0,0,.5); border: 1px solid rgba(255,215,94,.4); border-radius: 999px; padding: 3px 9px; }
#socSearch .mp .pbadges img { width: 13px; height: 13px; }
#socSearch .vs { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(2.6); width: min(40vw, 170px); opacity: 0; filter: drop-shadow(0 10px 26px rgba(0,0,0,.6)); }
#socSearch.found .vs { animation: socSlam .5s cubic-bezier(.25,1.2,.4,1) .3s forwards; }
@keyframes socSlam { 60% { opacity: 1; transform: translate(-50%, -50%) scale(.94); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
#socSearch .found { position: absolute; top: 18%; left: 0; right: 0; text-align: center; font-family: 'Lilita One', sans-serif; font-size: 32px; letter-spacing: 2px; color: var(--sg); opacity: 0; text-shadow: 0 4px 0 rgba(0,0,0,.4), 0 0 24px rgba(255,215,94,.5); }
#socSearch.found .found { animation: socFoundPop .8s cubic-bezier(.2,1.4,.3,1) forwards; }
@keyframes socFoundPop { 0% { opacity: 0; transform: scale(.6); } 40% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
#socSearch .cancel { position: absolute; bottom: calc(env(safe-area-inset-bottom) + 20px); }
@media (max-width: 360px) { .socMe .pname { font-size: 19px; } .socArena h3 { font-size: 22px; } .cardPick { grid-template-columns: repeat(3, minmax(0, 1fr)); } .badgePick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Keep the original royal SOCIAL composition; new online tools live below its artwork. */
#view-social .soc { padding: 0 0 25px !important; gap: 10px; }
#view-social #gloryPanel { position: relative; z-index: 2; }
#view-social #socInvite { position: relative; z-index: 2; }
#view-social .socArena, #view-social .socSec, #view-social .socMe {
  border-radius: 14px; border-color: #edcf7b;
  background: linear-gradient(135deg,#24304a,#0d182b 75%);
  box-shadow: inset 0 1px 0 #fff8, 0 4px 13px #020a1699;
}
#view-social .socArena { margin-top: 4px; }
#view-social .socArena .k, #view-social .socSec .sh h3 small { color: #ffe294; }
#view-social .socArena .live.off { color: #d3dcf0; }
#view-social .socArena .live.off i { background: #8490a9; box-shadow: none; animation: none; }
#view-social .socMe { order: 2; }
#view-social .socArena { order: 1; }
#view-social #socFriendsSec { order: 3; }
#view-social #socClanSec { order: 4; }

/* the clan room sheets never slide sideways either */
.socSheet .socPanel .pb2 { overflow-x: hidden; }

/* ═══ a gift from the clan (29.9) — who, which card, and what it is for ═══ */
.socGifts { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.socGift { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 12px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,215,94,.12), rgba(255,215,94,.03)); border: 1.5px solid rgba(255,215,94,.35); }
.socGift .gc { position: relative; flex: 0 0 84px; width: 84px; height: 84px; border-radius: 14px; overflow: hidden; border: 2.5px solid #ffd75e;
  box-shadow: 0 0 0 3px rgba(0,0,0,.35), 0 0 22px rgba(255,215,94,.45); animation: socGiftIn .55s cubic-bezier(.2,1.4,.3,1) both; }
.socGift .gc img { width: 100%; height: 100%; object-fit: cover; display: block; }
.socGift .gc b { position: absolute; right: 4px; bottom: 3px; font: 20px 'Lilita One', sans-serif; color: #fff; letter-spacing: .5px;
  text-shadow: 0 2px 0 #000, 0 0 8px rgba(0,0,0,.8); }
.socGift .gt { min-width: 0; flex: 1; }
.socGift .gn { font: 20px 'Lilita One', sans-serif; letter-spacing: .6px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.socGift .gf { font: 10px 'Russo One', sans-serif; letter-spacing: 1.2px; color: #ffd75e; margin: 2px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.socGift .gb { height: 8px; border-radius: 6px; background: rgba(0,0,0,.45); overflow: hidden; }
.socGift .gb i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #7dd3fc, #38bdf8); }
.socGift .gl { font: 10px 'Russo One', sans-serif; letter-spacing: .8px; color: rgba(255,255,255,.78); margin-top: 5px; }
.socGift .gl.ready { color: #86efac; }
.socGiftNote { margin: 12px 2px 0; font: 12px/1.45 'Russo One', sans-serif; letter-spacing: .3px; color: rgba(255,255,255,.72); text-align: center; }
.socGiftSheet .pf { display: flex; gap: 10px; }
.socGiftSheet .pf .sbtn { flex: 1; }
@keyframes socGiftIn { 0% { transform: scale(.4) rotate(-8deg); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ═══ THE SEARCH, IN CLASH ROYALE'S ORDER (29.9) — social.js findOverlay/foundCut ═══
   the home falls away in 0.3 s, the realm island stays where it stood, the words and a cancel come in; found = a hard cut
   to the loading poster (the arena page continues the same poster). */
#socFind { position: fixed; inset: 0; z-index: 740; overflow: hidden; }
#socFind .sfBack { position: absolute; inset: 0; opacity: 0; transition: opacity .3s ease-out;
  background: radial-gradient(85% 55% at 50% 50%, #2a6fa6 0%, #0f2b52 52%, #050a16 100%); }   /* opaque: the home is GONE, only the realm stays */
#socFind.on .sfBack { opacity: 1; }
#socFind .sfIsle { position: absolute; pointer-events: none; filter: drop-shadow(0 24px 40px rgba(0,0,0,.55)); }
#socFind .sfIsle.card { left: 50%; top: 50%; width: min(66vw, 300px); aspect-ratio: 3 / 4; transform: translate(-50%, -54%); border-radius: 20px;
  background-size: cover; background-position: center; border: 3px solid rgba(255,215,94,.8); box-shadow: 0 0 0 4px rgba(0,0,0,.35), 0 20px 50px rgba(0,0,0,.6); }
#socFind.on .sfIsle { animation: sfBreath 3.2s ease-in-out infinite; }
#socFind .sfTop { position: absolute; top: calc(env(safe-area-inset-top) + 24px); left: 12px; right: 12px; text-align: center;
  opacity: 0; transform: translateY(-10px); transition: opacity .3s ease-out, transform .3s ease-out; }
#socFind.on .sfTop { opacity: 1; transform: none; }
#socFind .sfTitle { font-family: 'Lilita One', sans-serif; font-size: clamp(21px, 6.4vw, 30px); letter-spacing: 1.5px; color: #fff;
  text-shadow: 0 3px 0 rgba(0,0,0,.45), 0 0 16px rgba(56,189,248,.35); }
#socFind .sfDots i { font-style: normal; opacity: 0; animation: sfDot 1.2s infinite; }
#socFind .sfDots i:nth-child(2) { animation-delay: .2s; } #socFind .sfDots i:nth-child(3) { animation-delay: .4s; }
#socFind .sfSub { margin-top: 6px; font-family: 'Russo One', sans-serif; font-size: 11px; letter-spacing: 2.5px; color: #9fdcff; }
#socFind .sfBottom { position: absolute; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 22px);
  display: flex; flex-direction: column; align-items: center; gap: 14px; opacity: 0; transform: translateY(12px); transition: opacity .3s ease-out, transform .3s ease-out; }
#socFind.on .sfBottom { opacity: 1; transform: none; }
#socFind .sfCancel { min-width: 160px; background: linear-gradient(180deg, #ff6b6b, #c81e3a); border-color: #7f1022; color: #fff; }
#socFind .sfTip { width: 100%; max-width: 420px; box-sizing: border-box; padding: 10px 14px; border-radius: 14px; text-align: center;
  background: rgba(16,36,66,.88); border: 1.5px solid rgba(159,220,255,.35); font: 12px/1.45 'Russo One', sans-serif; letter-spacing: .3px; color: #e8f4ff; }
#socFind .sfTip b { display: block; margin-bottom: 3px; font-size: 10px; letter-spacing: 2.5px; color: #ffd75e; font-weight: normal; }
/* found: the loading poster, laid out like the arena page's (index.html #mm) so the page change cannot be seen */
#socFind .sfLoad { position: absolute; inset: 0; background: #05070d; opacity: 0; pointer-events: none; }
#socFind.found .sfLoad { opacity: 1; }
#socFind .sfPoster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#socFind .sfShade { position: absolute; inset: 0; background: linear-gradient(rgba(5,7,13,.55), transparent 30%, transparent 62%, rgba(5,7,13,.8)); }
#socFind .sfLoadTop { position: absolute; top: calc(env(safe-area-inset-top) + 32px); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; }
#socFind .sfLogo { width: min(40vw, 200px); aspect-ratio: 1000 / 891; margin: 0 auto 6px; background: url('../../assets/ui/logo-welkings-v7.webp') center / contain no-repeat;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.65)) drop-shadow(0 0 14px rgba(126,206,255,.35)); }
#socFind .sfLoadTitle { font-family: 'Lilita One', sans-serif; font-size: 21px; letter-spacing: 2px; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.8); }
#socFind .sfLoadBot { position: absolute; bottom: calc(env(safe-area-inset-bottom) + 30px); left: 10%; right: 10%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
#socFind .sfBar { width: 100%; max-width: 320px; height: 7px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.14); box-shadow: inset 0 1px 2px rgba(0,0,0,.5); }
#socFind .sfBar i { display: block; height: 100%; width: 40%; border-radius: 99px; background: linear-gradient(90deg, #38bdf8, #7fdcff); animation: sfSweep 1.15s ease-in-out infinite; }
#socFind .sfLoadTip { font-size: 11.5px; font-weight: 700; color: #cfe3ff; letter-spacing: .4px; text-shadow: 0 1px 6px rgba(0,0,0,.9); text-align: center; }
@keyframes sfDot { 0%, 20% { opacity: 0; } 40%, 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sfBreath { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes sfSweep { 0% { margin-left: -42%; } 100% { margin-left: 102%; } }
@media (prefers-reduced-motion: reduce) { #socFind * { animation: none !important; transition: none !important; } }

/* ═══ 29.9 — remove-friend confirm · a player's card · the real glory board ═══ */
.socConfirm { display: flex; align-items: center; gap: 14px; }
.socConfirm .face { flex: 0 0 64px; height: 64px; border-radius: 50%; background-size: cover; background-position: center 20%; border: 3px solid var(--sg); }
.socConfirm p { margin: 0; font: 13px/1.45 'Russo One', sans-serif; color: #e8f0ff; }
.socConfirmSheet .pf, .socProfSheet .pf { display: flex; gap: 10px; } .socConfirmSheet .pf .sbtn { flex: 1; }
.sbtn.socDanger { background: linear-gradient(180deg, #ff6b6b, #c81e3a); border-color: #7f1022; color: #fff; }
.socRow2 .face[data-pid], .socRow2 .face[data-mpid] { cursor: pointer; }
.socProf { min-width: 0; }
.socProf .spHead { position: relative; min-height: 116px; border-radius: 16px; overflow: hidden; margin-bottom: 12px; border: 1.5px solid rgba(255,215,94,.45); }
.socProf .spBanner { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.socProf .spShade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,10,22,.9) 0%, rgba(5,10,22,.55) 60%, rgba(5,10,22,.25) 100%); }
.socProf .spFace { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 76px; height: 76px; border-radius: 50%;
  background-size: cover; background-position: center 20%; border: 3px solid var(--sg); box-shadow: 0 6px 18px rgba(0,0,0,.6); }
.socProf .spFace i { position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; border-radius: 50%; background: #64748b; border: 2px solid #0b1424; }
.socProf .spFace i.on { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.socProf .spWho { position: relative; margin-left: 104px; padding: 16px 12px 14px 0; min-width: 0; }
.socProf .spName { font: 22px 'Lilita One', sans-serif; letter-spacing: .6px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.socProf .spName em { font-style: normal; font-size: 14px; color: #ffd75e; margin-left: 6px; }
.socProf .spStats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.socProf .spStats span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.45); font: 10px 'Russo One', sans-serif; letter-spacing: .6px; color: #e8f0ff; }
.socProf .spStats span.lv { color: #ffd75e; } .socProf .spStats img { width: 13px; height: 13px; }
.socProf .spOn { margin-top: 6px; font: 10px 'Russo One', sans-serif; letter-spacing: 2px; color: #94a3b8; } .socProf .spOn.on { color: #4ade80; }
.socProf .spLabel { font: 11px 'Russo One', sans-serif; letter-spacing: 2.5px; color: #ffd75e; margin: 4px 2px 8px; }
.socProf .spDeck { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; min-width: 0; }
.socProf .spCard { position: relative; min-width: 0; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; border: 2px solid rgba(255,215,94,.55); background: #0b1b30; }
.socProf .spCard img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; display: block; }
.socProf .spCard b { position: absolute; top: 4px; right: 4px; padding: 1px 6px; border-radius: 999px; background: rgba(43,29,3,.92); border: 1px solid #ffd75e; font: 9px 'Russo One', sans-serif; color: #ffd75e; }
.socProf .spCard span { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 2px; background: rgba(0,0,0,.7); font: 8.5px 'Russo One', sans-serif; letter-spacing: .4px; color: #fff; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.socProf .spRow { display: flex; align-items: center; gap: 10px; margin-top: 10px; min-width: 0; }
.socProf .spKing { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 14px; background: rgba(255,215,94,.1); border: 1.5px solid rgba(255,215,94,.4); min-width: 0; }
.socProf .spKing img { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; object-position: center 15%; }
.socProf .spKing span { font: 11px 'Russo One', sans-serif; letter-spacing: .6px; color: #ffe8a8; white-space: nowrap; }
.socProf .spSpells { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.socProf .spSpells img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; border: 1.5px solid rgba(159,220,255,.5); }
#socBoard .socGFace { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; background-size: cover; background-position: center 20%; border: 1.5px solid rgba(255,215,94,.7); cursor: pointer; }
#socBoard .socGFace.rival { cursor: default; }
#socBoard .socGTag { font-style: normal; color: #ffd75e; font-size: 10px; }
#socBoard .socGKind { font-style: normal; font-size: 8px; letter-spacing: 1px; padding: 1px 5px; border-radius: 999px; margin-left: 4px; vertical-align: 1px; background: rgba(255,255,255,.1); color: #cbd5e1; }
#socBoard .socGKind.friend { background: rgba(34,197,94,.18); color: #86efac; } #socBoard .socGKind.clan { background: rgba(255,215,94,.16); color: #ffd75e; }
#socBoard .socGKind.you { background: rgba(56,189,248,.2); color: #7dd3fc; }

/* Glory board: the live row has rank + portrait + identity + score. */
#view-social #socBoard .socRow{display:grid;grid-template-columns:24px minmax(0,1fr) auto;align-items:center;column-gap:7px;row-gap:3px;padding:13px 17px;min-height:64px;box-sizing:border-box;direction:ltr}
#view-social #socBoard .socRow .rk{grid-column:1;grid-row:1 / 3;align-self:center;justify-self:center;width:24px;margin:0;font:18px/30px 'Lilita One',sans-serif}
#view-social #socBoard .socRow .nm{grid-column:2;grid-row:1 / 3;min-width:0;margin:0;font:13px/1.35 'Lilita One',sans-serif;letter-spacing:.15px;text-align:left;overflow-wrap:anywhere}
#view-social #socBoard .socRow .tr{grid-column:3;grid-row:1 / 3;justify-content:flex-end;white-space:nowrap;font:15px/1.2 'Lilita One',sans-serif;font-variant-numeric:tabular-nums;margin:0;align-self:center}
#view-social #socBoard .socRow:has(.socGFace){grid-template-columns:24px 28px minmax(0,1fr)}
#view-social #socBoard .socRow .socGFace{grid-column:2;grid-row:1 / 3;align-self:center;justify-self:center;width:28px;height:28px;box-sizing:border-box}
#view-social #socBoard .socRow:has(.socGFace) .nm{grid-column:3;grid-row:1;align-self:end}
#view-social #socBoard .socRow:has(.socGFace) .tr{grid-column:3;grid-row:2;justify-content:flex-start;align-self:start;font-size:14px}
#view-social #socBoard .socGTag{font:10px/1.35 'Russo One',sans-serif;white-space:nowrap}
#view-social #socBoard .socGKind{display:inline-block;vertical-align:middle;margin:0 0 0 4px;padding:2px 5px;font:8px/1.2 'Russo One',sans-serif;letter-spacing:.6px;white-space:nowrap}
#view-social #socBoard .socRow.me .socGTag{color:#654300}
#view-social #socBoard .socRow.me .socGKind{color:#163d53;background:#f2faff8c}
#view-social #gloryPanel .dSub{max-width:100%;margin:7px auto 12px;padding:0 5px;text-align:center;font:9px/1.5 'Russo One',sans-serif;letter-spacing:.35px;text-wrap:balance}
@media(max-width:350px){#view-social #socBoard .socRow{padding-left:13px;padding-right:13px;column-gap:5px}#view-social #socBoard .socRow .nm{font-size:12px}}
