/* Вкладка «Столы» — зоны, карточки столов, гости */
.zone-section {
  margin-bottom: 8px;
}

.zone-title {
  padding: 18px 16px 4px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.zone-title-mine {
  color: rgba(255, 255, 255, 0.75);
}

.toggle-zone-tables-btn {
  margin: 4px 16px 12px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-block;
  transition: background 0.2s ease;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.toggle-zone-tables-btn:active {
  background: rgba(255, 255, 255, 0.12);
}

.table-card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  margin: 6px 12px;
  overflow: hidden;
  transition: background 0.2s;
}

.table-card-mine {
  border: 1px solid rgba(255, 106, 0, 0.22);
  background: rgba(255, 106, 0, 0.06);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.table-header-labels {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.table-number {
  font-size: 15px;
  font-weight: 600;
  color: white;
}

.table-you-badge {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.table-guests-count {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

.table-guests-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.table-card.expanded .table-guests-list {
  max-height: 500px;
  overflow-y: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.table-card.expanded .table-guests-count {
  display: none;
}

.guest-row {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.guest-row:active {
  background: rgba(255, 255, 255, 0.06);
}

.guest-avatar-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  margin-right: 12px;
  flex-shrink: 0;
}

.guest-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.guest-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.guest-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #1a1a24;
  background: #4caf50;
}

.guest-online-dot.inactive {
  background: #ffb74d;
  opacity: 0.9;
}

.guest-online-dot.offline {
  background: #d32f2f;
}

.guest-info {
  flex: 1;
  min-width: 0;
}

.guest-nick {
  font-size: 15px;
  font-weight: 500;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guest-status {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Пустой стол — серая неактивная карточка */
.table-card-empty {
  opacity: 0.42;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* Свой стол при reconnect — не «призрак», пока users[] ещё не пришёл */
.table-card-mine.table-card-empty {
  opacity: 1;
  background: rgba(255, 106, 0, 0.06);
  border: 1px solid rgba(255, 106, 0, 0.22);
}

.table-card-mine.table-card-empty .table-header {
  cursor: pointer;
}

.table-card-mine.table-card-empty .table-number {
  color: white;
}

.table-card-empty .table-header {
  cursor: default;
}

.table-card-empty .table-number {
  color: rgba(255, 255, 255, 0.35);
}

.table-card-empty .table-guests-count {
  display: none;
}

.tables-search-empty {
  padding: 28px 16px;
  text-align: center;
  color: rgba(255, 255, 255, 0.38);
  font-size: 13px;
  font-weight: 600;
}
