/* ==========================================================================
   sync.css — индикатор связи и окно «Ведущие за одним столом»
   ========================================================================== */

.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  width: auto !important;
  padding: 8px 13px !important;
  border-radius: 999px !important;
  border: 1px solid var(--line) !important;
  background: var(--surface2) !important;
  color: var(--ink) !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
}
.sync-badge:hover { border-color: var(--gold) !important; transform: translateY(-1px); }
.sync-badge .sync-label { white-space: nowrap; }
.sync-badge .sync-room {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  padding-left: 8px;
  border-left: 1px solid var(--line);
}
.sync-badge .sync-peers {
  min-width: 20px;
  text-align: center;
  border-radius: 999px;
  background: var(--gold);
  color: #241a0d;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
}

.sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #7b8598;
  box-shadow: 0 0 0 3px #7b859833;
  flex: 0 0 auto;
}
.sync-badge[data-status="online"] .sync-dot,
.sync-dot[data-status="online"] {
  background: #55d48a;
  box-shadow: 0 0 0 3px #55d48a33;
  animation: syncPulse 2.4s ease-in-out infinite;
}
.sync-badge[data-status="connecting"] .sync-dot,
.sync-dot[data-status="connecting"] {
  background: var(--gold);
  box-shadow: 0 0 0 3px #ffb36a33;
  animation: syncPulse 1s ease-in-out infinite;
}
.sync-badge[data-status="error"] .sync-dot,
.sync-dot[data-status="error"] {
  background: var(--red);
  box-shadow: 0 0 0 3px #e4747e33;
}
.sync-badge[data-status="offline"] .sync-dot,
.sync-dot[data-status="offline"] {
  background: #7b8598;
  box-shadow: 0 0 0 3px #7b859833;
}

/* --- окно связи --- */
.sync-card { width: min(760px, 100%); }
.sync-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #10192c;
  font-size: 13px;
}
.sync-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.sync-grid .field { display: grid; gap: 5px; }
.sync-grid input,
.sync-grid select { width: 100%; }
.sync-link {
  flex: 1 1 220px;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sync-subhead {
  margin: 18px 0 9px;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.sync-client-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.sync-client {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #162033;
}
.sync-client.is-me { border-color: var(--gold); background: #1d2437; }
.sync-client-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--gold), #c8792f);
  color: #1b1207;
  font-weight: 900;
  font-size: 13px;
}
.sync-client-name { font-weight: 700; font-size: 13px; }
.sync-client-name i { color: var(--gold); font-style: normal; font-weight: 600; }
.sync-client-mode {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}

@media (max-width: 720px) {
  .sync-badge { width: 100% !important; justify-content: center; }
  .sync-badge .sync-room { display: none; }
}

/* --- окно связи всегда читаемо, даже в жёлтой «комикс»-теме --- */
#syncModal .sync-card {
  background: linear-gradient(155deg, #1c2841, #121a2b) !important;
  border-color: #3b4b6b !important;
  color: #eef2fb !important;
}
#syncModal .sync-card h3,
#syncModal .sync-card h4 { color: #ffffff !important; }
#syncModal .sync-card .eyebrow { color: var(--gold) !important; }
#syncModal .sync-card .muted,
#syncModal .sync-card .muted.small { color: #a9b6d0 !important; }
#syncModal .sync-card input,
#syncModal .sync-card select {
  background: #0e1626 !important;
  color: #eef2fb !important;
  border-color: #3b4b6b !important;
  box-shadow: none !important;
}
body[data-theme="antifishka"] #syncModal .sync-card button,
body[data-theme="alliance"] #syncModal .sync-card button {
  background: #23304a !important;
  color: #eef2fb !important;
  border: 1px solid #3b4b6b !important;
  box-shadow: none !important;
}
body[data-theme="antifishka"] #syncModal .sync-card button.primary,
body[data-theme="alliance"] #syncModal .sync-card button.primary {
  background: var(--gold) !important;
  color: #1c1408 !important;
  border-color: var(--gold) !important;
}
#syncModal .sync-card .note,
#syncModal .sync-card .note.info {
  background: #16223a !important;
  border-color: #3b4b6b !important;
  color: #cfdcf2 !important;
}
#syncModal .sync-client { background: #1b2740 !important; border-color: #3b4b6b !important; }
#syncModal .sync-client.is-me { background: #24314d !important; border-color: var(--gold) !important; }
#syncModal .sync-client-mode { color: #9fb0cd !important; border-color: #3b4b6b !important; }
