/* Social: chat panel, CLAN and SETTINGS screens (public/social.js). Phone landscape first: big tap targets. */
#chatBtn { position: fixed; z-index: 27; left: max(10px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom));
  width: 48px; height: 48px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-size: 22px; line-height: 1;
  box-shadow: 0 4px 14px rgba(0,0,0,.4); }
#chatBtn i { position: absolute; top: 5px; right: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--bg); }
body.inmatch #chatBtn { top: calc(max(8px, env(safe-area-inset-top)) + 60px); bottom: auto; left: calc(max(10px, env(safe-area-inset-left)) + 96px);
  width: 40px; height: 40px; border-radius: 10px; font-size: 18px; box-shadow: none; }
body.chatopen #chatBtn { display: none; }

#chatBox { position: fixed; z-index: 31; left: max(8px, env(safe-area-inset-left)); top: max(8px, env(safe-area-inset-top));
  bottom: max(8px, env(safe-area-inset-bottom)); width: min(420px, 50%); min-width: 290px; display: flex; flex-direction: column;
  background: rgba(16,19,25,.94); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); overflow: hidden; user-select: text; -webkit-user-select: text; touch-action: auto; }
.chead { display: flex; gap: 6px; padding: 6px; border-bottom: 1px solid var(--line); }
.ctabs { flex: 1; display: flex; gap: 4px; min-width: 0; }
.ctabs button { flex: 1; min-height: 40px; border-radius: 9px; background: var(--btn); border: 1px solid var(--line); font-weight: 800; font-size: 12px; letter-spacing: .05em; }
.ctabs button.on { background: var(--gold); color: #1a1200; border-color: transparent; }
.cx { width: 44px; min-height: 40px; border-radius: 9px; background: var(--btn); border: 1px solid var(--line); font-size: 16px; }
.clist { flex: 1; overflow-y: auto; padding: 6px 8px; font-size: 13px; line-height: 1.35; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.cmsg { padding: 5px 6px; border-radius: 8px; word-wrap: break-word; overflow-wrap: anywhere; cursor: pointer; }
.cmsg small { color: var(--muted); font-size: 10px; margin-right: 5px; font-variant-numeric: tabular-nums; }
.cmsg b { color: #8ab8ff; }
.cmsg.mine b { color: var(--gold); }
.cmsg.mine { cursor: default; }
.cmsg.sel { background: rgba(255,255,255,.08); }
.cact { display: flex; gap: 4px; padding: 2px 0 6px; flex-wrap: wrap; }
.cact button { flex: 1; min-height: 38px; border-radius: 8px; background: var(--btn); border: 1px solid var(--line); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.cact button.bad { color: #ff8a80; border-color: rgba(229,72,77,.5); }
.cempty { color: var(--muted); padding: 12px 6px; text-align: center; font-size: 12px; }
.cerr { color: var(--gold); font-size: 12px; min-height: 0; padding: 0 8px; }
.cerr:not(:empty) { padding: 3px 8px; }
.cquick { display: flex; gap: 5px; overflow-x: auto; padding: 5px 6px; border-top: 1px solid var(--line); touch-action: pan-x; scrollbar-width: none; }
.cquick::-webkit-scrollbar { display: none; }
.cquick button { flex: none; min-height: 38px; padding: 0 12px; border-radius: 19px; background: rgba(59,130,246,.18); border: 1px solid rgba(59,130,246,.45);
  font-size: 12px; font-weight: 700; white-space: nowrap; }
.cin { display: flex; gap: 6px; padding: 6px; border-top: 1px solid var(--line); }
.cin .inp { flex: 1; min-width: 0; padding: 9px 10px; font-size: 14px; user-select: text; -webkit-user-select: text; }
.cs { min-width: 64px; min-height: 42px; border-radius: 10px; background: var(--red); font-weight: 800; letter-spacing: .06em; }

/* menu chips */
.chipsR { justify-self: end; display: flex; gap: 6px; align-items: center; }
#btnSettings { font-size: 16px; padding: 3px 10px; }
.chip.clanchip { background: linear-gradient(135deg, #2f9e6a, #1f6f8b); border-color: rgba(122,230,189,.6); }
.shield { width: 11px; height: 13px; background: #fff; border-radius: 2px 2px 6px 6px; display: inline-block; }

/* CLAN + SETTINGS screens */
.panel.soc { width: min(640px, 100%); }
.socsub { color: var(--muted); font-size: 13px; }
.socmsg { color: #ff8a80; font-size: 13px; min-height: 16px; margin: 2px 0 4px; }
.socmsg.ok { color: var(--green); }
.clangrid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; }
.clanbox { display: flex; flex-direction: column; gap: 6px; }
.clanbox .start { margin-top: 2px; }
.plist { display: flex; flex-direction: column; gap: 4px; max-height: 34vh; overflow-y: auto; }
.plist.tall { max-height: 46vh; }
.prow { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; background: rgba(255,255,255,.04); font-size: 13px; }
.prow.you { background: rgba(245,184,61,.12); }
.prow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow b.tap { cursor: pointer; }
.prow small { color: var(--muted); }
.prow .ghost { width: auto; padding: 0 12px; min-height: 38px; font-size: 12px; }
.ghost.danger { color: #ff8a80; border-color: rgba(229,72,77,.5); }
.row2 .ghost.danger { margin-top: 6px; }
.rdrow { display: flex; gap: 6px; }
.rdrow .inp { flex: 1; min-width: 0; }
.rdrow .ghost, .rdrow .start { width: auto; padding: 0 16px; min-height: 42px; margin: 0; }
.setrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.setrow.col { flex-direction: column; align-items: stretch; gap: 6px; }
.setrow small { display: block; color: var(--muted); font-size: 12px; }
.tog { min-width: 84px; min-height: 44px; border-radius: 22px; background: var(--green); color: #062014; font-weight: 900; letter-spacing: .08em; }
.tog.off { background: var(--btn); color: var(--muted); border: 1px solid var(--line); }
@media (max-height: 420px) {
  .panel.soc h2 { font-size: 20px; margin: 0; }
  .setrow { padding: 6px 0; }
  .plist { max-height: 30vh; }
}
@media (max-width: 640px) { html:not(.rot) .clangrid { grid-template-columns: 1fr; } }
html.rot .plist { max-height: 34vw; }
html.rot .plist.tall { max-height: 46vw; }

/* ADMIN: REPORTS and CODES tabs (public/admin.js) */
.admrep { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 6px; font-size: 13px; }
.admrep.done { opacity: .55; }
.admrep small { color: var(--muted); }
.admrep .ctx { margin: 6px 0; padding: 6px 8px; background: rgba(0,0,0,.25); border-radius: 8px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.admrep .ctx .bad { color: #ff8a80; }
.admrep .admact, .admcode { display: flex; flex-wrap: wrap; gap: 6px; }
.admrep .admact .ghost { width: auto; padding: 8px 12px; min-height: 40px; }
.admcode .inp { flex: 1 1 130px; width: auto; }
.admcode .start { margin: 0; }
.admrow.code { grid-template-columns: 1.1fr 1.4fr 70px 1fr auto; cursor: default; }
.admrow.code .ghost { width: auto; padding: 6px 12px; }
.admact .admnote { grid-column: 1 / -1; padding: 0 2px; }
/* menu top row: profile/shop/items on the left and clan/ranking/settings on the right take what they need,
   the title gets the middle (equal side columns made the left chips run under the title on phones) */
.menutop { grid-template-columns: auto minmax(0, 1fr) auto; }
.menutop h1 { justify-self: center; white-space: nowrap; }
@media (max-height: 420px) { .menutop h1 { font-size: 22px; } }
html.rot.short .menutop h1 { font-size: 22px; }
/* phone landscape: the chat button sits in its own strip left of the menu card (never over its corner); under
   full-screen pages (profile 28, shop 30, admin 35) */
@media (max-width: 900px) { #menu.overlay { padding-left: 70px; } }
/* quick phrases: all 8 visible (2 rows of 4) instead of a side-scrolling strip that looked cut off on phones */
.cquick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
.cquick button { min-height: 44px; padding: 0 4px; font-size: 12px; white-space: normal; line-height: 1.1; }

/* SETTINGS: compact game-style panel, left tabs, ~44 px rows (built in social.js; rows added by groupb, audio, security) */
.panel.setp { width: min(680px, 100%); height: min(372px, 100%); display: flex; flex-direction: column; padding: 0 12px 10px; overflow: hidden; }
.setp > .profhead { padding: 8px 0 6px; flex: none; }
.setp > .profhead h2 { margin: 0; font-size: 20px; letter-spacing: .04em; }
.setwrap { flex: 1; min-height: 0; display: flex; gap: 10px; }
.settabs { flex: none; width: 104px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; scrollbar-width: none; }
.settabs button { flex: none; min-height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 8px; border-radius: 10px;
  background: var(--btn); border: 1px solid var(--line); font-weight: 800; font-size: 11px; letter-spacing: .06em; text-align: left; color: var(--muted); }
.settabs button i { font-style: normal; font-size: 16px; width: 20px; text-align: center; }
.settabs button.on { background: linear-gradient(135deg, #ffd84f, #f5a623); color: #1a1200; border-color: transparent; box-shadow: 0 2px 8px rgba(245,184,61,.35); }
.setbody { flex: 1; min-width: 0; overflow-y: auto; touch-action: pan-y; padding: 0 4px 4px 0; border-left: 1px solid var(--line); padding-left: 10px; }
.setsec[hidden] { display: none; }
.setp .setrow { min-height: 44px; padding: 3px 0; gap: 8px; border-top: 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 13px; }
.setp .setrow.col { padding: 6px 0; gap: 4px; }
.setp .setrow b { font-size: 13px; }
.setp .setrow small { font-size: 11px; line-height: 1.25; }
.setp .setrow .grow { min-width: 0; }
.setp .ghost { width: auto; flex: none; min-height: 36px; padding: 0 12px; font-size: 12px; }
.setp .start.sm { width: auto; min-height: 36px; padding: 0 12px; font-size: 12px; margin: 0; }
.setp .plist { max-height: none; }
.setp .prow { min-height: 36px; font-size: 12px; }
.setp .prow .ghost { min-height: 32px; }
.setp .cempty { padding: 4px 6px; text-align: left; }
.setp .socmsg { margin: 0; min-height: 0; font-size: 12px; }
.setp .socmsg:not(:empty) { padding: 2px 0 4px; }
.setlab { flex: none; width: 74px; }
.setp .rdrow .inp { padding: 7px 10px; font-size: 14px; min-height: 36px; }
.sethint { display: block; color: var(--muted); font-size: 11px; line-height: 1.3; padding: 6px 0; }
/* compact switch: pill with the state in it */
.setp .tog { min-width: 56px; min-height: 30px; padding: 0 10px; border-radius: 15px; font-size: 11px; flex: none; }
.seg2 { display: inline-flex; flex: none; padding: 2px; border-radius: 16px; background: rgba(0,0,0,.35); border: 1px solid var(--line); min-height: 34px; }
.seg2 span { display: inline-flex; align-items: center; padding: 0 12px; border-radius: 14px; font-size: 11px; font-weight: 900; letter-spacing: .06em; color: var(--muted); }
.seg2 span.on { background: var(--green); color: #062014; }
/* sliders on one line */
.setp .volrow { display: flex; align-items: center; gap: 10px; }
.setp .volrow span { width: 52px; font-weight: 800; font-size: 12px; letter-spacing: .06em; }
.setp .volrow input { flex: 1; min-width: 0; }
.setp .volrow em { width: 40px; text-align: right; font-style: normal; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
/* linked sign-ins inside ACCOUNT */
.setp .blinks { margin: 4px 0; gap: 3px; }
.setp .blinks .lbl { margin: 2px 0; }
.setp .blinks .bnote { font-size: 11px; margin-top: 2px; }
.setp a.blink { min-height: 36px; padding: 0 12px; font-size: 12px; }
.setdanger { margin-top: 10px; padding: 4px 8px; border: 1px solid rgba(229,72,77,.45); border-radius: 10px; background: rgba(229,72,77,.07); }
.setdanger .lbl { color: #ff8a80; margin: 4px 0 0; font-size: 10px; }
.setdanger .setrow { border-bottom: 0; }
/* narrow window (not turned): tabs on top as a row */
@media (max-width: 520px) {
  html:not(.rot) .setwrap { flex-direction: column; }
  html:not(.rot) .settabs { width: auto; flex-direction: row; overflow-x: auto; }
  html:not(.rot) .settabs button { flex: 1 0 auto; justify-content: center; }
  html:not(.rot) .settabs button span { display: none; }
  html:not(.rot) .setbody { border-left: 0; padding-left: 0; }
  html:not(.rot) .panel.setp { height: min(560px, 100%); }
}
/* FIND PLAYER (chat 🔍 / CLAN) */
#findOv { z-index: 40; }
.findbtn { width: auto !important; flex: none; min-height: 44px; padding: 0 12px !important; font-size: 12px; }
#findOv .rdrow { flex-wrap: wrap; }
#findOv #pidIn { flex: 1 1 100%; letter-spacing: .12em; }
#findOv .rdrow .ghost { flex: 1; }

.setp #setHudSize span { width: auto; min-width: 64px; white-space: nowrap; }   /* "HUD SIZE" on one line */
