/* =====================================================================================
   Freunde & Clan (js/sozial.js, js/bannerbau.js): Seitenleiste rechts, Privat-Chatfenster, Hinweis-Chip,
   Banner-Builder, Clan-Abzeichen. Farben/Schriften aus thema.css (Eisen/Gold).
   Ebenen: Leiste 78, Chat 79, Banner-Builder 81 – darüber Melden (80 → hier 82 angehoben), Passwort, Konto, Fragen, Toast.
   ===================================================================================== */
#melden { z-index: 82; }

/* ---------------------------------------------------------------- Seitenleiste */
.so-leiste { position: fixed; z-index: 78; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); display: flex; flex-direction: column;
  background: var(--korn), linear-gradient(180deg, #1d1a20, #0e0c10); background-color: #110f13; isolation: isolate; box-shadow: -2px 0 0 var(--gold-dunkel), -18px 0 40px rgba(0, 0, 0, .6);
  color: var(--text); font-family: var(--schrift); animation: so-rein .22s ease-out; }
.so-leiste[hidden] { display: none; }
@keyframes so-rein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.so-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 8px 18px; }
.so-kopf h2 { display: flex; align-items: center; gap: 10px; margin: 0; font: 800 24px var(--schrift-titel); letter-spacing: 3px; color: var(--gold); }
.so-kopf h2 svg { width: 24px; height: 24px; fill: none; stroke: var(--gold); stroke-width: 2; }
.so-icon-knopf { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--eisen-rand); background: rgba(0, 0, 0, .35);
  color: var(--grau); cursor: var(--zeiger-klick); flex: none; }
.so-icon-knopf:hover { color: var(--gold); border-color: var(--gold-dunkel); }
.so-icon-knopf svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.so-icon-knopf svg circle { fill: currentColor; stroke: none; }
.so-icon-knopf.klein { width: 24px; height: 24px; }
.so-icon-knopf.klein svg { width: 13px; height: 13px; }
.so-reiter { display: grid; grid-template-columns: 1fr 1fr; margin: 0 14px; border-bottom: 1px solid var(--eisen-rand); }
.so-reiter button { position: relative; padding: 10px 6px; border: 0; background: none; color: var(--grau); font: 700 17px var(--schrift-titel); letter-spacing: 2px;
  text-transform: uppercase; cursor: var(--zeiger-klick); border-bottom: 3px solid transparent; }
.so-reiter button.an { color: var(--gold); border-bottom-color: var(--gold); }
.so-reiter button:hover { color: var(--gold-hell); }
.so-inhalt { flex: 1; overflow-y: auto; padding: 12px 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.so-zahl { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--blut);
  color: #fff; font: 700 11px var(--schrift); font-style: normal; letter-spacing: 0; vertical-align: middle; box-shadow: 0 0 8px rgba(226, 56, 44, .5); }
.so-zahl:empty, .so-zahl[hidden] { display: none; }

.so-unterreiter { display: flex; gap: 4px; flex-wrap: wrap; }
.so-unterreiter button { flex: 1 1 auto; padding: 6px 8px; border: 1px solid var(--eisen-rand); background: rgba(0, 0, 0, .3); color: var(--grau);
  font: 700 13px var(--schrift-titel); letter-spacing: 1px; text-transform: uppercase; cursor: var(--zeiger-klick); }
.so-unterreiter button small { font: 600 11px var(--schrift); color: var(--grau); }
.so-unterreiter button.an { color: var(--gold); border-color: var(--gold-dunkel); background: rgba(246, 197, 90, .1); }
.so-unterreiter .so-zahl { margin-left: 3px; }

.so-zeile-form { display: flex; gap: 6px; }
.so-zeile-form input { flex: 1; min-width: 0; }
.so-leiste input, .so-leiste textarea, .so-leiste select, .so-chat input { padding: 7px 9px; border: 1px solid var(--eisen-rand); background: rgba(0, 0, 0, .45); color: var(--text);
  font: 14px var(--schrift); outline: none; }
.so-leiste input:focus, .so-leiste textarea:focus, .so-leiste select:focus, .so-chat input:focus { border-color: var(--gold-dunkel); box-shadow: 0 0 0 1px var(--gold-dunkel); }
.so-leiste .knopf.mini { margin-left: 0; white-space: nowrap; }
.so-liste { display: flex; flex-direction: column; gap: 4px; }
.so-leer { margin: 8px 0; color: var(--grau); font-size: 13px; text-align: center; }
.so-hinweis { margin: 0; color: var(--grau); font-size: 12.5px; }
.so-titel { margin: 8px 0 2px; font: 700 13px var(--schrift-titel); letter-spacing: 2px; text-transform: uppercase; color: var(--gold); }
.so-h3 { margin: 0; font: 800 22px var(--schrift-titel); letter-spacing: 2px; color: var(--gold); }
.so-fehler { margin: 0; min-height: 1em; color: #ff7a70; font-size: 13px; }
.knopf-link.so-mehr-laden { align-self: center; margin: 2px auto 6px; display: block; }

.so-eintrag { display: grid; grid-template-columns: auto minmax(110px, 1fr) auto; align-items: center; gap: 4px 10px; padding: 7px 8px; background: rgba(0, 0, 0, .28);
  border-left: 3px solid var(--eisen-rand); }
.so-eintrag:hover { background: rgba(246, 197, 90, .05); }
.so-eintrag.kompakt { grid-template-columns: 1fr auto; padding: 5px 8px; }
.so-wer { min-width: 0; display: flex; flex-direction: column; }
.so-wer b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 14.5px; }
.so-wer small { color: var(--grau); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-knoepfe { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.so-knoepfe.rechts { justify-content: flex-end; margin-top: 4px; }
.so-mehr { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; padding-top: 4px; }
.so-mehr[hidden] { display: none; }
.so-chat-knopf { position: relative; display: inline-grid; place-items: center; padding: 5px 8px !important; clip-path: none !important; }
.so-chat-knopf svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.so-chat-knopf .so-zahl { position: absolute; top: -7px; right: -8px; margin: 0; }
.knopf.mini.gefahr { color: #ffb0a8; border-color: #6a2620; }
.knopf.mini.gefahr:hover { color: #fff; background: linear-gradient(#5a1c18, #2a0c0a); }

/* Online-Punkt: grün = Menü, gold = Lobby/Runde, grau = offline */
.so-punkt { width: 10px; height: 10px; border-radius: 50%; background: #4b4652; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5); flex: none; }
.so-punkt.on { background: #5fd36a; box-shadow: 0 0 8px rgba(95, 211, 106, .6); }
.so-punkt.spiel { background: var(--gold); box-shadow: 0 0 8px rgba(246, 197, 90, .6); }
.so-punkt.neu { background: var(--glut); box-shadow: 0 0 8px rgba(255, 122, 42, .6); }
.so-punkt.gesperrt { background: var(--blut); }

.so-karte { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 9px 10px; background: rgba(246, 197, 90, .07);
  box-shadow: inset 3px 0 0 var(--gold); }
.so-karte.so-einladung { grid-template-columns: 1fr auto; }
.so-karte b { display: block; color: var(--gold); font-size: 14px; }
.so-karte small { color: var(--text); font-size: 12.5px; }

/* ---------------------------------------------------------------- Clan */
.clan-tag { color: var(--gold); font-weight: 700; letter-spacing: .5px; }
.so-banner { display: inline-block; width: 34px; height: 40px; flex: none; }
.so-banner svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.so-banner.gross { width: 92px; height: 108px; }
.so-clan-kopf { display: flex; align-items: center; gap: 14px; padding: 4px 2px 6px; }
.so-clan-kopf h3 { margin: 0 0 2px; font: 800 24px var(--schrift-titel); letter-spacing: 1px; color: var(--text); line-height: 1.1; overflow-wrap: anywhere; }
.so-clan-kopf small { color: var(--grau); font-size: 12.5px; }
.so-clan-nav button { flex: 1 1 30%; }
.so-clan-teil { display: flex; flex-direction: column; gap: 6px; }
.so-beschreibung { margin: 0; padding: 10px 12px; background: rgba(0, 0, 0, .3); border-left: 3px solid var(--gold-dunkel); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; white-space: normal; }
.so-infos { display: flex; flex-direction: column; gap: 4px; }
.so-info-link { display: flex; align-items: baseline; gap: 10px; padding: 6px 10px; background: rgba(0, 0, 0, .25); color: var(--text); text-decoration: none; border: 1px solid transparent; }
.so-info-link:hover { border-color: var(--gold-dunkel); }
.so-info-link b { min-width: 76px; color: var(--gold); font: 700 13px var(--schrift-titel); letter-spacing: 1px; text-transform: uppercase; }
.so-info-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #cfe0ff; font-size: 13px; }
.so-werte { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.so-werte span { display: flex; flex-direction: column; padding: 6px 8px; background: rgba(0, 0, 0, .25); color: var(--grau); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.so-werte b { color: var(--text); font-size: 14px; text-transform: none; letter-spacing: 0; }
.so-rang { display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-size: 12px; color: var(--grau); white-space: nowrap; }
.so-rang svg { width: 14px; height: 14px; fill: var(--gold); }
.so-rang.r0 { color: var(--gold); } .so-rang.r1 { color: #e7c88a; }
.so-eintrag select { max-width: 120px; padding: 4px 6px; font-size: 12.5px; }
.so-ohne-clan { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; background: rgba(0, 0, 0, .25); text-align: center; }
.so-clan-zeile { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 1px solid transparent; background: rgba(0, 0, 0, .28);
  color: var(--text); text-align: left; font: inherit; cursor: var(--zeiger-klick); }
.so-clan-zeile:hover { border-color: var(--gold-dunkel); background: rgba(246, 197, 90, .06); }
.so-formular { display: flex; flex-direction: column; gap: 8px; }
.so-formular label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--grau); }
.so-formular label small { color: #7d7586; }
.so-formular textarea { resize: vertical; min-height: 70px; }
.so-tag-feld { text-transform: uppercase; letter-spacing: 2px; font-weight: 700 !important; }
.so-banner-wahl { display: flex; align-items: center; gap: 14px; padding: 8px; background: rgba(0, 0, 0, .25); }
.so-banner-wahl small { color: var(--glut); font-size: 12px; }
.so-rang-form { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: rgba(0, 0, 0, .25); }
.so-rang-kopf { display: flex; align-items: center; gap: 6px; }
.so-rang-kopf input { flex: 1; min-width: 0; }
.so-rang-nr { display: grid; place-items: center; width: 24px; height: 24px; background: var(--gold-dunkel); color: #1a0e02; font: 700 13px var(--schrift-titel); font-style: normal; }
.so-rechte { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.so-rechte label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); }
.so-rechte input { accent-color: var(--gold); width: 15px; height: 15px; }

/* Clan-Chat */
.so-cc-liste { display: flex; flex-direction: column; gap: 3px; max-height: min(52vh, 460px); min-height: 160px; overflow-y: auto; padding: 8px; background: rgba(0, 0, 0, .35); }
.so-cc-zeile { position: relative; padding: 3px 28px 3px 4px; font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
.so-cc-zeile small { color: #7d7586; font-size: 11px; margin-right: 6px; }
.so-cc-zeile b { color: var(--gold); }
.so-cc-zeile.ich b { color: #9fd6a6; }
.so-cc-zeile .so-icon-knopf { position: absolute; right: 0; top: 1px; opacity: 0; }
.so-cc-zeile:hover .so-icon-knopf { opacity: 1; }

/* ---------------------------------------------------------------- Privat-Chatfenster (unten rechts, neben der Leiste) */
.so-chat { position: fixed; z-index: 79; right: calc(min(440px, 100vw) + 14px); bottom: 14px; width: min(340px, calc(100vw - 28px)); height: min(420px, 60vh);
  display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(29, 26, 32, .97), rgba(14, 12, 16, .97)); color: var(--text); font-family: var(--schrift);
  box-shadow: inset 0 0 0 1px var(--gold-dunkel), 0 14px 40px rgba(0, 0, 0, .65); }
.so-chat[hidden] { display: none; }
body:has(.so-leiste[hidden]) .so-chat { right: 14px; }
.so-chat header { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--eisen-rand); }
.so-chat-wer { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.so-chat-wer b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-chat-wer small { color: var(--grau); font-size: 11.5px; }
.so-chat-liste { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; padding: 10px; }
.so-pn { align-self: flex-start; max-width: 82%; padding: 6px 9px; background: rgba(255, 255, 255, .06); border-left: 2px solid var(--eisen-rand); font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
.so-pn small { display: block; margin-top: 2px; color: #7d7586; font-size: 10.5px; }
.so-pn.ich { align-self: flex-end; background: rgba(246, 197, 90, .12); border-left: 0; border-right: 2px solid var(--gold-dunkel); text-align: right; }
.so-chat-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--eisen-rand); }
.so-chat-form input { flex: 1; min-width: 0; }
.so-chat-form .knopf.mini { margin-left: 0; }

/* ---------------------------------------------------------------- Hauptmenü-/Pausemenü-Knopf, Hinweis-Chip */
.hm-knoepfe .so-hm-knopf { display: flex; align-items: center; gap: 10px; }
.hm-knoepfe .so-hm-knopf[hidden] { display: none; }
.so-hm-knopf svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.so-hm-knopf span { flex: 1; }
#knopf-pause-sozial[hidden] { display: none; }
.so-chip { position: fixed; z-index: 27; top: calc(8px + env(safe-area-inset-top, 0)); left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--gold-dunkel); background: rgba(18, 15, 20, .92); color: var(--gold); font: 700 13px var(--schrift); cursor: var(--zeiger-klick);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5); animation: so-puls 1.6s ease-in-out infinite alternate; }
.so-chip[hidden] { display: none; }
.so-chip svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.so-chip kbd { padding: 1px 6px; background: var(--gold); color: #1a0e02; font: 700 11px var(--schrift); }
@keyframes so-puls { from { box-shadow: 0 6px 18px rgba(0, 0, 0, .5); } to { box-shadow: 0 6px 18px rgba(0, 0, 0, .5), 0 0 16px rgba(246, 197, 90, .35); } }
body:has(#admin-leiste:not([hidden])) .so-chip { top: 48px; }

/* Clan-Abzeichen vor dem Namen (Lobby, Gruppenanzeige, Chat) */
.so-abzeichen { display: inline-block; width: 13px; height: 15px; margin-right: 3px; vertical-align: -2px; }
.so-abzeichen svg { width: 100%; height: 100%; display: block; }
.rl-eintrag .so-abzeichen, .lb-detail .so-abzeichen { width: 16px; height: 19px; vertical-align: -4px; }
.chat-zeile .clan-tag, #mitspieler .clan-tag { font-size: .92em; }

/* ---------------------------------------------------------------- Banner-Builder */
#so-bannerbau { z-index: 81; }
.bb-tafel { width: min(900px, 96vw); max-height: calc(100vh - 24px); overflow-y: auto; }
.bb-inhalt { display: grid; grid-template-columns: 240px 1fr; gap: 18px; min-height: 0; }
.bb-vorschau { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px; background: radial-gradient(circle at 50% 40%, rgba(246, 197, 90, .12), transparent 70%), rgba(0, 0, 0, .3); }
.bb-bild { width: 220px; height: 256px; }
.bb-gross { width: 100%; height: 100%; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .7)); }
.bb-rechts { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bb-reiter { display: flex; gap: 4px; flex-wrap: wrap; }
.bb-reiter button { flex: 1; padding: 7px 6px; border: 1px solid var(--eisen-rand); background: rgba(0, 0, 0, .3); color: var(--grau); font: 700 14px var(--schrift-titel);
  letter-spacing: 1.5px; text-transform: uppercase; cursor: var(--zeiger-klick); }
.bb-reiter button.an { color: var(--gold); border-color: var(--gold-dunkel); background: rgba(246, 197, 90, .1); }
.bb-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; max-height: 300px; overflow-y: auto; padding: 2px; }
.bb-wahl { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 4px; border: 1px solid transparent; background: rgba(0, 0, 0, .3); color: var(--grau);
  cursor: var(--zeiger-klick); font: 11px var(--schrift); }
.bb-wahl:hover { border-color: var(--eisen-rand); color: var(--text); }
.bb-wahl.an { border-color: var(--gold); color: var(--gold); background: rgba(246, 197, 90, .1); }
.bb-klein { width: 54px; height: 63px; }
.bb-wahl small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-farb-titel { font: 700 13px var(--schrift-titel); letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); }
.bb-palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.bb-farbe { aspect-ratio: 1; min-height: 26px; border: 2px solid rgba(0, 0, 0, .6); background: var(--f); cursor: var(--zeiger-klick); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.bb-farbe.an { outline: 2px solid var(--gold-hell); outline-offset: 2px; }
@media (max-width: 720px) {
  .bb-inhalt { grid-template-columns: 1fr; }
  .bb-bild { width: 130px; height: 152px; }
  .bb-raster { max-height: 200px; }
  .so-chat { right: 8px !important; bottom: 8px; height: 50vh; }
}
@media (max-height: 560px) { .bb-raster { max-height: 150px; } .bb-bild { width: 120px; height: 140px; } }

/* Farbwahl: Aufklapp-Bereich „Mehr Farben“ */
.bb-mehr { margin: 6px 0 2px; font-size: 13px; }
.bb-palette-mehr { margin-top: 4px; }
.bb-palette-mehr[hidden] { display: none; }
.bb-farbgruppe { grid-column: 1 / -1; margin-top: 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--grau); }
